block

package
v0.0.0-...-1e43bc6 Latest Latest
Warning

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

Go to latest
Published: May 5, 2020 License: Apache-2.0, MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CodecRaw uint = 0x55
	CodecPB  uint = 0x70
)

Variables

View Source
var AvailableHashers = map[string]hasher{
	"none": {
		// contains filtered or unexported fields
	},
	"sha2-256": {
		// contains filtered or unexported fields
	},
	"sha3-512": {
		// contains filtered or unexported fields
	},
	"blake2b-256": {
		// contains filtered or unexported fields
	},
	"murmur3-128": {
		// contains filtered or unexported fields
	},
}

multihash ids come from https://github.com/multiformats/multicodec/blob/master/table.csv

Functions

This section is empty.

Types

type AsyncHashBus

type AsyncHashBus chan<- hashTask

type DataSource

type DataSource struct {
	chunker.Chunk // critically *NOT* a reference, so that DataSource{} is usable on its own
	Content       *zcpstring.ZcpString
}
type Header struct {
	// contains filtered or unexported fields
}

func RawDataLeaf

func RawDataLeaf(ds DataSource, bm Maker) *Header

func (*Header) Cid

func (h *Header) Cid() []byte

func (*Header) CidBase32

func (h *Header) CidBase32() string

func (*Header) Content

func (h *Header) Content() (c *zcpstring.ZcpString)

func (*Header) DummyHashed

func (h *Header) DummyHashed() bool

func (*Header) EvictContent

func (h *Header) EvictContent()

func (*Header) IsInlined

func (h *Header) IsInlined() bool

func (*Header) IsSparse

func (h *Header) IsSparse() bool

func (*Header) SizeBlock

func (h *Header) SizeBlock() int

func (*Header) SizeCumulativeDag

func (h *Header) SizeCumulativeDag() uint64

func (*Header) SizeCumulativePayload

func (h *Header) SizeCumulativePayload() uint64
func (h *Header) SizeLinkSection() int

func (*Header) String

func (h *Header) String() string

type Maker

type Maker func(
	blockContent *zcpstring.ZcpString,
	codecID uint,
	sizePayload uint64,
	sizeSubDag uint64,
	sizeLinkSection int,
) *Header

func MakerFromConfig

func MakerFromConfig(
	hashAlg string,
	cidHashSize int,
	inlineMaxSize int,
	maxAsyncHashers int,
) (maker Maker, asyncHashQueue chan hashTask, errString string)

Jump to

Keyboard shortcuts

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