cof

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2023 License: MIT Imports: 3 Imported by: 0

README

cof

Key-value cache

Documentation

Index

Constants

View Source
const (
	OFF = 0
)

Variables

This section is empty.

Functions

func CleanInterval

func CleanInterval(ci time.Duration) option

func TTL

func TTL(ttl time.Duration) option

Types

type C

type C[T any] struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func Init

func Init[T any](opts ...option) (*C[T], error)

func (*C[T]) Get

func (c *C[T]) Get(k string) (T, bool)

func (*C[T]) Pop

func (c *C[T]) Pop(k string) (T, bool)

func (*C[T]) Put

func (c *C[T]) Put(k string, v T)

func (*C[T]) Stop

func (c *C[T]) Stop()

Jump to

Keyboard shortcuts

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