Documentation ¶
Index ¶
- Constants
- type AddedContent
- type AuthedClient
- type Client
- func (c *Client) Health() *HealthReq
- func (c *Client) PublicContentByCid(ci cid.Cid) *PublicContentByCidReq
- func (c *Client) PublicMinerDeals(addr address.Address) *PublicMinerDealsReq
- func (c *Client) PublicMinerFailures(addr address.Address) *PublicMinerFailuresReq
- func (c *Client) PublicMinerStats(addr address.Address) *PublicMinerStatsReq
- func (c *Client) PublicMinerStorageAsk(addr address.Address) *PublicMinerStorageAskReq
- func (c *Client) PublicNodeInfo() *PublicNodeInfoReq
- func (c *Client) PublicStats() *StatsReq
- func (c *Client) WithToken(token string) *AuthedClient
- type Content
- type ContentAddFromIpfsReq
- func (r *ContentAddFromIpfsReq) Collection(v string) *ContentAddFromIpfsReq
- func (r *ContentAddFromIpfsReq) Context(ctx context.Context) *ContentAddFromIpfsReq
- func (r *ContentAddFromIpfsReq) Name(v string) *ContentAddFromIpfsReq
- func (r *ContentAddFromIpfsReq) Peers(peers ...peer.AddrInfo) *ContentAddFromIpfsReq
- func (r *ContentAddFromIpfsReq) Send() (*IpfsPinStatus, error)
- type ContentAddReq
- type ContentDeal
- type ContentInfo
- type Error
- type Health
- type HealthReq
- type IpfsPin
- type IpfsPinStatus
- type MinerChainInfo
- type MinerDeal
- type MinerDealFailure
- type MinerStats
- type MinerStorageAsk
- type PinList
- type PinServices
- func (s *PinServices) Add(ci cid.Cid) *PinServicesAddReq
- func (s *PinServices) Delete(requestId string) *PinServicesDeleteReq
- func (s *PinServices) Get(requestId string) *PinServicesGetReq
- func (s *PinServices) List() *PinServicesListReq
- func (s *PinServices) Replace(requestId string, ci cid.Cid) *PinServicesReplaceReq
- type PinServicesAddReq
- func (r *PinServicesAddReq) Collection(v string) *PinServicesAddReq
- func (r *PinServicesAddReq) Context(ctx context.Context) *PinServicesAddReq
- func (r *PinServicesAddReq) Meta(meta map[string]interface{}) *PinServicesAddReq
- func (r *PinServicesAddReq) Name(v string) *PinServicesAddReq
- func (r *PinServicesAddReq) Origins(addrs ...peer.AddrInfo) *PinServicesAddReq
- func (r *PinServicesAddReq) Send() (*IpfsPinStatus, error)
- type PinServicesDeleteReq
- type PinServicesGetReq
- type PinServicesListReq
- type PinServicesReplaceReq
- func (r *PinServicesReplaceReq) Collection(v string) *PinServicesReplaceReq
- func (r *PinServicesReplaceReq) Context(ctx context.Context) *PinServicesReplaceReq
- func (r *PinServicesReplaceReq) Meta(meta map[string]interface{}) *PinServicesReplaceReq
- func (r *PinServicesReplaceReq) Name(v string) *PinServicesReplaceReq
- func (r *PinServicesReplaceReq) Origins(addrs ...peer.AddrInfo) *PinServicesReplaceReq
- func (r *PinServicesReplaceReq) Send() (*IpfsPinStatus, error)
- type PublicContentByCidReq
- type PublicMinerDealsReq
- type PublicMinerFailuresReq
- type PublicMinerStatsReq
- type PublicMinerStorageAskReq
- type PublicNodeInfo
- type PublicNodeInfoReq
- type PublicStats
- type ResponseError
- type StatsReq
Constants ¶
const ( // Version is the current version of the client library. Version = "0.1.0" // DefaultUserAgent is the default user agent header used by the client library. DefaultUserAgent = "estuary-client/" + Version DefaultAddr = "api.estuary.tech" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AddedContent ¶
type AuthedClient ¶
type AuthedClient struct { Pins *PinServices // contains filtered or unexported fields }
AuthedClient is the base client used for interacting with services that require authentication.
func NewAuthedClient ¶
func NewAuthedClient(client *http.Client, addr string, token string) *AuthedClient
New creates a new client that will use the supplied HTTP client and connect via the specified API host address.
func (*AuthedClient) ContentAdd ¶
func (c *AuthedClient) ContentAdd(name string, r io.Reader) *ContentAddReq
func (*AuthedClient) ContentAddFromIpfs ¶
func (c *AuthedClient) ContentAddFromIpfs(root cid.Cid) *ContentAddFromIpfsReq
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is the base client used for interacting with services that do not require authentication.
func New ¶
New creates a new client that will use the supplied HTTP client and connect via the specified API host address.
func NewDefault ¶
func NewDefault() *Client
NewDefault creates a new client that will use the default HTTP client and connect to api.estuary.tech.
func (*Client) PublicContentByCid ¶
func (c *Client) PublicContentByCid(ci cid.Cid) *PublicContentByCidReq
PublicContentByCid prepares a request for information about content by its cid
func (*Client) PublicMinerDeals ¶
func (c *Client) PublicMinerDeals(addr address.Address) *PublicMinerDealsReq
PublicMinerDeals prepares a request for information about deals made with a miner.
func (*Client) PublicMinerFailures ¶
func (c *Client) PublicMinerFailures(addr address.Address) *PublicMinerFailuresReq
PublicMinerFailures prepares a request for information about miner deal failures.
func (*Client) PublicMinerStats ¶
func (c *Client) PublicMinerStats(addr address.Address) *PublicMinerStatsReq
PublicMinerStats prepares a request for public stats about a miner.
func (*Client) PublicMinerStorageAsk ¶
func (c *Client) PublicMinerStorageAsk(addr address.Address) *PublicMinerStorageAskReq
PublicMinerStorageAsk prepares a request for a miner's storage ask details.
func (*Client) PublicNodeInfo ¶
func (c *Client) PublicNodeInfo() *PublicNodeInfoReq
PublicNodeInfo prepares a request for information about the Estuary node.
func (*Client) PublicStats ¶
func (*Client) WithToken ¶
func (c *Client) WithToken(token string) *AuthedClient
WithToken creates a Client with the supplied authentication token, copying options set on the receiver.
type Content ¶
type Content struct { ID uint `json:"id"` Cid string `json:"cid"` Name string `json:"name"` UserID uint `json:"userId"` Description string `json:"description"` Size int64 `json:"size"` Active bool `json:"active"` Offloaded bool `json:"offloaded"` Replication int `json:"replication"` AggregatedIn uint `json:"aggregatedIn"` Aggregate bool `json:"aggregate"` Pinning bool `json:"pinning"` PinMeta string `json:"pinMeta"` Failed bool `json:"failed"` Location string `json:"location"` DagSplit bool `json:"dagSplit"` }
type ContentAddFromIpfsReq ¶
type ContentAddFromIpfsReq struct {
// contains filtered or unexported fields
}
func (*ContentAddFromIpfsReq) Collection ¶
func (r *ContentAddFromIpfsReq) Collection(v string) *ContentAddFromIpfsReq
func (*ContentAddFromIpfsReq) Context ¶
func (r *ContentAddFromIpfsReq) Context(ctx context.Context) *ContentAddFromIpfsReq
Context sets the context to be used during this request.
func (*ContentAddFromIpfsReq) Name ¶
func (r *ContentAddFromIpfsReq) Name(v string) *ContentAddFromIpfsReq
func (*ContentAddFromIpfsReq) Peers ¶
func (r *ContentAddFromIpfsReq) Peers(peers ...peer.AddrInfo) *ContentAddFromIpfsReq
func (*ContentAddFromIpfsReq) Send ¶
func (r *ContentAddFromIpfsReq) Send() (*IpfsPinStatus, error)
type ContentAddReq ¶
type ContentAddReq struct {
// contains filtered or unexported fields
}
func (*ContentAddReq) Context ¶
func (r *ContentAddReq) Context(ctx context.Context) *ContentAddReq
Context sets the context to be used during this request.
func (*ContentAddReq) Send ¶
func (r *ContentAddReq) Send() (*AddedContent, error)
type ContentDeal ¶
type ContentDeal struct { ID uint `json:"id"` Content uint `json:"content"` PropCid string `json:"propCid"` Miner string `json:"miner"` DealID int64 `json:"dealId"` Failed bool `json:"failed"` Verified bool `json:"verified"` FailedAt time.Time `json:"failedAt,omitempty"` DTChan string `json:"dtChan"` TransferStarted time.Time `json:"transferStarted"` TransferFinished time.Time `json:"transferFinished"` OnChainAt time.Time `json:"onChainAt"` SealedAt time.Time `json:"sealedAt"` }
type ContentInfo ¶
type ContentInfo struct { Content Content `json:"content"` AggregatedIn *Content `json:"aggregatedIn,omitempty"` Deals []ContentDeal `json:"deals"` }
type HealthReq ¶
type HealthReq struct {
// contains filtered or unexported fields
}
type IpfsPinStatus ¶
type MinerChainInfo ¶
type MinerDeal ¶
type MinerDeal struct { ID uint `json:"id"` Content uint `json:"content"` PropCid string `json:"propCid"` Miner string `json:"miner"` DealID int64 `json:"dealId"` Failed bool `json:"failed"` Verified bool `json:"verified"` FailedAt time.Time `json:"failedAt,omitempty"` DTChan string `json:"dtChan"` TransferStarted time.Time `json:"transferStarted"` TransferFinished time.Time `json:"transferFinished"` OnChainAt time.Time `json:"onChainAt"` SealedAt time.Time `json:"sealedAt"` ContentCid string `json:"contentCid"` }
type MinerDealFailure ¶
type MinerStats ¶
type MinerStats struct { Miner string `json:"miner"` Name string `json:"name"` Version string `json:"version"` UsedByEstuary bool `json:"usedByEstuary"` DealCount int64 `json:"dealCount"` ErrorCount int64 `json:"errorCount"` Suspended bool `json:"suspended"` SuspendedReason string `json:"suspendedReason"` ChainInfo *MinerChainInfo `json:"chainInfo"` }
type MinerStorageAsk ¶
type PinList ¶
type PinList struct { Count int `json:"count"` Results []IpfsPinStatus `json:"results"` }
type PinServices ¶
type PinServices struct {
// contains filtered or unexported fields
}
PinServices provides access to pin related API services.
func NewPinServices ¶
func NewPinServices(a *AuthedClient) *PinServices
func (*PinServices) Add ¶
func (s *PinServices) Add(ci cid.Cid) *PinServicesAddReq
Add prepares a request to add a pin.
func (*PinServices) Delete ¶
func (s *PinServices) Delete(requestId string) *PinServicesDeleteReq
Get prepares a request to delete a pin
func (*PinServices) Get ¶
func (s *PinServices) Get(requestId string) *PinServicesGetReq
Get prepares a request to get the status of a pin
func (*PinServices) List ¶
func (s *PinServices) List() *PinServicesListReq
List prepares a request for a list of pins.
func (*PinServices) Replace ¶
func (s *PinServices) Replace(requestId string, ci cid.Cid) *PinServicesReplaceReq
Replace prepares a request to replace a pin.
type PinServicesAddReq ¶
type PinServicesAddReq struct {
// contains filtered or unexported fields
}
func (*PinServicesAddReq) Collection ¶
func (r *PinServicesAddReq) Collection(v string) *PinServicesAddReq
Collection sets a collection to be associated with the pin.
func (*PinServicesAddReq) Context ¶
func (r *PinServicesAddReq) Context(ctx context.Context) *PinServicesAddReq
Context sets the context to be used during this request.
func (*PinServicesAddReq) Meta ¶
func (r *PinServicesAddReq) Meta(meta map[string]interface{}) *PinServicesAddReq
Meta sets additional metadata to be associated with the pin.
func (*PinServicesAddReq) Name ¶
func (r *PinServicesAddReq) Name(v string) *PinServicesAddReq
Name sets a name to be associated with the pin.
func (*PinServicesAddReq) Origins ¶
func (r *PinServicesAddReq) Origins(addrs ...peer.AddrInfo) *PinServicesAddReq
Origins sets one or more origin addresses to be associated with the pin.
func (*PinServicesAddReq) Send ¶
func (r *PinServicesAddReq) Send() (*IpfsPinStatus, error)
Send sends the prepared request and returns the status of the added pin.
type PinServicesDeleteReq ¶
type PinServicesDeleteReq struct {
// contains filtered or unexported fields
}
func (*PinServicesDeleteReq) Context ¶
func (r *PinServicesDeleteReq) Context(ctx context.Context) *PinServicesDeleteReq
Context sets the context to be used during this request.
func (*PinServicesDeleteReq) Send ¶
func (r *PinServicesDeleteReq) Send() error
Send sends the prepared request and returns the status of the pin.
type PinServicesGetReq ¶
type PinServicesGetReq struct {
// contains filtered or unexported fields
}
func (*PinServicesGetReq) Context ¶
func (r *PinServicesGetReq) Context(ctx context.Context) *PinServicesGetReq
Context sets the context to be used during this request.
func (*PinServicesGetReq) Send ¶
func (r *PinServicesGetReq) Send() (*IpfsPinStatus, error)
Send sends the prepared request and returns the status of the pin.
type PinServicesListReq ¶
type PinServicesListReq struct {
// contains filtered or unexported fields
}
func (*PinServicesListReq) Context ¶
func (r *PinServicesListReq) Context(ctx context.Context) *PinServicesListReq
Context sets the context to be used during this request.
func (*PinServicesListReq) Send ¶
func (r *PinServicesListReq) Send() (*PinList, error)
Send sends the prepared request and returns a list of pins.
type PinServicesReplaceReq ¶
type PinServicesReplaceReq struct {
// contains filtered or unexported fields
}
func (*PinServicesReplaceReq) Collection ¶
func (r *PinServicesReplaceReq) Collection(v string) *PinServicesReplaceReq
Collection sets a collection to be associated with the pin.
func (*PinServicesReplaceReq) Context ¶
func (r *PinServicesReplaceReq) Context(ctx context.Context) *PinServicesReplaceReq
Context sets the context to be used during this request.
func (*PinServicesReplaceReq) Meta ¶
func (r *PinServicesReplaceReq) Meta(meta map[string]interface{}) *PinServicesReplaceReq
Meta sets additional metadata to be associated with the pin.
func (*PinServicesReplaceReq) Name ¶
func (r *PinServicesReplaceReq) Name(v string) *PinServicesReplaceReq
Name sets a name to be associated with the pin.
func (*PinServicesReplaceReq) Origins ¶
func (r *PinServicesReplaceReq) Origins(addrs ...peer.AddrInfo) *PinServicesReplaceReq
Origins sets one or more origin addresses to be associated with the pin.
func (*PinServicesReplaceReq) Send ¶
func (r *PinServicesReplaceReq) Send() (*IpfsPinStatus, error)
Send sends the prepared request and returns the status of the replaced pin.
type PublicContentByCidReq ¶
type PublicContentByCidReq struct {
// contains filtered or unexported fields
}
func (*PublicContentByCidReq) Context ¶
func (r *PublicContentByCidReq) Context(ctx context.Context) *PublicContentByCidReq
Context sets the context to be used during this request.
func (*PublicContentByCidReq) Send ¶
func (r *PublicContentByCidReq) Send() ([]ContentInfo, error)
Send sends the prepared request and returns public information about the content.
type PublicMinerDealsReq ¶
type PublicMinerDealsReq struct {
// contains filtered or unexported fields
}
func (*PublicMinerDealsReq) Context ¶
func (r *PublicMinerDealsReq) Context(ctx context.Context) *PublicMinerDealsReq
Context sets the context to be used during this request.
func (*PublicMinerDealsReq) Send ¶
func (r *PublicMinerDealsReq) Send() ([]MinerDeal, error)
Send sends the prepared request and returns information about deals made with a miner.
type PublicMinerFailuresReq ¶
type PublicMinerFailuresReq struct {
// contains filtered or unexported fields
}
func (*PublicMinerFailuresReq) Context ¶
func (r *PublicMinerFailuresReq) Context(ctx context.Context) *PublicMinerFailuresReq
Context sets the context to be used during this request.
func (*PublicMinerFailuresReq) Send ¶
func (r *PublicMinerFailuresReq) Send() ([]MinerDealFailure, error)
Send sends the prepared request and returns information about miner deal failures.
type PublicMinerStatsReq ¶
type PublicMinerStatsReq struct {
// contains filtered or unexported fields
}
func (*PublicMinerStatsReq) Context ¶
func (r *PublicMinerStatsReq) Context(ctx context.Context) *PublicMinerStatsReq
Context sets the context to be used during this request.
func (*PublicMinerStatsReq) Send ¶
func (r *PublicMinerStatsReq) Send() (*MinerStats, error)
Send sends the prepared request and returns public stats about the miner.
type PublicMinerStorageAskReq ¶
type PublicMinerStorageAskReq struct {
// contains filtered or unexported fields
}
func (*PublicMinerStorageAskReq) Context ¶
func (r *PublicMinerStorageAskReq) Context(ctx context.Context) *PublicMinerStorageAskReq
Context sets the context to be used during this request.
func (*PublicMinerStorageAskReq) Send ¶
func (r *PublicMinerStorageAskReq) Send() (*MinerStorageAsk, error)
Send sends the prepared request and returns the miner's storage ask details.
type PublicNodeInfo ¶
type PublicNodeInfo struct {
PrimaryAddress string `json:"primaryAddress"`
}
type PublicNodeInfoReq ¶
type PublicNodeInfoReq struct {
// contains filtered or unexported fields
}
func (*PublicNodeInfoReq) Context ¶
func (r *PublicNodeInfoReq) Context(ctx context.Context) *PublicNodeInfoReq
Context sets the context to be used during this request.
func (*PublicNodeInfoReq) Send ¶
func (r *PublicNodeInfoReq) Send() (*PublicNodeInfo, error)
Send sends the prepared request and returns public information about the Estuary node.
type PublicStats ¶
type ResponseError ¶
func (*ResponseError) Error ¶
func (e *ResponseError) Error() string