trackstore

package
v1.2.6 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2020 License: MIT Imports: 8 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) GetRenewables

func (s *Store) GetRenewables() ([]TrackedCid, error)

GetRenewables returns all the tracked renewable storage configs.

func (*Store) GetRepairables

func (s *Store) GetRepairables() ([]TrackedCid, error)

GetRepairables returns all the tracked repairable storage configs.

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(iid ffs.APIID, c cid.Cid) error

Remove removes tracking the storage config from iid.

type TrackedCid added in v1.2.2

type TrackedCid struct {
	Cid     cid.Cid
	Tracked []TrackedStorageConfig
}

TrackedCid contains tracked storage configs for a Cid.

type TrackedStorageConfig added in v1.2.2

type TrackedStorageConfig struct {
	IID           ffs.APIID
	StorageConfig ffs.StorageConfig
}

TrackedStorageConfig has information about a StorageConfig from an APIID which is repairable/renewable.

Jump to

Keyboard shortcuts

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