conf

package
v1.4.14 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2022 License: Apache-2.0 Imports: 6 Imported by: 125

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// LenStackBuf 异常堆栈信息
	LenStackBuf = 1024
	// Conf 配置结构体
	Conf = Config{}
)

Functions

func LoadConfig

func LoadConfig(Path string)

LoadConfig 加载配置

Types

type Config

type Config struct {
	Log      map[string]interface{}
	BI       map[string]interface{}
	OP       map[string]interface{}
	RPC      RPC `json:"rpc"`
	Module   map[string][]*ModuleSettings
	Mqtt     Mqtt
	Settings map[string]interface{}
}

Config 配置结构体

type ModuleSettings

type ModuleSettings struct {
	ID        string `json:"ID"`
	Host      string
	ProcessID string
	Settings  map[string]interface{}
}

ModuleSettings 模块配置

type Mqtt

type Mqtt struct {
	WirteLoopChanNum int // Should > 1 	    // 最大写入包队列缓存
	ReadPackLoop     int // 最大读取包队列缓存
	ReadTimeout      int // 读取超时
	WriteTimeout     int // 写入超时
}

Mqtt mqtt协议配置

type RPC added in v1.3.6

type RPC struct {
	MaxCoroutine int  //模块同时可以创建的最大协程数量默认是100
	RPCExpired   int  `json:"RpcExpired"` //远程访问最后期限值 单位秒[默认5秒] 这个值指定了在客户端可以等待服务端多长时间来应答
	Log          bool //是否打印RPC的日志
}

rpc 进程间通信配置

Jump to

Keyboard shortcuts

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