cache

package
v0.3.9 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Redis

type Redis struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

Redis is a in reservation cache using the filesystem as backend

func NewRedis

func NewRedis(pool *redis.Pool) *Redis

NewRedis creates a in memory reservation store

func (*Redis) Add

func (s *Redis) Add(r *provision.Reservation) error

Add a reservation to the store

func (*Redis) ClearByType

func (s *Redis) ClearByType(types []provision.ReservationType) error

ClearByType remove all the reservation of a certain type from the cache

func (*Redis) Close

func (s *Redis) Close() error

Close makes sure the backend of the store is closed properly

func (*Redis) Exists

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

Exists checks if the reservation ID is in the store

func (*Redis) Get

func (s *Redis) 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 (*Redis) GetExpired

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

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

func (*Redis) NetworkExists

func (s *Redis) NetworkExists(_ string) (bool, error)

NetworkExists is just there to satisfy the github.com/threefoldtech/zos/pkg/provision.ReservationCache interface

func (*Redis) Remove

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

Remove a reservation from the store

func (*Redis) Sync

func (s *Redis) 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