Help us shape the future of Go! Take the 2026 Go Developer Survey

version

package
v1.233.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetAtmosConfig

func SetAtmosConfig(config *schema.AtmosConfiguration)

SetAtmosConfig sets the Atmos configuration for the version command. This is called from root.go after atmosConfig is initialized.

Types

type GitHubClient

type GitHubClient interface {
	GetReleases(owner, repo string, opts ReleaseOptions) ([]*go_github.RepositoryRelease, error)
	GetRelease(owner, repo, tag string) (*go_github.RepositoryRelease, error)
	GetLatestRelease(owner, repo string) (*go_github.RepositoryRelease, error)
}

GitHubClient interface for fetching releases (enables mocking).

type MockGitHubClient

type MockGitHubClient struct {
	Releases []*go_github.RepositoryRelease
	Release  *go_github.RepositoryRelease
	Err      error
}

MockGitHubClient for testing (no API calls).

func (*MockGitHubClient) GetLatestRelease

func (m *MockGitHubClient) GetLatestRelease(owner, repo string) (*go_github.RepositoryRelease, error)

GetLatestRelease returns a mock latest release.

func (*MockGitHubClient) GetRelease

func (m *MockGitHubClient) GetRelease(owner, repo, tag string) (*go_github.RepositoryRelease, error)

GetRelease returns a mock release.

func (*MockGitHubClient) GetReleases

func (m *MockGitHubClient) GetReleases(owner, repo string, opts ReleaseOptions) ([]*go_github.RepositoryRelease, error)

GetReleases returns mock releases.

type RealGitHubClient

type RealGitHubClient struct{}

RealGitHubClient implements GitHubClient using the real GitHub API.

func (*RealGitHubClient) GetLatestRelease

func (c *RealGitHubClient) GetLatestRelease(owner, repo string) (*go_github.RepositoryRelease, error)

GetLatestRelease fetches the latest stable release.

func (*RealGitHubClient) GetRelease

func (c *RealGitHubClient) GetRelease(owner, repo, tag string) (*go_github.RepositoryRelease, error)

GetRelease fetches a specific release by tag.

func (*RealGitHubClient) GetReleases

func (c *RealGitHubClient) GetReleases(owner, repo string, opts ReleaseOptions) ([]*go_github.RepositoryRelease, error)

GetReleases fetches releases from GitHub.

type ReleaseOptions

type ReleaseOptions struct {
	Limit              int
	Offset             int
	IncludePrereleases bool
	Since              *time.Time
}

ReleaseOptions contains options for fetching releases.

type VersionCommandProvider

type VersionCommandProvider struct{}

VersionCommandProvider implements the CommandProvider interface.

func (*VersionCommandProvider) GetAliases added in v1.199.0

func (v *VersionCommandProvider) GetAliases() []internal.CommandAlias

GetAliases returns command aliases. Version command has no aliases.

func (*VersionCommandProvider) GetCommand

func (v *VersionCommandProvider) GetCommand() *cobra.Command

GetCommand returns the version command.

func (*VersionCommandProvider) GetCompatibilityFlags added in v1.198.0

func (v *VersionCommandProvider) GetCompatibilityFlags() map[string]compat.CompatibilityFlag

GetCompatibilityFlags returns compatibility flags for this command. Version command has no compatibility flags (uses native Cobra flags only).

func (*VersionCommandProvider) GetFlagsBuilder added in v1.198.0

func (v *VersionCommandProvider) GetFlagsBuilder() flags.Builder

GetFlagsBuilder returns the flags builder for this command. Version command uses StandardParser for its flags.

func (*VersionCommandProvider) GetGroup

func (v *VersionCommandProvider) GetGroup() string

GetGroup returns the command group for help organization.

func (*VersionCommandProvider) GetName

func (v *VersionCommandProvider) GetName() string

GetName returns the command name.

func (*VersionCommandProvider) GetPositionalArgsBuilder added in v1.198.0

func (v *VersionCommandProvider) GetPositionalArgsBuilder() *flags.PositionalArgsBuilder

GetPositionalArgsBuilder returns the positional args builder for this command. Version command has no positional arguments.

func (*VersionCommandProvider) IsExperimental added in v1.205.0

func (v *VersionCommandProvider) IsExperimental() bool

IsExperimental returns whether this command is experimental.

type VersionOptions added in v1.198.0

type VersionOptions struct {
	global.Flags
	Check  bool
	Format string
}

VersionOptions contains parsed flags for the version command.

Directories

Path Synopsis
Package track implements the `atmos version track` command group: the Atmos Version Tracker's verbs for locking, updating, inspecting, and applying managed external versions.
Package track implements the `atmos version track` command group: the Atmos Version Tracker's verbs for locking, updating, inspecting, and applying managed external versions.

Jump to

Keyboard shortcuts

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