websocket

package
v0.0.15 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChannelContext

type ChannelContext struct {
	mojito.WebSocketContext

	Channel *string
	Payload json.RawMessage
}

func (*ChannelContext) Read

func (ctx *ChannelContext) Read(out interface{}) error

func (*ChannelContext) Send

func (ctx *ChannelContext) Send(data interface{}) error

type Message

type Message struct {
	Channel *string         `json:"channel"`
	Error   string          `json:"error,omitempty"`
	Payload json.RawMessage `json:"payload"`
}

type WebSocket

type WebSocket struct {
	// contains filtered or unexported fields
}

func New

func New() *WebSocket

func (*WebSocket) ToHandler

func (ws *WebSocket) ToHandler() interface{}

func (*WebSocket) WithAsyncChannel

func (ws *WebSocket) WithAsyncChannel(name string, handler interface{}) *WebSocket

func (*WebSocket) WithCatchAll

func (ws *WebSocket) WithCatchAll(handler interface{}) *WebSocket

func (*WebSocket) WithChannel

func (ws *WebSocket) WithChannel(name string, handler interface{}) *WebSocket

Jump to

Keyboard shortcuts

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