Documentation
¶
Overview ¶
Package alpine implements Alpine APK v2 package and index metadata.
Index ¶
- Constants
- func EncodeIndex(entries []Package, description, keyName string, key *rsa.PrivateKey) ([]byte, error)
- func ParseIndexPath(p string) (branch, component, arch string, ok bool)
- func ParsePath(p string) (branch, component, arch, file string, ok bool)
- func Serves(t repo.PackageType) bool
- func SigningKey(ctx context.Context, st store.Store, c repo.Config) (string, *rsa.PrivateKey, error)
- type Handler
- func (Handler) Admit(ctx context.Context, env format.Env, c repo.Config, w format.Write) (format.Write, error)
- func (Handler) Classify(_ repo.Config, path string) format.Class
- func (Handler) Deleted(ctx context.Context, env format.Env, c repo.Config, removed []types.Item) error
- func (Handler) Deleting(ctx context.Context, env format.Env, c repo.Config, it 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) Owed(c repo.Config, cached bool, path string) []format.WorkRef
- func (Handler) Reindex(ctx context.Context, env format.Env, c repo.Config) error
- func (Handler) Work(ctx context.Context, env format.Env, work types.WorkItem) error
- func (Handler) WorkKinds() []string
- type Package
Constants ¶
const ( KindIndex = "alpine.index" IndexName = "APKINDEX.tar.gz" PropName = "alpine.name" PropVersion = "alpine.version" PropBranch = "alpine.branch" PropComponent = "alpine.repository" PropArchitecture = "alpine.architecture" )
Variables ¶
This section is empty.
Functions ¶
func EncodeIndex ¶
func EncodeIndex( entries []Package, description, keyName string, key *rsa.PrivateKey, ) ([]byte, error)
EncodeIndex writes the APKINDEX.tar.gz stream, optionally prepending a signature stream using the same RSA wire form as abuild-sign. The key name must match the basename placed in the client's /etc/apk/keys directory.
func ParseIndexPath ¶
ParseIndexPath recognizes the branch/component/architecture APKINDEX layout.
func ParsePath ¶
ParsePath accepts the branch/component/architecture/name-version.apk layout documented by Artifactory. It does not infer identity from a filename alone.
func Serves ¶
func Serves(t repo.PackageType) bool
func SigningKey ¶
func SigningKey( ctx context.Context, st store.Store, c repo.Config, ) (string, *rsa.PrivateKey, error)
SigningKey selects the repository's configured apk signing pair. Virtual repositories use keyPair; local and federated repositories use the primary keypair shared with Artifactory's public-key download endpoint.
Types ¶
type Handler ¶
type Package ¶
type Package struct {
Name, Version, Architecture string
Branch, Component string
Path string
ArchiveSize int64
InstalledSize int64
Description, URL, License string
Origin, Maintainer, Commit string
BuildTime int64
Depends, Provides, InstallIf []string
ControlSHA1 string
IndexRaw string
}
Package is the native metadata extracted from a validated APK v2 archive.
func DecodeIndex ¶
DecodeIndex validates an apk v2 index and returns the exact package records. Source records remain byte-for-byte intact when a virtual index is rebuilt.
func ReadPackage ¶
ReadPackage validates the bounded control streams and the optional datahash, then extracts only metadata that belongs in APKINDEX. The caller provides the stored blob, so the same check can guard local and remote data.
func (Package) IndexRecord ¶
IndexRecord renders the apk-tools v2 one-letter metadata fields. Values come from bounded .PKGINFO parsing, not from client-supplied index text.