websocket

package
v1.2.3 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2023 License: AGPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertHandler

func ConvertHandler(wsHandler Handler) gin.HandlerFunc

Types

type BaseHandler

type BaseHandler struct {
}

func (*BaseHandler) CheckOrigin

func (bh *BaseHandler) CheckOrigin(r *http.Request) bool

func (*BaseHandler) MaxMessageSize

func (bh *BaseHandler) MaxMessageSize() int64

func (*BaseHandler) OnClose

func (bh *BaseHandler) OnClose(hub Hub, code int, text string)

func (*BaseHandler) OnPing

func (bh *BaseHandler) OnPing(hub Hub, appData string)

func (*BaseHandler) OnPong

func (bh *BaseHandler) OnPong(hub Hub, appData string)

func (*BaseHandler) ReadBufferSize

func (bh *BaseHandler) ReadBufferSize() int

func (*BaseHandler) ReadTimeout

func (bh *BaseHandler) ReadTimeout() zone.Duration

func (*BaseHandler) WriteBufferSize

func (bh *BaseHandler) WriteBufferSize() int

func (*BaseHandler) WriteTimeout

func (bh *BaseHandler) WriteTimeout() zone.Duration

type Handler

type Handler interface {
	DefaultChannels() []string
	OnMessage(hub Hub, msg *Msg)
	Loop(hub Hub) error

	OnPing(hub Hub, appData string)
	OnPong(hub Hub, appData string)
	OnClose(hub Hub, code int, text string)

	Controller.Controller
	// contains filtered or unexported methods
}

type Hub

type Hub interface {
	Send(msg *Msg)
	Broadcast(msg *Msg)
	BroadcastTo(channelName string, msg *Msg)

	request.Context
	// contains filtered or unexported methods
}

type Msg

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

func (*Msg) Byte

func (wm *Msg) Byte() *[]byte

func (*Msg) Error

func (wm *Msg) Error() error

func (*Msg) JSON

func (wm *Msg) JSON(dataPtr interface{}) error

func (*Msg) ProtoBuf

func (wm *Msg) ProtoBuf(dataPtr proto.Message) error

func (*Msg) SendDone

func (wm *Msg) SendDone()

func (*Msg) SetByte

func (wm *Msg) SetByte(msgType int, msg *[]byte)

func (*Msg) SetJSON

func (wm *Msg) SetJSON(data interface{})

func (*Msg) SetProtoBuf

func (wm *Msg) SetProtoBuf(data proto.Message)

func (*Msg) SetString

func (wm *Msg) SetString(data string)

func (*Msg) String

func (wm *Msg) String() string

func (*Msg) Type

func (wm *Msg) Type() int

Jump to

Keyboard shortcuts

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