websocket

package
v0.0.143 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotConnected = errors.New("dongle not connected")
)

Functions

This section is empty.

Types

type RPCWebsocket

type RPCWebsocket struct {
	websocket.Websocket
	// contains filtered or unexported fields
}

func CreateRPCWebsocket

func CreateRPCWebsocket() *RPCWebsocket

func (*RPCWebsocket) Call

func (c *RPCWebsocket) Call(ctx context.Context, redis *redis.Client, dongleID string, call apimodels.RPCCall) (apimodels.RPCResponse, error)

func (*RPCWebsocket) OnConnect

func (c *RPCWebsocket) OnConnect(ctx context.Context, _ *http.Request, w websocket.Writer, device *models.Device, _ *gorm.DB, redis *redis.Client)

func (*RPCWebsocket) OnDisconnect

func (c *RPCWebsocket) OnDisconnect(_ context.Context, _ *http.Request, device *models.Device, _ *gorm.DB)

func (*RPCWebsocket) OnMessage

func (c *RPCWebsocket) OnMessage(ctx context.Context, _ *http.Request, _ websocket.Writer, msg []byte, msgType int, device *models.Device, _ *gorm.DB, redis *redis.Client)

Jump to

Keyboard shortcuts

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