Documentation ¶
Index ¶
- type Option
- func WithCleanupInterval(v time.Duration) Option
- func WithDealDuration(v abi.ChainEpoch) Option
- func WithDealStartDelay(v abi.ChainEpoch) Option
- func WithForcePackAfter(d time.Duration) 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 WithMinFreeSpace(space int64) Option
- func WithPackThreshold(s int64) Option
- func WithPreparationName(n string) 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 *singularityclient.SingularityAPI) 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 Reader
- type Store
- func (s *Store) Describe(ctx context.Context, id blob.ID) (*blob.Descriptor, error)
- func (s *Store) Get(ctx context.Context, id blob.ID) (io.ReadSeekCloser, error)
- func (s *Store) PassGet(w http.ResponseWriter, r *http.Request, id blob.ID)
- func (s *Store) Put(ctx context.Context, reader io.Reader) (*blob.Descriptor, error)
- func (s *Store) Shutdown(ctx context.Context) error
- func (s *Store) 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 WithCleanupInterval ¶ added in v0.2.1
WithCleanupInterval sets how often to check for and remove data that has been successfully stored on Filecoin. Deafults to time.Hour
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 WithForcePackAfter ¶ added in v0.2.2
WithForcePackAfter sets the maximum amount of time to wait without any data being received before forcing packing. Defaults to 24 hours.
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 WithMinFreeSpace ¶ added in v0.2.3
WithMinFreeSpce configures the minimul free disk space that must remain after storing a blob. A value of zero uses the default value and -1 disabled checks.
func WithPackThreshold ¶
WithPackThreshold sets the threshold at which unpacked bytes are scheduled for packing. Defaults to 16 GiB.
func WithPreparationName ¶ added in v0.2.1
WithPreparationName sets the singularity preparation name used to store data. Defaults to "MOTION_PREPARATION".
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 ¶
func WithSingularityClient(c *singularityclient.SingularityAPI) Option
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 Reader ¶ added in v0.2.2
type Reader struct {
// contains filtered or unexported fields
}
io.ReadSeekCloser implementation that reads from remote singularity
func NewReader ¶ added in v0.2.2
func NewReader(client *singularityclient.SingularityAPI, fileID uint64, size int64) *Reader