client

package
v0.0.0-...-3f3af25 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 30, 2026 License: ISC Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Crockford alphabet (https://www.crockford.com/base32.html)
	LowercaseAlphabet = "0123456789abcdefghjkmnpqrstvwxyz"
)

Variables

View Source
var (
	ErrJoinFailed = fmt.Errorf("Join failed")
	ErrNoMessage  = fmt.Errorf("No message")
)

Functions

func ConfigDir

func ConfigDir() (string, error)

func MakeDNSLabels

func MakeDNSLabels(s string) string

Types

type Channel

type Channel struct {
	Name   string
	Public []byte
	// contains filtered or unexported fields
}

func (*Channel) Join

func (ch *Channel) Join(nick string) error

func (*Channel) Read

func (ch *Channel) Read(id uint64) (*Message, error)

func (*Channel) Send

func (ch *Channel) Send(msgType rune, message string) (uint64, error)

func (*Channel) String

func (ch *Channel) String() string

type Client

type Client struct {
	UID uint64
	// contains filtered or unexported fields
}

func New

func New(server *Server, key *ecdh.PrivateKey) *Client

func (*Client) NewChannel

func (c *Client) NewChannel(name string) (*Channel, error)

func (*Client) String

func (client *Client) String() string

type ClientKey

type ClientKey struct {
	New bool
	*ecdh.PrivateKey
}

func Key

func Key() (*ClientKey, error)

type Message

type Message struct {
	ID      uint64
	TS      uint64
	Type    string
	Content string
}

type Server

type Server struct {
	Base      string
	Info      string
	Debug     bool
	PublicKey *ecdh.PublicKey
	RTT       time.Duration
	// contains filtered or unexported fields
}

func NewServer

func NewServer(base, dnsServer string) (*Server, error)

func (*Server) QueryTXT

func (s *Server) QueryTXT(name string) ([]byte, string, error)

QueryTXT queries for a TXT record and returns raw bytes. miekg/dns escapes non-printable bytes as \DDD, so we decode them.

func (*Server) String

func (s *Server) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL