upgrade

package
v2.0.0-beta1 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2025 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config map[string]Level

func NewConfig

func NewConfig() Config

func (Config) Get

func (c Config) Get(pkg string) Level

Get the allowed Level for the given pkg name.

func (Config) Set

func (c Config) Set(pkg string, level Level) bool

Set the allowed upgrade level for a given pkg name. If level for pkg was previously set, sets the package to the new level and returns true. Otherwise, sets the package's level and returns false.

func (Config) SetDefault

func (c Config) SetDefault(level Level) bool

SetDefault sets the default allowed upgrade level packages that weren't explicitly set. If default was previously set, sets the default to the new level and returns true. Otherwise, sets the default and returns false.

type Level

type Level int
const (
	Major Level = iota
	Minor
	Patch
	None
)

func (Level) Allows

func (level Level) Allows(diff semver.Diff) bool

Allows returns if the semver.Diff is allowable for this upgrade level constraint.

Jump to

Keyboard shortcuts

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