client

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2022 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

func (*Client) Close

func (c *Client) Close() error

func (*Client) Get

func (c *Client) Get(ctx context.Context, interval time.Duration, attempts int) (netip.AddrPort, error)

func (*Client) Run

func (c *Client) Run(ctx context.Context, interval time.Duration) (<-chan Result, error)

type Config

type Config struct {
	ServerAddrPort netip.AddrPort
	BindAddress    string
	PSK            []byte
}

func (Config) Client

func (c Config) Client() (*Client, error)

type Error

type Error struct {
	Message      string
	PeerAddrPort netip.AddrPort
	PacketLength int
	Err          error
}

func (Error) Error

func (e Error) Error() string

func (Error) Unwrap

func (e Error) Unwrap() error

type Result

type Result struct {
	ClientAddrPort netip.AddrPort
	Err            Error
}

func ErrResult

func ErrResult(err Error) Result

func OkResult

func OkResult(clientAddrPort netip.AddrPort) Result

func (Result) IsOk

func (r Result) IsOk() bool

Jump to

Keyboard shortcuts

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