Documentation
¶
Overview ¶
Package opkg reads bounded IPK archives and their control metadata.
Index ¶
- Constants
- func Digest(body []byte) string
- func EncodeIndex(packages []Package, feed string) (map[string][]byte, error)
- func Feed(p string) string
- func FeedPath(p string) (string, bool)
- func IndexPath(feed, name string) string
- func IsIndex(p string) bool
- func Serves(t repo.PackageType) bool
- func SignFeed(ctx context.Context, st store.Store, c repo.Config, files map[string][]byte) error
- func ValidPath(p string) bool
- func ValidateRelease(body []byte) 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, p 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, p 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 = "opkg.index" PropName = "opkg.name" PropVersion = "opkg.version" PropArchitecture = "opkg.architecture" PropFeed = "opkg.feed" )
const ( PackagesName = "Packages" PackagesGzipName = "Packages.gz" ReleaseName = "Release" SignatureName = "Packages.sig" )
Variables ¶
This section is empty.
Functions ¶
func EncodeIndex ¶
EncodeIndex creates a deterministic Packages/Packages.gz pair for one feed.
func Serves ¶
func Serves(t repo.PackageType) bool
func SignFeed ¶
SignFeed signs the uncompressed Packages bytes, which the opkg client verifies before trusting the package digests inside the feed.
func ValidPath ¶
ValidPath accepts feed-relative IPK names. Artifactory's documented upload example allows my-app.ipk, while canonical OpenWrt names include identity.
func ValidateRelease ¶
Types ¶
type Handler ¶
type Package ¶
type Package struct {
Name, Version, Architecture string
Description, Maintainer string
Depends, Provides, Conflicts, Replaces string
Section, Priority, Source, License string
Path, SHA256, MD5 string
Size int64
}
Package is the metadata that opkg reads from an IPK's CONTROL/control. Checksums and archive size come from the stored blob, never from the control.
func DecodeIndex ¶
DecodeIndex rejects metadata that could make a client fetch a package outside its feed, confuse a virtual member selection, or skip integrity checks. gzip is selected from the requested resource, not content sniffing.
func ReadPackage ¶
ReadPackage accepts OpenWrt's gzip(tar) IPK and the older ar container. Both must contain one debian-binary, one control.tar.gz, and one data.tar.gz.