Documentation
¶
Index ¶
- type Option
- func WithDatasetName(n string) Option
- func WithDealDuration(v abi.ChainEpoch) Option
- func WithDealStartDelay(v abi.ChainEpoch) Option
- func WithIPNIAnnounce(v bool) Option
- func WithKeepUnsealed(v bool) Option
- func WithMaxCarSize(s string) Option
- func WithMaxPendingDealNumber(v int) Option
- func WithMaxPendingDealSize(v string) Option
- func WithPackThreshold(s int64) Option
- func WithPricePerDeal(v abi.TokenAmount) Option
- func WithPricePerGiB(v abi.TokenAmount) Option
- func WithPricePerGiBEpoch(v abi.TokenAmount) Option
- func WithReplicationFactor(r uint) Option
- func WithScheduleCron(c string) Option
- func WithScheduleCronPerpetual(v bool) Option
- func WithScheduleDealNumber(n int) Option
- func WithScheduleDealSize(v string) Option
- func WithScheduleUrlTemplate(t string) Option
- func WithSingularityClient(c client.Client) Option
- func WithStorageProviders(sp ...address.Address) Option
- func WithStoreDir(s string) Option
- func WithTotalDealNumber(v int) Option
- func WithTotalDealSize(v string) Option
- func WithVerifiedDeal(v bool) Option
- func WithWalletKey(wk string) Option
- type SingularityStore
- func (s *SingularityStore) Describe(ctx context.Context, id blob.ID) (*blob.Descriptor, error)
- func (s *SingularityStore) Get(ctx context.Context, id blob.ID) (io.ReadSeekCloser, error)
- func (s *SingularityStore) Put(ctx context.Context, reader io.ReadCloser) (*blob.Descriptor, error)
- func (l *SingularityStore) Shutdown(ctx context.Context) error
- func (l *SingularityStore) Start(ctx context.Context) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Option ¶
type Option func(*options) error
Option represents a configurable parameter in Motion service.
func WithDatasetName ¶
WithDatasetName sets the singularity dataset name used to store data. Defaults to "MOTION_DATASET".
func WithDealDuration ¶
func WithDealDuration(v abi.ChainEpoch) Option
WithDealDuration sets duration of Filecoin deals made. Defaults to one year if unspecified.
func WithDealStartDelay ¶
func WithDealStartDelay(v abi.ChainEpoch) Option
WithDealStartDelay sets the delay for deal start epoch. Defaults to 72 hours if unspecified.
func WithIPNIAnnounce ¶
WithIPNIAnnounce set whether the deal payload should be announced to IPNI. Defaults to true.
func WithKeepUnsealed ¶
WithKeepUnsealed set whether the deal the deal should be kept unsealed. Defaults to false.
func WithMaxCarSize ¶
WithMaxCarSize sets singularity max car size config as string. Defaults to "31.5GiB"
func WithMaxPendingDealNumber ¶
WithMaxPendingDealNumber sets the max pending deal number. Defaults to 1.
func WithMaxPendingDealSize ¶
WithMaxPendingDealSize sets the max pending deal size. Defaults to "0".
func WithPackThreshold ¶
WithPackThreshold sets the threshold at which unpacked bytes are scheduled for packing. Defaults to 16 GiB.
func WithPricePerDeal ¶
func WithPricePerDeal(v abi.TokenAmount) Option
WithPricePerDeal sets the per deal.
func WithPricePerGiB ¶
func WithPricePerGiB(v abi.TokenAmount) Option
WithPricePerGiB sets the per epoch per GiB.
func WithPricePerGiBEpoch ¶
func WithPricePerGiBEpoch(v abi.TokenAmount) Option
WithPricePerGiBEpoch sets the price per epoch per GiB.
func WithReplicationFactor ¶
WithReplicationFactor sets the replication factor for the blobs. Defaults to the number of storage providers specified. If no storage providers are specified the replication factor will be zero, i.e. data will only be stored locally.
See WithStorageProviders.
func WithScheduleCron ¶
WithScheduleCron sets the Singularity schedule cron. Defaults to disabled.
func WithScheduleCronPerpetual ¶
WithScheduleCronPerpetual sets whether a cron schedule should run in definitely. Defaults to true.
func WithScheduleDealNumber ¶
WithScheduleDealNumber sets the max number of deals per singularity scheduled time. Defaults to unlimited.
func WithScheduleDealSize ¶
WithScheduleDealSize sets the size of deals per schedule trigger. Defaults to "0".
func WithScheduleUrlTemplate ¶
WithScheduleUrlTemplate sets the Singularity schedule URL template for online deals. Defaults to offline deals.
func WithSingularityClient ¶
WithSingularityClient sets the client used to communicate with Singularity API. Defaults to HTTP client with API endpoint http://localhost:9090.
func WithStorageProviders ¶
func WithStorageProviders(sp ...address.Address) Option
WithStorageProviders sets the list of Filecoin storage providers to make deals with. Defaults to no deals, i.e. local storage only if unspecified.
func WithStoreDir ¶
WithStoreDir sets local directory used by the singularity store. Defaults to OS temporary directory. See: os.TempDir.
func WithTotalDealNumber ¶
WithTotalDealNumber sets the total number of deals. Defaults to 0, i.e. unlimited.
func WithTotalDealSize ¶
WithTotalDealSize sets the total schedule deal size. Defaults to "0".
func WithVerifiedDeal ¶
WithVerifiedDeal set whether the deals should be verified. Defaults to true.
func WithWalletKey ¶
WithWalletKey sets the wallet used by Motion to interact with Filecoin network.
type SingularityStore ¶
type SingularityStore struct {
// contains filtered or unexported fields
}
func NewStore ¶
func NewStore(o ...Option) (*SingularityStore, error)
func (*SingularityStore) Describe ¶
func (s *SingularityStore) Describe(ctx context.Context, id blob.ID) (*blob.Descriptor, error)
func (*SingularityStore) Get ¶
func (s *SingularityStore) Get(ctx context.Context, id blob.ID) (io.ReadSeekCloser, error)
func (*SingularityStore) Put ¶
func (s *SingularityStore) Put(ctx context.Context, reader io.ReadCloser) (*blob.Descriptor, error)