ttl

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2024 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 Option

type Option func(*Options)

func CleanupInterval

func CleanupInterval(cleanupInterval time.Duration) Option

type Options

type Options struct {
	CleanupInterval time.Duration
}

type TtlCache

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

func NewTtlCache

func NewTtlCache(opts ...Option) *TtlCache

func (*TtlCache) Clear

func (tc *TtlCache) Clear()

func (*TtlCache) Delete

func (tc *TtlCache) Delete(key string)

func (*TtlCache) Get

func (tc *TtlCache) Get(key string) (interface{}, bool)

func (*TtlCache) Set

func (tc *TtlCache) Set(key string, value interface{}, ttl time.Duration)

Jump to

Keyboard shortcuts

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