utils

package
v0.0.0-...-5de6587 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2021 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CalculateFileCID

func CalculateFileCID(f string, node *core.IpfsNode) (string, error)

Calculates a file CID

func CalculateRootCid

func CalculateRootCid(rootPath string, node *core.IpfsNode) (string, error)

Calculate the RootCid for a given set of files rootPath: root folder to group the files

func InitIpfsNode

func InitIpfsNode() (*core.IpfsNode, error)

Types

type FileMetadata

type FileMetadata struct {
	Cid  string `json:"cid" validate:"required"`
	Name string `json:"name" validate:"required"`
}

func ToFileData

func ToFileData(workDir string, node *core.IpfsNode) ([]*FileMetadata, error)

Jump to

Keyboard shortcuts

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