cache

package
v1.15.0 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2024 License: BSD-3-Clause Imports: 12 Imported by: 0

Documentation

Overview

Package cache contains facilities for caching immutable files, typically for a cloud object store.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cacheable

type Cacheable func(*storage.URI) bool

type Kind

type Kind string
const (
	KindNone  Kind = "none"
	KindLocal Kind = "local"
	KindRedis Kind = "redis"
)

func (*Kind) Set

func (k *Kind) Set(s string) error

func (Kind) String

func (k Kind) String() string

type LocalCache

type LocalCache struct {
	storage.Engine
	// contains filtered or unexported fields
}

func NewLocalCache

func NewLocalCache(engine storage.Engine, cacheable Cacheable, size int, registerer prometheus.Registerer) (*LocalCache, error)

func (*LocalCache) Get

func (c *LocalCache) Get(ctx context.Context, u *storage.URI) (storage.Reader, error)

type RedisCache

type RedisCache struct {
	storage.Engine
	// contains filtered or unexported fields
}

func NewRedisCache

func NewRedisCache(engine storage.Engine, client *redis.Client, cacheable Cacheable, expiration time.Duration, reg prometheus.Registerer) *RedisCache

func (*RedisCache) Get

func (c *RedisCache) Get(ctx context.Context, u *storage.URI) (storage.Reader, error)

Jump to

Keyboard shortcuts

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