blobs

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2026 License: MIT Imports: 4 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package blobs is the port for storing content by key outside the database: artifact contents, previews, archives. Implement Blobs over S3, a disk or memory; the engine depends on the interface only.

Index

Constants

This section is empty.

Variables

View Source
var ErrNotFound = errors.New("blob not found")

ErrNotFound means the key is unknown to the blob store.

View Source
var ErrTooLarge = errors.New("blob exceeds the storage limit")

ErrTooLarge means the content exceeds the backend's per-blob cap.

Functions

func PutReader

func PutReader(ctx context.Context, b Blobs, key string, r io.Reader, size int64) error

PutReader stores size bytes read from r: streamed when the backend supports it, else read into memory first (ErrTooLarge above the backend's cap).

Types

type Blobs

type Blobs interface {
	Put(ctx context.Context, key string, data []byte) error
	Get(ctx context.Context, key string) ([]byte, error)
	Has(ctx context.Context, key string) (bool, error)
	// Delete removes a blob (no error when it does not exist).
	Delete(ctx context.Context, key string) error
	// MaxBytes is the per-blob cap (0 = no cap).
	MaxBytes() int64
}

Blobs is the content store; keys are content sha256 (hex) or derived keys such as "preview/<owner tag>/<sha256>.pdf".

type StreamPutter

type StreamPutter interface {
	PutStream(ctx context.Context, key string, r io.Reader, size int64) error
}

StreamPutter is a blob backend that stores content read from r (size bytes) without the caller holding it in memory (uploads, workspace Git archives).

Jump to

Keyboard shortcuts

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