class Agate::Indexer

Overview

A packfile indexer that builds an index from raw pack data.

indexer = Indexer.new("/path/to/objects/pack")
indexer.append(data)
indexer.commit
puts indexer.name # => "pack-abc123..."

Defined in:

agate/indexer.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(path : String, mode : UInt32 = 0) : Indexer #

Creates a new indexer that will write to the given directory.


[View source]

Instance Method Detail

def append(data : Bytes) : IndexerProgress #

Appends data to the indexer.


[View source]
def commit : IndexerProgress #

Finalizes the pack and writes the index file.


[View source]
def name : String | Nil #

Returns the unique name for the resulting packfile. Only valid after #commit.


[View source]