Documentation
¶
Index ¶
- func BuildP2(ctx context.Context, store VersionReaderInterface, overlayObj *overlay.Obj, ...) (*api.ComposerP2Obj, error)
- func BuildPackageList(overlayObj *overlay.Obj, names NamesReaderInterface, filter string) *api.ComposerPackageListObj
- func BuildPackages(overlayObj *overlay.Obj, names NamesReaderInterface) *api.ComposerPackagesObj
- func CheckFilter(filter string) error
- type NamesReaderInterface
- type ResolveObj
- type VersionReaderInterface
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildP2 ¶
func BuildP2(ctx context.Context, store VersionReaderInterface, overlayObj *overlay.Obj, resolveObj ResolveObj, linkObj link.Obj, listenerID stcode.ListenerType) (*api.ComposerP2Obj, error)
BuildP2 builds `/p2/{vendor}/{packageFile}` for an already resolved package. Dev variants return an empty version set; overlay rejection maps to serr.ErrNotFound. Dist URLs are host-sensitive, and the caller resolves addressing first for ETag calculation.
func BuildPackageList ¶
func BuildPackageList(overlayObj *overlay.Obj, names NamesReaderInterface, filter string) *api.ComposerPackageListObj
BuildPackageList builds `/packages/list.json` with optional prefix or glob filtering. The caller gates filter length first; an empty filter returns all names.
func BuildPackages ¶
func BuildPackages(overlayObj *overlay.Obj, names NamesReaderInterface) *api.ComposerPackagesObj
BuildPackages builds `/packages.json` from cross-key composer names without storage reads.
func CheckFilter ¶
CheckFilter rejects overlong filters with serr.ErrBadInput.
Types ¶
type NamesReaderInterface ¶
type NamesReaderInterface interface {
ComposerPackageNames() []string
ComposerKeyForName(name string) (string, bool)
}
NamesReaderInterface exposes cross-key composer names and name-to-winner mapping for serve-time p2.
type ResolveObj ¶
ResolveObj is parsed p2 addressing: composer name, dev flag, and winner key.
func Resolve ¶
func Resolve(names NamesReaderInterface, vendor string, packageFile string) (ResolveObj, error)
Resolve maps vendor/packageFile to composer name, dev flag, and winner key. Bad files and unknown names return serr.ErrNotFound; callers derive ETags from the result.
type VersionReaderInterface ¶
type VersionReaderInterface interface {
ListVersionsKeyset(ctx context.Context, key string, includeDeleted bool, afterSeq int64, afterVersion string, limit int) ([]core.VersionObj, error)
GetArtifact(ctx context.Context, keyObj core.ArtifactKeyObj) (core.ArtifactObj, bool, error)
ReadTree(ctx context.Context, treeHashObj core.HashObj) ([]core.TreeEntryObj, error)
ReadBlob(ctx context.Context, hashObj core.HashObj) ([]byte, error)
}
VersionReaderInterface provides keyset version walking, composer.json object reads, and dist artifact lookup.