g

package
v0.0.0-...-5416f79 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	VERSION = "0.0.4"
)

Variables

View Source
var (
	ConfigFile string
)

Functions

func ParseConfig

func ParseConfig(cfg string)

Types

type ApiConfig

type ApiConfig struct {
	Hostnames string `json:"hostnames"`
	Push      string `json:"push"`
	GraphLast string `json:"graphLast'`
}

type Cluster

type Cluster struct {
	Id          int64
	GroupId     int64
	Numerator   string
	Denominator string
	Endpoint    string
	Metric      string
	Tags        string
	DsType      string
	Step        int
	LastUpdate  time.Time
}

func (*Cluster) String

func (this *Cluster) String() string

type DatabaseConfig

type DatabaseConfig struct {
	Addr     string `json:"addr"`
	Idle     int    `json:"idle"`
	Ids      []int  `json:"ids"`
	Interval int64  `json:"interval"`
}

type GlobalConfig

type GlobalConfig struct {
	Debug    bool            `json:"debug"`
	Http     *HttpConfig     `json:"http"`
	Database *DatabaseConfig `json:"database"`
	Api      *ApiConfig      `json:"api"`
}

func Config

func Config() *GlobalConfig

type HttpConfig

type HttpConfig struct {
	Enabled bool   `json:"enabled"`
	Listen  string `json:"listen"`
}

type SafeClusterMonitorItems

type SafeClusterMonitorItems struct {
	sync.RWMutex
	M map[string]*Cluster
}

key: Id+LastUpdate

func NewClusterMonitorItems

func NewClusterMonitorItems() *SafeClusterMonitorItems

func (*SafeClusterMonitorItems) Get

func (this *SafeClusterMonitorItems) Get() map[string]*Cluster

func (*SafeClusterMonitorItems) Init

func (this *SafeClusterMonitorItems) Init(m map[string]*Cluster)

Jump to

Keyboard shortcuts

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