client

package
v0.1.8 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2023 License: Unlicense Imports: 33 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultDeadline  = 10 * time.Minute
	ReverseLayerLen  = reverse.Len + layer.Len
	ReverseHeaderLen = 3 * ReverseLayerLen
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	*node.Node
	node.Nodes
	session.Sessions
	PendingSessions []nonce.ID
	*confirm.Confirms
	ExitHooks response.Hooks
	sync.Mutex
	*signer.KeySet
	atomic.Bool
	qu.C
}

func New

func New(tpt ifc.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 *session.Session)

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) SendKeys

func (cl *Client) SendKeys(nodeID []nonce.ID, hook confirm.Hook) (conf nonce.ID,
	e error)

SendKeys is the delivery of a ...

todo: this function should be requiring input of keys, and a related prior

function that generates the preimage for an LN AMP, from the hash of the
keys.

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