storage

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2025 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Fs

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

Fs is a in reservation cache using the filesystem as backend

func NewFSStore

func NewFSStore(root string) (*Fs, error)

NewFSStore creates a in memory reservation store

func (*Fs) Add

func (s *Fs) Add(d gridtypes.Deployment) error

Add workload to database

func (*Fs) ByTwin

func (s *Fs) ByTwin(twin uint32) ([]uint64, error)

ByTwin return list of deployment for given twin id

func (*Fs) Capacity

func (s *Fs) Capacity() (cap gridtypes.Capacity, err error)

Capacity returns the total capacity of all deployments that are in OK state.

func (*Fs) Close

func (s *Fs) Close() error

Close makes sure the backend of the store is closed properly

func (*Fs) Delete

func (s *Fs) Delete(d gridtypes.Deployment) error

Delete is only used for the migration

func (*Fs) Get

func (s *Fs) Get(twin uint32, deployment uint64) (gridtypes.Deployment, error)

Get gets a workload by id

func (*Fs) GetShared

func (s *Fs) GetShared(twinID uint32, name gridtypes.Name) (gridtypes.WorkloadID, error)

Shared, returns a workload id that reference the workload with that name. The workload type must be of a `Shared` type. A Shared workload type means that the workload (of that type) can be accessed by other deployments for the same twin. A shared workload should be only updatable only via the deployment that creates it

func (*Fs) Set

func (s *Fs) Set(dl gridtypes.Deployment) error

Set updates value of a workload, the reservation must exists otherwise an error is returned

func (*Fs) SharedByTwin

func (s *Fs) SharedByTwin(twinID uint32) ([]gridtypes.WorkloadID, error)

func (*Fs) Twins

func (s *Fs) Twins() ([]uint32, error)

Twins lists available users

Jump to

Keyboard shortcuts

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