Documentation
¶
Overview ¶
Package swift implements the Swift package registry's stored archive format.
Index ¶
- Constants
- func Serves(t repo.PackageType) bool
- func ValidName(s string) bool
- func ValidScope(s string) bool
- func ValidVersion(v string) bool
- type Archive
- type Handler
- func (h Handler) Admit(ctx context.Context, env format.Env, c repo.Config, w format.Write) (format.Write, error)
- func (Handler) Classify(_ repo.Config, _ string) format.Class
- func (Handler) Deleted(context.Context, format.Env, repo.Config, []types.Item) error
- func (Handler) Deleting(context.Context, format.Env, repo.Config, types.Item) error
- func (Handler) Deployed(ctx context.Context, env format.Env, c repo.Config, it types.Item) error
- func (Handler) Inspect(ctx context.Context, env format.Env, _ repo.Config, w format.Write) (any, error)
- func (Handler) Reindex(ctx context.Context, env format.Env, c repo.Config) error
- type Package
Constants ¶
const (
MaxArchiveBytes = 512 << 20
)
Variables ¶
This section is empty.
Functions ¶
func Serves ¶
func Serves(t repo.PackageType) bool
func ValidScope ¶
ValidScope and ValidName implement the registry specification's grammar, including the different maximum lengths and separator rules.
func ValidVersion ¶
Types ¶
type Archive ¶
Archive describes a completely validated source ZIP. Manifests are kept bounded in memory; all other members are read to EOF so CRC, size and truncated-stream errors are checked before a release can be published.
type Handler ¶
Handler keeps the package index derived from immutable source archives. Every write path, including ordinary item PUT, copy and restore, passes through these hooks so no malformed source is advertised to SwiftPM.
type Package ¶
type Package struct {
Scope, Name, Version string
}
Package is a Swift registry identity. A release has one immutable source archive at the Artifactory layout documented for local Swift repositories.
func ParseArchivePath ¶
ParseArchivePath accepts only the documented local archive layout. It never interprets another generic item as a Swift release.