Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrEmptyInfo = errors.New("empty info")
ErrEmptyInfo happens when ServerInfo is empty during Delegate creation.
Functions ¶
Types ¶
type Delegate ¶
type Delegate[T any] struct { // contains filtered or unexported fields }
Delegate implements the core.ServerDelegate interface.
It initializes the connection by sending ServerInfo to the client.
func New ¶
func New[T any](info delegate.ServerInfo, factory TransportFactory[T], handler TransportHandler[T], ops ...SetOption, ) (d Delegate[T])
New creates a new Delegate.
Panics with ErrEmptyInfo if ServerInfo is empty.
type SetOption ¶
type SetOption func(o *Options)
func WithServerInfoSendDuration ¶
WithServerInfoDuration specifies how long the server will try to send ServerInfo to the client. If == 0, it will try forever.
type Transport ¶
type Transport[T any] interface { delegate.Transport[core.Result, core.Cmd[T]] SendServerInfo(info delegate.ServerInfo) error }
Transport is a transport for the server delegate.
It is used by the delegate to receive Commands and send Results.
type TransportFactory ¶
TransportFactory is a factory which creates a Transport for the server delegate.
Click to show internal directories.
Click to hide internal directories.