Documentation ¶
Index ¶
Constants ¶
const AggregateManifestFilename = `@AggregateManifest.ndjson`
AggregateManifestFilename must be a name go-unixfs will sort first in the final structure. Since ADL-free selectors-over-names are currently difficult instead one can simply say "I want the cid of the first link of the root structure" and be reasonably confident they will get to this file.
Variables ¶
var CurrentManifestPreamble = ManifestPreamble{ Version: 1, RecordType: DagAggregatePreamble, }
CurrentManifestPreamble is always encoded as the very first line within the AggregateManifestFilename
Functions ¶
func EncodeManifestJSON ¶ added in v0.2.0
func EncodeManifestJSON(aggregateManifestEntries []*ManifestDagEntry, jsonFile io.Writer) error
EncodeManifestJSON turns a set of manifest entries into the final NDJSON file included at the root of the aggregate structure.
Types ¶
type AggregateDagEntry ¶
type ManifestDagEntry ¶
type ManifestDagEntry struct { RecordType RecordType DagCidV1 string DagCidV0 string `json:",omitempty"` DagSize *uint64 `json:",omitempty"` NodeCount *uint64 `json:",omitempty"` PathPrefixes [2]string // not repeating the DagCid as segment#3 - too long PathIndexes [3]int // contains filtered or unexported fields }
func Aggregate ¶
func Aggregate(ctx context.Context, ds ipldformat.DAGService, toAggregate []AggregateDagEntry) (aggregateRoot cid.Cid, aggregateManifestEntries []*ManifestDagEntry, err error)
Aggregate de-duplicates and orders the supplied list of `AggregateDagEntry`-es and adds them into a two-level UnixFSv1 directory structure. The intermediate blocks comprising the directory tree and the manifest json file are written to the supplied DAGService. No "temporary blocks" are produced in the process: everything written to the DAGService is part of the final DAG capped by the final `aggregateRoot`.
type ManifestPreamble ¶
type ManifestPreamble struct { RecordType RecordType Version uint32 }
type ManifestSummary ¶
type ManifestSummary struct { RecordType RecordType EntryCount int EntriesSortedBy string Description string }
type RecordType ¶
type RecordType string
const ( DagAggregatePreamble RecordType = `DagAggregatePreamble` DagAggregateSummary RecordType = `DagAggregateSummary` DagAggregateEntry RecordType = `DagAggregateEntry` )
Directories ¶
Path | Synopsis |
---|---|
cmd
|
|
fil-daggregator
Module
|
|
lib
|
|
rambs
Package rambs is an implementation of a blockstore, keeping records indexed by full CIDs instead of just multihashes.
|
Package rambs is an implementation of a blockstore, keeping records indexed by full CIDs instead of just multihashes. |