g

package
v0.0.0-...-a9119a5 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	VERSION = "1.1.0-xxx"

	REDISAGENTUPGRADESET = "agent_upgrade_set" //redis 中agent升级的set作为控制并发的队列

	REDIS_AGENT_UPGRADE_SET_EXPIRE = 70 //并发队列过期时间,避免异常agent占据升级队列

	MapCleanInterval = 1 //过期agent map清理周期,单位小时

	AgentUpdateQueueLength = 2000 //自升级agent的并发上线
)

change log: 1.0.7: code refactor for open source 1.0.8: bugfix loop init cache 1.0.9: update host table anyway 1.1.0: remove Checksum when query plugins

Variables

View Source
var (
	ConfigFile string

	HostName, _    = Hostname()
	GlobalCacheTtl time.Duration
)
View Source
var Logger = utils.InitLogger()

Functions

func Hostname

func Hostname() (string, error)

func ParseConfig

func ParseConfig(cfg string)

Types

type GlobalConfig

type GlobalConfig struct {
	Debug                      bool        `json:"debug"`
	Hosts                      string      `json:"hosts"`
	Database                   string      `json:"database"`
	DatabaseRo                 string      `json:"database_ro"`
	MaxConns                   int         `json:"maxConns"`
	MaxIdle                    int         `json:"maxIdle"`
	Listen                     string      `json:"listen"`
	Trustable                  []string    `json:"trustable"`
	Http                       *HttpConfig `json:"http"`
	MapCleanInterval           int64       `json:"map_clean_interval"`
	AgentUpdateQueueLength     int         `json:"agent_update_queue_length"`
	RedisAgentUpgradeSetExpire int         `json:"redis_agent_upgrade_set_expire"`
	RedisClusterNodes          []string    `json:"redis_cluster_nodes"`
	CacheTtl                   int64       `json:"cache_ttl"`
}

func Config

func Config() *GlobalConfig

type HttpConfig

type HttpConfig struct {
	Enabled bool   `json:"enabled"`
	Listen  string `json:"listen"`
}

Jump to

Keyboard shortcuts

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