judge

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2020 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var HistoryBigMap = make(map[string]*SafeItemMap)

Functions

func InitHistoryBigMap

func InitHistoryBigMap()

func Judge

func Judge(L *SafeLinkedList, item *dataobj.ItemStatus, now int64)

Types

type HistoryData

type HistoryData struct {
	Timestamp int64 `json:"timestamp"`
	Value     int64 `json:"value"`
}

type SafeItemMap

type SafeItemMap struct {
	sync.RWMutex
	M map[string]*SafeLinkedList
}

func NewSafeItemMap

func NewSafeItemMap() *SafeItemMap

func (*SafeItemMap) BatchDelete

func (this *SafeItemMap) BatchDelete(keys []string)

func (*SafeItemMap) CleanStale

func (this *SafeItemMap) CleanStale(before int64)

func (*SafeItemMap) Delete

func (this *SafeItemMap) Delete(key string)

func (*SafeItemMap) Get

func (this *SafeItemMap) Get(key string) (*SafeLinkedList, bool)

func (*SafeItemMap) Len

func (this *SafeItemMap) Len() int

func (*SafeItemMap) PushFrontAndMaintain

func (this *SafeItemMap) PushFrontAndMaintain(key string, val *dataobj.ItemStatus, maxCount int, now int64)

func (*SafeItemMap) Set

func (this *SafeItemMap) Set(key string, val *SafeLinkedList)

type SafeLinkedList

type SafeLinkedList struct {
	sync.RWMutex
	L *list.List
}

func (*SafeLinkedList) Front

func (this *SafeLinkedList) Front() *list.Element

func (*SafeLinkedList) HistoryData

func (this *SafeLinkedList) HistoryData(limit int) ([]*HistoryData, bool)

func (*SafeLinkedList) Len

func (this *SafeLinkedList) Len() int

func (*SafeLinkedList) PushFrontAndMaintain

func (this *SafeLinkedList) PushFrontAndMaintain(v *dataobj.ItemStatus, maxCount int) bool

Jump to

Keyboard shortcuts

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