g

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Version = "3.0.1"
)

Variables

View Source
var (
	TransferCheck   = false
	RedisNormalHost []string
	TotalLru        = make(map[int]LruCache, 1)
	SkipAlarm       = false
)
View Source
var (
	Logger *log.Logger
	Ipaddr string
)
View Source
var (
	ConfigFile string
)

Functions

func GetHostCount

func GetHostCount(totalCache map[int]LruCache) (totalCount int)

func GetIP

func GetIP() string

func InitLog

func InitLog() *log.Logger

func MonitorPeriod

func MonitorPeriod()

func ParseConfig

func ParseConfig(cfg string)

func PutData

func PutData(totalCache map[int]LruCache, newCache LruCache) (reNewCache map[int]LruCache)

func ToString

func ToString(filePath string) (string, error)

func ToTrimString

func ToTrimString(filePath string) (string, error)

Types

type ClientConfig

type ClientConfig struct {
	RoomName string `json:"roomname"`
	ShotName string `json:"shotname"`
	CheckUrl string `json:"checkurl"`
}

type Cmdb

type Cmdb struct {
	Url     string `json:"url"`
	SysName string `json:"sysname"`
	Token   string `json:"token"`
}

type Degrade

type Degrade struct {
	Enabled    bool `json:"enabled"`
	Period     int  `json:"period"`
	AlarmLimit int  `json:"alarmlimit"`
	FrozenTime int  `json:"frozentime"`
}

type Falcon

type Falcon struct {
	FalconAuthName string `json:"falconauth"`
	FalconAuthSig  string `json:"falconsign"`
	Url            string `json:"url"`
}

type GlobalConfig

type GlobalConfig struct {
	Debug            bool            `json:"debug"`
	ForceCheck       bool            `json:"forcecheck"`
	AlarmEnable      bool            `json:"alarmenable"`
	LogMaxAge        int             `json:"logmaxage"`
	LogRotateAge     int             `json:"logrotateage"`
	AgentExpire      int64           `json:"agentexpire"`
	AgentPriority    string          `json:"agentpriority"`
	CheckInterval    int             `json:"checkinterval"`
	LogFile          string          `json:"logfile"`
	Http             *HttpConfig     `json:"http"`
	Redis            *RedisConfig    `json:"redis"`
	FlushKeyInterval int             `json:"flushkeyinterval"`
	Falcon           *Falcon         `json:"falcon"`
	Cmdb             *Cmdb           `json:"cmdb"`
	Pigeon           *Pigeon         `json:"pigeon"`
	ExcludeDomains   []string        `json:"excludedomains"`
	ExcludeDBATags   string          `json:"excludedbatags"`
	ExcludeDBADeploy []int           `json:"excludedbadeploytype"`
	Transfer         *TransferConfig `json:"transfer"`
	PingClient       *[]ClientConfig `json:"pingclient"`
	Degrade          *Degrade        `json:"degrade"`
	Proxy            *Proxy          `json:"proxy"`
}

func Config

func Config() *GlobalConfig

type HttpConfig

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

type HttpPingRequest

type HttpPingRequest struct {
	Ipaddr string `json:"ipaddr"`
}

type HttpPingResponse

type HttpPingResponse struct {
	PingStatus bool   `json:"pingcheck"`
	Ipaddr     string `json:"ipaddr"`
}

type LruCache

type LruCache struct {
	Timestamp int64    `json:"timestamp"`
	HostList  []string `json:"hostlist"`
}

func (LruCache) HostDetail

func (l LruCache) HostDetail() string

func (LruCache) Len

func (l LruCache) Len() int

func (LruCache) String

func (l LruCache) String() string

type Pigeon

type Pigeon struct {
	PigeonSource string `json:"source"`
	PigeonKey    string `json:"key"`
	M3dbUrl      string `json:"m3dburl"`
	PigeonUrl    string `json:"pigeonurl"`
}

type Proxy

type Proxy struct {
	Servers []string `json:"servers"`
}

type RedisConfig

type RedisConfig struct {
	Enabled     bool   `json:"enabled"`
	Server      string `json:"server"`
	Port        string `json:"port"`
	MaxIdle     int    `json:"maxidle"`
	MaxActive   int    `json:"maxactive"`
	IdleTimeOut int    `json:"idletimeout"`
}

type TransferConfig

type TransferConfig struct {
	Interval int      `json:"interval"`
	Servers  []string `json:"servers"`
}

Jump to

Keyboard shortcuts

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