Documentation ¶
Index ¶
- type Provider
- func (p *Provider) GatewayURL(input string) (string, error)
- func (p *Provider) ItemStats(hash string) (*provider.ItemStatistics, error)
- func (p *Provider) List() ([]*provider.ItemStatistics, error)
- func (p *Provider) Pin(hash string) error
- func (p *Provider) PinContent(name string, content io.Reader, opts *provider.ContentOpts) (string, error)
- func (p *Provider) Ping() (bool, error)
- func (p *Provider) ServiceStats() (*provider.SiteStatistics, error)
- func (p *Provider) Unpin(hash string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Provider ¶
type Provider struct { }
Provider is an implementation of the IPFS provider for Infura.
func NewProvider ¶
NewProvider creates a new Infura provider. func NewProvider(apiKey string, apiSecret string) (*Provider, error) {
func (*Provider) GatewayURL ¶
GatewayURL provides a gateway URL for the given input. The input may be an existing gateway URL, a multiaddr, or a plain hash
func (*Provider) ItemStats ¶
func (p *Provider) ItemStats(hash string) (*provider.ItemStatistics, error)
ItemStats returns information on an IPFS hash pinned to this provider. Note that this does not return the file name.
func (*Provider) List ¶
func (p *Provider) List() ([]*provider.ItemStatistics, error)
List lists all content pinned to this provider.
func (*Provider) PinContent ¶
func (p *Provider) PinContent(name string, content io.Reader, opts *provider.ContentOpts) (string, error)
PinContent pins content to this provider.
func (*Provider) Ping ¶
Ping is an internal method to ensure the endpoint is accessible. This returns true if the endpoint is accessible, otherwise false. This returns an error for a network or authentication problem.
func (*Provider) ServiceStats ¶
func (p *Provider) ServiceStats() (*provider.SiteStatistics, error)
ServiceStats provides statistics for this provider.