g

package
v0.0.0-...-595f689 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2022 License: Apache-2.0 Imports: 13 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
)

Functions

func GetRoot

func GetRoot() string

func IsExist

func IsExist(fp string) bool

func ParseConfig

func ParseConfig(ver string)

func SaveConfig

func SaveConfig() error

Types

type AlertLog

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

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 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