cache

package
v0.0.0-...-2753770 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2024 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

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

func New

func New() *Cache

func (*Cache) Delete

func (c *Cache) Delete(key []byte) error

func (*Cache) Get

func (c *Cache) Get(key []byte) ([]byte, error)

func (*Cache) Has

func (c *Cache) Has(key []byte) bool

func (*Cache) Set

func (c *Cache) Set(key []byte, value []byte, ttl time.Duration) error

func (*Cache) SetTTL

func (c *Cache) SetTTL(key []byte, duration time.Duration)

type Cacher

type Cacher interface {
	Get([]byte) ([]byte, error)
	Set([]byte, []byte, time.Duration) error
	Has([]byte) bool
	Delete([]byte) error
}

Jump to

Keyboard shortcuts

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