ipfs

package
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2021 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HostGatewayURL

func HostGatewayURL() (string, error)

HostGatewayURL returns IPFS gateway URL that host is configured to use

func NormalizeGatewayURL

func NormalizeGatewayURL(urlstr string) string

NormalizeGatewayURL normalizes IPFS gateway URL

func RunDaemon

func RunDaemon() error

RunDaemon runs the IPFS daemon

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client is the client structure

func NewClient

func NewClient() *Client

NewClient returns a new IPFS client instance

func NewRemoteClient

func NewRemoteClient(config *Config) *Client

NewRemoteClient returns a new IPFS shell client

func (*Client) AddDir

func (client *Client) AddDir(dir string) (string, error)

AddDir adds a directory to IPFS https://github.com/ipfs/go-ipfs-api/blob/master/add.go#L99-L145

func (*Client) AddImage

func (client *Client) AddImage(manifest map[string][]byte, layers map[string][]byte) (string, error)

AddImage adds components of an image recursively

func (*Client) Cat

func (client *Client) Cat(path string) (io.ReadCloser, error)

Cat the content at the given path. Callers need to drain and close the returned reader after usage.

func (*Client) GatewayURL

func (client *Client) GatewayURL() string

GatewayURL returns the gateway URL

func (*Client) Get

func (client *Client) Get(hash, outdir string) error

Get fetches the contents and outputs into a directory

func (*Client) List

func (client *Client) List(path string) ([]*api.LsLink, error)

List entries at the given path

func (*Client) Refs

func (client *Client) Refs(hash string, recursive bool) (<-chan string, error)

Refs returns the refs of an IPFS hash

type Config

type Config struct {
	Host       string
	GatewayURL string
}

Config is the config for the client

Jump to

Keyboard shortcuts

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