g

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2018 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DLock sync.Mutex
	Root  string
	Db    *sql.DB
	Cfg   Config
)

Functions

func GetRoot

func GetRoot() string

func IsExist added in v0.5.0

func IsExist(fp string) bool

func ParseConfig

func ParseConfig(ver string)

func SaveConfig added in v0.5.0

func SaveConfig() error

Types

type Alterdata

type Alterdata struct {
	Logtime  string
	Fromname string
	Toname   string
	Tracert  string
}

type Config

type Config struct {
	Ver          string
	Port         int
	Name         string
	Timeout      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
}

Main Config

func ReadConfig

func ReadConfig(filename string) Config

Opening 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 PingSt added in v0.4.0

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

Ping Stuct

type Target

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

Target Config

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
}

Topology

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