storage

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2025 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(exclude ...provision.Exclude) (storageCap provision.StorageCapacity, err error)

func (*BoltStorage) Changes

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

func (*BoltStorage) CleanDeleted

func (b *BoltStorage) CleanDeleted() error

CleanDeleted is a cleaner method intended to clean up old "deleted" contracts that has no active workloads anymore. We used to always leave the entire history of all deployments that ever lived on the system. But we changed that so once a deployment is deleted, it's deleted forever. Hence this code is only needed temporary until it's available on all environments then can be dropped.

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