components

package
v0.0.0-...-96491ad Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2021 License: MIT Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccountInfo

type AccountInfo struct {
	Role            string
	Account         string
	ActiveTimestamp int64
}

AccountInfo :

func NewAccountInfo

func NewAccountInfo(role, account string, t int64) *AccountInfo

NewAccountInfo :

type Config

type Config struct {
	// contains filtered or unexported fields
}

Config : 配置组件

func NewConfig

func NewConfig(ctx *common.Context) *Config

NewConfig : 实例化

func (*Config) Close

func (*Config) Close()

Close : 关闭组件

func (*Config) Config

func (cfg *Config) Config() *config.FrameworkConfig

Config : 获取框架层配置

func (*Config) GetViperObj

func (cfg *Config) GetViperObj() *viper.Viper

GetViperObj : 获取 viper 对象

func (*Config) LoadConfig

func (cfg *Config) LoadConfig(cfgfile string, cfgobj interface{}) bool

LoadConfig : 逻辑层可以用该接口加载配置文件

func (*Config) PrintUsage

func (cfg *Config) PrintUsage()

PrintUsage : 打印命令行参数

func (*Config) Start

func (*Config) Start() bool

Start : 实例化组件

type Log

type Log struct {
	// contains filtered or unexported fields
}

Log : 日志组件

func NewLog

func NewLog(ctx *common.Context) *Log

NewLog : 实例化

func (*Log) Close

func (log *Log) Close()

Close : 关闭组件

func (*Log) Start

func (log *Log) Start() bool

Start : 实例化组件

type Plugin

type Plugin struct {
	// contains filtered or unexported fields
}

Plugin : 插件组件

func NewPlugin

func NewPlugin(ctx *common.Context) *Plugin

NewPlugin : 实例化

func (*Plugin) Close

func (p *Plugin) Close()

Close : 关闭组件

func (*Plugin) Start

func (p *Plugin) Start() bool

Start : 实例化组件

type Pprof

type Pprof struct {
	// contains filtered or unexported fields
}

Pprof : http pprof组件

func NewPprof

func NewPprof(ctx *common.Context) *Pprof

NewPprof : 实例化

func (*Pprof) Close

func (pprof *Pprof) Close()

Close : 关闭组件

func (*Pprof) Start

func (pprof *Pprof) Start() bool

Start : 实例化组件

type Rand

type Rand struct {
	// contains filtered or unexported fields
}

Rand : 随机函数组件

func NewRand

func NewRand(ctx *common.Context) *Rand

NewRand : 实例化

func (*Rand) Close

func (*Rand) Close()

Close : 关闭组件

func (*Rand) Start

func (r *Rand) Start() bool

Start : 实例化组件

type Redis

type Redis struct {
	// contains filtered or unexported fields
}

Redis : Redis 组件

func NewRedis

func NewRedis(ctx *common.Context) *Redis

NewRedis : 实例化

func (*Redis) Close

func (*Redis) Close()

Close : 关闭组件

func (*Redis) Start

func (redis *Redis) Start() bool

Start : 实例化组件

type Role2Account

type Role2Account struct {
	// contains filtered or unexported fields
}

Role2Account : 本帮助类,提供`根据角色名查找账号`的功能

func NewRole2Account

func NewRole2Account(ctx *common.Context) *Role2Account

NewRole2Account : 构造函数

func (*Role2Account) Add

func (role2account *Role2Account) Add(role, account string)

Add : 加入本地缓存

func (*Role2Account) AddAndInsertDB

func (role2account *Role2Account) AddAndInsertDB(role, account string) bool

AddAndInsertDB : 加入本地缓存并保存数据库

func (*Role2Account) Close

func (role2account *Role2Account) Close()

Close : 结束

func (*Role2Account) GetAndActive

func (role2account *Role2Account) GetAndActive(role string) string

GetAndActive : 根据角色名,查找账号。先从本地缓存中找,没有则数据库中找

func (*Role2Account) Start

func (role2account *Role2Account) Start() bool

Start : 开始

type Signal

type Signal struct {
	// contains filtered or unexported fields
}

Signal : 信号处理组件

func NewSignal

func NewSignal(ctx *common.Context) *Signal

NewSignal : 实例化

func (*Signal) Close

func (s *Signal) Close()

Close : 关闭组件

func (*Signal) Start

func (s *Signal) Start() bool

Start : 实例化组件

type TCPServer

type TCPServer struct {
	// contains filtered or unexported fields
}

TCPServer : TCP Server 组件

func NewTCPServer

func NewTCPServer(ctx *common.Context) *TCPServer

NewTCPServer : 实例化

func (*TCPServer) Close

func (server *TCPServer) Close()

Close : 关闭组件

func (*TCPServer) Start

func (server *TCPServer) Start() bool

Start : 实例化组件

type Time

type Time struct {
	// contains filtered or unexported fields
}

Time : 随机函数组件

func NewTime

func NewTime(ctx *common.Context) *Time

NewTime : 实例化

func (*Time) Close

func (*Time) Close()

Close : 关闭组件

func (*Time) GetTickCount

func (t *Time) GetTickCount() int64

GetTickCount : 毫秒数

func (*Time) SetDelta

func (t *Time) SetDelta(delta int64)

SetDelta : 设置时间差(单位毫秒),用来快进或后退当前时间(调试时间相关功能时,会用到)

func (*Time) Start

func (t *Time) Start() bool

Start : 实例化组件

type UID

type UID struct {
	// contains filtered or unexported fields
}

UID : UID 组件

func NewUID

func NewUID(ctx *common.Context) *UID

NewUID : 实例化

func (*UID) Close

func (*UID) Close()

Close : 关闭组件

func (*UID) GetUID

func (uid *UID) GetUID(key string) (uint64, error)

GetUID : 根据 KEY , 获取 UID

func (*UID) Start

func (uid *UID) Start() bool

Start : 实例化组件

Directories

Path Synopsis
node
mgr

Jump to

Keyboard shortcuts

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