conf

package
v1.4.18 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

*

  • description: 配置加载
  • author: jarekzha@gmail.com
  • date: Aug 31, 2022

Index

Constants

This section is empty.

Variables

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

Functions

func LoadConfig

func LoadConfig(configFileUrl string)

LoadConfig 加载配置

Types

type Config

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

Config 配置结构体

type ModuleSettings

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

ModuleSettings 模块配置

type Mqtt

type Mqtt struct {
	WirteLoopChanNum int `mqant:"WirteLoopChanNum"` // 最大写入包队列缓存 (1,+∞)
	ReadPackLoop     int `mqant:"ReadPackLoop"`     // 最大读取包队列缓存
	ReadTimeout      int `mqant:"ReadTimeout"`      // 读取超时
	WriteTimeout     int `mqant:"WriteTimeout"`     // 写入超时
}

Mqtt mqtt协议配置

type RPC

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

rpc 进程间通信配置

Jump to

Keyboard shortcuts

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