base

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: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ApplicationInterface added in v0.0.2

type ApplicationInterface interface {
	// 获取组件实例
	GetComponent(v ComponentInterface) ComponentInterface
}

application 接口 NODE:Provides interface function to the module inner framework

type ApplicationStatus

type ApplicationStatus uint8

app运行装填

type ComponentInterface

type ComponentInterface interface {
	// 初始化
	Init(configInterface ConfigComponentInterface)
	// 开始
	Start()
	// 停止
	Stop()
}

组件接口

type ConfigComponent

type ConfigComponent int16

配置组件类型

type ConfigComponentInterface

type ConfigComponentInterface interface {
	GetComponent() ComponentInterface
}

组件类型配置接口

type ContextInterface added in v0.0.2

type ContextInterface interface {
	// 获取 session
	GetSession() SessionInterface
}

上下文接口

type ControllerInterface added in v0.0.2

type ControllerInterface interface {
	// 初始化方法
	Init()
	// 执行动作前执行的方法
	BeforeAction(action string) bool
	// 执行动作后执行的方法
	AfterAction(action string, response []byte) []byte

	// 设置上下文对象
	SetContext(context ContextInterface)
	// 获取上下文对象
	GetContext() ContextInterface

	// 设置 http 请求的参数
	SetHttpValues(w http.ResponseWriter, r *http.Request)
	// 设置 websocket 请求的参数
	SetValues(values map[string]interface{})
	// 添加参数
	AddValue(key string, value interface{})
}

控制器实例

type ControllerType

type ControllerType uint8

控制器类型(websocket 或 http)

type SessionInterface added in v0.0.2

type SessionInterface interface {
	// 获取 sessionId
	GetSessionId() string
	// 设置值
	Set(key interface{}, value interface{})
	// 获取值
	Get(key interface{}) interface{}
	// 销毁session
	Destroy()
}

session 接口

type WebsocketServerMode

type WebsocketServerMode uint8

websocket server 运行模式

Jump to

Keyboard shortcuts

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