lockfile

package
v0.2.0-alpha.4 Latest Latest
Warning

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

Go to latest
Published: May 13, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const APIVersion = "1"
View Source
const LockfileName = "almd-lock.toml"

Variables

This section is empty.

Functions

func Save

func Save(projectRoot string, lf *Lockfile) error

Save saves the lockfile to the given project root path.

Types

type Lockfile

type Lockfile struct {
	ApiVersion string                  `toml:"api_version"`
	Package    map[string]PackageEntry `toml:"package"`
}

Lockfile represents the structure of the almd-lock.toml file.

func Load

func Load(projectRoot string) (*Lockfile, error)

Load loads the lockfile from the given project root path. If the lockfile doesn't exist, it returns a new Lockfile instance.

func New

func New() *Lockfile

New creates a new Lockfile instance with default values.

func (*Lockfile) AddOrUpdatePackage

func (lf *Lockfile) AddOrUpdatePackage(name, rawURL, relativePath, integrityHash string)

AddOrUpdatePackage adds or updates a package entry in the lockfile.

type PackageEntry

type PackageEntry struct {
	Source string `toml:"source"`
	Path   string `toml:"path"`
	Hash   string `toml:"hash"`
}

PackageEntry represents a single package entry in the lockfile.

Jump to

Keyboard shortcuts

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