g

package
v0.0.0-...-b0925cc Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2017 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	VERSION = "51idc-0.0.1"
)

changelog: 0.0.1: first version

Variables

View Source
var (
	TransferClientsLock *sync.RWMutex                   = new(sync.RWMutex)
	TransferClients     map[string]*SingleConnRpcClient = map[string]*SingleConnRpcClient{}
)
View Source
var (
	ConfigFile string
)
View Source
var LocalIps []string
View Source
var Root string

Functions

func DuPaths

func DuPaths() []string

func GetCurrPluginVersion

func GetCurrPluginVersion() string

func Hostname

func Hostname() (string, error)

func IP

func IP() string

func InitLocalIps

func InitLocalIps()

func InitRootDir

func InitRootDir()

func InitRpcClients

func InitRpcClients()

func InitSeeLog

func InitSeeLog()

func IsTrustable

func IsTrustable(remoteAddr string) bool

func ParseConfig

func ParseConfig(cfg string)

func ReportPorts

func ReportPorts() []int64

func ReportProcs

func ReportProcs() map[string]map[int]string

func ReportUrls

func ReportUrls() map[string]string

func SendMetrics

func SendMetrics(metrics []*model.MetricValue, resp *model.TransferResponse)

func SendToTransfer

func SendToTransfer(metrics []*model.MetricValue)

func SetDuPaths

func SetDuPaths(paths []string)

func SetReportPorts

func SetReportPorts(ports []int64)

func SetReportProcs

func SetReportProcs(procs map[string]map[int]string)

func SetReportUrls

func SetReportUrls(urls map[string]string)

func SetTrustableIps

func SetTrustableIps(ipStr string)

func TrustableIps

func TrustableIps() []string

Types

type GlobalConfig

type GlobalConfig struct {
	Debug           bool             `json:"debug"`
	Hostname        string           `json:"hostname"`
	IP              string           `json:"ip"`
	Plugin          *PluginConfig    `json:"plugin"`
	Heartbeat       *HeartbeatConfig `json:"heartbeat"`
	Transfer        *TransferConfig  `json:"transfer"`
	Http            *HttpConfig      `json:"http"`
	SmartAPI        *SmartAPIConfig  `json:"smartAPI`
	DBType          string           `json:"dbType"`
	MySQLMetric     map[string]bool  `json:"mysqlMetric"`
	SQLServerMetric map[string]bool  `json:"sqlserverMetric"`
	AccessKeyId     string           `json:"accessKeyId"`
	AccessKeySecret string           `json:"accessKeySecret"`
	DBInstanceId    string           `json:"dbInstanceId"`
}

func Config

func Config() *GlobalConfig

type HeartbeatConfig

type HeartbeatConfig struct {
	Enabled  bool   `json:"enabled"`
	Addr     string `json:"addr"`
	Interval int    `json:"interval"`
	Timeout  int    `json:"timeout"`
}

type HttpConfig

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

type PluginConfig

type PluginConfig struct {
	Enabled bool   `json:"enabled"`
	Dir     string `json:"dir"`
	Git     string `json:"git"`
	LogDir  string `json:"logs"`
}

type SingleConnRpcClient

type SingleConnRpcClient struct {
	sync.Mutex

	RpcServer string
	Timeout   time.Duration
	// contains filtered or unexported fields
}
var (
	HbsClient *SingleConnRpcClient
)

func (*SingleConnRpcClient) Call

func (this *SingleConnRpcClient) Call(method string, args interface{}, reply interface{}) error

type SmartAPIConfig

type SmartAPIConfig struct {
	Enabled bool   `json:"enabled"`
	Url     string `json:"url"`
}

type TransferConfig

type TransferConfig struct {
	Enabled  bool     `json:"enabled"`
	Addrs    []string `json:"addrs"`
	Interval int      `json:"interval"`
	Timeout  int      `json:"timeout"`
}