cache

package
v0.4.5-rc1 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2020 License: Apache-2.0 Imports: 14 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 {
	sync.RWMutex
	// 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(r *provision.Reservation) error

Add a reservation to the store

func (*Fs) Close

func (s *Fs) Close() error

Close makes sure the backend of the store is closed properly

func (*Fs) Exists

func (s *Fs) Exists(id string) (bool, error)

Exists checks if the reservation ID is in the store

func (*Fs) Get

func (s *Fs) Get(id string) (*provision.Reservation, error)

Get retrieves a specific reservation using its ID if returns a non nil error if the reservation is not present in the store

func (*Fs) GetExpired

func (s *Fs) GetExpired() ([]*provision.Reservation, error)

GetExpired returns all id the the reservations that are expired at the time of the function call

func (*Fs) NetworkExists added in v0.4.0

func (s *Fs) NetworkExists(id string) (bool, error)

NetworkExists exists checks if a network exists in cache already

func (*Fs) Remove

func (s *Fs) Remove(id string) error

Remove a reservation from the store

func (*Fs) Sync

func (s *Fs) Sync(statser provision.Statser) error

Sync update the statser with all the reservation present in the cache

Jump to

Keyboard shortcuts

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