lockdiff

package
v0.0.0-...-8114a04 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Register

func Register(filename string, parser Parser)

func RegisteredFilenames

func RegisteredFilenames() []string

Types

type ChangeKind

type ChangeKind string
const (
	ChangeAdded      ChangeKind = "added"
	ChangeRemoved    ChangeKind = "removed"
	ChangeUpgraded   ChangeKind = "upgraded"
	ChangeDowngraded ChangeKind = "downgraded"
)

type FileDiff

type FileDiff struct {
	File      string
	Ecosystem string
	Changes   []PackageChange
}

func Diff

func Diff(ecosystem, file string, before, after map[string]string) FileDiff

func (FileDiff) Counts

func (d FileDiff) Counts() (added, removed, upgraded, downgraded int)

func (FileDiff) Empty

func (d FileDiff) Empty() bool

func (FileDiff) MajorUpgrades

func (d FileDiff) MajorUpgrades() int

type PackageChange

type PackageChange struct {
	Name    string
	Kind    ChangeKind
	FromVer string
	ToVer   string
	Level   SemverLevel
}

type Parser

type Parser interface {
	Ecosystem() string
	Parse(data []byte) (map[string]string, error)
}

func ParserFor

func ParserFor(filename string) (Parser, bool)

type SemverLevel

type SemverLevel string
const (
	LevelMajor SemverLevel = "major"
	LevelMinor SemverLevel = "minor"
	LevelPatch SemverLevel = "patch"
	LevelOther SemverLevel = "other"
)

Jump to

Keyboard shortcuts

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