cache

package
v0.4.3 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2024 License: MulanPSL-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NegativeTimeoutPrefix  = "t:"
	PositiveDurationPrefix = "d:"
)

Variables

This section is empty.

Functions

func DefaultNewSchedule

func DefaultNewSchedule(sec int) schedule.Interface

Types

type Cache

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

func (*Cache) Init

func (c *Cache) Init(cron *cron.Cron, handle NewScheduleFunc)

type NewScheduleFunc

type NewScheduleFunc func(int) schedule.Interface

type PullHandle

type PullHandle func() (interface{}, error)

type RefreshCache

type RefreshCache struct {
	Cache
}

func (*RefreshCache) Add

func (c *RefreshCache) Add(name string, sec int, get PullHandle)

func (*RefreshCache) Get

func (c *RefreshCache) Get(name string) (interface{}, error)

type TimeoutCache

type TimeoutCache struct {
	Cache
}

func (*TimeoutCache) Add

func (c *TimeoutCache) Add(name string, sec int, get PullHandle)

func (*TimeoutCache) Get

func (c *TimeoutCache) Get(name string) (interface{}, error)

Jump to

Keyboard shortcuts

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