g

package
v0.0.0-...-362a939 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2019 License: Apache-2.0 Imports: 5 Imported by: 24

Documentation

Index

Constants

View Source
const (
	VERSION = "0.2.0"
)

Variables

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

Functions

func Parse

func Parse(cfg string) error

Types

type AlarmConfig

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

type CheckResult

type CheckResult struct {
	Sid      int64  `json:"sid"`
	Domain   string `json:"domain"`
	Target   string `json:"target"`
	Creator  string `json:"creator"`
	Tag      string `json:"tag"`
	RespCode string `json:"resp_code"`
	RespTime int    `json:"resp_time"`
	Status   int64  `json:"status"`
	PushTime int64  `json:"push_time"`
	Ip       string `json:"ip"`
}

agent上报的数据结构

type DetectedItem

type DetectedItem struct {
	Sid        int64  `json:"sid"`
	Domain     string `json:"domain"`
	Target     string `json:"target"`
	Ip         string `json:"ip"`
	Keywords   string `json:"keywords"`
	Timeout    int    `json:"timeout"`
	Creator    string `json:"creator"`
	Data       string `json:"data"`
	Tag        string `json:"tag"`
	ExpectCode string `json:"expect_code"`
	Idc        string `json:"idc"`
}

下发给agent的数据结构

type DetectedItemSafeMap

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

func (*DetectedItemSafeMap) Get

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

func (*DetectedItemSafeMap) Set

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

type FalconConfig

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

type GlobalConfig

type GlobalConfig struct {
	Debug       bool                `json:"debug"`
	Admins      []string            `json:"admins"`
	Salt        string              `json:"salt"`
	Past        int                 `json:"past"` //查看最近几分钟内的报警历史和绘图,默认为30分钟
	Http        *HttpConfig         `json:"http"`
	Rpc         *RpcConfig          `json:"rpc"`
	Ldap        *LdapConfig         `json:"ldap"`
	Log         *LogConfig          `json:"log"`
	Mysql       *MysqlConfig        `json:"mysql"`
	Alarm       *AlarmConfig        `json:"alarm"`
	Falcon      *FalconConfig       `json:"falcon"`
	InternalDns *InternalDnsConfig  `json:"internalDns"`
	MonitorMap  map[string][]string `json:"monitorMap"`
}
var (
	Config *GlobalConfig
)

type HttpConfig

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

type InternalDnsConfig

type InternalDnsConfig struct {
	Enable bool   `json:"enable"`
	Addr   string `json:"addr"`
}

type IpIdc

type IpIdc struct {
	Ip  string
	Idc string
}

type LdapConfig

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

type LogConfig

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

type MysqlConfig

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

type RpcConfig

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

Jump to

Keyboard shortcuts

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