cloud

package
v0.9.2 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2025 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrMisconfiguredCloud = errors.New("misconfigured Cloud")
	ErrQuicRequired       = errors.New("quic cannot be nil")
	ErrWsRequired         = errors.New("websocket cannot be nil")
)

Functions

This section is empty.

Types

type CloudConfig added in v0.7.35

type CloudConfig struct {
	QuicPreferred bool
}

type Handler

type Handler interface {
	// connect to cloud and start sending and receiving messages
	Start()
	// disconnect from cloud
	Stop()
	// any listener added will be called when the network channel receives a messages from the cloud
	AddMessageListener(listener event.MsgListener) event.CancelFunc
	// any listener added will be called when the network channel tries to connect
	AddConnectListener(listener event.ConnectListener) event.CancelFunc
	Name() string
	IsEnabled() bool
}

Handler interface is used to handle networking calls to and from the cloud in a similar way

func New added in v0.7.35

func New(opts ...Option) (Handler, error)

TODO - log handler stuff

type Option added in v0.7.35

type Option interface {
	// contains filtered or unexported methods
}

func MaxTries added in v0.7.35

func MaxTries(maxTries int32) Option

max tries before switching protocols (quic vs websocket)

func PreferQuic added in v0.7.35

func PreferQuic(preferQuic bool) Option

whether or not to try quic before trying the websocket

func QuicClient added in v0.7.35

func QuicClient(qc Handler) Option

func Websocket added in v0.7.35

func Websocket(ws Handler) Option

type Proxy added in v0.7.35

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

func (*Proxy) AddConnectListener added in v0.7.35

func (p *Proxy) AddConnectListener(listener event.ConnectListener) event.CancelFunc

func (*Proxy) AddMessageListener added in v0.7.35

func (p *Proxy) AddMessageListener(listener event.MsgListener) event.CancelFunc

func (*Proxy) AddProxyListeners added in v0.7.35

func (p *Proxy) AddProxyListeners(handler Handler)

func (*Proxy) HandleWrp added in v0.7.35

func (p *Proxy) HandleWrp(m wrp.Message) error

func (*Proxy) IsEnabled added in v0.8.3

func (p *Proxy) IsEnabled() bool

func (*Proxy) Name added in v0.7.35

func (p *Proxy) Name() string

func (*Proxy) OnQuicConnect added in v0.7.35

func (p *Proxy) OnQuicConnect(e event.Connect)

func (*Proxy) OnWebsocketConnect added in v0.7.35

func (p *Proxy) OnWebsocketConnect(e event.Connect)

func (*Proxy) Start added in v0.7.35

func (p *Proxy) Start()

func (*Proxy) Stop added in v0.7.35

func (p *Proxy) Stop()

Jump to

Keyboard shortcuts

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