composer

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 4, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

Package composer validates hosted Composer archives and their package identity.

Index

Constants

View Source
const (
	ArchiveLimit  = 128 << 20
	MetadataLimit = 1 << 20
)

Variables

This section is empty.

Functions

func HostedPath

func HostedPath(path, name string) bool

HostedPath binds the embedded package identity to the upload path. The final filename may differ from the metadata version when a matrix version supplies it, as documented by Artifactory's Composer deployment guide.

func Serves

func Serves(t repo.PackageType) bool

func ValidName

func ValidName(name string) bool

func ValidVersion

func ValidVersion(version string) bool

Types

type Handler

type Handler struct{ generic.Handler }

func (Handler) Admit

func (Handler) Admit(
	ctx context.Context,
	env format.Env,
	c repo.Config,
	w format.Write,
) (format.Write, error)

func (Handler) Inspect

func (Handler) Inspect(
	ctx context.Context,
	env format.Env,
	_ repo.Config,
	w format.Write,
) (any, error)

func (Handler) Reindex

func (Handler) Reindex(ctx context.Context, env format.Env, c repo.Config) error

type Package

type Package struct {
	Name    string
	Version string
	Fields  map[string]json.RawMessage
}

Package is the validated composer.json of one archive. Extra Composer fields are retained so the solver sees require, autoload, conflicts and stability.

func ParseArchive

func ParseArchive(ctx context.Context, r io.Reader, size int64, override string) (Package, error)

func (Package) Document

func (p Package) Document() map[string]any

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL