version

package
v1.200.0 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2025 License: Apache-2.0 Imports: 31 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.

type VersionOptions added in v1.198.0

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

VersionOptions contains parsed flags for the version command.

Jump to

Keyboard shortcuts

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