Documentation ¶
Index ¶
- Variables
- func GenerateDummyDirectory(path string, maxItems int, maxDepth int)
- func GetHash(hash string) string
- func GetLabel(hash string) string
- func HasLabel(hash string) bool
- func SetChunkSize(size int)
- type ClassicTreeBranch
- type Dag
- func (dag *Dag) CreateDirectory(path string) error
- func (dag *Dag) GetContentFromLeaf(leaf *DagLeaf) ([]byte, error)
- func (d *Dag) IterateDag(processLeaf func(leaf *DagLeaf, parent *DagLeaf) error) error
- func (dag *Dag) ToCBOR() ([]byte, error)
- func (dag *Dag) ToJSON() ([]byte, error)
- func (dag *Dag) Verify() error
- type DagBuilder
- type DagLeaf
- func (leaf *DagLeaf) AddLink(hash string)
- func (leaf *DagLeaf) Clone() *DagLeaf
- func (leaf *DagLeaf) CreateDirectoryLeaf(path string, dag *Dag) error
- func (leaf *DagLeaf) GetBranch(key string) (*ClassicTreeBranch, error)
- func (leaf *DagLeaf) HasLink(hash string) bool
- func (leaf *DagLeaf) SetLabel(label string)
- func (leaf *DagLeaf) VerifyBranch(branch *ClassicTreeBranch) error
- func (leaf *DagLeaf) VerifyLeaf() error
- func (leaf *DagLeaf) VerifyRootLeaf() error
- type DagLeafBuilder
- func (b *DagLeafBuilder) AddLink(label string, hash string)
- func (b *DagLeafBuilder) BuildLeaf(additionalData map[string]string) (*DagLeaf, error)
- func (b *DagLeafBuilder) BuildRootLeaf(dag *DagBuilder, additionalData map[string]string) (*DagLeaf, error)
- func (b *DagLeafBuilder) SetData(data []byte)
- func (b *DagLeafBuilder) SetType(leafType LeafType)
- type LeafType
- type MetaData
Constants ¶
This section is empty.
Variables ¶
View Source
var ChunkSize = 2048 * 1024 // 2048 * 1024 bytes = 2 megabytes
Functions ¶
func GenerateDummyDirectory ¶
func SetChunkSize ¶
func SetChunkSize(size int)
Types ¶
type ClassicTreeBranch ¶
type ClassicTreeBranch struct { Leaf string Proof *merkletree.Proof }
type DagBuilder ¶
func CreateDagBuilder ¶
func CreateDagBuilder() *DagBuilder
func (*DagBuilder) BuildDag ¶
func (b *DagBuilder) BuildDag(root string) *Dag
func (*DagBuilder) GetLatestLabel ¶
func (b *DagBuilder) GetLatestLabel() string
func (*DagBuilder) GetNextAvailableLabel ¶
func (b *DagBuilder) GetNextAvailableLabel() string
type DagLeaf ¶
type DagLeaf struct { Hash string ItemName string Type LeafType ContentHash []byte Content []byte ClassicMerkleRoot []byte CurrentLinkCount int LatestLabel string LeafCount int Links map[string]string ParentHash string AdditionalData map[string]string }
func CreateDummyLeaf ¶
func (*DagLeaf) CreateDirectoryLeaf ¶
func (*DagLeaf) VerifyBranch ¶
func (leaf *DagLeaf) VerifyBranch(branch *ClassicTreeBranch) error
func (*DagLeaf) VerifyLeaf ¶
func (*DagLeaf) VerifyRootLeaf ¶
type DagLeafBuilder ¶
type DagLeafBuilder struct { ItemName string Label int64 LeafType LeafType Data []byte Links map[string]string }
func CreateDagLeafBuilder ¶
func CreateDagLeafBuilder(name string) *DagLeafBuilder
func (*DagLeafBuilder) AddLink ¶
func (b *DagLeafBuilder) AddLink(label string, hash string)
func (*DagLeafBuilder) BuildLeaf ¶
func (b *DagLeafBuilder) BuildLeaf(additionalData map[string]string) (*DagLeaf, error)
func (*DagLeafBuilder) BuildRootLeaf ¶
func (b *DagLeafBuilder) BuildRootLeaf(dag *DagBuilder, additionalData map[string]string) (*DagLeaf, error)
func (*DagLeafBuilder) SetData ¶
func (b *DagLeafBuilder) SetData(data []byte)
func (*DagLeafBuilder) SetType ¶
func (b *DagLeafBuilder) SetType(leafType LeafType)
Click to show internal directories.
Click to hide internal directories.