ipfsutils

package module
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2021 License: Apache-2.0 Imports: 11 Imported by: 0

README

ipfsutils

Helper functions to easily work with IPFS (both local and remote).

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetBytesFromIPFS

func GetBytesFromIPFS(ctx context.Context, cid string) ([]byte, error)

func GetJSONFromIPFS

func GetJSONFromIPFS(ctx context.Context, cid string, t interface{}) error

func UploadBytesToIPFS

func UploadBytesToIPFS(ctx context.Context, data []byte) (string, error)

func UploadFileToIPFS

func UploadFileToIPFS(ctx context.Context, filePath string) (string, error)

func UploadObjectToIPFS

func UploadObjectToIPFS(ctx context.Context, data interface{}) (string, error)

Types

type InfuraIPFSResponse

type InfuraIPFSResponse struct {
	// {
	// 	"Name": "sample-result.json",
	// 	"Hash": "QmSTkR1kkqMuGEeBS49dxVJjgHRMH6cUYa7D3tcHDQ3ea3",
	// 	"Size": "2120"
	// }
	Name string
	Hash string
	Size string
}

Jump to

Keyboard shortcuts

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