version

package
v25.10.2 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(opts *Options)

Option represents a function that applies a configuration to a Version instance.

func WithDefaultVersion

func WithDefaultVersion(defaultVersion string) Option

WithDefaultVersion sets a default version if parsing the Docker image tag fails.

func WithLogger

func WithLogger(logger logr.Logger) Option

WithLogger sets a logger for the Version instance.

type Options

type Options struct {
	// contains filtered or unexported fields
}

Options to be used with Version.

type Version

type Version struct {
	// contains filtered or unexported fields
}

Version wraps a HashiCorp version.Version struct to provide additional functionalities for better convenience.

func NewVersion

func NewVersion(image string, vOpts ...Option) (*Version, error)

NewVersion constructs a new Version instance from a given Docker image tag.

func (*Version) Compare

func (v *Version) Compare(other string) (int, error)

Compare compares the current version with another semantic version string.

func (*Version) GetMinorVersion

func (v *Version) GetMinorVersion() (string, error)

GetMinorVersion extracts and returns the "major.minor" part of the version.

func (*Version) GreaterThanOrEqual

func (v *Version) GreaterThanOrEqual(other string) (bool, error)

GreaterThanOrEqual checks if the current version is greater than or equal to another version.

Jump to

Keyboard shortcuts

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