cache

package
v0.0.0-...-4bf943b Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cacher

type Cacher interface {
	// Get must return a pointer to the item, a boolean representing whether
	// item is present or not, and an error (must be nil when key is not
	// present).
	Get(ctx context.Context, key string) (*Item, bool, error)
	// Set sets the item into cache with the given TTL.
	Set(ctx context.Context, key string, item *Item, ttl time.Duration) error
}

Cacher represents a backend cache that can be used by sqlcache package.

type Item

type Item struct {
	Cols []string
	Rows [][]driver.Value
}

Item represents a single item in cache and will contain the results of a single SQL query.

Jump to

Keyboard shortcuts

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