datadir

package
v0.33.1 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: MPL-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const DataDirName = ".terraform"

Variables

This section is empty.

Functions

func ModuleManifestFilePath

func ModuleManifestFilePath(fs fs.StatFS, modulePath string) (string, bool)

func ModulePath

func ModulePath(filePath string) (string, bool)

ModulePath strips known lock file paths to get the path to the (closest) module these files belong to

func ModuleUriFromDataDir added in v0.29.0

func ModuleUriFromDataDir(rawUri string) (string, bool)

func ModuleUriFromModuleLockFile added in v0.29.0

func ModuleUriFromModuleLockFile(rawUri string) (string, bool)

func ModuleUriFromPluginLockFile added in v0.29.0

func ModuleUriFromPluginLockFile(rawUri string) (string, bool)

func PluginLockFilePath

func PluginLockFilePath(fs fs.StatFS, modPath string) (string, bool)

Types

type DataDir

type DataDir struct {
	ModuleManifestPath string
	PluginLockFilePath string
}

func WalkDataDirOfModule

func WalkDataDirOfModule(fs fs.StatFS, modPath string) *DataDir

type EventType added in v0.29.0

type EventType rune
const (
	AnyEventType    EventType = '*'
	CreateEventType EventType = 'c'
	ModifyEventType EventType = 'm'
	DeleteEventType EventType = 'd'
)

type FS added in v0.29.0

type FS interface {
	ReadFile(name string) ([]byte, error)
	ReadDir(name string) ([]fs.DirEntry, error)
}

type ModuleManifest

type ModuleManifest struct {
	Records []ModuleRecord `json:"Modules"`
	// contains filtered or unexported fields
}

func NewModuleManifest added in v0.16.0

func NewModuleManifest(rootDir string, records []ModuleRecord) *ModuleManifest

func ParseModuleManifestFromFile

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

func (*ModuleManifest) ContainsLocalModule added in v0.16.0

func (mm *ModuleManifest) ContainsLocalModule(path string) bool

func (*ModuleManifest) Copy added in v0.17.1

func (mm *ModuleManifest) Copy() *ModuleManifest

func (*ModuleManifest) RootDir

func (mm *ModuleManifest) RootDir() 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 for the module.
	SourceAddr tfmod.ModuleSourceAddr `json:"-"`

	// RawSourceAddr is the raw source address for the module
	// as it appears in the manifest.
	RawSourceAddr 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 PluginVersionMap added in v0.29.0

type PluginVersionMap map[tfaddr.Provider]*version.Version

func ParsePluginVersions added in v0.29.0

func ParsePluginVersions(filesystem FS, modPath string) (PluginVersionMap, error)

type WatchPattern added in v0.29.0

type WatchPattern struct {
	Pattern   string
	EventType EventType
}

func PathGlobPatternsForWatching added in v0.29.0

func PathGlobPatternsForWatching() []WatchPattern

type WatchablePaths

type WatchablePaths struct {
	Dirs            []string
	ModuleManifests []string
	PluginLockFiles []string
}

func WatchableModulePaths

func WatchableModulePaths(modPath string) *WatchablePaths

Jump to

Keyboard shortcuts

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