storage

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2017 License: Apache-2.0 Imports: 8 Imported by: 1

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
}

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)
	// 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)
	// 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)

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

	// GenericGet gets a generic template by name.
	GenericGet(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