ipfs

package
v1.3.4 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2020 License: GPL-2.0, GPL-3.0 Imports: 7 Imported by: 10

Documentation

Index

Constants

This section is empty.

Variables

View Source
var IpfsFileLength int

IpfsFileLength defines the length of the ipfs filename

Functions

func AddBytes

func AddBytes(data []byte) (string, error)

AddBytes hashes a byte string

func AddFile

func AddFile(filepath string) (string, error)

AddFile returns the ipfs hash of a file

func AddString

func AddString(a string) (string, error)

AddString stores the passed string in ipfs and returns the hash

func GetFile

func GetFile(hash string, extension string) (string, error)

GetFile gets back the contents of an ipfs hash and stores them in the required extension format. This has to match with the extension format that the original file had or else one would not be able to view the file

func GetString

func GetString(hash string) (string, error)

GetString gets back the contents of an ipfs hash as a string

func ReadfromFile

func ReadfromFile(filepath string) ([]byte, error)

ReadfromFile reads a pdf and returns the datastream

func RetrieveShell

func RetrieveShell() *shell.Shell

RetrieveShell retrieves the ipfs shell for use by other functions

func SetConsts

func SetConsts(fileLength int)

SetConsts sets values for consts related to ipfs

func SetPath

func SetPath(newPath string)

SetPath sets the path for the local / remote ipfs daemon

Types

This section is empty.

Jump to

Keyboard shortcuts

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