Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Module ¶
type Module struct {
// contains filtered or unexported fields
}
Module represents a starlark modules.
type ModuleReaderFactory ¶
ModuleReaderFactory is a factory function returning reader for the module.
func NewFileReaderFactory ¶
func NewFileReaderFactory(baseDir string) ModuleReaderFactory
NewFileReaderFactory returns new ModuleReaderFactory function for reading from disk using path relative to baseDir. It will try to follow symlink to avoid module cycles. TODO(dmitry-ilyevskiy): Support git:// source.
type ModulesLoader ¶
type ModulesLoader interface { // Load implements module loading. Repeated calls with the same module name // returns the same module. Load(t *starlark.Thread, module string) (starlark.StringDict, error) // GetLoaded returns a mapping of loaded module paths to their text context. GetLoaded() map[string]string }
ModulesLoader defines the interface to interact with a ModulesLoader.
func NewFakeModulesLoader ¶
func NewFakeModulesLoader( predeclaredPkgs starlark.StringDict, modReaderFn ModuleReaderFactory, ) ModulesLoader
NewFakeModulesLoader creates a fake loader for modules with predeclared packages.
func NewModulesLoader ¶
func NewModulesLoader(baseDir string) ModulesLoader
NewModulesLoader creates a new loader for modules.
func NewModulesLoaderWithPredeclaredPkgs ¶
func NewModulesLoaderWithPredeclaredPkgs( baseDir string, predeclaredPkgs starlark.StringDict, ) ModulesLoader
NewModulesLoaderWithPredeclaredPkgs creates a new loader for modules with predeclared packages.