lockfile

package
v0.21.3 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsStale

func IsStale(
	lockPath string,
	tomlPackages map[string]string,
) (bool, error)

IsStale checks if the lock file is stale relative to the gale.toml packages. Returns true if packages differ.

func VersionMatches added in v0.16.3

func VersionMatches(locked, toml string) bool

VersionMatches reports whether the locked version (potentially canonical form like "1.8.1-1") matches the toml version (bare form like "1.8.1"). They match if the strings are equal, or if the locked version is "<toml>-<N>" for any all-digit suffix N > 0 (canonical revision form). Revision 0 is not a valid canonical revision and is not treated as a match.

func Write

func Write(path string, lf *LockFile) error

Write writes a LockFile to the given path atomically.

Types

type LockFile

type LockFile struct {
	Packages map[string]LockedPackage `toml:"packages"`
}

LockFile represents a gale.lock file.

func Read

func Read(path string) (*LockFile, error)

Read reads a gale.lock file. Returns empty LockFile if the file doesn't exist.

type LockedPackage added in v0.4.0

type LockedPackage struct {
	Version        string `toml:"version"`
	SHA256         string `toml:"sha256,omitempty"`
	ManifestDigest string `toml:"manifest_digest,omitempty"`
}

LockedPackage represents a pinned package in the lockfile.

Jump to

Keyboard shortcuts

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