pin

package
v0.6.20 Latest Latest
Warning

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

Go to latest
Published: May 14, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidPath = errors.New("invalid file path")
	ErrMissingPath = errors.New("missing file path")
)
View Source
var (
	ErrMissingPin     = errors.New("missing version pin")
	ErrUnexpectedFile = errors.New("unexpected file")
)

Functions

func Read

func Read(path string) (version.Version, error)

Parses a 'Version' from the specified pin file.

func Remove

func Remove(path string) error

Deletes the specified pin file if it exists.

func VersionAt

func VersionAt(ctx context.Context, storePath, path string) (version.Version, error)

Resolves a version for the specified directory. This function starts by looking for a pin file in the specified directory or any ancestor directories. If none are found then globally-pinned version is checked.

func Write

func Write(v version.Version, path string) error

Writes a 'Version' to the specified pin file path.

NOTE: This function will fail if any directories along the path do not exist.

Types

This section is empty.

Jump to

Keyboard shortcuts

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