Documentation ¶
Index ¶
- Variables
- type QueryIndexFilters
- type QueryIndexSort
- type QueryIndexSortField
- type Store
- func (s *Store) GenerateMinerIndexSnapshot(ctx context.Context) error
- func (s *Store) GetAllMiners(ctx context.Context) ([]model.MinerInfo, error)
- func (s *Store) GetLastIndexSnapshotTime(ctx context.Context) (time.Time, error)
- func (s *Store) GetLastRetrievalRecordUpdatedAt(ctx context.Context, powName string) (time.Time, error)
- func (s *Store) GetLastStorageDealRecordUpdatedAt(ctx context.Context, powName string) (time.Time, error)
- func (s *Store) GetMinerInfo(ctx context.Context, miner string) (model.MinerInfo, error)
- func (s *Store) GetPowergateTargets(ctx context.Context) ([]model.PowTarget, error)
- func (s *Store) PersistRetrievalRecords(ctx context.Context, powName, region string, prrs []model.PowRetrievalRecord) error
- func (s *Store) PersistStorageDealRecords(ctx context.Context, powName, region string, psrs []model.PowStorageDealRecord) error
- func (s *Store) PutFilecoinInfo(ctx context.Context, miner string, info model.FilecoinInfo) error
- func (s *Store) PutMetadataLocation(ctx context.Context, miner string, location string) error
- func (s *Store) QueryIndex(ctx context.Context, filters QueryIndexFilters, sort QueryIndexSort, limit int, ...) ([]model.MinerInfo, error)
- func (s *Store) UpdateTextileDealsInfo(ctx context.Context) error
- func (s *Store) UpdateTextileRetrievalsInfo(ctx context.Context) error
Constants ¶
This section is empty.
Variables ¶
var (
ErrMinerNotExists = errors.New("miner doesn't exists")
)
Functions ¶
This section is empty.
Types ¶
type QueryIndexFilters ¶
type QueryIndexFilters struct {
MinerLocation string
}
type QueryIndexSort ¶
type QueryIndexSort struct { Ascending bool TextileRegion string Field QueryIndexSortField }
type QueryIndexSortField ¶
type QueryIndexSortField int
const ( SortFieldTextileDealTotalSuccessful QueryIndexSortField = iota SortFieldTextileDealLastSuccessful SortFieldTextileRetrievalTotalSuccessful SortFieldTextileRetrievalLastSuccessful SortFieldAskPrice SortFieldVerifiedAskPrice SortFieldActiveSectors )
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
func (*Store) GenerateMinerIndexSnapshot ¶
func (*Store) GetAllMiners ¶
func (*Store) GetLastIndexSnapshotTime ¶
func (*Store) GetLastRetrievalRecordUpdatedAt ¶
func (s *Store) GetLastRetrievalRecordUpdatedAt(ctx context.Context, powName string) (time.Time, error)
GetLastRetrievalRecordUpdatedAt returns the latests updated-at timestamp of a particular external Powergate. This might serve to ask the external powergate, for newer records since this timestamp.
func (*Store) GetLastStorageDealRecordUpdatedAt ¶
func (s *Store) GetLastStorageDealRecordUpdatedAt(ctx context.Context, powName string) (time.Time, error)
GetLastStorageDealRecordUpdatedAt returns the latests updated-at timestamp of a particular external Powergate. This might serve to ask the external powergate, for newer records since this timestamp.
func (*Store) GetMinerInfo ¶
func (*Store) GetPowergateTargets ¶
GetPowergateTargets returns the external Powergates that will be polled to import storage-deal and retrieval records.
func (*Store) PersistRetrievalRecords ¶
func (s *Store) PersistRetrievalRecords(ctx context.Context, powName, region string, prrs []model.PowRetrievalRecord) error
PersistRetrievalRecords merge a set of retrieval records for an external powergate. The action has upsert semantics, so if the record already exists, it's updated.
func (*Store) PersistStorageDealRecords ¶
func (s *Store) PersistStorageDealRecords(ctx context.Context, powName, region string, psrs []model.PowStorageDealRecord) error
PersistStorageDealRecords merge a set of storage-deal records for an external powergate. The action has upsert semantics, so if the record already exists, it's updated.
func (*Store) PutFilecoinInfo ¶
func (*Store) PutMetadataLocation ¶
func (*Store) QueryIndex ¶
func (s *Store) QueryIndex(ctx context.Context, filters QueryIndexFilters, sort QueryIndexSort, limit int, offset int64) ([]model.MinerInfo, error)