Documentation ¶
Overview ¶
Package loader has a data loading interface and various implementations.
Index ¶
- Variables
- func IsRemoteFile(path string) bool
- func NewFileLoaderAtCwd(fSys filesys.FileSystem) *fileLoader
- func NewFileLoaderAtRoot(fSys filesys.FileSystem) *fileLoader
- func NewLoader(lr LoadRestrictorFunc, target string, fSys filesys.FileSystem) (ifc.Loader, error)
- func RestrictionNone(_ filesys.FileSystem, _ filesys.ConfirmedDir, path string) (string, error)
- func RestrictionRootOnly(fSys filesys.FileSystem, root filesys.ConfirmedDir, path string) (string, error)
- type LoadRestrictorFunc
Constants ¶
This section is empty.
Variables ¶
var ( ErrHTTP = errors.Errorf("HTTP Error") ErrRtNotDir = errors.Errorf("must build at directory") )
Functions ¶
func IsRemoteFile ¶ added in v0.13.0
IsRemoteFile returns whether path has a url scheme that kustomize allows for remote files. See https://github.com/kubernetes-sigs/kustomize/blob/master/examples/remoteBuild.md
func NewFileLoaderAtCwd ¶
func NewFileLoaderAtCwd(fSys filesys.FileSystem) *fileLoader
NewFileLoaderAtCwd returns a loader that loads from PWD. A convenience for kustomize edit commands.
func NewFileLoaderAtRoot ¶
func NewFileLoaderAtRoot(fSys filesys.FileSystem) *fileLoader
NewFileLoaderAtRoot returns a loader that loads from "/". A convenience for tests.
func NewLoader ¶
func NewLoader( lr LoadRestrictorFunc, target string, fSys filesys.FileSystem) (ifc.Loader, error)
NewLoader returns a Loader pointed at the given target. If the target is remote, the loader will be restricted to the root and below only. If the target is local, the loader will have the restrictions passed in. Regardless, if a local target attempts to transitively load remote bases, the remote bases will all be root-only restricted.
func RestrictionNone ¶
func RestrictionNone( _ filesys.FileSystem, _ filesys.ConfirmedDir, path string) (string, error)
func RestrictionRootOnly ¶
func RestrictionRootOnly( fSys filesys.FileSystem, root filesys.ConfirmedDir, path string) (string, error)
Types ¶
type LoadRestrictorFunc ¶
type LoadRestrictorFunc func( filesys.FileSystem, filesys.ConfirmedDir, string) (string, error)