storage

package
v1.1.5 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2026 License: Apache-2.0 Imports: 12 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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