packaging

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2026 License: MIT Imports: 13 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package packaging audits runtime dependencies and local resource closure

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Cached

func Cached(path, key string) bool

Check whether an artifact and its stored cache key still match

func CurrentModulePath

func CurrentModulePath(ctx context.Context, root string, environment []string) (string, error)

Ask the selected Go toolchain which main module owns this go.mod. A workspace can contain several main modules; an arbitrary first result may be a sibling

func Fingerprint

func Fingerprint(inputs map[string][]byte, configuration any) (string, error)

Fingerprint includes explicit configuration and sorted, length-delimited inputs

func Parallel

func Parallel[T any](ctx context.Context, items []T, jobs int, fn func(T) error) error

Parallel bounds build execution while preserving caller-owned cancellation

func ReadNotices

func ReadNotices(modules []Module) ([]byte, error)

ReadNotices requires a license for every runtime dependency and retains NOTICE

func Remember

func Remember(path, key string) error

Record the cache key and digest of a completed artifact

func VCSConfiguration

func VCSConfiguration(ctx context.Context, root string, environment []string) (any, error)

Go stamps repository-wide revision/dirty state and derives the main module's version from local tags and history. These inputs can change without a plugin source changing. Keep them in every binary key, including worktree checkouts

func ValidateLayoutReferences

func ValidateLayoutReferences(value any, files map[string][]byte) error

ValidateLayoutReferences walks JSON layouts and checks local image/layout assets

Types

type BinaryBuildConfiguration

type BinaryBuildConfiguration struct {
	Go         json.RawMessage
	ModulePath string
	VCS        any
	SDK        SDKBuildInput
}

func BinaryConfiguration

func BinaryConfiguration(ctx context.Context, root string, environment []string) (BinaryBuildConfiguration, error)

Read effective values from the same Go command and environment used for the build. os.Getenv alone misses settings saved with go env -w, and the running packager's runtime.Version may differ from the selected compiler's version

type Module

type Module struct {
	Path, Version, Dir string
	Main               bool
	Replace            *Module
}

func GoModules

func GoModules(ctx context.Context, root, packagePath string, environment []string) ([]Module, error)

Resolve the Go modules actually used by the target package

type Resource

type Resource struct {
	Path   string `json:"path"`
	SHA256 string `json:"sha256"`
	Bytes  int64  `json:"bytes"`
}

func AuditResources

func AuditResources(root string, references []string) ([]Resource, error)

Audit bounded packaged resources and their references

type SDKBuildInput

type SDKBuildInput struct{ ImportPath, Version, Sum, Content string }

func SDKConfiguration

func SDKConfiguration(ctx context.Context, root string, environment []string) (SDKBuildInput, error)

Hash the effective package tree, including replace/go.work sources. A version alone is insufficient when SDK development changes files without a new tag

Jump to

Keyboard shortcuts

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