storage

package
v0.1.27 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2022 License: Apache-2.0 Imports: 13 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var FILE_ENDINGS = []string{".yaml", ".yml", ".json"} // Order of endings matters!

Functions

This section is empty.

Types

type Backend

type Backend interface {
	List() ([]uuid.UUID, error)
	Load(opId uuid.UUID) (*core.Blueprint, error)
	Has(opId uuid.UUID) bool
}

type FileSystem

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

func NewReadOnlyFileSystem

func NewReadOnlyFileSystem(root string) *FileSystem

func (*FileSystem) Has

func (fs *FileSystem) Has(opId uuid.UUID) bool

func (*FileSystem) List

func (fs *FileSystem) List() ([]uuid.UUID, error)

func (*FileSystem) Load

func (fs *FileSystem) Load(opId uuid.UUID) (*core.Blueprint, error)

type Storage

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

func NewStorage

func NewStorage() *Storage

func (*Storage) AddBackend

func (s *Storage) AddBackend(backend Backend) *Storage

func (*Storage) IsSavedInWritableBackend

func (s *Storage) IsSavedInWritableBackend(opId uuid.UUID) bool

func (*Storage) List

func (s *Storage) List() ([]uuid.UUID, error)

func (*Storage) Load

func (s *Storage) Load(opId uuid.UUID) (*core.Blueprint, error)

func (*Storage) Save

func (s *Storage) Save(blueprint core.Blueprint) (uuid.UUID, error)

type WritableFileSystem

type WritableFileSystem struct {
	FileSystem
}

func NewWritableFileSystem

func NewWritableFileSystem(root string) *WritableFileSystem

func (*WritableFileSystem) Save

func (fs *WritableFileSystem) Save(blueprint core.Blueprint) (uuid.UUID, error)

type WriteableBackend

type WriteableBackend interface {
	Backend
	Save(blueprint core.Blueprint) (uuid.UUID, error)
}

Jump to

Keyboard shortcuts

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