storage

package
v0.5.5 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrTransactionNotExist = fmt.Errorf("no transaction found")
	ErrInvalidWorkloadType = fmt.Errorf("invalid workload type")
)

Functions

This section is empty.

Types

type BoltStorage

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

func New

func New(path string) (*BoltStorage, error)

func (*BoltStorage) Add

func (b *BoltStorage) Add(twin uint32, deployment uint64, workload gridtypes.Workload) error

func (*BoltStorage) ByTwin

func (b *BoltStorage) ByTwin(twin uint32) ([]uint64, error)

func (*BoltStorage) Capacity

func (b *BoltStorage) Capacity() (cap gridtypes.Capacity, err error)

func (*BoltStorage) Changes

func (b *BoltStorage) Changes(twin uint32, deployment uint64) (changes []gridtypes.Workload, err error)

func (*BoltStorage) Close

func (b *BoltStorage) Close() error

func (*BoltStorage) Create

func (b *BoltStorage) Create(deployment gridtypes.Deployment) error

func (*BoltStorage) Current

func (b *BoltStorage) Current(twin uint32, deployment uint64, name gridtypes.Name) (gridtypes.Workload, error)

func (*BoltStorage) Delete

func (b *BoltStorage) Delete(twin uint32, deployment uint64) error

func (*BoltStorage) Error

func (b *BoltStorage) Error(twinID uint32, dl uint64, e error) error

func (*BoltStorage) Get

func (b *BoltStorage) Get(twin uint32, deployment uint64) (dl gridtypes.Deployment, err error)

func (BoltStorage) Migration

func (b BoltStorage) Migration() MigrationStorage

func (*BoltStorage) Remove

func (b *BoltStorage) Remove(twin uint32, deployment uint64, name gridtypes.Name) error

func (*BoltStorage) Transaction

func (b *BoltStorage) Transaction(twin uint32, deployment uint64, workload gridtypes.Workload) error

func (*BoltStorage) Twins

func (b *BoltStorage) Twins() ([]uint32, error)

func (*BoltStorage) Update

func (b *BoltStorage) Update(twin uint32, deployment uint64, field ...provision.Field) error

type MigrationStorage

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

func (*MigrationStorage) Migrate

func (b *MigrationStorage) Migrate(dl gridtypes.Deployment) error

Migrate deployment creates an exact copy of dl in this storage. usually used to copy deployment from older storage

Jump to

Keyboard shortcuts

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