const ( // DstPrefix prefixes the target and ref, if target is remote, in the default localize destination directory name DstPrefix = "localized" // LocalizeDir is the name of the localize directories used to store remote content in the localize destination LocalizeDir = "localized-files" // FileSchemeDir is the name of the directory immediately inside LocalizeDir used to store file-schemed repos FileSchemeDir = "file-schemed" )
func NewLoader(rawTarget string, rawScope string, rawNewDir string, fSys filesys.FileSystem) (*Loader, Args, error)
NewLoader is the factory method for Loader, under localize constraints, at rawTarget. For invalid localize arguments, NewLoader returns an error.
func Run(target, scope, newDir string, fSys filesys.FileSystem) (string, error)
Run attempts to localize the kustomization root at target with the given localize arguments and returns the path to the created newDir.
Args holds localize arguments
type Args struct { // target; local copy if remote Target filesys.ConfirmedDir // directory that bounds target's local references // repo directory of local copy if target is remote Scope filesys.ConfirmedDir // localize destination NewDir filesys.ConfirmedDir }
Loader is an ifc.Loader that enforces additional constraints specific to kustomize localize.
type Loader struct { // loader at Loader's current directory ifc.Loader // contains filtered or unexported fields }
func (ll *Loader) Load(path string) ([]byte, error)
Load returns the contents of path if path is a valid localize file. Otherwise, Load returns an error.
func (ll *Loader) New(path string) (ifc.Loader, error)
New returns a Loader at path if path is a valid localize root. Otherwise, New returns an error.
type PathLocalizeError struct { Path string FileError error RootError error }
func (ple PathLocalizeError) Error() string
type ResourceLoadError struct { InlineError error FileError error }
func (rle ResourceLoadError) Error() string