deb

package
v0.26.0 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2026 License: AGPL-3.0 Imports: 18 Imported by: 0 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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ControlFieldsToStore added in v0.2.0

func ControlFieldsToStore(fields map[string]string) map[string]string

ControlFieldsToStore returns the subset of the logical control fields of a package that is persisted at upload, in wire form.

func FormatPackagesEntry added in v0.2.0

func FormatPackagesEntry(e models.DebPackageEntry) string

FormatPackagesEntry renders a complete Packages stanza (terminated by a blank line) for the entry, including a pool-relative Filename.

func GetInReleasePath

func GetInReleasePath(distribution string) string

func GetPoolPath

func GetPoolPath(component, packageName, _, filename string) string

GetPoolPath renders the pool location of a package file (see pkgdeb.PoolPath). The version is not part of the path; it is kept for the callers' symmetry.

func GetReleaseGPGPath

func GetReleaseGPGPath(distribution string) string

func GetReleasePath

func GetReleasePath(distribution string) string

func IndexEntry added in v0.24.0

IndexEntry converts a stored package entry into the entry pkgformat renders.

func NewRelease added in v0.24.0

func NewRelease(dist string) *pkgdeb.Release

NewRelease starts the Release of a distribution the repository publishes. No Valid-Until is set: metadata is only regenerated on upload, so an expiry would make apt reject an idle repository.

func StreamPackages

func StreamPackages(
	ctx context.Context,
	database StreamPackagesStore,
	repoID, dist, comp, arch string,
	compression pkgdeb.Compression,
	w io.Writer,
) (int64, error)

StreamPackages writes a Packages file for the given distribution/component/arch directly to w, applying the requested compression. Returns the number of bytes written and any error.

func StreamRelease

func StreamRelease(ctx context.Context, database StreamReleaseStore, repoID, dist string, w io.Writer) error

StreamRelease writes a Release file for the given distribution directly to w. It queries all components and architectures from the database and generates the Release header. Checksum entries are omitted (no pre-computed blobs); clients that require checksums should use the pre-generated blob path.

Types

type HTTPHandler

type HTTPHandler struct {
	// contains filtered or unexported fields
}

func NewHTTPHandler

func NewHTTPHandler(log *logger.Logger, database HTTPStore, blobStore storage.BlobStore) *HTTPHandler

func (*HTTPHandler) RegisterRepoRoutes

func (h *HTTPHandler) RegisterRepoRoutes(r chi.Router)

RegisterRepoRoutes registers Debian-specific routes on the provided sub-router. It does NOT wrap in r.Route() — callers are responsible for the path prefix.

type HTTPStore added in v0.15.0

type HTTPStore interface {
	quarantine.Checker
	StreamPackagesStore
	StreamReleaseStore
	GetComponentByFilename(ctx context.Context, repoID string, filename string) (*models.Component, error)
	GetRepoMetadataByPath(ctx context.Context, repositoryID string, path string) (*models.RepoMetadata, error)
	GetRepositoryByName(ctx context.Context, name string) (*models.Repository, error)
}

HTTPStore is the part of the database HTTPHandler needs.

type StreamPackagesStore added in v0.15.0

type StreamPackagesStore interface {
	ListDebPackageEntries(ctx context.Context, repoID string, dist string, comp string, arch string) ([]models.DebPackageEntry, error)
}

StreamPackagesStore is the part of the database StreamPackages needs.

type StreamReleaseStore added in v0.15.0

type StreamReleaseStore interface {
	GetDebianArchitecturesByDist(ctx context.Context, distID string) ([]models.DebianArchitecture, error)
	GetDebianComponentsByDist(ctx context.Context, distID string) ([]models.DebianComponent, error)
	GetDebianDistributionsByRepo(ctx context.Context, repoID string) ([]models.DebianDistribution, error)
}

StreamReleaseStore is the part of the database StreamRelease needs.

Jump to

Keyboard shortcuts

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