Documentation ¶
Index ¶
- Variables
- func AddItem(key string, val *cmodel.GraphItem)
- func GetAllItems(key string) []*cmodel.GraphItem
- func GetLastItem(key string) *cmodel.GraphItem
- type GraphItemMap
- func (this *GraphItemMap) Back(key string) *cmodel.GraphItem
- func (this *GraphItemMap) FetchAll(key string) ([]*cmodel.GraphItem, uint32)
- func (this *GraphItemMap) First(key string) *cmodel.GraphItem
- func (this *GraphItemMap) Get(key string) (*SafeLinkedList, bool)
- func (this *GraphItemMap) GetFlag(key string) (uint32, error)
- func (this *GraphItemMap) Getitems(idx int) map[string]*SafeLinkedList
- func (this *GraphItemMap) ItemCnt(key string) int
- func (this *GraphItemMap) KeysByIndex(idx int) []string
- func (this *GraphItemMap) Len() int
- func (this *GraphItemMap) PopAll(key string) []*cmodel.GraphItem
- func (this *GraphItemMap) PushAll(key string, items []*cmodel.GraphItem) error
- func (this *GraphItemMap) PushFront(key string, item *cmodel.GraphItem, md5 string, cfg *g.GlobalConfig)
- func (this *GraphItemMap) Remove(key string) bool
- func (this *GraphItemMap) Set(key string, val *SafeLinkedList)
- func (this *GraphItemMap) SetFlag(key string, flag uint32) error
- type SafeLinkedList
- func (this *SafeLinkedList) Back() *list.Element
- func (this *SafeLinkedList) FetchAll() ([]*cmodel.GraphItem, uint32)
- func (this *SafeLinkedList) Front() *list.Element
- func (this *SafeLinkedList) Len() int
- func (this *SafeLinkedList) PopAll() []*cmodel.GraphItem
- func (this *SafeLinkedList) PopBack() *list.Element
- func (this *SafeLinkedList) PushAll(items []*cmodel.GraphItem)
- func (this *SafeLinkedList) PushFront(v interface{}) *list.Element
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // mem: front = = = back // time: latest ... old HistoryCache = tmap.NewSafeMap() )
Functions ¶
func GetAllItems ¶
func GetLastItem ¶
Types ¶
type GraphItemMap ¶
type GraphItemMap struct { sync.RWMutex A []map[string]*SafeLinkedList Size int }
var GraphItems *GraphItemMap
func (*GraphItemMap) FetchAll ¶
func (this *GraphItemMap) FetchAll(key string) ([]*cmodel.GraphItem, uint32)
func (*GraphItemMap) Get ¶
func (this *GraphItemMap) Get(key string) (*SafeLinkedList, bool)
func (*GraphItemMap) Getitems ¶
func (this *GraphItemMap) Getitems(idx int) map[string]*SafeLinkedList
func (*GraphItemMap) KeysByIndex ¶
func (this *GraphItemMap) KeysByIndex(idx int) []string
func (*GraphItemMap) Len ¶
func (this *GraphItemMap) Len() int
func (*GraphItemMap) PushAll ¶
func (this *GraphItemMap) PushAll(key string, items []*cmodel.GraphItem) error
func (*GraphItemMap) PushFront ¶
func (this *GraphItemMap) PushFront(key string, item *cmodel.GraphItem, md5 string, cfg *g.GlobalConfig)
func (*GraphItemMap) Remove ¶
func (this *GraphItemMap) Remove(key string) bool
Remove method remove key from GraphItemMap, return true if exists
func (*GraphItemMap) Set ¶
func (this *GraphItemMap) Set(key string, val *SafeLinkedList)
type SafeLinkedList ¶
func (*SafeLinkedList) Back ¶
func (this *SafeLinkedList) Back() *list.Element
func (*SafeLinkedList) FetchAll ¶
func (this *SafeLinkedList) FetchAll() ([]*cmodel.GraphItem, uint32)
return为倒叙的?
func (*SafeLinkedList) Front ¶
func (this *SafeLinkedList) Front() *list.Element
func (*SafeLinkedList) Len ¶
func (this *SafeLinkedList) Len() int
func (*SafeLinkedList) PopAll ¶
func (this *SafeLinkedList) PopAll() []*cmodel.GraphItem
remain参数表示要给linkedlist中留几个元素 在cron中刷磁盘的时候要留一个,用于创建数据库索引 在程序退出的时候要一个不留的全部刷到磁盘
func (*SafeLinkedList) PopBack ¶
func (this *SafeLinkedList) PopBack() *list.Element
func (*SafeLinkedList) PushAll ¶
func (this *SafeLinkedList) PushAll(items []*cmodel.GraphItem)
restore PushAll
func (*SafeLinkedList) PushFront ¶
func (this *SafeLinkedList) PushFront(v interface{}) *list.Element
Click to show internal directories.
Click to hide internal directories.