powergate: github.com/textileio/powergate/ffs/scheduler/internal/astore Index | Files

package astore

import "github.com/textileio/powergate/ffs/scheduler/internal/astore"


Package Files



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

type RetrievalAction Uses

type RetrievalAction struct {
    APIID         ffs.APIID
    RetrievalID   ffs.RetrievalID
    PayloadCid    cid.Cid
    PieceCid      cid.Cid
    Selector      string
    Miners        []string
    WalletAddress string
    MaxPrice      uint64

RetrievalAction contains information necessary to execute a RetrievalJob.

type StorageAction Uses

type StorageAction struct {
    APIID       ffs.APIID
    Cid         cid.Cid
    Cfg         ffs.StorageConfig
    ReplacedCid cid.Cid

StorageAction contains information necessary to execute a StorageJob.

type Store Uses

type Store struct {
    // contains filtered or unexported fields

Store persists Actions.

func New Uses

func New(ds datastore.Datastore) *Store

New returns a new ActionStore backed by the Datastore.

func (*Store) GetRetrievalAction Uses

func (s *Store) GetRetrievalAction(jid ffs.JobID) (RetrievalAction, error)

GetRetrievalAction returns a the RetrievalAction corresponding to the RetrievalJob id.

func (*Store) GetStorageAction Uses

func (s *Store) GetStorageAction(jid ffs.JobID) (StorageAction, error)

GetStorageAction gets an action for a JobID. If doesn't exist, returns ErrNotFound.

func (*Store) PutRetrievalAction Uses

func (s *Store) PutRetrievalAction(jid ffs.JobID, a RetrievalAction) error

PutRetrievalAction saves the RetrievalAction corresponding to a RetrievalJob.

func (*Store) PutStorageAction Uses

func (s *Store) PutStorageAction(jid ffs.JobID, a StorageAction) error

PutStorageAction saves a new Action for a Job.

Package astore imports 6 packages (graph) and is imported by 3 packages. Updated 2020-09-27. Refresh now. Tools for package owners.