jsstore

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2020 License: MIT Imports: 11 Imported by: 0

Documentation

Rendered for js/wasm

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(bridged js.Value) nodestore.DagStore

New expects a javascript ipfs-block-service (javascript flavor) and wraps it to make it compatible with the nodestore.DagStore interface (which is currently just format.DagService)

Types

type JSStore

type JSStore struct {
	nodestore.DagStore
	// contains filtered or unexported fields
}

JSStore is a go wrapper to use a javascript nodestore from wasm it implements the nodestore.DagStore interface after being passed an underlying javascript block-service implementation (for instance: https://github.com/ipfs/js-ipfs-block-service )

func (*JSStore) Add

func (jss *JSStore) Add(ctx context.Context, n format.Node) error

func (*JSStore) AddMany

func (jss *JSStore) AddMany(ctx context.Context, nodes []format.Node) error

func (*JSStore) Get

func (jss *JSStore) Get(ctx context.Context, c cid.Cid) (format.Node, error)

func (*JSStore) GetMany

func (jss *JSStore) GetMany(ctx context.Context, cids []cid.Cid) <-chan *format.NodeOption

func (*JSStore) Remove

func (jss *JSStore) Remove(ctx context.Context, c cid.Cid) error

func (*JSStore) RemoveMany

func (jss *JSStore) RemoveMany(ctx context.Context, cids []cid.Cid) error

Jump to

Keyboard shortcuts

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