lockfile

package
v2.0.0-beta2 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2025 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 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 lockfile.DepFile) (*resolve.Graph, error)

func (NpmReadWriter) System

func (NpmReadWriter) System() resolve.System

func (NpmReadWriter) Write

func (rw NpmReadWriter) Write(original lockfile.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 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 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