26 lines
872 B
Go
26 lines
872 B
Go
package protocol
|
|
|
|
import "context"
|
|
|
|
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, messageType string) (chan any, error)
|
|
|
|
// Emit sends the given message on the ReachView websocket connection
|
|
Emit(ctx context.Context, message any) error
|
|
}
|