storage

package
v0.0.0-...-822dead Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2021 License: GPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TestFileToString

func TestFileToString(t *testing.T)

func TestStorage

func TestStorage(t *testing.T)

Types

type IPFSStorage

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

func NewIPFSStore

func NewIPFSStore(url string, folder string) *IPFSStorage

func (IPFSStorage) GetObject

func (s IPFSStorage) GetObject(cid string, payload interface{}) (ok bool)

func (IPFSStorage) ManualDagGet

func (s IPFSStorage) ManualDagGet(cid string, v interface{}) interface{}

func (IPFSStorage) PutObject

func (s IPFSStorage) PutObject(payload interface{}) (st string, err error)

* return the cid, data and eventual error

func (IPFSStorage) StoreFile

func (s IPFSStorage) StoreFile(filename string) (cid string)

Store a file from the file system into IPFS

return its IPFS CID

func (IPFSStorage) TestIPFS

func (s IPFSStorage) TestIPFS()

func (IPFSStorage) UpdateHead

func (s IPFSStorage) UpdateHead(cid string)

type Store

type Store interface {
	GetObject(cid string, payload interface{}) (ok bool)
	PutObject(payload interface{}) (string, error)
	//GetPubKey(cid string) crypto.PublicK
	StoreFile(filename string) (cid string)
	UpdateHead(cid string)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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