plcache

package
v1.1.13 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package plcache implements cache in pipeline

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrClosed = errors.New("cache is closed")
	ErrArg    = errors.New("illegal arguments")
)

Functions

This section is empty.

Types

type Cache

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

func NewCache

func NewCache(interval time.Duration, numSlots int) (*Cache, error)

NewCache returns a Cache

func NewCacheWithTicker

func NewCacheWithTicker(interval time.Duration, numSlots int, ticker *time.Ticker) (*Cache, error)

NewCacheWithTicker returns a Cache with the given ticker.

func (*Cache) Get

func (c *Cache) Get(key string) (any, bool, error)

func (*Cache) Set

func (c *Cache) Set(key string, value any, expiration time.Duration) error

func (*Cache) Stop

func (c *Cache) Stop()

Jump to

Keyboard shortcuts

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