g

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 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 {
	ConnectTimeout int32  `json:"connect_timeout"`
	RequestTimeout int32  `json:"request_timeout"`
	PlusApi        string `json:"plus_api"`
	PlusApiToken   string `json:"plus_api_token"`
	PushApi        string `json:"push_api"`
}

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