registry

package
v0.0.0-...-c0b5b33 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DB

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

DB is the handle into the registry database.

func NewDB

func NewDB(c DBConfig) (*DB, error)

NewDB creates a new *DB based on a DBConfig.

func (*DB) StorageImageCreate

func (db *DB) StorageImageCreate(s *spinregistry.Storage) (*spinregistry.Image, error)

StorageImageCreate creates an image within a volume.

func (*DB) StorageImageDelete

func (db *DB) StorageImageDelete(volume, image string) error

StorageImageDelete will delete an image from the volume.

func (*DB) StorageImageGet

func (db *DB) StorageImageGet(volume, image string) (*spinregistry.Image, error)

StorageImageGet will retrieve an image from the volume as a *spinregistry.Storage.

func (*DB) StorageImageList

func (db *DB) StorageImageList(volume string) ([]string, error)

StorageImageList will retrieve a list of images for a given volume name.

func (*DB) StorageVolumeCreate

func (db *DB) StorageVolumeCreate(name string, path string) error

StorageVolumeCreate creates a volume

func (*DB) StorageVolumeDelete

func (db *DB) StorageVolumeDelete(name string) error

StorageVolumeDelete creates a volume

func (*DB) StorageVolumeList

func (db *DB) StorageVolumeList() (map[string]string, error)

StorageVolumeList lists all volumes

func (*DB) VMCreate

func (db *DB) VMCreate(vm *spinregistry.UpdatedVM) (uint64, error)

VMCreate creates a vm and returns its id, which is auto-generated.

func (*DB) VMDelete

func (db *DB) VMDelete(id uint64) error

VMDelete removes the vm at the id specified.

func (*DB) VMGet

func (db *DB) VMGet(id uint64) (*spinregistry.UpdatedVM, error)

VMGet retrieves the vm at the id specified.

func (*DB) VMList

func (db *DB) VMList() ([]uint64, error)

VMList returns a list of all stored vm ids.

func (*DB) VMUpdate

func (db *DB) VMUpdate(id uint64, vm *spinregistry.UpdatedVM) error

VMUpdate replaces the id with the new vm definition.

type DBConfig

type DBConfig struct {
	Filename string
}

DBConfig is the configuration of the database.

Jump to

Keyboard shortcuts

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