module

package
v0.0.0-...-e782fd1 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2024 License: MPL-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NormalizeName

func NormalizeName(name string) string

func NormalizeNamespace

func NormalizeNamespace(namespace string) string

func NormalizeTargetSystem

func NormalizeTargetSystem(name string) string

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 NormalizeAddr(moduleAddr Addr) Addr

func (Addr) Compare

func (a Addr) Compare(other Addr) int

func (Addr) Equals

func (a Addr) Equals(other Addr) bool

func (Addr) MarshalJSON

func (a Addr) MarshalJSON() ([]byte, error)

func (Addr) Normalize

func (a Addr) Normalize() Addr

func (Addr) String

func (a Addr) String() string

func (Addr) ToRepositoryAddr

func (a Addr) ToRepositoryAddr() vcs.RepositoryAddr

func (*Addr) UnmarshalJSON

func (a *Addr) UnmarshalJSON(b []byte) error

func (Addr) Validate

func (a Addr) Validate() error

type InvalidModuleAddrError

type InvalidModuleAddrError struct {
	Addr  Addr
	Cause error
}

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.

func (Metadata) Equals

func (m Metadata) Equals(other Metadata) bool

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.

func (Version) Compare

func (v Version) Compare(other Version) int

func (Version) Equals

func (v Version) Equals(other Version) bool

func (Version) Normalize

func (v Version) Normalize() Version

func (Version) Validate

func (v Version) Validate() error

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) Parse

func (v VersionNumber) Parse() (major int, minor int, patch int, stability string, stabilityNumber int, err error)

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

Jump to

Keyboard shortcuts

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