g

package
v0.0.0-...-f25a222 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2016 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	VERSION      = "0.0.17"
	GAUGE        = "GAUGE"
	COUNTER      = "COUNTER"
	DERIVE       = "DERIVE"
	DEFAULT_STEP = 60
)
View Source
const (
	COMMIT = "b5133f2"
)

Variables

View Source
var (
	ConfigFile string
)

Functions

func ParseConfig

func ParseConfig(cfg string)

Types

type ClusterNode

type ClusterNode struct {
	Addrs []string `json:"addrs"`
}

CLUSTER NODE

func NewClusterNode

func NewClusterNode(addrs []string) *ClusterNode

type GlobalConfig

type GlobalConfig struct {
	Debug   bool          `json:"debug"`
	MinStep int           `json:"minStep"` //最小周期,单位sec
	Http    *HttpConfig   `json:"http"`
	Rpc     *RpcConfig    `json:"rpc"`
	Socket  *SocketConfig `json:"socket"`
	Judge   *JudgeConfig  `json:"judge"`
	Graph   *GraphConfig  `json:"graph"`
	Tsdb    *TsdbConfig   `json:"tsdb"`
}

func Config

func Config() *GlobalConfig

type GraphConfig

type GraphConfig struct {
	Enabled     bool                    `json:"enabled"`
	Batch       int                     `json:"batch"`
	ConnTimeout int                     `json:"connTimeout"`
	CallTimeout int                     `json:"callTimeout"`
	PingMethod  string                  `json:"pingMethod"`
	MaxConns    int                     `json:"maxConns"`
	MaxIdle     int                     `json:"maxIdle"`
	Replicas    int                     `json:"replicas"`
	Cluster     map[string]string       `json:"cluster"`
	ClusterList map[string]*ClusterNode `json:"clusterList"`
}

type HttpConfig

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

type JudgeConfig

type JudgeConfig struct {
	Enabled     bool                    `json:"enabled"`
	Batch       int                     `json:"batch"`
	ConnTimeout int                     `json:"connTimeout"`
	CallTimeout int                     `json:"callTimeout"`
	PingMethod  string                  `json:"pingMethod"`
	MaxConns    int                     `json:"maxConns"`
	MaxIdle     int                     `json:"maxIdle"`
	Replicas    int                     `json:"replicas"`
	Cluster     map[string]string       `json:"cluster"`
	ClusterList map[string]*ClusterNode `json:"clusterList"`
}

type RpcConfig

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

type SocketConfig

type SocketConfig struct {
	Enabled bool   `json:"enabled"`
	Listen  string `json:"listen"`
	Timeout int    `json:"timeout"`
}

type TsdbConfig

type TsdbConfig struct {
	Enabled     bool   `json:"enabled"`
	Batch       int    `json:"batch"`
	ConnTimeout int    `json:"connTimeout"`
	CallTimeout int    `json:"callTimeout"`
	MaxConns    int    `json:"maxConns"`
	MaxIdle     int    `json:"maxIdle"`
	MaxRetry    int    `json:"retry"`
	Address     string `json:"address"`
}

Jump to

Keyboard shortcuts

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