Documentation
¶
Index ¶
- func ControlFieldsToStore(fields map[string]string) map[string]string
- func FormatPackagesEntry(e models.DebPackageEntry) string
- func GetInReleasePath(distribution string) string
- func GetPoolPath(component, packageName, _, filename string) string
- func GetReleaseGPGPath(distribution string) string
- func GetReleasePath(distribution string) string
- func IndexEntry(e models.DebPackageEntry) pkgdeb.IndexEntry
- func NewRelease(dist string) *pkgdeb.Release
- func StreamPackages(ctx context.Context, database StreamPackagesStore, ...) (int64, error)
- func StreamRelease(ctx context.Context, database StreamReleaseStore, repoID, dist string, ...) error
- type HTTPHandler
- type HTTPStore
- type StreamPackagesStore
- type StreamReleaseStore
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ControlFieldsToStore ¶ added in v0.2.0
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 GetPoolPath ¶
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 GetReleasePath ¶
func IndexEntry ¶ added in v0.24.0
func IndexEntry(e models.DebPackageEntry) pkgdeb.IndexEntry
IndexEntry converts a stored package entry into the entry pkgformat renders.
func NewRelease ¶ added in v0.24.0
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 (*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.