lockfile

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BundleKey

type BundleKey = string

BundleKey is a canonical key like "php:8.4.6:linux:x86_64:nts".

func ExtBundleKey

func ExtBundleKey(name, version, phpVersion, osName, arch, ts string) BundleKey

ExtBundleKey constructs a canonical key for an extension bundle.

func PHPBundleKey

func PHPBundleKey(version, osName, arch, ts string) BundleKey

PHPBundleKey constructs a canonical key for a PHP core bundle.

func ToolBundleKey

func ToolBundleKey(name, version string) BundleKey

ToolBundleKey constructs a canonical key for a tool bundle.

type Digest

type Digest = string

Digest is a content-addressed SHA-256 digest like "sha256:abc123".

type Lockfile

type Lockfile struct {
	SchemaVersion int                  `json:"schema_version"`
	GeneratedAt   time.Time            `json:"generated_at"`
	Bundles       map[BundleKey]Digest `json:"bundles"`
}

Lockfile represents the bundles.lock JSON structure.

func Parse

func Parse(data []byte) (*Lockfile, error)

Parse parses a lockfile from JSON bytes.

func ParseFile

func ParseFile(path string) (*Lockfile, error)

ParseFile reads and parses a lockfile from disk.

func (*Lockfile) Lookup

func (lf *Lockfile) Lookup(key BundleKey) (Digest, bool)

Lookup returns the digest for a bundle key, or false if not found.

func (*Lockfile) Set

func (lf *Lockfile) Set(key BundleKey, digest Digest)

Set adds or updates a bundle entry.

func (*Lockfile) Write

func (lf *Lockfile) Write(path string) error

Write serializes the lockfile to disk as indented JSON.

Jump to

Keyboard shortcuts

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