Documentation ¶
Index ¶
- Variables
- func Generate(path string, codec IndexCodec) error
- func Save(i Index, path string) error
- type Carbs
- func (c *Carbs) AllKeysChan(ctx context.Context) (<-chan cid.Cid, error)
- func (c *Carbs) DeleteBlock(_ cid.Cid) error
- func (c *Carbs) Get(key cid.Cid) (blocks.Block, error)
- func (c *Carbs) GetSize(key cid.Cid) (int, error)
- func (c *Carbs) Has(key cid.Cid) (bool, error)
- func (c *Carbs) HashOnRead(enabled bool)
- func (c *Carbs) Put(blocks.Block) error
- func (c *Carbs) PutMany([]blocks.Block) error
- func (c *Carbs) Read(idx int64) (cid.Cid, []byte, error)
- func (c *Carbs) Roots() ([]cid.Cid, error)
- type Index
- type IndexCls
- type IndexCodec
- type Record
Constants ¶
This section is empty.
Variables ¶
View Source
var IndexAtlas = map[IndexCodec]IndexCls{ IndexHashed: mkHashed, IndexSorted: mkSorted, IndexSingleSorted: mkSingleSorted, IndexGobHashed: mkGobHashed, }
IndexAtlas holds known index formats
Functions ¶
func Generate ¶
func Generate(path string, codec IndexCodec) error
Generate walks a car file and generates an index of cid->byte offset in it.
Types ¶
type Carbs ¶
type Carbs struct {
// contains filtered or unexported fields
}
Carbs provides a read-only Car Block Store.
func (*Carbs) AllKeysChan ¶
AllKeysChan returns the list of keys in the store
func (*Carbs) DeleteBlock ¶
DeleteBlock doesn't delete a block on RO blockstore
type Index ¶
type Index interface { Codec() IndexCodec Marshal(w io.Writer) error Unmarshal(r io.Reader) error Get(cid.Cid) (uint64, error) Load([]Record) error }
Index provides an interface for figuring out where in the car a given cid begins
func GenerateIndex ¶ added in v0.0.4
GenerateIndex provides a low-level interface to create an index over a reader to a car stream.
type IndexCodec ¶
type IndexCodec int
IndexCodec is used as a multicodec identifier for carbs index files
const ( IndexHashed IndexCodec = iota + 0x300000 IndexSorted IndexSingleSorted IndexGobHashed )
IndexCodec table is a first var-int in carbs indexes
Source Files ¶
Click to show internal directories.
Click to hide internal directories.