Documentation ¶
Index ¶
Constants ¶
const ( PinStatusPinned = PinStatus(api.TrackerStatusPinned) PinStatusPinning = PinStatus(api.TrackerStatusPinning) PinStatusPinQueued = PinStatus(api.TrackerStatusPinQueued) PinStatusRemote = PinStatus(api.TrackerStatusRemote) PinStatusUnpinned = PinStatus(api.TrackerStatusUnpinned) PinStatusUnknown = PinStatus(-1) )
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) Pin(context.Context, cid.Cid, ...PinOption) (*PinResponse, 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).
func WithHTTPClient ¶ added in v0.0.6
WithHTTPClient sets the HTTP client to use when making requests which allows timeouts and redirect behaviour to be configured. The default is to use the DefaultClient from the Go standard library.
type Pin ¶
func (*Pin) UnmarshalJSON ¶
type PinOption ¶ added in v0.0.6
type PinOption func(cfg *pinConfig) error
PinOption is an option configuring a call to Pin.
func WithPinMeta ¶ added in v0.0.6
WithPinMeta adds metadata about pinned data.
func WithPinName ¶ added in v0.0.6
WithPinName sets the name to use for the pinned data.
func WithPinOrigin ¶ added in v0.0.6
WithPinOrigin adds a multiaddr known to provide the data.
type PinResponse ¶ added in v0.0.6
type PinResponse struct { RequestID string Status string Created time.Time Pin PinResponseDetail Delegates []string }
func (*PinResponse) UnmarshalJSON ¶ added in v0.0.6
func (p *PinResponse) UnmarshalJSON(b []byte) error
type PinResponseDetail ¶ added in v0.0.6
type PinResponseDetail struct { Cid cid.Cid SourceCid cid.Cid ContentCid cid.Cid Name string Origins []string Meta map[string]string Deleted time.Time Created time.Time Updated time.Time Pins []Pin }
func (*PinResponseDetail) UnmarshalJSON ¶ added in v0.0.6
func (p *PinResponseDetail) UnmarshalJSON(b []byte) error
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.