store

package
v0.0.0-...-365eaa3 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// mem:  front = = = back
	// time: latest ...  old
	HistoryCache = tmap.NewSafeMap()
)

Functions

func AddItem

func AddItem(key string, val *cmodel.GraphItem)

func GetAllItems

func GetAllItems(key string) []*cmodel.GraphItem

func GetLastItem

func GetLastItem(key string) *cmodel.GraphItem

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

func (*GraphItemMap) First

func (this *GraphItemMap) First(key string) *cmodel.GraphItem

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) PopAll

func (this *GraphItemMap) PopAll(key string) []*cmodel.GraphItem

func (*GraphItemMap) PushFront

func (this *GraphItemMap) PushFront(key string, val *cmodel.GraphItem)

func (*GraphItemMap) Set

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

type SafeLinkedList

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

func NewSafeLinkedList

func NewSafeLinkedList() *SafeLinkedList

新创建SafeLinkedList容器

func (*SafeLinkedList) Back

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

func (*SafeLinkedList) FetchAll

func (this *SafeLinkedList) FetchAll() []*cmodel.GraphItem

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) PushFront

func (this *SafeLinkedList) PushFront(v interface{}) *list.Element

Jump to

Keyboard shortcuts

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