Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Session ¶ added in v1.3.6
type WebsocketConfig ¶ added in v1.3.6
type WebsocketConfig struct { bean.Component // Time allowed to write a message to the peer. WriteWait time.Duration `yaml:"write_wait"` // Maximum message size allowed from peer. MaxMessageSize int64 `yaml:"max_message_size"` // Time allowed to read the next pong message from the peer. PongWait time.Duration `yaml:"pong_wait"` // Send pings to peer with this period. Must be less than pongWait. PingPeriod time.Duration `yaml:"ping_period"` // Time to wait before force close on connection. CloseGracePeriod time.Duration `yaml:"close_grace_period"` CheckOrigin bool `yaml:"check_origin"` }
WebsocketConfig is websocket config
func (*WebsocketConfig) Prefix ¶ added in v1.3.6
func (w *WebsocketConfig) Prefix() string
type WebsocketController ¶
type WebsocketController struct { Config *WebsocketConfig // contains filtered or unexported fields }
WebsocketController is decorate dynamic controller
func (*WebsocketController) Bean ¶
func (w *WebsocketController) Bean() string
func (*WebsocketController) Channel ¶
func (w *WebsocketController) Channel(r *http.Request, rw http.ResponseWriter)
func (*WebsocketController) Controller ¶
func (w *WebsocketController) Controller() string
func (*WebsocketController) Destroy ¶ added in v1.3.8
func (w *WebsocketController) Destroy() error
func (*WebsocketController) Init ¶ added in v1.3.8
func (w *WebsocketController) Init() error
type WebsocketHandler ¶
type WebsocketHandler interface { bean.Bean Endpoint() string OnOpen(session *Session) OnClose(session *Session) OnMessage(session *Session, message []byte) error OnError(session *Session, err error) }
WebsocketHandler bean define
type WebsocketStarter ¶
type WebsocketStarter struct { bean.Component Handlers []WebsocketHandler Log log.Logger }
func NewStarter ¶ added in v1.3.6
func NewStarter() *WebsocketStarter
func (*WebsocketStarter) AfterInit ¶
func (w *WebsocketStarter) AfterInit()
Click to show internal directories.
Click to hide internal directories.