hive

package
v0.0.0-...-cd1225d Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2019 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DNSTimeout = 5 * time.Second

DNSTimeout is used when resolving DNS multiaddresses in this module

View Source
var HiveRequestTimeout = 60 * 5 * time.Second

Functions

This section is empty.

Types

type Connector

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

Connector implements the IPFSConnector interface and provides a component which is used to perform on-demand requests against the configured IPFS daemom (such as a pin request).

func NewConnector

func NewConnector(nodeAddr string) (*Connector, error)

NewConnector creates the component and leaves it ready to be started

func (*Connector) FileAdd

func (ipfs *Connector) FileAdd(fname string, reader io.Reader) (ObjectEntry, error)

add file

func (*Connector) FileGet

func (ipfs *Connector) FileGet(path string) ([]byte, error)

get file from IPFS service

func (*Connector) FileLs

func (ipfs *Connector) FileLs(path string) (respFilesLs, error)

list file or directory

func (*Connector) FilesCp

func (ipfs *Connector) FilesCp(l []string) error

copy file to Hive

func (*Connector) FilesFlush

func (ipfs *Connector) FilesFlush(uid string, path string) error

file flushs

func (*Connector) FilesLs

func (ipfs *Connector) FilesLs(uid string, path string) (respFilesLs, error)

list file or directory

func (*Connector) FilesMkdir

func (ipfs *Connector) FilesMkdir(uid string, path string, parents bool) error

create a directotry

func (*Connector) FilesMv

func (ipfs *Connector) FilesMv(uid string, path string, dest string) error

move files

func (*Connector) FilesRead

func (ipfs *Connector) FilesRead(uid, path string) ([]byte, error)

read file

func (*Connector) FilesRm

func (ipfs *Connector) FilesRm(uid string, path string, recursive bool) error

remove file

func (*Connector) FilesStat

func (ipfs *Connector) FilesStat(uid string, path string) (respFilesStat, error)

get file statistic

func (*Connector) FilesWrite

func (ipfs *Connector) FilesWrite(uid string, path string, offset int64, create bool, truncate bool, count int, byteBuf *bytes.Buffer) error

write file

func (*Connector) Mkdir

func (ipfs *Connector) Mkdir() (respObjectLink, error)

add file

func (*Connector) NamePublish

func (ipfs *Connector) NamePublish(uid string, id string) (respNamePublish, error)

NamePublish publish ipfs path with uid

func (ipfs *Connector) ObjPatchAddlink(rootHash string, fname string, object string) (respObjectLink, error)

ObjPatchAddlink

func (*Connector) UidInfo

func (ipfs *Connector) UidInfo(uid string) (respUIDSecret, error)

log in Hive cluster and get new id

func (*Connector) UidNew

func (ipfs *Connector) UidNew(name string) (respUIDSecret, error)

create a virtual id.

func (*Connector) UidRenew

func (ipfs *Connector) UidRenew(l []string) (respUIDRenew, error)

log in Hive cluster and get new id

type FileLsEntry

type FileLsEntry struct {
	Name string
	Type int
	Size uint64
	Hash string
}

map to ipld.Link

type ObjectEntry

type ObjectEntry struct {
	Name string
	Hash string
	Size uint64
}

Jump to

Keyboard shortcuts

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