timed

package
v0.0.0-...-9109040 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 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 TimedCache

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

func New

func New(delegate cache.Cache, defaultTTL int64) *TimedCache

func (*TimedCache) Clear

func (c *TimedCache) Clear()

func (*TimedCache) ContainsKey

func (c *TimedCache) ContainsKey(key interface{}) bool

func (*TimedCache) Get

func (c *TimedCache) Get(key interface{}) interface{}

func (*TimedCache) GetTimeValue

func (c *TimedCache) GetTimeValue(key interface{}) interface{}

func (*TimedCache) KeySet

func (c *TimedCache) KeySet() []interface{}

func (*TimedCache) Put

func (c *TimedCache) Put(key, value interface{})

func (*TimedCache) PutIfAbsent

func (c *TimedCache) PutIfAbsent(key, value interface{}) interface{}

func (*TimedCache) PutTTL

func (c *TimedCache) PutTTL(key, value interface{}, ttl int64)

func (*TimedCache) Remove

func (c *TimedCache) Remove(key interface{})

func (*TimedCache) Size

func (c *TimedCache) Size() int

type TimedValue

type TimedValue interface {
	Creation() time.Time
	Timeout() time.Duration
	Value() interface{}

	//
	// Check if the value has expired
	// now current time to be compared with the Creation()
	//
	IsValid(now time.Time) bool
}

func NewTimedValue

func NewTimedValue(value interface{}, creation time.Time, timeout time.Duration) TimedValue

Jump to

Keyboard shortcuts

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