No description
Find a file
baa-ableton 45f3562374
docs: removed unneccessary comments for ModulePackage (#7)
Signed-off-by: Babur Ayanlar <babur.ayanlar@ableton.com>
2026-03-07 10:53:25 -03:00
.github build(deps): bump actions/checkout from 3.6.0 to 4.0.0 (#47) 2023-09-05 09:02:40 +01:00
.copywrite.hcl Add copywrite config (#32) 2023-04-12 06:47:21 +01:00
.go-version Prepare for v2 with some breaking changes 2025-06-11 07:31:31 -07:00
errors.go Prepare for v2 with some breaking changes 2025-06-11 07:31:31 -07:00
go.mod Prepare for v2 with some breaking changes 2025-06-11 07:31:31 -07:00
go.sum Prepare for v2 with some breaking changes 2025-06-11 07:31:31 -07:00
LICENSE Prepare for v2 with some breaking changes 2025-06-11 07:31:31 -07:00
module.go Prepare for v2 with some breaking changes 2025-06-11 07:31:31 -07:00
module_package.go docs: removed unneccessary comments for ModulePackage (#7) 2026-03-07 10:53:25 -03:00
module_test.go Prepare for v2 with some breaking changes 2025-06-11 07:31:31 -07:00
provider.go Prepare for v2 with some breaking changes 2025-06-11 07:31:31 -07:00
provider_test.go Prepare for v2 with some breaking changes 2025-06-11 07:31:31 -07:00
README.md Prepare for v2 with some breaking changes 2025-06-11 07:31:31 -07:00

OpenTofu Registry Addresses

This Go library contains types to represent module and provider registry addresses as used in OpenTofu, along with the canonical implementations of parsing and comparing those addresses.

Provider addresses can be found in

Module addresses can be found within source argument of module blocks in OpenTofu modules (*.tf) and parts of the address (namespace and name) in the Module Registry API.

Compatibility

The module aims for compatibility with OpenTofu v1.5 and later.

Usage

Provider

pAddr, err := regaddr.ParseProviderSource("foo/bar")
if err != nil {
	// deal with error
}

// pAddr == regaddr.Provider{
//   Type:      "foo",
//   Namespace: "bar",
//   Hostname:  regaddr.DefaultProviderRegistryHost,
// }

Module

mAddr, err := regaddr.ParseModuleSource("foo/bar/baz//modules/example")
if err != nil {
	// deal with error
}

// mAddr == Module{
//   Package: ModulePackage{
//     Host:         regaddr.DefaultModuleRegistryHost,
//     Namespace:    "foo",
//     Name:         "bar",
//     TargetSystem: "baz",
//   },
//   Subdir: "modules/example",
// },

Other Module Address Formats

OpenTofu supports various other module source address types that are not handled by this library. This library focuses only on the syntax used for OpenTofu module registries.