module

package
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ContainsPath

func ContainsPath(modules []Module, path string) bool

ContainsPath reports whether any module in the slice has the given path.

func FormatTag

func FormatTag(modulePath string, version *semver.Version) string

FormatTag creates a tag string from a module path and version.

func GroupTagsByModule

func GroupTagsByModule(tags []TagInfo) map[string][]TagInfo

GroupTagsByModule groups parsed tag infos by module path.

func NextVersion

func NextVersion(current *semver.Version, bump string) (*semver.Version, error)

NextVersion computes the next version given a bump type.

func SortVersionsAsc

func SortVersionsAsc(tags []TagInfo)

SortVersionsAsc sorts tag infos by version ascending (oldest first).

func SortVersionsDesc

func SortVersionsDesc(tags []TagInfo)

SortVersionsDesc sorts tag infos by version descending (newest first).

Types

type Module

type Module struct {
	Path string // Relative path within the repo, e.g. "hetzner/server"
}

Module represents a discovered terraform module.

func DiscoverModules

func DiscoverModules(repoPath string, excludeDirs ...string) ([]Module, error)

DiscoverModules walks the repository directory and finds all directories containing .tf files (excluding the root directory). Any directories in excludeDirs are skipped (matched by name, not path).

type TagInfo

type TagInfo struct {
	Tag        string
	ModulePath string
	Version    *semver.Version
}

TagInfo holds parsed information from a git tag.

func FilterTagsForModule

func FilterTagsForModule(tags []TagInfo, modulePath string) []TagInfo

FilterTagsForModule filters parsed tags to only those matching a module path.

func LatestVersion

func LatestVersion(tags []TagInfo) *TagInfo

LatestVersion returns the latest version from a list of tag infos. Returns nil if the list is empty.

func ParseAllTags

func ParseAllTags(rawTags []string) []TagInfo

ParseAllTags parses a list of raw tag strings, skipping those that don't match the expected format.

func ParseTag

func ParseTag(tag string) (*TagInfo, error)

ParseTag parses a git tag into module path and version. Tags have the format: {module_path}-{semver} We scan from the right for a '-' followed by a valid semver to handle module paths containing dashes (e.g. aws/ec2/security-group-1.0.0).

Jump to

Keyboard shortcuts

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