snapmeta

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2020 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package snapmeta describes entities that can accept arbitrary metadata and flush it to a persistent repository.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Persister

type Persister interface {
	Store
	snap.RepoManager
	LoadMetadata() error
	FlushMetadata() error
	Cleanup()
}

Persister describes the ability to flush metadata to, and load it again, from a repository.

func New

func New(baseDir string) (Persister, error)

New instantiates a new Persister and returns it.

type Simple

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

Simple is a snapstore implementation that stores snapshot metadata as a byte slice in a map in memory. A Simple should not be copied.

func NewSimple

func NewSimple() *Simple

NewSimple instantiates a new Simple snapstore and returns its pointer.

func (*Simple) Delete

func (s *Simple) Delete(key string)

Delete implements the Storer interface Delete method.

func (*Simple) GetKeys

func (s *Simple) GetKeys() []string

GetKeys implements the Storer interface GetKeys method.

func (*Simple) Load

func (s *Simple) Load(key string) ([]byte, error)

Load implements the Storer interface Load method.

func (*Simple) Store

func (s *Simple) Store(key string, val []byte) error

Store implements the Storer interface Store method.

type Store

type Store interface {
	Store(key string, val []byte) error
	Load(key string) ([]byte, error)
	Delete(key string)
	GetKeys() []string
}

Store describes the ability to store and retrieve a buffer of metadata, indexed by a string key.

Jump to

Keyboard shortcuts

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