Documentation ¶
Index ¶
- type Client
- func (c *Client) Announce(ctx context.Context, provider *peer.AddrInfo, root cid.Cid) error
- func (c *Client) IndexContent(ctx context.Context, providerID peer.ID, privateKey p2pcrypto.PrivKey, ...) error
- func (c *Client) Register(ctx context.Context, providerID peer.ID, privateKey p2pcrypto.PrivKey, ...) error
- type Interface
- type Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is an http client for the indexer ingest API
func New ¶
New creates a new ingest http client. If an http.Client is not provide by the WithClient option, then the default client is used.
func (*Client) IndexContent ¶
func (c *Client) IndexContent(ctx context.Context, providerID peer.ID, privateKey p2pcrypto.PrivKey, m multihash.Multihash, contextID []byte, metadata []byte, addrs []string) error
IndexContent creates an index directly on the indexer. This bypasses the process of ingesting advertisements. It is used to index special one-off content that is outside of an advertisement chain, and is intentionally limited to indexing a single multihash.
func (*Client) Register ¶
func (c *Client) Register(ctx context.Context, providerID peer.ID, privateKey p2pcrypto.PrivKey, addrs []string) error
Register registers a provider directly with an indexer. The primary use is update an indexer with new provider addresses without having to wait until a new advertisement is ingested.
type Interface ¶
type Interface interface { // Announce announces a new head CID directly to the indexer. Announce(ctx context.Context, provider *peer.AddrInfo, root cid.Cid) error // IndexContent creates an index directly on the indexer. IndexContent(ctx context.Context, providerID peer.ID, privateKey crypto.PrivKey, m multihash.Multihash, contextID []byte, metadata []byte, addrs []string) error // Register registers a provider directly with an indexer. Register(ctx context.Context, providerID peer.ID, privateKey crypto.PrivKey, addrs []string) error }
Interface is the interface implemented by all ingest clients.