conf

package
v1.6.7 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2018 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	LenStackBuf = 1024

	Conf = Config{}
)

Functions

func LoadConfig

func LoadConfig(Path string)

Types

type Config

type Config struct {
	Log      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
}

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
	//日志文件目录
	//pid.nohup.log
	//pid.access.log
	//pid.error.log
	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 {
	MaxCoroutine int  //模块同时可以创建的最大协程数量默认是100
	RpcExpired   int  //远程访问最后期限值 单位秒[默认5秒] 这个值指定了在客户端可以等待服务端多长时间来应答
	LogSuccess   bool //是否打印请求处理成功的日志
	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

Jump to

Keyboard shortcuts

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