class
Agate::ODB
- Agate::ODB
- Reference
- Object
Overview
The git object database for raw object storage and retrieval.
Defined in:
agate/odb.cragate/odb_backend.cr
Instance Method Summary
-
#add_alternate(backend : ODBBackend, priority : Int32 = 1) : Nil
Adds a custom backend as an alternate to this ODB.
-
#add_backend(backend : ODBBackend, priority : Int32 = 1) : Nil
Adds a custom backend to this ODB with the given priority.
-
#free : Nil
Explicitly frees the underlying ODB handle.
-
#read(oid : OID) : OdbObject
Reads a raw object by OID.
-
#read_header(oid : OID) : Tuple(Object::Type, UInt64)
Reads just the header (type + size) of an object.
-
#write(data : Bytes | String, type : Object::Type) : OID
Writes raw data to the ODB, returning the OID.
Instance Method Detail
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.
Adds a custom backend to this ODB with the given priority. Higher priority backends are consulted first. After calling this, libgit2 owns the backend.
Reads just the header (type + size) of an object.
Writes raw data to the ODB, returning the OID.