anlblock

package
v0.0.0-...-e7a70b0 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2023 License: Apache-2.0, MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

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

	NulRootCarHeader = "\x19" +

		"\xA2" +

		"\x65" + "roots" +

		"\x81" +

		"\xD8\x2A" +

		"\x45" +

		"\x00\x01\x55\x00\x00" +

		"\x67" + "version" +

		"\x01"
)

Variables

View Source
var AvailableHashers = map[string]hasher{
	"none": {
		// contains filtered or unexported fields
	},
	"sha2-256": {
		// contains filtered or unexported fields
	},
	"sha2-256-gocore": {
		// 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 AsyncHashingBus

type AsyncHashingBus chan<- hashTask

type DataSource

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

func (*Header) Cid

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

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) IsCidInlined

func (h *Header) IsCidInlined() 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

type Maker

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

func MakerFromConfig

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

Jump to

Keyboard shortcuts

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