hamt

package module
v0.0.0-...-343485d Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2018 License: MIT Imports: 12 Imported by: 0

README

go-hamt-ipld

Travis CI

A CHAMP HAMT implemented using ipld

Table of Contents

Examples

// TODO

Contribute

PRs are welcome!

Small note: If editing the Readme, please conform to the standard-readme specification.

License

MIT © Whyrusleeping

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotFound = fmt.Errorf("not found")

Functions

This section is empty.

Types

type CborIpldStore

type CborIpldStore struct {
	Blocks blocks
	Atlas  *atlas.Atlas
}

func NewCborStore

func NewCborStore() *CborIpldStore

func (*CborIpldStore) Get

func (s *CborIpldStore) Get(ctx context.Context, c *cid.Cid, out interface{}) error

func (*CborIpldStore) Put

func (s *CborIpldStore) Put(ctx context.Context, v interface{}) (*cid.Cid, error)

type KV

type KV struct {
	Key   string
	Value interface{}
}

type Node

type Node struct {
	Bitfield *big.Int   `refmt:"bf"`
	Pointers []*Pointer `refmt:"p"`
	// contains filtered or unexported fields
}

func LoadNode

func LoadNode(ctx context.Context, cs *CborIpldStore, c *cid.Cid) (*Node, error)

func NewNode

func NewNode(cs *CborIpldStore) *Node

func (*Node) Copy

func (n *Node) Copy() *Node

func (*Node) Delete

func (n *Node) Delete(ctx context.Context, k string) error

func (*Node) Find

func (n *Node) Find(ctx context.Context, k string) (interface{}, error)

func (*Node) Flush

func (n *Node) Flush(ctx context.Context) error

func (*Node) Set

func (n *Node) Set(ctx context.Context, k string, v interface{}) error

type Pointer

type Pointer struct {
	KVs  []*KV    `refmt:"v,omitempty"`
	Link *cid.Cid `refmt:"l,omitempty"`
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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