astore

package
v0.3.1-pre.1 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2020 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	// ErrNotFound indicates the instance doesn't exist.
	ErrNotFound = errors.New("action not found")
)

Functions

This section is empty.

Types

type Action

type Action struct {
	APIID       ffs.APIID
	Cid         cid.Cid
	Cfg         ffs.StorageConfig
	ReplacedCid cid.Cid
}

Action represents an action to be executed by the Scheduler.

type Store

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

Store is a Datastore backed implementation of ActionStore, which saves latests PushStorageConfig actions for a Cid.

func New

func New(ds datastore.Datastore) *Store

New returns a new ActionStore backed by the Datastore.

func (*Store) Get

func (s *Store) Get(jid ffs.JobID) (Action, error)

Get gets the lastest pushed Action of a Cid.

func (*Store) GetRenewable

func (s *Store) GetRenewable() ([]Action, error)

GetRenewable returns all Actions that have StorageConfigs that have the Renew flag enabled and should be inspected for Deal renewals.

func (*Store) GetRepairable

func (s *Store) GetRepairable() ([]Action, error)

GetRepairable returns all Actions that have StorageConfigs with enabled auto-repair.

func (*Store) Put

func (s *Store) Put(ji ffs.JobID, a Action) error

Put saves a new Action for a Cid.

func (*Store) Remove

func (s *Store) Remove(c cid.Cid) error

Remove removes any Action associated with a Cid.

Jump to

Keyboard shortcuts

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