rootmodule

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2020 License: MPL-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsRootModuleNotFound

func IsRootModuleNotFound(err error) bool

func NewRootModuleMock

func NewRootModuleMock(ctx context.Context, rmm *RootModuleMock, dir string) *rootModule

func ParseModuleManifestFromFile

func ParseModuleManifestFromFile(path string) (*moduleManifest, error)

Types

type File

type File interface {
	Path() string
}

type ModuleRecord

type ModuleRecord struct {
	// Key is a unique identifier for this particular module, based on its
	// position within the static module tree.
	Key string `json:"Key"`

	// SourceAddr is the source address given for this module in configuration.
	// This is used only to detect if the source was changed in configuration
	// since the module was last installed, which means that the installer
	// must re-install it.
	SourceAddr string `json:"Source"`

	// Version is the exact version of the module, which results from parsing
	// VersionStr. nil for un-versioned modules.
	Version *version.Version `json:"-"`

	// VersionStr is the version specifier string. This is used only for
	// serialization in snapshots and should not be accessed or updated
	// by any other codepaths; use "Version" instead.
	VersionStr string `json:"Version,omitempty"`

	// Dir is the path to the local directory where the module is installed.
	Dir string `json:"Dir"`
}

ModuleRecord represents some metadata about an installed module, as part of a ModuleManifest.

func (*ModuleRecord) IsExternal

func (r *ModuleRecord) IsExternal() bool

func (*ModuleRecord) IsRoot

func (r *ModuleRecord) IsRoot() bool

func (*ModuleRecord) UnmarshalJSON

func (r *ModuleRecord) UnmarshalJSON(b []byte) error

type ParserFinder

type ParserFinder interface {
	ParserForDir(path string) (lang.Parser, error)
}

type RootModule

type RootModule interface {
	IsKnownPluginLockFile(path string) bool
	IsKnownModuleManifestFile(path string) bool
	PathsToWatch() []string
	UpdatePluginCache(lockFile File) error
	UpdateModuleManifest(manifestFile File) error
	Parser() lang.Parser
	TerraformExecutor() *exec.Executor
}

func NewRootModule

func NewRootModule(ctx context.Context, dir string) (RootModule, error)

type RootModuleCandidateFinder

type RootModuleCandidateFinder interface {
	RootModuleCandidatesByPath(path string) []string
}

type RootModuleFactory

type RootModuleFactory func(context.Context, string) (*rootModule, error)

type RootModuleManager

type RootModuleManager interface {
	ParserFinder
	TerraformExecFinder
	RootModuleCandidateFinder

	SetLogger(logger *log.Logger)
	SetTerraformExecPath(path string)
	SetTerraformExecLogPath(logPath string)
	SetTerraformExecTimeout(timeout time.Duration)
	AddRootModule(dir string) error
	PathsToWatch() []string
	RootModuleByPath(path string) (RootModule, error)
}

func NewRootModuleManager

func NewRootModuleManager(ctx context.Context) RootModuleManager

type RootModuleManagerFactory

type RootModuleManagerFactory func(context.Context) RootModuleManager

func NewRootModuleManagerMock

func NewRootModuleManagerMock(m map[string]*RootModuleMock) RootModuleManagerFactory

type RootModuleMock

type RootModuleMock struct {
	TerraformExecQueue exec.MockItemDispenser
	ProviderSchemas    *tfjson.ProviderSchemas
}

type RootModuleMockFactory

type RootModuleMockFactory struct {
	// contains filtered or unexported fields
}

func (*RootModuleMockFactory) New

func (rmf *RootModuleMockFactory) New(ctx context.Context, dir string) (*rootModule, error)

type RootModuleNotFoundErr

type RootModuleNotFoundErr struct {
	Dir string
}

func (*RootModuleNotFoundErr) Error

func (e *RootModuleNotFoundErr) Error() string

type TerraformExecFinder

type TerraformExecFinder interface {
	TerraformExecutorForDir(ctx context.Context, path string) (*exec.Executor, error)
}

type WalkFunc

type WalkFunc func(rootModulePath string) error

type Walker

type Walker struct {
	// contains filtered or unexported fields
}

func NewWalker

func NewWalker() *Walker

func (*Walker) SetLogger

func (w *Walker) SetLogger(logger *log.Logger)

func (*Walker) WalkInitializedRootModules

func (w *Walker) WalkInitializedRootModules(path string, wf WalkFunc) error

Jump to

Keyboard shortcuts

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