storage

package
Version: v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package storage defines matchbox's storage and object types.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrGroupNotFound   = errors.New("storage: No Group found")
	ErrProfileNotFound = errors.New("storage: No Profile found")
)

Storage errors

Functions

This section is empty.

Types

type Config

type Config struct {
	Root   string
	Logger *logrus.Logger
}

Config initializes a fileStore.

type Dir

type Dir string

Dir implements access to a collection of named files, restricted to a specific directory tree. It is very similar to net/http.Dir, but provides write access and some io/ioutil utilities. An empty directory is treated as ".".

type Store

type Store interface {
	// GroupPut creates or updates a Group.
	GroupPut(group *storagepb.Group) error
	// GroupGet returns a machine Group by id.
	GroupGet(id string) (*storagepb.Group, error)
	// GroupDelete deletes a machine Group by id.
	GroupDelete(id string) error
	// GroupList lists all machine Groups.
	GroupList() ([]*storagepb.Group, error)

	// ProfilePut creates or updates a Profile.
	ProfilePut(profile *storagepb.Profile) error
	// ProfileGet gets a profile by id.
	ProfileGet(id string) (*storagepb.Profile, error)
	// ProfileDelete deletes a profile by id.
	ProfileDelete(id string) error
	// ProfileList lists all profiles.
	ProfileList() ([]*storagepb.Profile, error)

	// IgnitionPut creates or updates an Ignition template.
	IgnitionPut(name string, config []byte) error
	// IgnitionGet gets an Ignition template by name.
	IgnitionGet(name string) (string, error)
	// IgnitionDelete deletes an Ignition template by name.
	IgnitionDelete(name string) error

	// GenericPut creates or updates a Generic template.
	GenericPut(name string, config []byte) error
	// GenericGet gets a Generic template by name.
	GenericGet(name string) (string, error)
	// GenericDelete deletes a Generic template by name.
	GenericDelete(name string) error

	// CloudGet gets a Cloud-Config template by name.
	CloudGet(name string) (string, error)
}

A Store stores machine Groups, Profiles, and Configs.

func NewFileStore

func NewFileStore(config *Config) Store

NewFileStore returns a new memory-backed Store.

Directories

Path Synopsis
Package storagepb provides storage protobuf client and server interfaces.
Package storagepb provides storage protobuf client and server interfaces.
Package testfakes provides shared storage implementations for testing.
Package testfakes provides shared storage implementations for testing.

Jump to

Keyboard shortcuts

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