ipfs

package
v0.0.0-...-6d9c22b Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2020 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DEBUG = false

DEBUG allows more detailed working to be exposed through the terminal.

Functions

func ConnectToIPFSForDownload

func ConnectToIPFSForDownload(hash string, hostName string, port string) (*bytes.Reader, error)

ConnectToIPFSForDownload will connect to a IPFS instance, based on the hash name of file on IPFS. It returns a reference to an io.Reader with IPFS instance information

func CreateCID

func CreateCID(ipfsData *IPFSdata, data []byte) (string, error)

CreateCID will connect to a IPFS instance, based on the read property from an external file. It returns Created CID.

Types

type ConfigIPFS

type ConfigIPFS struct {
	HostName  string `json:"hostName"`
	Port      string `json:"port"`
	Path      string `json:"path"`
	ChunkSize string `json:"chunkSize"`
}

ConfigIPFS defines the variables and types.

func LoadIPFSProperty

func LoadIPFSProperty(fullFileName string) (ConfigIPFS, error)

LoadIPFSProperty reads and parses the JSON file. that contain a IPFS instance's property. and returns all the properties as an object.

type IPFSdata

type IPFSdata struct {
	Sh         *shell.Shell
	FilePath   string
	ChunkSize  int64
	FileHandle *os.File
}

IPFSdata structure for ipfs data

func ConnectToIPFSStorj

func ConnectToIPFSStorj(fullFileName string) (*IPFSdata, error)

ConnectToIPFSStorj will connect to a IPFS instance, based on the read property from an external file. It returns a reference to an io.Reader with IPFS instance information.

type Reader

type Reader struct {
	Sh *shell.Shell
	// contains filtered or unexported fields
}

Reader implements an io.Reader interface

Jump to

Keyboard shortcuts

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