Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func Register ¶
func Register(identifier Identifier, factory ProtocolFactory)
Types ¶
type Identifier ¶
type Identifier string
type Operations ¶
type Operations interface { // Connect initiates a new connection to the ReachView service // It should be called before any other operation Connect(ctx context.Context) error // Close closes the current connection to the ReachView service Close(ctx context.Context) error // Alive returns true if the ReachView websocket connection is alive, false otherwise Alive(ctx context.Context) (bool, error) // Version returns the current ReachView version, // true if the module uses the stable channel or an error Version(ctx context.Context) (string, bool, error) // On listens for messages of the given type on ReachView websocket connection On(ctx context.Context, mType string) (chan any, error) // Emit sends the given message on the ReachView websocket connection Emit(ctx context.Context, mType string, message any) error // Configuration retrieves the module's configuration Configuration(ctx context.Context) (any, error) // SetBase updates the base configuration SetBase(ctx context.Context, funcs ...SetBaseOptionFunc) error GetBaseInfo(ctx context.Context) (*BaseInfo, error) // Reboot restarts the module Reboot(ctx context.Context) error }
type Protocol ¶
type Protocol interface { Identifier() Identifier Available(ctx context.Context, addr string) (bool, error) Operations(addr string) Operations }
type ProtocolFactory ¶
type ProtocolFactory func(opts *ProtocolOptions) (Protocol, error)
type ProtocolOptionFunc ¶
type ProtocolOptionFunc func(opts *ProtocolOptions)
func WithProtocolDial ¶
func WithProtocolDial(dial DialFunc) ProtocolOptionFunc
func WithProtocolLogger ¶
func WithProtocolLogger(logger logger.Logger) ProtocolOptionFunc
type ProtocolOptions ¶
func NewProtocolOptions ¶
func NewProtocolOptions(funcs ...ProtocolOptionFunc) *ProtocolOptions
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
func DefaultRegistry ¶
func DefaultRegistry() *Registry
func NewRegistry ¶
func NewRegistry() *Registry
func (*Registry) Availables ¶
func (*Registry) Get ¶
func (r *Registry) Get(identifier Identifier, funcs ...ProtocolOptionFunc) (Protocol, error)
func (*Registry) Register ¶
func (r *Registry) Register(identifier Identifier, factory ProtocolFactory)
type SetBaseOptionFunc ¶
type SetBaseOptionFunc func(opts *SetBaseOptions)
func WithBaseAntennaOffset ¶
func WithBaseAntennaOffset(value float64) SetBaseOptionFunc
func WithBaseHeight ¶
func WithBaseHeight(value float64) SetBaseOptionFunc
func WithBaseLatitude ¶
func WithBaseLatitude(value float64) SetBaseOptionFunc
func WithBaseLongitude ¶
func WithBaseLongitude(value float64) SetBaseOptionFunc
func WithBaseMode ¶
func WithBaseMode(value string) SetBaseOptionFunc
type SetBaseOptions ¶
type SetBaseOptions struct { Mode *string AntennaOffset *float64 Latitude *float64 Longitude *float64 Height *float64 }
func NewSetBaseOptions ¶
func NewSetBaseOptions(funcs ...SetBaseOptionFunc) *SetBaseOptions
Click to show internal directories.
Click to hide internal directories.