g

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2017 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DLock sync.Mutex
View Source
var (
	Root string
)

Functions

func GetRoot

func GetRoot() string

Types

type Alterdata

type Alterdata struct {
	Logtime   string
	Fromname  string
	Toname    string
	Alerttype int
}

type Config

type Config struct {
	Ver          string
	Port         int
	Name         string
	Timeout      string
	Ping         string
	Ip           string
	Db           string
	Password     string
	Alerthistory int
	Alertcycle   int
	Alertsound   string
	Thdchecksec  int
	Thdoccnum    int
	Thdavgdelay  int
	Thdloss      int
	Tline        string
	Tsymbolsize  string
	Targets      []Target
}

func ParseConfig

func ParseConfig(ver string) (Config, *sql.DB)

func ReadConfig

func ReadConfig(filename string) Config

Opening (or creating) config file in JSON format

type LogInfo

type LogInfo struct {
	Logtime   string
	Ip        string
	Name      string
	Maxdelay  string
	Mindelay  string
	Avgdelay  string
	Sendpk    string
	Revcpk    string
	Losspk    string
	Lastcheck string
}

type PingResult

type PingResult struct {
	MaxDelay  string
	MinDelay  string
	AvgDelay  string
	SendPk    string
	RevcPk    string
	LossPk    string
	LastCheck string
}

Ping Db Result

type PingResultList

type PingResultList struct {
	Lock       sync.Mutex
	PingResult map[string]PingResult
}

Ping Db Result List

type PingSt added in v0.4.0

type PingSt struct {
	SendPk   string
	RevcPk   string
	LossPk   string
	MinDelay string
	AvgDelay string
	MaxDelay string
}

Ping Stuct

type Showlist

type Showlist struct {
	Tlist       []*Topo
	Nlist       []map[string]string
	Status      map[string]string
	AGraph      []map[string]string
	Alert       string
	Tline       string
	Tsymbolsize string
}

type State

type State struct {
	Conf      Config
	Localname string
	Localip   string
	Showtype  string
	Lock      sync.Mutex
	State     map[*Target]TargetStatus
}

type Target

type Target struct {
	Name        string
	Addr        string
	Type        string
	Thdchecksec int
	Thdoccnum   int
	Thdavgdelay int
	Thdloss     int
}

type TargetStatus

type TargetStatus struct {
	Target    *Target
	MaxDelay  string
	MinDelay  string
	AvgDelay  string
	SendPk    string
	RevcPk    string
	LossPk    string
	LastCheck string
}

type Todata

type Todata struct {
	Area []Todataarea `json:"area"`
	Line []Todataline `json:"line"`
}

type Todataarea

type Todataarea struct {
	Name      string      `json:"name"`
	ItemStyle ToitemStyle `json:"itemStyle"`
}

type Todataline

type Todataline struct {
	Source    string      `json:"source"`
	Target    string      `json:"target"`
	ItemStyle ToitemStyle `json:"itemStyle"`
}

type ToitemStyle

type ToitemStyle struct {
	Normal map[string]string `json:"normal"`
}

type Topo

type Topo struct {
	From  map[string]string
	To    map[string]string
	Color string
}

type TopoLog

type TopoLog struct {
	Maxavgdelay string
	Maxlosspk   string
	Cnt         string
}

Jump to

Keyboard shortcuts

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