g

package
v0.0.0-...-1489327 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2022 License: GPL-2.0, Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	BinaryName string
	Version    string
	GitCommit  string
)
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

func VersionMsg

func VersionMsg() string

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

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

func (*SafeFilterMap) Exists

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

func (*SafeFilterMap) ReInit

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
	CallTimeout 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