client

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2026 License: Apache-2.0 Imports: 15 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 New

func New(baseURL, credential string, identity Identity) *Client

func (*Client) Close

func (c *Client) Close() error

func (*Client) Connect

func (c *Client) Connect(ctx context.Context) error

func (*Client) FetchTURNCredentials

func (c *Client) FetchTURNCredentials(ctx context.Context) (TURNResponse, error)

func (*Client) Receive

func (c *Client) Receive() (protocol.Envelope, error)

func (*Client) Send

func (c *Client) Send(envelope protocol.Envelope) error

func (*Client) SetAllowPrivateICEServers

func (c *Client) SetAllowPrivateICEServers(allow bool)

func (*Client) SetAllowedICEServerHosts

func (c *Client) SetAllowedICEServerHosts(hosts []string)

type Identity

type Identity interface {
	NodeID(context.Context) (string, error)
	PublicKey(context.Context) (ed25519.PublicKey, error)
}

type TURNResponse

type TURNResponse struct {
	Username   string   `json:"username"`
	Credential string   `json:"credential"`
	TTLSeconds int      `json:"ttl_seconds"`
	URIs       []string `json:"uris"`
	STUNURIs   []string `json:"stun_uris,omitempty"`
}

Jump to

Keyboard shortcuts

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