agentpackages

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: 20 Imported by: 0

Documentation

Overview

Package agentpackages validates and indexes APM Agent Packages ZIP archives.

Index

Constants

View Source
const (
	MaxArchiveBytes  = 64 << 20
	MaxManifestBytes = 1 << 20
	MaxFiles         = 512
)

Variables

View Source
var (
	ErrArchive = errors.New("agentpackages: invalid agent package archive")
)

Functions

func ParsePath

func ParsePath(p string) (owner, name, version string, ok bool)

func Path

func Path(owner, name, version string) string

func Serves

func Serves(t repo.PackageType) bool

func ValidComponent

func ValidComponent(v string) bool

func ValidVersion

func ValidVersion(v string) bool

Types

type Handler

type Handler struct{ generic.Handler }

func (Handler) Admit

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

func (Handler) Deleted

func (Handler) Deleting

func (Handler) Deployed

func (Handler) Deployed(ctx context.Context, env format.Env, c repo.Config, it types.Item) error

func (Handler) GuardWrite

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

GuardWrite keeps version ZIPs immutable through both APM and ordinary item routes. Restore bypasses the guard by design; it reindexes the saved bytes.

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 Metadata

type Metadata struct {
	Name        string   `json:"name"`
	Version     string   `json:"version"`
	Path        string   `json:"path"`
	Description string   `json:"description,omitempty"`
	Tags        []string `json:"tags,omitempty"`
	Types       []string `json:"types,omitempty"`
	SHA256      string   `json:"sha256"`
	Size        int64    `json:"size"`
}

Metadata carries bounded descriptor fields; the canonical path supplies identity and version after validation.

func ReadArchive

func ReadArchive(r io.Reader, size int64) (Metadata, error)

ReadArchive checks all ZIP members, including CRC and inflated size. An apm.yml takes precedence over the documented lockfile fallback.

Jump to

Keyboard shortcuts

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