lockfile

package
v2.3.2 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2026 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Overview

Package lockfile provides functionality for reading and writing lockfiles.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Overwrite

func Overwrite(rw ReadWriter, filename string, patches []DependencyPatch) error

Types

type DependencyPatch

type DependencyPatch struct {
	Pkg         resolve.PackageKey
	OrigVersion string
	NewVersion  string
}

type NpmReadWriter

type NpmReadWriter struct{}

func (NpmReadWriter) Read

func (rw NpmReadWriter) Read(file depfile.DepFile) (*resolve.Graph, error)

func (NpmReadWriter) System

func (NpmReadWriter) System() resolve.System

func (NpmReadWriter) Write

func (rw NpmReadWriter) Write(original depfile.DepFile, output io.Writer, patches []DependencyPatch) error

type ReadWriter

type ReadWriter interface {
	// System returns which ecosystem this ReadWriter is for.
	System() resolve.System
	// Read parses a lockfile into a resolved graph
	Read(file depfile.DepFile) (*resolve.Graph, error)
	// Write applies the DependencyPatches to the lockfile, with minimal changes to the file.
	// `original` is the original lockfile to read from. The updated lockfile is written to `output`.
	Write(original depfile.DepFile, output io.Writer, patches []DependencyPatch) error
}

func GetReadWriter

func GetReadWriter(pathToLockfile string) (ReadWriter, error)

Jump to

Keyboard shortcuts

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