item

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2023 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ArcItem added in v1.0.2

type ArcItem struct {
	Key        interface{}
	Value      interface{}
	Expiration *time.Time
}

func (*ArcItem) Expire added in v1.0.2

func (it *ArcItem) Expire() *time.Time

func (*ArcItem) IsExpired added in v1.0.2

func (it *ArcItem) IsExpired(now *time.Time) bool

returns boolean value whether this item is expired or not.

type ArcList added in v1.0.2

type ArcList struct {
	// contains filtered or unexported fields
}

func NewARCList added in v1.0.2

func NewARCList() *ArcList

func (*ArcList) Has added in v1.0.2

func (al *ArcList) Has(key interface{}) bool

has key func return bool

func (*ArcList) Len added in v1.0.2

func (al *ArcList) Len() int

list len

func (*ArcList) Lookup added in v1.0.2

func (al *ArcList) Lookup(key interface{}) *list.Element

Lookup func : search list.element for key

func (*ArcList) MoveToFront added in v1.0.2

func (al *ArcList) MoveToFront(elt *list.Element)

Move item to front

func (*ArcList) PushFront added in v1.0.2

func (al *ArcList) PushFront(key interface{})

push item to front

func (*ArcList) Remove added in v1.0.2

func (al *ArcList) Remove(key interface{}, elt *list.Element)

delete item

func (*ArcList) RemoveTail added in v1.0.2

func (al *ArcList) RemoveTail() interface{}

delete last

type FIFOItem added in v1.1.1

type FIFOItem struct {
	Key   interface{}
	Value interface{}
}

type LfuItem

type LfuItem struct {
	Key         interface{}
	Value       interface{}
	FreqElement *list.Element
	Expiration  *time.Time
}

func (*LfuItem) Expire

func (it *LfuItem) Expire() *time.Time

func (*LfuItem) IsExpired

func (it *LfuItem) IsExpired(now *time.Time) bool

returns boolean value whether this item is expired or not.

type LruItem

type LruItem struct {
	Key        interface{}
	Value      interface{}
	Expiration *time.Time
}

func (*LruItem) Expire

func (it *LruItem) Expire() *time.Time

func (*LruItem) IsExpired

func (it *LruItem) IsExpired(now *time.Time) bool

returns boolean value whether this item is expired or not.

type SimpleItem added in v1.0.2

type SimpleItem struct {
	Value      interface{}
	Expiration *time.Time
}

func (*SimpleItem) Expire added in v1.0.2

func (it *SimpleItem) Expire() *time.Time

func (*SimpleItem) IsExpired added in v1.0.2

func (si *SimpleItem) IsExpired(now *time.Time) bool

returns boolean value whether this item is expired or not.

Jump to

Keyboard shortcuts

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