trackstore

package
v0.6.7 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Store

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

Store persist information about storage configs which should be repaired or renewed. It always contain the latest Storage Config value of a Cid to execute those actions. This store is used by the Scheduler background jobs that repair or renew storage configurations.

func New

func New(ds datastore.Datastore) (*Store, error)

New retruns a new Store.

func (*Store) Get

func (s *Store) Get(c cid.Cid) (ffs.StorageConfig, ffs.APIID, error)

Get returns the storage config of a repairable/renewable stored Cid.

func (*Store) GetRenewables

func (s *Store) GetRenewables() ([]cid.Cid, error)

GetRenewables returns the list of Cids which have a renewable Storage Config.

func (*Store) GetRepairables

func (s *Store) GetRepairables() ([]cid.Cid, error)

GetRepairables returns the list of Cids which have a repairable Storage Config.

func (*Store) Put

func (s *Store) Put(iid ffs.APIID, c cid.Cid, sc ffs.StorageConfig) error

Put updates the StorageConfig tracking state for a Cid. If the StorageConfig is repairable or renewable, it will be added (or updated if exist) for a Cid. If it isn't repairable or renewable, it will ensure it's removed from the store if exists. This last point happens when a StorageConfig which was repairable/renewable get that feature disabled.

func (*Store) Remove

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

Remove removes a Cid from the store, usually meaning the Cid storage config shouldn't be tracked for repair or renewal anymore.

Jump to

Keyboard shortcuts

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