leaf

package module
v0.0.0-...-9c21ab8 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

README

请参考原版文档以及说明,与原版不兼容。主要修正包括:

  1. 移除了一些不需要的模块,如mongo的支持等,这些直接用第三方库即可;
  2. 将自己实现的log模块改为zap的,性能更好并支持json格式的日志;
  3. 将websocket的RemoteAddr返回值改为透过代理的(如果存在);
  4. 加上go mod支持,修改版本号为规范格式;
  5. protobuf消息支持自定义ID;
  6. 增加了大量utils函数;
  7. 增加了udp支持;将TCP的协议解析器和路由抽象出来,允许自行定义;
  8. 允许动态加载各module,允许热重启所有module;
  9. 增加了tcp和websocket的通用客户端;
  10. 关闭信号由chan bool改为chan struct{}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CloseServer

func CloseServer()

手动关闭服务

func ReloadServer

func ReloadServer()

内部热加载

func Run

func Run(consolePort int, getMods GetModules, beforeClose func())

一般运行模式:开启模块热加载特性

func StaticRun

func StaticRun(consolePort int, mods []module.Module)

模块以静态模式加载(关闭热加载特性)

Types

type GetModules

type GetModules func() map[module.Action][]module.Module

Directories

Path Synopsis
tcp
udp
ws
util
deepcopy
from: https://github.com/mohae/deepcopy
from: https://github.com/mohae/deepcopy
fs
tz

Jump to

Keyboard shortcuts

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