ipfs

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2022 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package ipfs defines a storage based on InterPlanetary File System.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewShell

func NewShell(config Config) *shell.Shell

Types

type Config

type Config struct {
	IPFSDaemonPort string `envconfig:"IPFS_DAEMON_PORT" default:"5001"`
	IPFSDaemonHost string `envconfig:"IPFS_DAEMON_HOST" required:"true"`
}

type DaemonStorage

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

DaemonStorage is IPFS-based storage.ContentStorage interface implementation

func NewStorage

func NewStorage(sh *shell.Shell, codec storage.Codec) *DaemonStorage

func (*DaemonStorage) Read

func (s *DaemonStorage) Read(ctx context.Context, cid cid.Cid) (storage.ProtoDecodable, error)

func (*DaemonStorage) Write

func (s *DaemonStorage) Write(ctx context.Context, message proto.Message) (cid.Cid, error)

Jump to

Keyboard shortcuts

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