infura

package module
v1.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 4, 2019 License: Apache-2.0 Imports: 12 Imported by: 0

README

go-ipfs-provider-infura

Tag License GoDoc Travis CI codecov.io Go Report Card

Provides an interface to the IPFS service provided by infura.

Table of Contents

Install

go-ipfs-provider-infura is a standard Go module which can be installed with:

go get github.com/wealdtech/go-ipfs-provider-infura

Usage

TODO

Example
TODO

Maintainers

Jim McDonald: @mcdee.

Contribute

Contributions welcome. Please check out the issues.

License

Apache-2.0 © 2019 Weald Technology Trading Ltd

Documentation

Index

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

func NewProvider() (*Provider, error)

NewProvider creates a new Infura provider. func NewProvider(apiKey string, apiSecret string) (*Provider, error) {

func (*Provider) GatewayURL

func (p *Provider) GatewayURL(input string) (string, error)

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) Pin

func (p *Provider) Pin(hash string) error

Pin pins existing IPFS content 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

func (p *Provider) Ping() (bool, error)

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.

func (*Provider) Unpin

func (p *Provider) Unpin(hash string) error

Unpin removes content from this provider.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL