Versions in this module Expand all Collapse all v0 v0.2.1 Aug 15, 2017 v0.2.0 Jun 18, 2017 Changes in this version + var HistoryBigMap = make(map[string]*JudgeItemMap) + func CheckExpression(L *SafeLinkedList, firstItem *model.JudgeItem, now int64) + func CheckStrategy(L *SafeLinkedList, firstItem *model.JudgeItem, now int64) + func InitHistoryBigMap() + func Judge(L *SafeLinkedList, firstItem *model.JudgeItem, now int64) + type AllFunction struct + Limit int + Operator string + RightValue float64 + func (this AllFunction) Compute(L *SafeLinkedList) (vs []*model.HistoryData, leftValue float64, isTriggered bool, isEnough bool) + type AvgFunction struct + Limit int + Operator string + RightValue float64 + func (this AvgFunction) Compute(L *SafeLinkedList) (vs []*model.HistoryData, leftValue float64, isTriggered bool, isEnough bool) + type DiffFunction struct + Limit int + Operator string + RightValue float64 + func (this DiffFunction) Compute(L *SafeLinkedList) (vs []*model.HistoryData, leftValue float64, isTriggered bool, isEnough bool) + type Function interface + Compute func(L *SafeLinkedList) (vs []*model.HistoryData, leftValue float64, isTriggered bool, isEnough bool) + func ParseFuncFromString(str string, operator string, rightValue float64) (fn Function, err error) + type JudgeItemMap struct + M map[string]*SafeLinkedList + func NewJudgeItemMap() *JudgeItemMap + func (this *JudgeItemMap) BatchDelete(keys []string) + func (this *JudgeItemMap) CleanStale(before int64) + func (this *JudgeItemMap) Delete(key string) + func (this *JudgeItemMap) Get(key string) (*SafeLinkedList, bool) + func (this *JudgeItemMap) Len() int + func (this *JudgeItemMap) PushFrontAndMaintain(key string, val *model.JudgeItem, maxCount int, now int64) + func (this *JudgeItemMap) Set(key string, val *SafeLinkedList) + type LookupFunction struct + Limit int + Num int + Operator string + RightValue float64 + func (this LookupFunction) Compute(L *SafeLinkedList) (vs []*model.HistoryData, leftValue float64, isTriggered bool, isEnough bool) + type MaxFunction struct + Limit int + Operator string + RightValue float64 + func (this MaxFunction) Compute(L *SafeLinkedList) (vs []*model.HistoryData, leftValue float64, isTriggered bool, isEnough bool) + type MinFunction struct + Limit int + Operator string + RightValue float64 + func (this MinFunction) Compute(L *SafeLinkedList) (vs []*model.HistoryData, leftValue float64, isTriggered bool, isEnough bool) + type PDiffFunction struct + Limit int + Operator string + RightValue float64 + func (this PDiffFunction) Compute(L *SafeLinkedList) (vs []*model.HistoryData, leftValue float64, isTriggered bool, isEnough bool) + type SafeLinkedList struct + L *list.List + func (this *SafeLinkedList) Front() *list.Element + func (this *SafeLinkedList) HistoryData(limit int) ([]*model.HistoryData, bool) + func (this *SafeLinkedList) Len() int + func (this *SafeLinkedList) PushFront(v interface{}) *list.Element + func (this *SafeLinkedList) PushFrontAndMaintain(v *model.JudgeItem, maxCount int) bool + func (this *SafeLinkedList) ToSlice() []*model.JudgeItem + type SumFunction struct + Limit int + Operator string + RightValue float64 + func (this SumFunction) Compute(L *SafeLinkedList) (vs []*model.HistoryData, leftValue float64, isTriggered bool, isEnough bool)