cache

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterCache

func RegisterCache(reg CacheRegistration)

func RegisteredCacheNames

func RegisteredCacheNames() []string

Types

type Cache

type Cache interface {
	Lookup(ctx context.Context, t pkg.TileRequest) (*pkg.Image, error)
	Save(ctx context.Context, t pkg.TileRequest, img *pkg.Image) error
}

func ConstructCache

func ConstructCache(rawConfig map[string]interface{}, errorMessages config.ErrorMessages) (Cache, error)

type CacheRegistration

type CacheRegistration interface {
	Name() string
	Initialize(config any, errorMessages config.ErrorMessages) (Cache, error)
	InitializeConfig() any
}

func RegisteredCache

func RegisteredCache(name string) (CacheRegistration, bool)

type CacheWrapper added in v0.6.0

type CacheWrapper struct {
	Name  string
	Cache Cache
}

A struct that wraps all other caches in order to add in instrumentation, specifically child spans for tracing the requests to caches. This is used even when telemetry is disabled but OTEL handles no-op'ing in that case so performance impact is minimal

func (CacheWrapper) Lookup added in v0.6.0

func (w CacheWrapper) Lookup(ctx context.Context, t pkg.TileRequest) (*pkg.Image, error)

func (CacheWrapper) Save added in v0.6.0

func (w CacheWrapper) Save(ctx context.Context, t pkg.TileRequest, img *pkg.Image) error

Jump to

Keyboard shortcuts

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