cache

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: May 2, 2024 License: MPL-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package cache implements an in-memory cache over schematic storage.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Storage

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

Storage is a schematic storage in-memory cache.

func NewCache

func NewCache(underlying storage.Storage) *Storage

NewCache returns a new cache storage.

func (*Storage) Collect

func (s *Storage) Collect(ch chan<- prometheus.Metric)

Collect implements prom.Collector interface.

func (*Storage) Describe

func (s *Storage) Describe(ch chan<- *prometheus.Desc)

Describe implements prom.Collector interface.

func (*Storage) Get

func (s *Storage) Get(ctx context.Context, id string) ([]byte, error)

Get returns the schematic.

func (*Storage) Head

func (s *Storage) Head(ctx context.Context, id string) error

Head checks if the schematic exists.

func (*Storage) Put

func (s *Storage) Put(ctx context.Context, id string, data []byte) error

Put stores the schematic.

Jump to

Keyboard shortcuts

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