class Agate::ODB

Overview

The git object database for raw object storage and retrieval.

Defined in:

agate/odb.cr
agate/odb_backend.cr

Instance Method Summary

Instance Method Detail

def add_alternate(backend : ODBBackend, priority : Int32 = 1) : Nil #

Adds a custom backend as an alternate to this ODB. Alternates are consulted for reads but not writes. After calling this, libgit2 owns the backend.


[View source]
def add_backend(backend : ODBBackend, priority : Int32 = 1) : Nil #

Adds a custom backend to this ODB with the given priority. Higher priority backends are consulted first. After calling this, libgit2 owns the backend.


[View source]
def free : Nil #

Explicitly frees the underlying ODB handle. Safe to call multiple times.


[View source]
def read(oid : OID) : OdbObject #

Reads a raw object by OID.


[View source]
def read_header(oid : OID) : Tuple(Object::Type, UInt64) #

Reads just the header (type + size) of an object.


[View source]
def write(data : Bytes | String, type : Object::Type) : OID #

Writes raw data to the ODB, returning the OID.


[View source]