Documentation
¶
Overview ¶
Package blob handles content-addressed blob storage in Fossil repository databases.
Fossil's blob format is a 4-byte big-endian uncompressed-size prefix followed by zlib-compressed data. Compress and Decompress handle this encoding transparently.
Store compresses content, computes its SHA1 hash, and inserts it into the blob table. StoreDelta does the same for delta-encoded blobs and records the delta relationship. Load retrieves and decompresses a blob by RID.
Index ¶
- func Compress(data []byte) (result []byte, err error)
- func Decompress(data []byte) (result []byte, err error)
- func Exists(q db.Querier, uuid string) (libfossil.FslID, bool)
- func Load(q db.Querier, rid libfossil.FslID) (result []byte, err error)
- func Store(q db.Querier, content []byte) (rid libfossil.FslID, uuid string, err error)
- func StoreDelta(q db.Querier, content []byte, srcRid libfossil.FslID) (rid libfossil.FslID, uuid string, err error)
- func StorePhantom(q db.Querier, uuid string) (rid libfossil.FslID, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Compress ¶
Compress produces Fossil-compatible compressed blob content: [4-byte big-endian uncompressed size][zlib-compressed data]. This matches Fossil's blob_compress() in src/blob.c.
func Decompress ¶
Decompress handles Fossil's compressed blob format: [4-byte big-endian uncompressed size][zlib-compressed data]. The 4-byte prefix is skipped before decompressing.
func StoreDelta ¶
Types ¶
This section is empty.