lockfile

package
v0.7.12 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2022 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

This is a bastardised version of the internal depsfile and addr packages from the terraform source code i.e. "github.com/hashicorp/terraform/internal/addrs" and "github.com/hashicorp/terraform/internal/depsfile". We simply need to load the .terraform.lock.hcl file and decode the version and version constraint for each provider. So this lockfile package contains only the essential functions etc. from the two internal modules listed above. Yes, this is not nice but it works.

Index

Constants

View Source
const DefaultProviderRegistryHost = svchost.Hostname("registry.terraform.io")
View Source
const LegacyProviderNamespace = "-"
View Source
const UnknownProviderNamespace = "?"

Variables

View Source
var ErrParseProviderPart = errors.New("error parsing provider parts")

Functions

func ParseProviderPart

func ParseProviderPart(given string) (string, error)

Types

type Locks

type Locks struct {
	Providers           map[Provider]*ProviderLock
	OverriddenProviders map[Provider]struct{}
	Sources             map[string][]byte
}

func LoadLocks

func LoadLocks(path string) (*Locks, error)

func NewLocks

func NewLocks() *Locks

type ParserError

type ParserError struct {
	Summary string
	Detail  string
}

func (*ParserError) Error

func (pe *ParserError) Error() string

type Provider

type Provider = regsrc.Provider

func ParseProviderSource

func ParseProviderSource(str string) (Provider, error)

type ProviderLock

type ProviderLock struct {
	// addr is the address of the provider this lock applies to.
	Addr               Provider
	Version            Version
	VersionConstraints VersionConstraints
}

type Version

type Version = versions.Version

func ParseVersion

func ParseVersion(str string) (Version, error)

type VersionConstraints

type VersionConstraints = constraints.IntersectionSpec

func ParseVersionConstraints

func ParseVersionConstraints(str string) (VersionConstraints, error)

Jump to

Keyboard shortcuts

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