g

package
v0.0.0-...-f62d9cd Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2020 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GAUGE   = "GAUGE"
	COUNTER = "COUNTER"
	DERIVE  = "DERIVE"
)

Variables

View Source
var (
	Version    string = "v0.1"
	BinaryName string = "ops-transfer.dev"
)
View Source
var (
	ConfigFile string
)
View Source
var (
	GraphCluster map[string]*ClusterNode
)

Functions

func HbsInfo

func HbsInfo() string

func InitAll

func InitAll()

func InitClusterNode

func InitClusterNode()

初始化集群配置

func InitConfig

func InitConfig()

func InitLog

func InitLog()

func InitRuntime

func InitRuntime()

func MemMonitor

func MemMonitor()

func ReloadConfig

func ReloadConfig() error

func Shutdown

func Shutdown(ctx context.Context) error

func Validator

func Validator() error

func VersionInfo

func VersionInfo() string

Types

type ClusterNode

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

func NewClusterNode

func NewClusterNode(addrs []string) *ClusterNode

type GlobalConfig

type GlobalConfig struct {
	Debug      bool         `json:"debug"`
	MinStep    int          `json:"min_step"`
	Log        *LogConfig   `json:"log"`
	Judge      *JudgeConfig `json:"judge"`
	Graph      *GraphConfig `json:"graph"`
	TsDB       *TsDBConfig  `json:"tsdb"`
	Rpc        *RpcConfig   `json:"rpc"`
	Http       *HttpConfig  `json:"http"`
	MaxCPURate float64      `json:"max_cpu_rate"`
	MaxMemRate float64      `json:"max_mem_rate"`
}

func Conf

func Conf() *GlobalConfig

type GraphConfig

type GraphConfig struct {
	Enabled     bool              `json:"enabled"`
	Batch       int               `json:"batch"`
	ConnTimeout int               `json:"conn_timeout"`
	CallTimeout int               `json:"call_timeout"`
	MaxConn     int               `json:"max_conn"`
	MaxIdle     int               `json:"max_idle"`
	Replicas    int               `json:"replicas"`
	Cluster     map[string]string `json:"cluster"`
}

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:"conn_timeout"`
	CallTimeout int               `json:"call_timeout"`
	MaxConn     int               `json:"max_conn"`
	MaxIdle     int               `json:"max_idle"`
	Replicas    int               `json:"replicas"`
	Cluster     map[string]string `json:"cluster"`
}

type LogConfig

type LogConfig struct {
	LogPath      string `json:"log_path"`
	LogLevel     string `json:"log_level"`
	LogFileName  string `json:"log_file_name"`
	LogKeepHours int    `json:"log_keep_hours"`
}

type RpcConfig

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

type TsDBConfig

type TsDBConfig struct {
	Enabled     bool   `json:"enabled"`
	Batch       int    `json:"batch"`
	ConnTimeout int    `json:"conn_timeout"`
	CallTimeout int    `json:"call_timeout"`
	MaxConn     int    `json:"max_conn"`
	MaxIdle     int    `json:"max_idle"`
	Retry       int    `json:"retry"`
	Addr        string `json:"addr"`
}

Jump to

Keyboard shortcuts

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