client

package
v0.1.10 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2023 License: Unlicense Imports: 36 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ReverseLayerLen  = reverse.Len + crypt.Len
	ReverseHeaderLen = 3 * ReverseLayerLen
)

Variables

This section is empty.

Functions

func BudgeUp added in v0.1.9

func BudgeUp(b slice.Bytes, start slice.Cursor) (o slice.Bytes)

func FormatReply added in v0.1.9

func FormatReply(header, res slice.Bytes, ciphers [3]sha256.Hash,
	nonces [3]nonce.IV) (rb slice.Bytes)

Types

type Client

type Client struct {
	*node.Node
	node.Nodes
	sync.Mutex
	*confirm.Confirms
	response.Hooks
	*signer.KeySet
	ShuttingDown atomic.Bool
	qu.C
}

func NewClient added in v0.1.9

func NewClient(tpt types.Transport, hdrPrv *prv.Key, no *node.Node,
	nodes node.Nodes) (c *Client, e error)

func (*Client) Cleanup

func (cl *Client) Cleanup()

Cleanup closes and flushes any resources the client opened that require sync in order to reopen correctly.

func (*Client) FindCloaked

func (cl *Client) FindCloaked(clk cloak.PubKey) (hdr *prv.Key,
	pld *prv.Key, sess *traffic.Session, identity bool)

FindCloaked searches the client identity key and the sessions for a match. It returns the session as well, though not all users of this function will need this.

func (*Client) RegisterConfirmation

func (cl *Client) RegisterConfirmation(hook confirm.Hook,
	cnf nonce.ID)

func (*Client) Send

func (cl *Client) Send(addr *netip.AddrPort, b slice.Bytes)

Send a message to a peer via their AddrPort.

func (*Client) Shutdown

func (cl *Client) Shutdown()

Shutdown triggers the shutdown of the client and the Cleanup before finishing.

func (*Client) Start

func (cl *Client) Start()

Start a single thread of the Client.

Jump to

Keyboard shortcuts

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