g

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2020 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	VERSION = "0.2.0"
)

Variables

View Source
var (
	DetectedItemMap = &DetectedItemSafeMap{M: make(map[string][]*dataobj.DetectedItem)}
)

Functions

func Parse

func Parse(cfg string) error

Types

type AlarmConfig

type AlarmConfig struct {
	Enable      bool              `yaml:"enable"`
	Batch       int               `yaml:"batch"`
	Replicas    int               `yaml:"replicas"`
	ConnTimeout int               `yaml:"connTimeout"`
	CallTimeout int               `yaml:"callTimeout"`
	MaxConns    int               `yaml:"maxConns"`
	MaxIdle     int               `yaml:"maxIdle"`
	SleepTime   int               `yaml:"sleepTime"`
	Cluster     map[string]string `yaml:"cluster"`
}

type DetectedItemSafeMap

type DetectedItemSafeMap struct {
	sync.RWMutex
	M map[string][]*dataobj.DetectedItem
}

func (*DetectedItemSafeMap) Get

func (this *DetectedItemSafeMap) Get(key string) ([]*dataobj.DetectedItem, bool)

func (*DetectedItemSafeMap) GetAll

func (this *DetectedItemSafeMap) GetAll() map[string][]*dataobj.DetectedItem

func (*DetectedItemSafeMap) Set

func (this *DetectedItemSafeMap) Set(detectedItemMap map[string][]*dataobj.DetectedItem)

type FalconConfig

type FalconConfig struct {
	Enable   bool   `yaml:"enable"`
	Addr     string `yaml:"addr"`
	Interval int    `yaml:"interval"`
}

type GlobalConfig

type GlobalConfig struct {
	Debug            bool          `yaml:"debug"`
	Admins           []string      `yaml:"admins"`
	Salt             string        `yaml:"salt"`
	Register         bool          `yaml:"register"`
	ShowDurationMin  int           `yaml:"showDurationMin"`  //查看最近几分钟内的报警历史和绘图,默认为30分钟
	KeepDurationHour int           `yaml:"keepDurationHour"` //保留历史数据时间长度,默认为12小时
	Http             *HttpConfig   `yaml:"http"`
	Rpc              *RpcConfig    `yaml:"rpc"`
	Ldap             *LdapConfig   `yaml:"ldap"`
	Mysql            *MysqlConfig  `yaml:"mysql"`
	Alarm            *AlarmConfig  `yaml:"alarm"`
	Falcon           *FalconConfig `yaml:"falcon"`
	Statsd           *StatsdConfig `yaml:"statsd"`
	Prom             *PromConfig   `yaml:"prom"`
	IDC              []string      `yaml:"idc"`
}
var (
	Config *GlobalConfig
)

type HttpConfig

type HttpConfig struct {
	Listen string `yaml:"listen"`
	Secret string `yaml:"secret"`
}

type InternalDnsConfig

type InternalDnsConfig struct {
	Enable bool   `yaml:"enable"`
	CMD    string `yaml:"cmd"`
}

type LdapConfig

type LdapConfig struct {
	Enabled    bool     `yaml:"enabled"`
	Addr       string   `yaml:"addr"`
	BindDN     string   `yaml:"bindDN"`
	BaseDN     string   `yaml:"baseDN`
	BindPasswd string   `yaml:"bindPasswd"`
	UserField  string   `yaml:"userField"`
	Attributes []string `yaml:attributes`
}

type LogConfig

type LogConfig struct {
	Path     string `yaml:"path"`
	Filename string `yaml:"filename"`
	Level    string `yaml:"level"`
}

type MysqlConfig

type MysqlConfig struct {
	Addr string `yaml:"addr"`
	Idle int    `yaml:"idle"`
	Max  int    `yaml:"max"`
}

type PromConfig

type PromConfig struct {
	Enable bool   `yaml:"enable"`
	Addr   string `yaml:"addr"`
}

type RpcConfig

type RpcConfig struct {
	Listen string `yaml:"listen"`
}

type StatsdConfig

type StatsdConfig struct {
	Enable bool   `yaml:"enable"`
	Addr   string `yaml:"addr"`
}

Jump to

Keyboard shortcuts

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