g

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2018 License: Apache-2.0, Apache-2.0 Imports: 11 Imported by: 160

Documentation

Index

Constants

View Source
const (
	VERSION = "2.0.2"
)

change log 2.0.1: bugfix HistoryData limit 2.0.2: clean stale data

Variables

View Source
var (
	HbsClient     *SingleConnRpcClient
	StrategyMap   = &SafeStrategyMap{M: make(map[string][]model.Strategy)}
	ExpressionMap = &SafeExpressionMap{M: make(map[string][]*model.Expression)}
	LastEvents    = &SafeEventMap{M: make(map[string]*model.Event)}
	FilterMap     = &SafeFilterMap{M: make(map[string]string)}
)
View Source
var (
	ConfigFile string
)
View Source
var RedisConnPool *redis.Pool

Functions

func InitHbsClient

func InitHbsClient()

func InitRedisConnPool

func InitRedisConnPool()

func ParseConfig

func ParseConfig(cfg string)

func PingRedis

func PingRedis(c redis.Conn, t time.Time) error

Types

type AlarmConfig

type AlarmConfig struct {
	Enabled      bool         `json:"enabled"`
	MinInterval  int64        `json:"minInterval"`
	QueuePattern string       `json:"queuePattern"`
	Redis        *RedisConfig `json:"redis"`
}

type GlobalConfig

type GlobalConfig struct {
	Debug     bool         `json:"debug"`
	DebugHost string       `json:"debugHost"`
	Remain    int          `json:"remain"`
	Http      *HttpConfig  `json:"http"`
	Rpc       *RpcConfig   `json:"rpc"`
	Hbs       *HbsConfig   `json:"hbs"`
	Alarm     *AlarmConfig `json:"alarm"`
}

func Config

func Config() *GlobalConfig

type HbsConfig

type HbsConfig struct {
	Servers  []string `json:"servers"`
	Timeout  int64    `json:"timeout"`
	Interval int64    `json:"interval"`
}

type HttpConfig

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

type RedisConfig

type RedisConfig struct {
	Dsn          string `json:"dsn"`
	MaxIdle      int    `json:"maxIdle"`
	ConnTimeout  int    `json:"connTimeout"`
	ReadTimeout  int    `json:"readTimeout"`
	WriteTimeout int    `json:"writeTimeout"`
}

type RpcConfig

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

type SafeEventMap

type SafeEventMap struct {
	sync.RWMutex
	M map[string]*model.Event
}

func (*SafeEventMap) Get

func (this *SafeEventMap) Get(key string) (*model.Event, bool)

func (*SafeEventMap) Set

func (this *SafeEventMap) Set(key string, event *model.Event)

type SafeExpressionMap

type SafeExpressionMap struct {
	sync.RWMutex
	// metric:tag1 => [exp1, exp2 ...]
	// metric:tag2 => [exp1, exp2 ...]
	M map[string][]*model.Expression
}

func (*SafeExpressionMap) Get

func (this *SafeExpressionMap) Get() map[string][]*model.Expression

func (*SafeExpressionMap) ReInit

func (this *SafeExpressionMap) ReInit(m map[string][]*model.Expression)

type SafeFilterMap added in v0.2.2

type SafeFilterMap struct {
	sync.RWMutex
	M map[string]string
}

func (*SafeFilterMap) Exists added in v0.2.2

func (this *SafeFilterMap) Exists(key string) bool

func (*SafeFilterMap) ReInit added in v0.2.2

func (this *SafeFilterMap) ReInit(m map[string]string)

type SafeStrategyMap

type SafeStrategyMap struct {
	sync.RWMutex
	// endpoint:metric => [strategy1, strategy2 ...]
	M map[string][]model.Strategy
}

func (*SafeStrategyMap) Get

func (this *SafeStrategyMap) Get() map[string][]model.Strategy

func (*SafeStrategyMap) ReInit

func (this *SafeStrategyMap) ReInit(m map[string][]model.Strategy)

type SingleConnRpcClient

type SingleConnRpcClient struct {
	sync.Mutex

	RpcServers []string
	Timeout    time.Duration
	// contains filtered or unexported fields
}

func (*SingleConnRpcClient) Call

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

Jump to

Keyboard shortcuts

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