expires

package
v1.3.8 Latest Latest
Warning

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

Go to latest
Published: May 1, 2024 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var SharedManager = NewManager()

Functions

This section is empty.

Types

type IdKeyMap

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

func NewIdKeyMap

func NewIdKeyMap() *IdKeyMap

func (*IdKeyMap) Add

func (this *IdKeyMap) Add(id int64, key string)

func (*IdKeyMap) DeleteId

func (this *IdKeyMap) DeleteId(id int64)

func (*IdKeyMap) DeleteKey

func (this *IdKeyMap) DeleteKey(key string)

func (*IdKeyMap) Id

func (this *IdKeyMap) Id(key string) (id int64, ok bool)

func (*IdKeyMap) Key

func (this *IdKeyMap) Key(id int64) (key string, ok bool)

func (*IdKeyMap) Len

func (this *IdKeyMap) Len() int

type ItemMap

type ItemMap = map[uint64]zero.Zero

type List

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

func NewList

func NewList() *List

func NewSingletonList

func NewSingletonList() *List

func (*List) Add

func (this *List) Add(itemId uint64, expiresAt int64)

Add 添加条目 如果条目已经存在,则覆盖

func (*List) Clean

func (this *List) Clean()

func (*List) Count

func (this *List) Count() int

func (*List) ExpiresAt

func (this *List) ExpiresAt(itemId uint64) int64

func (*List) GC

func (this *List) GC(timestamp int64) ItemMap

func (*List) OnGC

func (this *List) OnGC(callback func(itemId uint64)) *List

func (*List) OnGCBatch

func (this *List) OnGCBatch(callback func(itemMap ItemMap)) *List

func (*List) Remove

func (this *List) Remove(itemId uint64)

type Manager

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

func NewManager

func NewManager() *Manager

func (*Manager) Add

func (this *Manager) Add(list *List)

func (*Manager) Remove

func (this *Manager) Remove(list *List)

Jump to

Keyboard shortcuts

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