pkgutil

package
v0.0.0-...-c7d747a Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CopyPackage

func CopyPackage(src, dst string, copyRootKptfile bool, matcher pkg.SubpackageMatcher) error

CopyPackage copies the content of a single package from src to dst. If includeSubpackages is true, it will copy resources belonging to any subpackages.

func Exists

func Exists(path string) (bool, error)

Exists returns true if a file or directory exists on the provided path, and false otherwise.

func FindSubpackagesForPaths

func FindSubpackagesForPaths(matcher pkg.SubpackageMatcher, recurse bool, pkgPaths ...string) ([]string, error)

FindSubpackagesForPaths traverses the provided package paths and finds all subpackages using the provided pkgLocatorFunc

func FormatPackage

func FormatPackage(pkgPath string)

FormatPackage formats resources and meta-resources in the package and all its subpackages

func RemovePackageContent

func RemovePackageContent(path string, removeRootKptfile bool) error

func RootPkgFirstSorter

func RootPkgFirstSorter(paths []string) func(i, j int) bool

RootPkgFirstSorter returns a "less" function that can be used with the sort.Slice function to correctly sort package paths so parent packages are always before subpackages.

func RoundTripKptfilesInPkg

func RoundTripKptfilesInPkg(pkgPath string) error

RoundTripKptfilesInPkg reads and writes all Kptfiles in the package including subpackages. This is used to format Kptfiles in the order of go structures TODO: phanimarupaka remove this method after addressing https://github.com/GoogleContainerTools/kpt/issues/2052

func SubPkgFirstSorter

func SubPkgFirstSorter(paths []string) func(i, j int) bool

SubPkgFirstSorter returns a "less" function that can be used with the sort.Slice function to correctly sort package paths so subpackages are always before parent packages.

func WalkPackage

func WalkPackage(src string, c func(string, os.FileInfo, error) error) error

WalkPackage walks the package defined at src and provides a callback for every folder and file. Any subpackages and the .git folder are excluded.

Types

This section is empty.

Jump to

Keyboard shortcuts

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