Documentation ¶
Index ¶
- func OnBroadcast(ctx context.Context, client *Client) (chan Broadcast, error)
- func OnMessage[T any](ctx context.Context, client *Client, mType string) (chan T, error)
- type Broadcast
- type Client
- func (c *Client) Alive(ctx context.Context) (bool, error)
- func (c *Client) Close(ctx context.Context) error
- func (c *Client) Configuration(ctx context.Context) (any, error)
- func (c *Client) Connect(ctx context.Context) error
- func (c *Client) Emit(ctx context.Context, mType string, message any) error
- func (c *Client) GetBaseInfo(ctx context.Context) (*protocol.BaseInfo, error)
- func (c *Client) On(ctx context.Context, messageType string) (chan any, error)
- func (c *Client) Protocol(ctx context.Context) (protocol.Identifier, protocol.Operations, error)
- func (c *Client) Reboot(ctx context.Context) error
- func (c *Client) SetBase(ctx context.Context, funcs ...protocol.SetBaseOptionFunc) error
- func (c *Client) Version(ctx context.Context) (string, bool, error)
- type OptionFunc
- func WithAvailableTimeout(timeout time.Duration) OptionFunc
- func WithDial(dial protocol.DialFunc) OptionFunc
- func WithFallbackProtocol(identifier protocol.Identifier) OptionFunc
- func WithLogger(logger logger.Logger) OptionFunc
- func WithPreferredProtocol(identifier protocol.Identifier) OptionFunc
- func WithProtocols(protocols *protocol.Registry) OptionFunc
- type Options
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func OnBroadcast ¶
OnBroadcast listens for ReachView "broadcast" messages
Types ¶
type Broadcast ¶
type Broadcast struct { Name string `mapstructure:"name" json:"name"` Payload any `mapstructure:"payload" json:"payload"` }
Broadcast is a broadcasted message containing module realtime informations.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func NewClient ¶
func NewClient(addr string, funcs ...OptionFunc) *Client
func (*Client) Configuration ¶
Configuration implements protocol.Operations.
func (*Client) GetBaseInfo ¶
GetBaseInfo implements protocol.Operations.
func (*Client) Protocol ¶
func (c *Client) Protocol(ctx context.Context) (protocol.Identifier, protocol.Operations, error)
type OptionFunc ¶
type OptionFunc func(opts *Options)
func WithAvailableTimeout ¶
func WithAvailableTimeout(timeout time.Duration) OptionFunc
func WithDial ¶
func WithDial(dial protocol.DialFunc) OptionFunc
func WithFallbackProtocol ¶
func WithFallbackProtocol(identifier protocol.Identifier) OptionFunc
func WithLogger ¶
func WithLogger(logger logger.Logger) OptionFunc
func WithPreferredProtocol ¶
func WithPreferredProtocol(identifier protocol.Identifier) OptionFunc
func WithProtocols ¶
func WithProtocols(protocols *protocol.Registry) OptionFunc
type Options ¶
type Options struct { Protocols *protocol.Registry PreferredProtocol protocol.Identifier FallbackProtocol protocol.Identifier AvailableTimeout time.Duration Logger logger.Logger Dial protocol.DialFunc }
func NewOptions ¶
func NewOptions(funcs ...OptionFunc) *Options
Click to show internal directories.
Click to hide internal directories.