cache

package
v0.0.0-...-dab88e5 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2023 License: MIT Imports: 8 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 NewCache

func NewCache(path string) (*Cache, error)

func NewCacheWithLogger

func NewCacheWithLogger(log *slog.Logger, path string) (*Cache, error)

func (*Cache) Delete

func (c *Cache) Delete(key string) error

func (*Cache) Exec

func (c *Cache) Exec(ttl int64, args ...string) (string, error)

Exec executes the arguments as a command and caches the result on success for ttl time if ttl < 0, the result is cached forever

func (*Cache) Get

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

func (*Cache) Glob

func (c *Cache) Glob(pattern string) (map[string]string, error)

func (*Cache) Like

func (c *Cache) Like(pattern string) (map[string]string, error)

func (*Cache) Set

func (c *Cache) Set(key string, value string, ttl int64) error

Jump to

Keyboard shortcuts

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