Versions in this module Expand all Collapse all v1 v1.6.0 Jun 2, 2026 Changes in this version + var ErrNoConsumer = errors.New("no consumer configured for LFS resolution") + var ErrNoStreamFetcher = errors.New("no stream fetcher configured for streaming access") + func ComputeChecksum(alg ChecksumAlg, data []byte) (string, error) + func EncodeEnvelope(env Envelope) ([]byte, error) + func IsLfsEnvelope(value []byte) bool + func NewChecksumHasher(alg ChecksumAlg) (hash.Hash, error) + type BlobFetcher interface + Fetch func(ctx context.Context, key string) ([]byte, error) + type ChecksumAlg string + const ChecksumCRC32 + const ChecksumMD5 + const ChecksumNone + const ChecksumSHA256 + func EnvelopeChecksum(env Envelope) (ChecksumAlg, string, bool, error) + func NormalizeChecksumAlg(raw string) (ChecksumAlg, error) + type ChecksumError struct + Actual string + Expected string + func (e *ChecksumError) Error() string + type Consumer struct + func NewConsumer(fetcher BlobFetcher, opts ...ConsumerOption) *Consumer + func (c *Consumer) Unwrap(ctx context.Context, value []byte) (*Envelope, []byte, error) + type ConsumerOption func(*Consumer) + func WithChecksumValidation(enabled bool) ConsumerOption + type Envelope struct + Bucket string + Checksum string + ChecksumAlg string + ContentType string + CreatedAt string + Key string + OriginalHeaders map[string]string + ProxyID string + SHA256 string + Size int64 + Version int + func DecodeEnvelope(data []byte) (Envelope, error) + type LfsError struct + Err error + Op string + func (e *LfsError) Error() string + func (e *LfsError) Unwrap() error + type ProduceResult struct + BytesSent int64 + Duration time.Duration + Envelope Envelope + type Producer struct + func NewProducer(endpoint string, opts ...ProducerOption) *Producer + func (p *Producer) Produce(ctx context.Context, topic, key string, body io.Reader) (*ProduceResult, error) + func (p *Producer) ProducePartitioned(ctx context.Context, topic string, partition int32, key string, body io.Reader) (*ProduceResult, error) + func (p *Producer) ProduceWithChecksum(ctx context.Context, topic, key string, body io.Reader, expectedSHA256 string) (*ProduceResult, error) + type ProducerOption func(*Producer) + func WithAPIKey(key string) ProducerOption + func WithContentType(ct string) ProducerOption + func WithHTTPClient(client *http.Client) ProducerOption + func WithProgress(fn ProgressFunc) ProducerOption + func WithRetry(maxRetries int, delay time.Duration) ProducerOption + type ProgressFunc func(bytesSent int64) error + type Record struct + func NewRecord(raw []byte, consumer *Consumer, opts ...RecordOption) *Record + func (r *Record) ContentType() string + func (r *Record) Envelope() (*Envelope, error) + func (r *Record) IsLFS() bool + func (r *Record) Raw() []byte + func (r *Record) Size() (int64, error) + func (r *Record) Value(ctx context.Context) ([]byte, error) + func (r *Record) ValueStream(ctx context.Context) (io.ReadCloser, int64, error) + type RecordOption func(*Record) + func WithRecordChecksumValidation(enabled bool) RecordOption + func WithStreamFetcher(fetcher StreamFetcher) RecordOption + type ResolvedRecord struct + BlobSize int64 + Checksum string + ChecksumAlg string + ContentType string + Envelope Envelope + Payload []byte + type Resolver struct + func NewResolver(cfg ResolverConfig, s3 S3Reader) *Resolver + func (r *Resolver) Resolve(ctx context.Context, value []byte) (ResolvedRecord, bool, error) + type ResolverConfig struct + MaxSize int64 + ValidateChecksum bool + type S3Client struct + func NewS3Client(ctx context.Context, cfg S3Config) (*S3Client, error) + func (c *S3Client) Fetch(ctx context.Context, key string) ([]byte, error) + func (c *S3Client) Stream(ctx context.Context, key string) (io.ReadCloser, int64, error) + type S3Config struct + AccessKeyID string + Bucket string + Endpoint string + ForcePathStyle bool + Region string + SecretAccessKey string + SessionToken string + type S3Reader interface + Fetch func(ctx context.Context, key string) ([]byte, error) + Stream func(ctx context.Context, key string) (io.ReadCloser, int64, error) + type StreamFetcher interface + Stream func(ctx context.Context, key string) (io.ReadCloser, int64, error)