iscn

package
v0.0.0-...-b62d79f Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2020 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BlockDecoder

func BlockDecoder(block goblocks.Block) (node.Node, error)

BlockDecoder takes care of the iscn-block IPLD objects (ISCN block headers)

Types

type Block

type Block struct {
	Version int    `json:"version"`
	ID      string `json:"id"`
	Owner   string `json:"owner"`
	Edition int    `json:"edition"`
	Hash    string `json:"hash"`
	// contains filtered or unexported fields
}

Block (iscn-block, codec 0x0264), represents an ISCN block header

func NewISCNBlock

func NewISCNBlock(m map[string]interface{}) (*Block, error)

NewISCNBlock creates a iscn-block IPLD object

func (*Block) Cid

func (b *Block) Cid() cid.Cid

Cid returns the CID of the block header

func (*Block) Copy

func (*Block) Copy() node.Node

Copy will go away. It is here to comply with the Node interface.

func (*Block) Links() []*node.Link

Links is a helper function that returns all links within this object HINT: Use `ipfs refs <cid>`

func (*Block) Loggable

func (*Block) Loggable() map[string]interface{}

Loggable returns a map the type of IPLD Link

func (*Block) RawData

func (b *Block) RawData() []byte

RawData returns the binary of the CBOR encode of the block header

func (*Block) Resolve

func (*Block) Resolve(path []string) (interface{}, []string, error)

Resolve resolves a path through this node, stopping at any link boundary and returning the object found as well as the remaining path to traverse

func (*Block) ResolveLink(path []string) (*node.Link, []string, error)

ResolveLink is a helper function that allows easier traversal of links through blocks

func (*Block) Size

func (*Block) Size() (uint64, error)

Size will go away. It is here to comply with the Node interface.

func (*Block) Stat

func (*Block) Stat() (*node.NodeStat, error)

Stat will go away. It is here to comply with the Node interface.

func (*Block) String

func (*Block) String() string

String is a helper for output

func (*Block) Tree

func (*Block) Tree(path string, depth int) []string

Tree lists all paths within the object under 'path', and up to the given depth. To list the entire object (similar to `find .`) pass "" and -1

Jump to

Keyboard shortcuts

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