cache

package
v0.28.2 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2024 License: AGPL-3.0 Imports: 13 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DB

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

func New

func New(ctx context.Context, cacheConf config.Cache) (DB, error)

func (DB) Close

func (db DB) Close()

func (DB) GetCurrencies added in v0.26.0

func (db DB) GetCurrencies(base currency.Currency, engs []engines.Name) (currency.Currencies, error)

func (DB) GetCurrenciesTTL added in v0.26.0

func (db DB) GetCurrenciesTTL(base currency.Currency, engs []engines.Name) (time.Duration, error)

func (DB) GetResults

func (db DB) GetResults(q string, cat category.Name, opts options.Options) ([]result.Result, error)

func (DB) GetResultsTTL

func (db DB) GetResultsTTL(q string, cat category.Name, opts options.Options) (time.Duration, error)

func (DB) SetCurrencies added in v0.26.0

func (db DB) SetCurrencies(base currency.Currency, engs []engines.Name, currencies currency.Currencies, ttl ...time.Duration) error

func (DB) SetResults

func (db DB) SetResults(q string, cat category.Name, opts options.Options, results []result.Result, ttl ...time.Duration) error

type Driver

type Driver interface {
	Close()
	Set(k string, v any, ttl ...time.Duration) error
	Get(k string, o any) error
	GetTTL(k string) (time.Duration, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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