Documentation ¶
Index ¶
Constants ¶
const ( PinStatusPinned = PinStatus(api.TrackerStatusPinned) PinStatusPinning = PinStatus(api.TrackerStatusPinning) PinStatusPinQueued = PinStatus(api.TrackerStatusPinQueued) )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client interface { Get(context.Context, cid.Cid) (*w3http.Web3Response, error) Put(context.Context, fs.File, ...PutOption) (cid.Cid, error) PutCar(context.Context, io.Reader) (cid.Cid, error) Status(context.Context, cid.Cid) (*Status, error) List(context.Context, ...ListOption) (*UploadIterator, error) }
Client is a HTTP API client to the web3.storage service.
type Deal ¶
type Deal struct { DealID uint64 StorageProvider address.Address Status DealStatus PieceCid cid.Cid DataCid cid.Cid DataModelSelector string Activation time.Time Created time.Time Updated time.Time }
func (*Deal) UnmarshalJSON ¶
type DealStatus ¶
type DealStatus int
const ( DealStatusQueued DealStatus = iota DealStatusPublished DealStatusActive )
func (DealStatus) String ¶
func (s DealStatus) String() string
type ListOption ¶ added in v0.0.4
type ListOption func(cfg *listConfig) error
ListOption is an option configuring a call to List.
func WithBefore ¶ added in v0.0.4
func WithBefore(before time.Time) ListOption
WithBefore sets the time that items in the list were uploaded before.
func WithMaxResults ¶ added in v0.0.4
func WithMaxResults(maxResults int) ListOption
WithMaxResults sets the maximum number of results that will be available from the iterator.
type Option ¶
type Option func(cfg *clientConfig) error
Option is an option configuring a web3.storage client.
func WithDatastore ¶
WithDatastore sets the underlying datastore to use when reading or writing DAG block data. The default is to use a new in-memory store per Get/Put request.
func WithEndpoint ¶
WithEndpoint sets the URL of the root API when making requests (default https://api.web3.storage).
type Pin ¶
func (*Pin) UnmarshalJSON ¶
type PutOption ¶
type PutOption func(cfg *putConfig) error
PutOption is an option configuring a call to Put.
func WithDirname ¶
WithDirname sets the root directory path, for use when the provided file is a directory and does NOT implement fs.ReadDirFile. The default is "", which will resolve to the current working directory if the file system interface is the default (the OS).
type Status ¶
Status is IPFS pin and Filecoin deal status for a given CID.
func (*Status) UnmarshalJSON ¶
type UploadIterator ¶ added in v0.0.4
type UploadIterator struct {
// contains filtered or unexported fields
}
func (*UploadIterator) Next ¶ added in v0.0.4
func (li *UploadIterator) Next() (*Status, error)
Next retrieves status information for the next upload in the list.