metadata

package
v0.0.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoKeys   = xerrors.New("no keys provided")
	ErrNotValue = xerrors.New("not a value")
	ErrNotKey   = xerrors.New("not a key")
	ErrNotExist = xerrors.New("does not exist")
)

Functions

This section is empty.

Types

type Metadata

type Metadata interface {
	Read(keys ...string) (string, error)
	ReadAll() (map[string]interface{}, error)

	// Delete only returns an error if len(keys) == 0 or if the item exists and can't be deleted
	Delete(keys ...string) error
	DeleteAll() error

	// Write overrides values without returning an error unless one of keys already exists and is a value (ErrNotKey)
	Write(value string, keys ...string) error
	WriteAll(metadata map[string]interface{}) error
}

Metadata ignores values that begin with '.' for ReadAll and DeleteAll

func NewFS

func NewFS(path string) Metadata

func NewMemory

func NewMemory() Metadata

Jump to

Keyboard shortcuts

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