components

package
v0.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2019 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Base

type Base struct {
	base.ComponentInterface
	// contains filtered or unexported fields
}

所有组件的基类

func (*Base) Init

func (component *Base) Init(configInterface base.ConfigComponentInterface)

使用配置初始化数据

func (*Base) Start

func (component *Base) Start()

开始

func (*Base) Stop

func (component *Base) Stop()

结束

type HttpServer

type HttpServer struct {
	Base
	// contains filtered or unexported fields
}

http服务

func (*HttpServer) Init

func (component *HttpServer) Init(configInterface base.ConfigComponentInterface)

使用配置初始化数据

func (*HttpServer) Start

func (component *HttpServer) Start()

启动

type WebsocketServer

type WebsocketServer struct {
	Base
	// contains filtered or unexported fields
}

func (*WebsocketServer) Init

func (component *WebsocketServer) Init(configInterface base.ConfigComponentInterface)

使用配置 初始化数据

func (*WebsocketServer) OnClose

func (component *WebsocketServer) OnClose(handler func(conn *models.WebsocketSession))

设置 关闭连接的方法

func (*WebsocketServer) OnConnect

func (component *WebsocketServer) OnConnect(handler func(conn *models.WebsocketSession))

设置 接受新连接的方法

func (*WebsocketServer) OnMessage

func (component *WebsocketServer) OnMessage(handler func(conn *models.WebsocketSession, recvMessage []byte))

设置 接受消息的方法

func (*WebsocketServer) Register

func (component *WebsocketServer) Register(handlerInterface controllers.HandlerInterface)

注册处理器。注册后将根据路由自动匹配调用方法

func (*WebsocketServer) Start

func (component *WebsocketServer) Start()

开始

Jump to

Keyboard shortcuts

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