Documentation ¶
Index ¶
- func NormalizeName(name string) string
- func NormalizeNamespace(namespace string) string
- func NormalizeTargetSystem(name string) string
- type Addr
- func (a Addr) Compare(other Addr) int
- func (a Addr) Equals(other Addr) bool
- func (a Addr) MarshalJSON() ([]byte, error)
- func (a Addr) Normalize() Addr
- func (a Addr) String() string
- func (a Addr) ToRepositoryAddr() vcs.RepositoryAddr
- func (a *Addr) UnmarshalJSON(b []byte) error
- func (a Addr) Validate() error
- type InvalidModuleAddrError
- type InvalidVersionNumber
- type Metadata
- type Version
- type VersionList
- type VersionNumber
- func (v VersionNumber) Compare(other VersionNumber) int
- func (v VersionNumber) Normalize() VersionNumber
- func (v VersionNumber) Parse() (major int, minor int, patch int, stability string, stabilityNumber int, ...)
- func (v VersionNumber) ToVCSVersion() vcs.VersionNumber
- func (v VersionNumber) Validate() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NormalizeName ¶
func NormalizeNamespace ¶
func NormalizeTargetSystem ¶
Types ¶
type Addr ¶
type Addr struct { Namespace string `json:"-"` Name string `json:"-"` TargetSystem string `json:"-"` }
Addr describes a module address combination of NAMESPACE-NAME-TARGETSYSTEM. This will translate to github.com/NAMESPACE/terraform-TARGETSYSTEM-NAME for now.
func AddrFromRepository ¶
func AddrFromRepository(repository vcs.RepositoryAddr) (Addr, error)
AddrFromRepository parses a repository name and returns a module address from it if valid.
func NormalizeAddr ¶
func (Addr) MarshalJSON ¶
func (Addr) ToRepositoryAddr ¶
func (a Addr) ToRepositoryAddr() vcs.RepositoryAddr
func (*Addr) UnmarshalJSON ¶
type InvalidModuleAddrError ¶
func (InvalidModuleAddrError) Error ¶
func (i InvalidModuleAddrError) Error() string
func (InvalidModuleAddrError) Unwrap ¶
func (i InvalidModuleAddrError) Unwrap() error
type InvalidVersionNumber ¶
type InvalidVersionNumber struct {
VersionNumber VersionNumber
}
func (InvalidVersionNumber) Error ¶
func (i InvalidVersionNumber) Error() string
type Metadata ¶
type Metadata struct { // Versions lists all available versions of a Namespace-Name-TargetSystem combination. Versions VersionList `json:"versions"` }
Metadata represents all the metadata for a module. This includes the list of versions available for the module. This structure represents the file in modules/o/opentofu/somemodule/platform.json.
type Version ¶
type Version struct { // Version number of the provider. Correlates to a tag in the module repository. Version VersionNumber `json:"version"` }
Version represents a single version of a module.
type VersionList ¶
type VersionList []Version
VersionList is a slice of versions.
func (VersionList) Equals ¶
func (v VersionList) Equals(other VersionList) bool
func (VersionList) Merge ¶
func (v VersionList) Merge(other VersionList) VersionList
Merge merges the current list with another list and returns the new merged list.
func (VersionList) Sort ¶
func (v VersionList) Sort()
Sort returns a sorted copy of the version list.
type VersionNumber ¶
type VersionNumber string
VersionNumber describes the semver version number. Note that in contrast to provider versions module versions do not have a compulsory "v" prefix. Call ToVCSVersion() before you call Normalize() in order to get the correct VCS version.
swagger:model ModuleVersionNumber
func VersionFromVCS ¶
func VersionFromVCS(vcsVersion vcs.VersionNumber) (VersionNumber, error)
VersionFromVCS converts a vcs.VersionNumber into a VersionNumber.
func (VersionNumber) Compare ¶
func (v VersionNumber) Compare(other VersionNumber) int
func (VersionNumber) Normalize ¶
func (v VersionNumber) Normalize() VersionNumber
Normalize adds a "v" prefix if none is present. Note, however, that in contrast to provider versions module versions do not have a compulsory "v" prefix. Call ToVCSVersion() before you call Normalize() in order to get the correct VCS version.
func (VersionNumber) ToVCSVersion ¶
func (v VersionNumber) ToVCSVersion() vcs.VersionNumber
ToVCSVersion creates a vcs.VersionNumber from the VersionNumber. Note that in contrast to provider versions module versions do not have a compulsory "v" prefix. Call ToVCSVersion() before you call Normalize() in order to get the correct VCS version.
func (VersionNumber) Validate ¶
func (v VersionNumber) Validate() error