cube

package module
v0.0.0-...-145bb91 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

README

cube

日志说明

日志默认使用三方库 https://github.com/sirupsen/logrus
修改或扩展日志功能只要修改或替换掉这个三方库中默认的标准日志对象就可以了
通过 logrus.StandardLogger() 获取三方库中默认的日志对象

代码说明
  • object: 基础节点,单线程模型,包含一个消息队列及定时器,在单线程中串行处理消息队列中的所有消息及定时任务
  • module: 自定义功能模块
    • network: 提供网络服务,支持tcp,websocket,过滤器network.Filter,中间件network.Middle
  • timer: 创建延迟函数及定时任务
  • g: 多线程支持
  • statsviz: 查看程序运行时的工具库 https://github.com/arl/statsviz

Documentation

Index

Constants

View Source
const Version = "1.0"

Variables

This section is empty.

Functions

func Close

func Close()

Close 关闭功能模块

func Load

func Load(filePath string)

Load 加载功能模块 filePath 配置文件路径

func Register

func Register(p Package)

Register 注册模块

func RegisterEncrypt

func RegisterEncrypt(h Encrypt)

RegisterEncrypt 注册加解密功能

func Run

func Run(config string)

Types

type Encrypt

type Encrypt interface {
	// IsCipherText 是否为加密数据
	IsCipherText([]byte) bool
	// Encrypt 数据加密
	Encrypt([]byte) []byte
	// Decode 数据解密
	Decode([]byte) []byte
}

Encrypt 配置文件加解密方式

type Package

type Package interface {
	// Name 模块名称
	Name() string
	// Init 初始化方法
	Init() error
	// Close 关闭方法
	Close() error
}

Package 功能模块

Directories

Path Synopsis
container
example
excel/gostruct
Code generated converter.
Code generated converter.
g

Jump to

Keyboard shortcuts

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