version_file_common

package
v0.0.0-...-65468f9 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2024 License: BSD-3-Clause Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetPinnedRev

func GetPinnedRev(dep *config.VersionFileConfig, contents string) (string, error)

GetPinnedRev reads the given file contents to find the pinned revision.

func GetPinnedRevs

func GetPinnedRevs(ctx context.Context, deps []*config.VersionFileConfig, getFile GetFileFunc) (map[string]string, error)

GetPinnedRevs reads files using the given GetFileFunc to retrieve the given pinned revisions. File retrievals are cached for efficiency.

func SetPinnedRev

func SetPinnedRev(dep *config.VersionFileConfig, newRev *revision.Revision, oldContents string) (string, error)

SetPinnedRev updates the given dependency pin in the given file, returning the new contents.

func UpdateDep

func UpdateDep(ctx context.Context, primaryDep *config.DependencyConfig, rev *revision.Revision, getFile GetFileFunc) (map[string]string, error)

UpdateDep updates the given dependency to the given revision, also updating any transitive dependencies to the revisions specified in the new revision of the primary dependency. Returns a map whose keys are file names to update and values are their updated contents.

Types

type GetFileFunc

type GetFileFunc func(ctx context.Context, path string) (string, error)

GetFileFunc is a function which retrieves the contents of a file.

Jump to

Keyboard shortcuts

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