ipfs

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: May 29, 2019 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package ipfs provides functions to handle ipfs public API.

Index

Constants

View Source
const DefaultEndpoint = "http://ipfs.app.mesg.com:5001/api/v0"

DefaultEndpoint is endpoint used to access ipfs network.

Variables

View Source
var DefaultClient = NewClient(DefaultEndpoint)

DefaultClient is global client used for communication with ipfs network.

Functions

func Get

func Get(hash string) (io.Reader, error)

Get retrives the file from the ipfs node.

Types

type AddResponse

type AddResponse struct {
	Name  string
	Hash  string
	Bytes int64
	Size  string
}

AddResponse contains the response of adding a file.

func Add

func Add(name string, r io.Reader) (*AddResponse, error)

Add sends data from a reader to the ipfs node.

type IPFS

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

IPFS handles communication with ipfs network.

func NewClient

func NewClient(endpoint string) *IPFS

NewClient creates new IPFS client.

func (*IPFS) Add

func (ipfs *IPFS) Add(name string, r io.Reader) (*AddResponse, error)

Add sends data from a reader to the ipfs node.

func (*IPFS) Get

func (ipfs *IPFS) Get(hash string) (io.Reader, error)

Get retrives the file from the ipfs node.

Jump to

Keyboard shortcuts

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