ipfs

package
v0.0.28-pre-dev Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2020 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotFound = errors.New("not found")
)

Functions

func DownloadIpfsItem added in v0.0.19

func DownloadIpfsItem(ctx context.Context, gatewayUrl string, cid cid.Cid) (io.ReadCloser, error)

func GetFileHash

func GetFileHash(r io.Reader) (string, error)

func NewDagService

func NewDagService() *mapBasedDag

Types

type AddItemResult added in v0.0.10

type AddItemResult struct {
	Error    error
	Resolved path.Resolved
}

type Client added in v0.0.10

type Client interface {
	AddItems(ctx context.Context, items []io.Reader) []AddItemResult
	AddItem(ctx context.Context, item io.Reader) AddItemResult
	// Links each of the nodes in the input under the same parent
	LinkNodes(ctx context.Context, nodes []LinkNodesInput) (*LinkNodesResult, error)
	PullItem(ctx context.Context, cid cid.Cid) (io.ReadCloser, error)
}

type LinkNodesInput added in v0.0.10

type LinkNodesInput struct {
	// name of link
	Name string
	Path path.Path
}

type LinkNodesResult added in v0.0.10

type LinkNodesResult struct {
	ParentPath path.Resolved
}

type SpaceIpfsClient added in v0.0.10

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

func NewSpaceIpfsClient added in v0.0.10

func NewSpaceIpfsClient(cfg config.Config) (*SpaceIpfsClient, error)

func (*SpaceIpfsClient) AddItem added in v0.0.10

func (s *SpaceIpfsClient) AddItem(ctx context.Context, item io.Reader) AddItemResult

func (*SpaceIpfsClient) AddItems added in v0.0.10

func (s *SpaceIpfsClient) AddItems(ctx context.Context, items []io.Reader) []AddItemResult

func (*SpaceIpfsClient) LinkNodes added in v0.0.10

func (s *SpaceIpfsClient) LinkNodes(ctx context.Context, nodes []LinkNodesInput) (*LinkNodesResult, error)

func (*SpaceIpfsClient) PullItem added in v0.0.10

func (s *SpaceIpfsClient) PullItem(ctx context.Context, cid cid.Cid) (io.ReadCloser, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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