websocket

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2024 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewWebSocketPayloadConverter

func NewWebSocketPayloadConverter(marshaller marshal.Marshalizer) (*webSocketsPayloadConverter, error)

NewWebSocketPayloadConverter returns a new instance of websocketPayloadParser

Types

type HttpServerHandler

type HttpServerHandler interface {
	ListenAndServe() error
	Shutdown(ctx context.Context) error
}

HttpServerHandler defines the minimum behaviour of a http server

type PayloadConverter

type PayloadConverter interface {
	ExtractWsMessage(payload []byte) (*data.WsMessage, error)
	ConstructPayload(wsMessage *data.WsMessage) ([]byte, error)
	IsInterfaceNil() bool
}

PayloadConverter defines what a websocket payload converter should do

type PayloadHandler

type PayloadHandler interface {
	ProcessPayload(payload []byte, topic string, version uint32) error
	Close() error
	IsInterfaceNil() bool
}

PayloadHandler defines what a payload handler should be able to do

func NewNilPayloadHandler

func NewNilPayloadHandler() PayloadHandler

NewNilPayloadHandler will create a new instance of nilPayloadHandler

type WSConClient

type WSConClient interface {
	io.Closer
	OpenConnection(url string) error
	IsOpen() bool
	WriteMessage(messageType int, data []byte) error
	ReadMessage() (int, []byte, error)
	GetID() string
	IsInterfaceNil() bool
}

WSConClient defines what a web-sockets connection client should be able to do

Directories

Path Synopsis
examples

Jump to

Keyboard shortcuts

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