components

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2019 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetApplication added in v0.0.2

func SetApplication(app base.ApplicationInterface)

设置app

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 Console added in v0.0.2

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

命令行组件

func (*Console) Init added in v0.0.2

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

初始化方法

func (*Console) RunAction added in v0.0.2

func (component *Console) RunAction()

运行控制台命令

type Database added in v0.0.2

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

数据库组件

func (*Database) Init added in v0.0.2

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

初始化

func (*Database) MigrateUp added in v0.0.2

func (component *Database) MigrateUp()

升级数据库

func (*Database) Start added in v0.0.2

func (component *Database) Start()

启动

func (*Database) Stop added in v0.0.2

func (component *Database) 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()

启动

func (*HttpServer) Stop added in v0.0.2

func (component *HttpServer) Stop()

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.Context))

设置 关闭连接的方法

func (*WebsocketServer) OnConnect

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

设置 接受新连接的方法

func (*WebsocketServer) OnMessage

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

设置 接受消息的方法

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