lockfile

package
v1.7.2 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2024 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Overwrite

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

Types

type DependencyPatch

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

type LockfileIO

type LockfileIO interface {
	// Read parses a lockfile into a resolved graph
	Read(file lockfile.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 lockfile.DepFile, output io.Writer, patches []DependencyPatch) error
}

func GetLockfileIO

func GetLockfileIO(pathToLockfile string) (LockfileIO, error)

type NpmLockfileIO

type NpmLockfileIO struct{}

func (NpmLockfileIO) Read

func (rw NpmLockfileIO) Read(file lockfile.DepFile) (*resolve.Graph, error)

func (NpmLockfileIO) Write

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

Jump to

Keyboard shortcuts

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