ipfs

package
v0.19.4 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2020 License: LGPL-3.0 Imports: 42 Imported by: 3

Documentation

Index

Constants

View Source
const (
	CidLength        = 36
	ZeroPeersTimeout = 2 * time.Minute
)

Variables

View Source
var (
	EmptyCid cid.Cid
	MinCid   [CidLength]byte
	MaxCid   [CidLength]byte
)

Functions

func GetVersion

func GetVersion(ipfsdir string) (int, error)

func Migrate

func Migrate(ipfsdir string, to int) error

Types

type DataType added in v0.19.2

type DataType = uint32
const (
	Block DataType = 1
	Flip  DataType = 2
)

type Proxy

type Proxy interface {
	Add(data []byte, pin bool) (cid.Cid, error)
	Get(key []byte) ([]byte, error)
	LoadTo(key []byte, to io.Writer, ctx context.Context, onLoading func(size, loaded int64)) error
	Pin(key []byte) error
	Unpin(key []byte) error
	Cid(data []byte) (cid.Cid, error)
	Port() int
	PeerId() string
	AddFile(absPath string, data io.ReadCloser, fi os.FileInfo) (cid.Cid, error)
	Host() core2.Host
	ShouldPin(dataType DataType) bool
}

func NewIpfsProxy

func NewIpfsProxy(cfg *config.IpfsConfig, bus eventbus.Bus) (Proxy, error)

func NewMemoryIpfsProxy

func NewMemoryIpfsProxy() Proxy

Jump to

Keyboard shortcuts

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