camWebsocket

package
v0.5.3 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2020 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type WebsocketComponent

type WebsocketComponent struct {
	component.Component
	camRouter.RouterPlugin
	camContext.ContextPlugin
	camMiddleware.MiddlewarePlugin
	// contains filtered or unexported fields
}

func (*WebsocketComponent) Init

init

func (*WebsocketComponent) Start

func (comp *WebsocketComponent) Start()

start

type WebsocketComponentConfig

websocket server 所需的配置

func NewWebsocketComponentConfig

func NewWebsocketComponentConfig(port uint16) *WebsocketComponentConfig

new websocket component

type WebsocketContext added in v0.4.1

type WebsocketContext struct {
	camContext.Context
	camContext.MessageContext
	// contains filtered or unexported fields
}

func (*WebsocketContext) GetConn added in v0.4.1

func (ctx *WebsocketContext) GetConn() *websocket.Conn

func (*WebsocketContext) GetMessage added in v0.4.1

func (ctx *WebsocketContext) GetMessage() *camStructs.RecvMessage

func (*WebsocketContext) GetRecv added in v0.4.1

func (ctx *WebsocketContext) GetRecv() []byte

func (*WebsocketContext) SetConn added in v0.4.1

func (ctx *WebsocketContext) SetConn(conn *websocket.Conn)

func (*WebsocketContext) SetMessage added in v0.4.1

func (ctx *WebsocketContext) SetMessage(msg *camStructs.RecvMessage)

func (*WebsocketContext) SetRecv added in v0.4.1

func (ctx *WebsocketContext) SetRecv(recv []byte)

type WebsocketContextInterface added in v0.4.1

type WebsocketContextInterface interface {
	camStatics.ContextInterface
	camContext.MessageContextInterface
	SetConn(conn *websocket.Conn)
	GetConn() *websocket.Conn
	SetRecv(recv []byte)
	GetRecv() []byte
}

websocket context

type WebsocketController

type WebsocketController struct {
	camRouter.Controller
}

func (*WebsocketController) GetConn

func (ctrl *WebsocketController) GetConn() *websocket.Conn

get *websocket.Conn

func (*WebsocketController) GetWebsocketContext added in v0.4.3

func (ctrl *WebsocketController) GetWebsocketContext() WebsocketContextInterface

get WebsocketContextInterface

type WebsocketSession

type WebsocketSession struct {
	camStatics.SessionInterface
	// contains filtered or unexported fields
}

websocket session

func NewWebsocketSession

func NewWebsocketSession() *WebsocketSession

new websocket session

func (*WebsocketSession) Del added in v0.4.0

func (sess *WebsocketSession) Del(key string)

delete key

func (*WebsocketSession) Destroy

func (sess *WebsocketSession) Destroy()

destroy session

func (*WebsocketSession) Get

func (sess *WebsocketSession) Get(key string) interface{}

get session value

func (*WebsocketSession) GetSessionId

func (sess *WebsocketSession) GetSessionId() string

get sessionId

func (*WebsocketSession) Set

func (sess *WebsocketSession) Set(key string, value interface{})

set session value

func (*WebsocketSession) SetSessionId added in v0.4.1

func (sess *WebsocketSession) SetSessionId(sessId string)

set sessionId

Jump to

Keyboard shortcuts

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