sourceaddr

package
v0.9.7 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultProviderRegistryHostname = "registry.terraform.io"

Variables

This section is empty.

Functions

func IsRegistryModuleSource

func IsRegistryModuleSource(source string) bool

IsRegistryModuleSource returns true if the source looks like a Terraform registry module reference.

func ParseProviderSource

func ParseProviderSource(source string) (namespace, typeName string, err error)

ParseProviderSource parses a provider source like "hashicorp/aws".

Types

type ModuleAddress

type ModuleAddress struct {
	Hostname  string
	Namespace string
	Name      string
	Provider  string
	Subdir    string
}

ModuleAddress is a normalized registry module source address.

func ParseRegistryModuleSource

func ParseRegistryModuleSource(source string) (ModuleAddress, error)

ParseRegistryModuleSource parses a registry module source like "hashicorp/consul/aws" or "app.terraform.io/hashicorp/consul/aws".

func (ModuleAddress) Source

func (a ModuleAddress) Source() string

func (ModuleAddress) WithHostname

func (a ModuleAddress) WithHostname(host string) ModuleAddress

WithHostname returns a copy of the module address using the provided hostname when non-empty.

type ProviderAddress

type ProviderAddress struct {
	Hostname  string
	Namespace string
	Type      string
}

ProviderAddress is a normalized provider source address.

func ParseProviderAddress

func ParseProviderAddress(source string) (ProviderAddress, error)

ParseProviderAddress parses a short or fully-qualified provider source.

func (ProviderAddress) ShortSource

func (a ProviderAddress) ShortSource() string

func (ProviderAddress) Source

func (a ProviderAddress) Source() string

Source returns the fully-qualified source form.

func (ProviderAddress) WithHostname

func (a ProviderAddress) WithHostname(host string) ProviderAddress

WithHostname returns a copy of the provider address using the provided hostname when non-empty.

Jump to

Keyboard shortcuts

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