ipldbind

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2019 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bind

func Bind(bindme interface{}, atl atlas.Atlas) ipld.Node

Bind binds any go value into being interfacable as a Node, using the provided atlas to understand how to traverse it.

Types

type Node

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

Node binds to some Go object in memory, using the definitions provided by refmt's object atlasing tools.

This binding does not provide a serialization valid for hashing; to compute a CID, you'll have to convert to another kind of node. If you're not sure which kind serializable node to use, try `ipldcbor.Node`.

func (Node) AsBool

func (n Node) AsBool() (v bool, _ error)

func (Node) AsBytes

func (n Node) AsBytes() (v []byte, _ error)

func (Node) AsFloat

func (n Node) AsFloat() (v float64, _ error)

func (Node) AsInt

func (n Node) AsInt() (v int, _ error)
func (n Node) AsLink() (v ipld.Link, _ error)

func (Node) AsString

func (n Node) AsString() (v string, _ error)

func (Node) IsNull

func (n Node) IsNull() bool

func (Node) IsUndefined

func (Node) IsUndefined() bool

func (Node) Length

func (n Node) Length() int

func (Node) ListIterator

func (n Node) ListIterator() ipld.ListIterator

func (Node) MapIterator

func (n Node) MapIterator() ipld.MapIterator

func (Node) NodeBuilder

func (n Node) NodeBuilder() ipld.NodeBuilder

func (Node) PushTokens

func (n Node) PushTokens(sink shared.TokenSink) error

func (Node) ReprKind

func (n Node) ReprKind() ipld.ReprKind

func (Node) TraverseField

func (n Node) TraverseField(pth string) (ipld.Node, error)

func (Node) TraverseIndex

func (n Node) TraverseIndex(idx int) (ipld.Node, error)

Jump to

Keyboard shortcuts

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