Documentation ¶
Index ¶
- Constants
- Variables
- func InitRedisConnPool()
- func Link(event *model.Event) string
- func ParseConfig(cfg string)
- func PingRedis(c redis.Conn, t time.Time) error
- func ReadCacheFromFile()
- func SaveCacheToFile()
- type ApiConfig
- type EventDto
- type GlobalConfig
- type HttpConfig
- type OrderedEvents
- type QueueConfig
- type RedisConfig
- type SafeEvents
Constants ¶
View Source
const (
VERSION = "2.0.2"
)
Variables ¶
View Source
var (
ConfigFile string
)
View Source
var Events = &SafeEvents{M: make(map[string]*EventDto)}
View Source
var RedisConnPool *redis.Pool
Functions ¶
func InitRedisConnPool ¶
func InitRedisConnPool()
func ParseConfig ¶
func ParseConfig(cfg string)
func ReadCacheFromFile ¶
func ReadCacheFromFile()
func SaveCacheToFile ¶
func SaveCacheToFile()
Types ¶
type EventDto ¶
type EventDto struct { Id string `json:"id"` Endpoint string `json:"endpoint"` Metric string `json:"metric"` Counter string `json:"counter"` Func string `json:"func"` LeftValue string `json:"leftValue"` Operator string `json:"operator"` RightValue string `json:"rightValue"` Note string `json:"note"` MaxStep int `json:"maxStep"` CurrentStep int `json:"currentStep"` Priority int `json:"priority"` Status string `json:"status"` Timestamp int64 `json:"timestamp"` ExpressionId int `json:"expressionId"` StrategyId int `json:"strategyId"` TemplateId int `json:"templateId"` ActionId int `json:"actionId"` Link string `json:"link"` }
type GlobalConfig ¶
type GlobalConfig struct { Debug bool `json:"debug"` UicToken string `json:"uicToken"` Http *HttpConfig `json:"http"` Queue *QueueConfig `json:"queue"` Redis *RedisConfig `json:"redis"` Api *ApiConfig `json:"api"` SaveFile string `json:"savefile"` }
func Config ¶
func Config() *GlobalConfig
type HttpConfig ¶
type OrderedEvents ¶
type OrderedEvents []*EventDto
func (OrderedEvents) Len ¶
func (this OrderedEvents) Len() int
func (OrderedEvents) Less ¶
func (this OrderedEvents) Less(i, j int) bool
func (OrderedEvents) Swap ¶
func (this OrderedEvents) Swap(i, j int)
type QueueConfig ¶
type RedisConfig ¶
type SafeEvents ¶
func (*SafeEvents) Clone ¶
func (this *SafeEvents) Clone() map[string]*EventDto
func (*SafeEvents) Delete ¶
func (this *SafeEvents) Delete(id string)
func (*SafeEvents) Init ¶
func (this *SafeEvents) Init(m map[string]*EventDto)
func (*SafeEvents) Len ¶
func (this *SafeEvents) Len() int
func (*SafeEvents) Put ¶
func (this *SafeEvents) Put(event *model.Event)
Click to show internal directories.
Click to hide internal directories.