Version: v2.0.0+incompatible Latest Latest

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

Go to latest
Published: Aug 22, 2019 License: Apache-2.0 Imports: 7 Imported by: 94




This section is empty.


View Source
var (
	LenStackBuf = 1024

	Conf = Config{}


func LoadConfig

func LoadConfig(Path string)


type Config

type Config struct {
	Log      map[string]interface{}
	BI       map[string]interface{}
	OP       map[string]interface{}
	Rpc      Rpc
	Module   map[string][]*ModuleSettings
	Mqtt     Mqtt
	Master   Master
	Settings map[string]interface{}

type Master

type Master struct {
	Enable  bool
	WebRoot string
	WebHost string
	SSH     []*SSH
	Process []*Process

func (*Master) GetSSH

func (m *Master) GetSSH(host string) *SSH

type ModuleSettings

type ModuleSettings struct {
	Id        string
	Host      string
	ProcessID string
	Settings  map[string]interface{}
	Rabbitmq  *Rabbitmq
	Redis     *Redis
	UDP       *UDP

type Mqtt

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

type Process

type Process struct {
	ProcessID string
	Host      string
	Execfile string
	LogDir string
	Args map[string]interface{}

type Rabbitmq

type Rabbitmq struct {
	Uri          string
	Exchange     string
	ExchangeType string
	Queue        string
	BindingKey   string //
	ConsumerTag  string //消费者TAG

type Redis

type Redis struct {
	Uri   string //redis://:[password]@[ip]:[port]/[db]
	Queue string

type Rpc

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

type SSH

type SSH struct {
	Host     string
	Port     int
	User     string
	Password string

func (*SSH) GetSSHHost

func (s *SSH) GetSSHHost() string

* host:port

type UDP

type UDP struct {
	Uri              string //udp服务端监听ip
	Port             int    //端口
	UDPMaxPacketSize int

Source Files

Jump to

Keyboard shortcuts

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