blob

package
v0.6.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 12, 2026 License: MIT Imports: 10 Imported by: 0

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

Constants

This section is empty.

Variables

This section is empty.

Functions

func Compress

func Compress(data []byte) (result []byte, err error)

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

func Decompress(data []byte) (result []byte, err error)

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 Exists

func Exists(q db.Querier, uuid string) (libfossil.FslID, bool)

func Load

func Load(q db.Querier, rid libfossil.FslID) (result []byte, err error)

func Store

func Store(q db.Querier, content []byte) (rid libfossil.FslID, uuid string, err error)

func StoreDelta

func StoreDelta(q db.Querier, content []byte, srcRid libfossil.FslID) (rid libfossil.FslID, uuid string, err error)

func StorePhantom

func StorePhantom(q db.Querier, uuid string) (rid libfossil.FslID, err error)

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL