g

package
v0.0.0-...-f78050c Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Root string
	Cfg  Config
	//CLock	       sync.Mutex
	SelfCfg        NetworkMember
	AlertStatus    map[string]bool
	AuthUserIpMap  map[string]bool
	AuthAgentIpMap map[string]bool
	ToolLimit      map[string]int
	Db             *sql.DB
	DLock          sync.Mutex
	Ads            AllDomainstruct
	Url            = "http://searchdns.search.weibo.com/domain/fourteenth_showalldomain"
)

Functions

func AutoDiscoveryHostAgent

func AutoDiscoveryHostAgent(consulEndpoint string, pipe chan<- AgentInfos) error

AutoDiscoveryHostAgent consul中自动获取agent相关信息

func Backmap

func Backmap(fline string) map[string]string

func CheckIsIn

func CheckIsIn(slicename []string, linename string) bool

func DefaultHandler

func DefaultHandler(datas AgentInfos)

DefaultHandler 默认数据处理函数

func GenerateHostAgentConfig

func GenerateHostAgentConfig(pipe <-chan AgentInfos, handler Handler)

GenerateHostAgentConfig 生成agent配置

func GetRoot

func GetRoot() string

func IsExist

func IsExist(fp string) bool

func ParseConfig

func ParseConfig(ver string)

func Parseurl

func Parseurl() []string

func ReadAdsConfig

func ReadAdsConfig()

func SaveConfig

func SaveConfig() error

func StartAutoDiscoveryConfig4LocalMode

func StartAutoDiscoveryConfig4LocalMode(consulEndpoint string, ver string)

StartAutoDiscoveryConfig4LocalMode 开启local模式配置自动更新

func UpdateAgentConfig

func UpdateAgentConfig(datas AgentInfos)

UpdateAgentConfig 更新配置数据内容

func ValidDomain

func ValidDomain(domainName string) bool

func ValidDomaina

func ValidDomaina(domainName string) bool

Types

type AgentInfos

type AgentInfos struct {
	Agents   HostAgentInfos
	NoAgents HostNoAgentInfos
}

AgentInfos agent信息

type AlertLog

type AlertLog struct {
	Logtime    string
	Targetip   string
	Targetname string
	Tracert    string
	Fromip     string
	Fromname   string
}

type AllDomainstruct

type AllDomainstruct struct {
	Domainipslice  map[string][]string
	Domainipmap    map[string][]map[string]string
	Domainipstruct map[string][]NetworkMember
	AllDomainslice []string
	Size           int
}

type ChinaMp

type ChinaMp struct {
	Text     string              `json:"text"`
	Subtext  string              `json:"subtext"`
	Avgdelay map[string][]MapVal `json:"avgdelay"`
}

type Config

type Config struct {
	Ver        string
	Port       int
	Name       string
	Addr       string
	Mode       map[string]string
	Base       map[string]int
	Topology   map[string]string
	Alert      map[string]string
	Network    map[string]NetworkMember
	Chinamap   map[string]map[string][]string
	Toollimit  int
	Authiplist string
	Password   string
}

func ReadConfig

func ReadConfig(filename string) Config

func SaveCloudConfig

func SaveCloudConfig(url string) (Config, error)

type DomainInfostruct

type DomainInfostruct struct {
	ID            int
	Domaintitle   string
	Busline       string
	Principal     string
	On_off_status string
	Status        string
	Create_time   string
	Mod_time      string
}

type Domainstruct

type Domainstruct struct {
	Result []DomainInfostruct
}

type Handler

type Handler func(datas AgentInfos)

Handler 数据处理函数

type HostAgentInfo

type HostAgentInfo struct {
	Name    string `json:"Name"`
	Address string `json:"Addr"`
}

HostAgentInfo the info of agent registried

type HostAgentInfos

type HostAgentInfos []HostAgentInfo

HostAgentInfos 安装了agent的host

type HostNoAgentInfos

type HostNoAgentInfos []HostAgentInfo

HostNoAgentInfos 未安装了agent的host

type MapVal

type MapVal struct {
	Value float64 `json:"value"`
	Name  string  `json:"name"`
}

type NetworkMember

type NetworkMember struct {
	Name      string
	Addr      string
	Smartping bool
	Ping      []string
	//Tools map[string][]string
	Topology []map[string]string
}

type PingLog

type PingLog struct {
	Logtime  string
	Maxdelay string
	Mindelay string
	Avgdelay string
	Losspk   string
}

type PingSt

type PingSt struct {
	SendPk   int
	RevcPk   int
	LossPk   int
	MinDelay float64
	AvgDelay float64
	MaxDelay float64
}

Ping Struct

type PingStMini

type PingStMini struct {
	Lastcheck []string `json:"lastcheck"`
	LossPk    []string `json:"losspk"`
	AvgDelay  []string `json:"avgdelay"`
}

Ping mini graph Struct

type ToolsRes

type ToolsRes struct {
	Status string `json:"status"`
	Error  string `json:"error"`
	Ip     string `json:"ip"`
	Ping   PingSt `json:"ping"`
}

Jump to

Keyboard shortcuts

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