cmd

package
v0.25.0 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2025 License: MIT Imports: 39 Imported by: 0

Documentation

Overview

Package cmd provides the command line interface for quad-ops

Package cmd provides artifact helper functions for cross-platform support

Package cmd provides the command line interface for quad-ops

Copyright © 2025 Travis Lyons travis.lyons@gmail.com

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Package cmd provides config init command functionality for quad-ops CLI

Package cmd provides config show command functionality for quad-ops CLI

Package cmd provides the command line interface for quad-ops

Copyright © 2025 Travis Lyons travis.lyons@gmail.com

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Package cmd provides the command line interface for quad-ops

Copyright © 2025 Travis Lyons travis.lyons@gmail.com

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Package cmd provides the command line interface for quad-ops

Copyright © 2025 Travis Lyons travis.lyons@gmail.com

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Package cmd contains the command-line interface (CLI) for quad-ops.

Package cmd contains legacy patterns that are being migrated.

This file exists as a placeholder to track deprecated patterns during the migration to dependency injection. It should be removed once all commands have been successfully migrated.

Deprecated patterns being removed: - Global variables for command state - Direct os.Exit() calls in command handlers - Global test seams for mocking system dependencies

Package cmd provides output formatting utilities for quad-ops CLI.

Package cmd provides the command line interface for quad-ops

Copyright © 2025 Travis Lyons travis.lyons@gmail.com

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Package cmd provides the command line interface for quad-ops

Copyright © 2025 Travis Lyons travis.lyons@gmail.com

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Package cmd provides unit command functionality for quad-ops CLI

Package cmd provides unit command functionality for quad-ops CLI

Package cmd provides unit command functionality for quad-ops CLI

Package cmd provides unit command functionality for quad-ops CLI

Package cmd provides the command line interface for quad-ops

Copyright © 2025 Travis Lyons travis.lyons@gmail.com

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Package cmd provides the command line interface for quad-ops

Copyright © 2025 Travis Lyons travis.lyons@gmail.com

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Package cmd provides the command line interface for quad-ops

Copyright © 2025 Travis Lyons travis.lyons@gmail.com

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Package cmd provides the command line interface for quad-ops

Copyright © 2025 Travis Lyons travis.lyons@gmail.com

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Index

Constants

View Source
const (
	SdNotifyReady    = daemon.SdNotifyReady
	SdNotifyWatchdog = daemon.SdNotifyWatchdog
)

Systemd notification constants (re-exported for Linux).

Variables

View Source
var (
	Version = "dev"
	Commit  = "none"
	Date    = "unknown"
)

Build information set by goreleaser.

Functions

func AssertCommandFailure added in v0.21.0

func AssertCommandFailure(t *testing.T, cmd *cobra.Command, args []string, expectedError string)

AssertCommandFailure verifies a command fails with expected error.

func AssertCommandOutput added in v0.21.0

func AssertCommandOutput(t *testing.T, cmd *cobra.Command, args []string, expectedOutputs ...string)

AssertCommandOutput verifies command output contains expected strings.

func AssertCommandSuccess added in v0.21.0

func AssertCommandSuccess(t *testing.T, cmd *cobra.Command, args []string)

AssertCommandSuccess verifies a command executed successfully.

func ExecuteCommand added in v0.21.0

func ExecuteCommand(t *testing.T, cmd *cobra.Command, args []string) error

ExecuteCommand is a simpler helper for commands that don't need output capture.

func ExecuteCommandWithCapture added in v0.21.0

func ExecuteCommandWithCapture(t *testing.T, cmd *cobra.Command, args []string) (output string, err error)

ExecuteCommandWithCapture executes a cobra command and captures all output (stdout/stderr). This handles both cmd.Print* and fmt.Print* outputs by redirecting os.Stdout/os.Stderr.

func PrintOutput added in v0.21.0

func PrintOutput(format string, data interface{}) error

PrintOutput formats and prints data according to the specified output format.

func SetupCommandContext added in v0.21.0

func SetupCommandContext(cmd *cobra.Command, app *App)

SetupCommandContext creates a command with app context for testing.

Types

type App added in v0.21.0

type App struct {
	Logger         log.Logger
	Config         *config.Settings
	ConfigProvider config.Provider
	Runner         execx.Runner
	FSService      *fs.Service

	// Phase 6: New architecture components (non-platform)
	ArtifactStore     repository.ArtifactStore  // Stores deployed platform artifacts
	RepoArtifactStore repository.ArtifactStore  // Stores managed artifacts in repository
	GitSyncer         repository.GitSyncer      // Syncs git repositories
	ComposeProcessor  ComposeProcessorInterface // Processes compose to service specs

	Validator    SystemValidator
	OutputFormat string
	// contains filtered or unexported fields
}

App holds the application dependencies for command line interface.

func NewApp added in v0.21.0

func NewApp(logger log.Logger, configProv config.Provider) (*App, error)

NewApp creates a new App with all dependencies initialized. Platform-specific components (Renderer, Lifecycle) are initialized lazily on first use.

func (*App) GetLifecycle added in v0.22.0

func (a *App) GetLifecycle(_ context.Context) (LifecycleInterface, error)

GetLifecycle returns the platform lifecycle manager, initializing it if necessary.

func (*App) GetRenderer added in v0.22.0

func (a *App) GetRenderer(_ context.Context) (RendererInterface, error)

GetRenderer returns the platform renderer, initializing it if necessary.

func (*App) IsPlatformAvailable added in v0.22.0

func (a *App) IsPlatformAvailable() bool

IsPlatformAvailable returns true if platform-specific features are available.

type ArtifactStoreInterface added in v0.22.0

type ArtifactStoreInterface interface {
	Write(ctx context.Context, artifacts []platform.Artifact) ([]string, error)
	List(ctx context.Context) ([]platform.Artifact, error)
	Delete(ctx context.Context, paths []string) error
}

ArtifactStoreInterface wraps repository.ArtifactStore for testing.

type CheckResult added in v0.21.0

type CheckResult struct {
	Name        string
	Passed      bool
	Message     string
	Suggestions []string
}

CheckResult represents the result of a diagnostic check.

type CheckResultStructured added in v0.21.0

type CheckResultStructured struct {
	Name        string   `json:"name" yaml:"name"`
	Status      string   `json:"status" yaml:"status"`
	Message     string   `json:"message,omitempty" yaml:"message,omitempty"`
	Suggestions []string `json:"suggestions,omitempty" yaml:"suggestions,omitempty"`
}

CheckResultStructured represents a health check result in structured format.

type CommonDeps added in v0.21.0

type CommonDeps struct {
	Clock      clock.Clock
	FileSystem FileSystem
	Logger     log.Logger
}

CommonDeps provides dependencies common across commands.

func NewCommonDeps added in v0.21.0

func NewCommonDeps(logger log.Logger) CommonDeps

NewCommonDeps creates production common dependencies.

func NewRootDeps added in v0.21.0

func NewRootDeps(app *App) CommonDeps

NewRootDeps creates common root dependencies for all commands. This helper reduces duplication in buildDeps methods.

type ComposeProcessorInterface added in v0.22.0

type ComposeProcessorInterface interface {
	Process(ctx context.Context, project *types.Project) ([]service.Spec, error)
}

ComposeProcessorInterface processes Docker Compose projects to service specs.

type ConfigCommand

type ConfigCommand struct{}

ConfigCommand represents the config command for quad-ops CLI.

func NewConfigCommand added in v0.21.0

func NewConfigCommand() *ConfigCommand

NewConfigCommand creates a new ConfigCommand.

func (*ConfigCommand) GetCobraCommand

func (c *ConfigCommand) GetCobraCommand() *cobra.Command

GetCobraCommand returns the cobra command for config operations.

type ConfigShowCommand added in v0.24.0

type ConfigShowCommand struct{}

ConfigShowCommand represents the config show command.

func NewConfigShowCommand added in v0.24.0

func NewConfigShowCommand() *ConfigShowCommand

NewConfigShowCommand creates a new ConfigShowCommand.

func (*ConfigShowCommand) GetCobraCommand added in v0.24.0

func (c *ConfigShowCommand) GetCobraCommand() *cobra.Command

GetCobraCommand returns the cobra command for config show operations.

type DaemonCommand added in v0.21.0

type DaemonCommand struct{}

DaemonCommand represents the daemon command for quad-ops CLI.

func NewDaemonCommand added in v0.21.0

func NewDaemonCommand() *DaemonCommand

NewDaemonCommand creates a new DaemonCommand.

func (*DaemonCommand) GetCobraCommand added in v0.21.0

func (c *DaemonCommand) GetCobraCommand() *cobra.Command

GetCobraCommand returns the cobra command for daemon operations.

func (*DaemonCommand) Run added in v0.21.0

func (c *DaemonCommand) Run(ctx context.Context, app *App, opts DaemonOptions, deps DaemonDeps) error

Run executes the daemon with injected dependencies.

type DaemonDeps added in v0.21.0

type DaemonDeps struct {
	CommonDeps
	Notify      NotifyFunc
	SyncCommand SyncRunner
}

DaemonDeps holds daemon dependencies.

type DaemonOptions added in v0.21.0

type DaemonOptions struct {
	SyncInterval time.Duration
	RepoName     string
	Force        bool
}

DaemonOptions holds daemon command options.

type DoctorCommand added in v0.21.0

type DoctorCommand struct{}

DoctorCommand represents the doctor command for quad-ops CLI.

func NewDoctorCommand added in v0.21.0

func NewDoctorCommand() *DoctorCommand

NewDoctorCommand creates a new DoctorCommand.

func (*DoctorCommand) GetCobraCommand added in v0.21.0

func (c *DoctorCommand) GetCobraCommand() *cobra.Command

GetCobraCommand returns the cobra command for doctor operations.

func (*DoctorCommand) Run added in v0.21.0

func (c *DoctorCommand) Run(_ context.Context, app *App, _ DoctorOptions, deps DoctorDeps) error

Run executes the doctor command with injected dependencies.

type DoctorDeps added in v0.21.0

type DoctorDeps struct {
	CommonDeps
	ViperConfigFile func() string
	GetOS           func() string
}

DoctorDeps holds doctor dependencies.

type DoctorOptions added in v0.21.0

type DoctorOptions struct {
}

DoctorOptions holds doctor command options.

type DownCommand added in v0.9.0

type DownCommand struct{}

DownCommand represents the down command for quad-ops CLI.

func NewDownCommand added in v0.21.0

func NewDownCommand() *DownCommand

NewDownCommand creates a new DownCommand.

func (*DownCommand) GetCobraCommand added in v0.9.0

func (c *DownCommand) GetCobraCommand() *cobra.Command

GetCobraCommand returns the cobra command for stopping managed units.

func (*DownCommand) Run added in v0.21.0

func (c *DownCommand) Run(ctx context.Context, app *App, opts DownOptions, deps DownDeps) error

Run executes the down command with injected dependencies.

type DownDeps added in v0.21.0

type DownDeps struct {
	CommonDeps
	Lifecycle     LifecycleInterface
	ArtifactStore ArtifactStoreInterface
}

DownDeps holds down dependencies.

type DownOptions added in v0.21.0

type DownOptions struct {
	Services []string
	All      bool
	Purge    bool
}

DownOptions holds down command options.

type FileSystem added in v0.21.0

type FileSystem interface {
	Stat(string) (fs.FileInfo, error)
	WriteFile(string, []byte, fs.FileMode) error
	Remove(string) error
	MkdirAll(string, fs.FileMode) error
}

FileSystem defines the interface for file system operations.

type FileSystemOps added in v0.21.0

type FileSystemOps struct {
	// Keep public fields for test compatibility
	StatFunc      func(string) (fs.FileInfo, error)
	WriteFileFunc func(string, []byte, fs.FileMode) error
	RemoveFunc    func(string) error
	MkdirAllFunc  func(string, fs.FileMode) error
}

FileSystemOps provides file system operations for dependency injection.

func NewFileSystemOps added in v0.21.0

func NewFileSystemOps() FileSystemOps

NewFileSystemOps returns production file system operations.

func (*FileSystemOps) MkdirAll added in v0.21.0

func (f *FileSystemOps) MkdirAll(path string, perm fs.FileMode) error

MkdirAll creates directories with the given path and permissions.

func (*FileSystemOps) Remove added in v0.21.0

func (f *FileSystemOps) Remove(path string) error

Remove deletes the file at the given path.

func (*FileSystemOps) Stat added in v0.21.0

func (f *FileSystemOps) Stat(path string) (fs.FileInfo, error)

Stat returns file information for the given path.

func (*FileSystemOps) WriteFile added in v0.21.0

func (f *FileSystemOps) WriteFile(path string, data []byte, perm fs.FileMode) error

WriteFile writes data to the given path with specified permissions.

type GitSyncerInterface added in v0.22.0

type GitSyncerInterface interface {
	SyncAll(ctx context.Context, repos []config.Repository) ([]repository.SyncResult, error)
	SyncRepo(ctx context.Context, repo config.Repository) repository.SyncResult
}

GitSyncerInterface wraps repository.GitSyncer for testing.

type HealthCheckOutput added in v0.21.0

type HealthCheckOutput struct {
	Overall string                  `json:"overall" yaml:"overall"`
	Checks  []CheckResultStructured `json:"checks" yaml:"checks"`
	Summary map[string]int          `json:"summary" yaml:"summary"`
}

HealthCheckOutput represents the output of the doctor command.

type ImageCommand added in v0.18.0

type ImageCommand struct{}

ImageCommand represents the image command for quad-ops CLI.

func NewImageCommand added in v0.21.0

func NewImageCommand() *ImageCommand

NewImageCommand creates a new ImageCommand.

func (*ImageCommand) GetCobraCommand added in v0.18.0

func (c *ImageCommand) GetCobraCommand() *cobra.Command

GetCobraCommand returns the cobra command for image operations.

type InitCommand added in v0.24.0

type InitCommand struct{}

InitCommand represents the config init command.

func NewInitCommand added in v0.24.0

func NewInitCommand() *InitCommand

NewInitCommand creates a new InitCommand.

func (*InitCommand) GetCobraCommand added in v0.24.0

func (c *InitCommand) GetCobraCommand() *cobra.Command

GetCobraCommand returns the cobra command for config init.

func (*InitCommand) Run added in v0.24.0

func (c *InitCommand) Run(app *App, opts InitOptions, deps InitDeps) error

Run executes the init command with injected dependencies.

type InitDeps added in v0.24.0

type InitDeps struct {
	CommonDeps
	UserHomeDir func() (string, error)
	MkdirAll    func(string, os.FileMode) error
	WriteFile   func(string, []byte, os.FileMode) error
}

InitDeps holds init dependencies.

type InitOptions added in v0.24.0

type InitOptions struct {
	Force bool
}

InitOptions holds init command options.

type LifecycleInterface added in v0.22.0

type LifecycleInterface interface {
	Name() string
	Reload(ctx context.Context) error
	Start(ctx context.Context, name string) error
	Stop(ctx context.Context, name string) error
	Restart(ctx context.Context, name string) error
	Status(ctx context.Context, name string) (*platform.ServiceStatus, error)
	StartMany(ctx context.Context, names []string) map[string]error
	StopMany(ctx context.Context, names []string) map[string]error
	RestartMany(ctx context.Context, names []string) map[string]error
	Exists(ctx context.Context, name string) (bool, error)
}

LifecycleInterface wraps platform.Lifecycle for testing.

type ListCommand added in v0.18.0

type ListCommand struct{}

ListCommand represents the unit list command.

func NewListCommand added in v0.21.0

func NewListCommand() *ListCommand

NewListCommand creates a new ListCommand.

func (*ListCommand) GetCobraCommand added in v0.18.0

func (c *ListCommand) GetCobraCommand() *cobra.Command

GetCobraCommand returns the cobra command for listing units.

func (*ListCommand) Run added in v0.21.0

func (c *ListCommand) Run(ctx context.Context, app *App, opts ListOptions, deps ListDeps) error

Run executes the list command with injected dependencies.

type ListDeps added in v0.21.0

type ListDeps struct {
	CommonDeps
	RepoArtifactStore repository.ArtifactStore // Git-managed artifacts
	ArtifactStore     repository.ArtifactStore // Deployed filesystem artifacts
}

ListDeps holds list dependencies.

type ListOptions added in v0.21.0

type ListOptions struct {
	Status        bool
	UseFilesystem bool // If true, use filesystem artifacts instead of repo artifacts
}

ListOptions holds list command options.

type NotifyFunc added in v0.21.0

type NotifyFunc func(unsetEnvironment bool, state string) (bool, error)

NotifyFunc represents systemd notification function.

type OperationResult added in v0.21.0

type OperationResult struct {
	Success bool              `json:"success" yaml:"success"`
	Message string            `json:"message,omitempty" yaml:"message,omitempty"`
	Items   []string          `json:"items,omitempty" yaml:"items,omitempty"`
	Errors  []string          `json:"errors,omitempty" yaml:"errors,omitempty"`
	Details map[string]string `json:"details,omitempty" yaml:"details,omitempty"`
}

OperationResult represents the result of an operation that can be output in structured format.

type OutputData added in v0.21.0

type OutputData struct {
	Data interface{} `json:"data,omitempty" yaml:"data,omitempty"`
}

OutputData represents structured data that can be output in multiple formats.

type PullCommand added in v0.18.0

type PullCommand struct{}

PullCommand represents the pull command.

func NewPullCommand added in v0.21.0

func NewPullCommand() *PullCommand

NewPullCommand creates a new PullCommand.

func (*PullCommand) GetCobraCommand added in v0.18.0

func (c *PullCommand) GetCobraCommand() *cobra.Command

GetCobraCommand gets the cobra command.

func (*PullCommand) Run added in v0.21.0

func (c *PullCommand) Run(ctx context.Context, app *App, _ PullOptions, deps PullDeps, args []string) error

Run executes the pull command with injected dependencies.

type PullDeps added in v0.21.0

type PullDeps struct {
	CommonDeps
	ExecCommand func(ctx context.Context, name string, arg ...string) *exec.Cmd
	Environ     func() []string
	Getuid      func() int
}

PullDeps holds pull dependencies.

type PullOptions added in v0.21.0

type PullOptions struct {
}

PullOptions holds pull command options.

type RendererInterface added in v0.22.0

type RendererInterface interface {
	Name() string
	Render(ctx context.Context, specs []service.Spec) (*platform.RenderResult, error)
}

RendererInterface wraps platform.Renderer for testing.

type RootCommand

type RootCommand struct{}

RootCommand represents the root command for quad-ops CLI.

func (*RootCommand) GetCobraCommand

func (c *RootCommand) GetCobraCommand() *cobra.Command

GetCobraCommand returns the cobra root command for quad-ops CLI.

type RootDeps added in v0.21.0

type RootDeps struct {
	CommonDeps
	ValidatePath func(string) error
	ExpandEnv    func(string) string
}

RootDeps holds root dependencies.

type RootOptions added in v0.21.0

type RootOptions struct {
	UserMode       bool
	ConfigFilePath string
	QuadletDir     string
	RepositoryDir  string
	Verbose        bool
	OutputFormat   string
}

RootOptions holds root command options.

type ShowCommand added in v0.18.0

type ShowCommand struct{}

ShowCommand represents the unit show command.

func NewShowCommand added in v0.21.0

func NewShowCommand() *ShowCommand

NewShowCommand creates a new ShowCommand.

func (*ShowCommand) GetCobraCommand added in v0.18.0

func (c *ShowCommand) GetCobraCommand() *cobra.Command

GetCobraCommand returns the cobra command for showing unit details.

func (*ShowCommand) Run added in v0.21.0

func (c *ShowCommand) Run(ctx context.Context, app *App, _ ShowOptions, deps ShowDeps, serviceName string) error

Run executes the show command with injected dependencies.

type ShowDeps added in v0.21.0

type ShowDeps struct {
	CommonDeps
	ArtifactStore repository.ArtifactStore
}

ShowDeps holds show dependencies.

type ShowOptions added in v0.21.0

type ShowOptions struct{}

ShowOptions holds show command options.

type StatusCommand added in v0.18.0

type StatusCommand struct{}

StatusCommand represents the unit status command.

func NewStatusCommand added in v0.21.0

func NewStatusCommand() *StatusCommand

NewStatusCommand creates a new StatusCommand.

func (*StatusCommand) GetCobraCommand added in v0.18.0

func (c *StatusCommand) GetCobraCommand() *cobra.Command

GetCobraCommand returns the cobra command for checking unit status.

func (*StatusCommand) Run added in v0.21.0

func (c *StatusCommand) Run(ctx context.Context, app *App, _ StatusOptions, deps StatusDeps, serviceName string) error

Run executes the status command with injected dependencies.

type StatusDeps added in v0.21.0

type StatusDeps struct {
	CommonDeps
}

StatusDeps holds status dependencies.

type StatusOptions added in v0.21.0

type StatusOptions struct{}

StatusOptions holds status command options.

type SyncCommand

type SyncCommand struct{}

SyncCommand represents the sync command for quad-ops CLI.

func NewSyncCommand added in v0.21.0

func NewSyncCommand() *SyncCommand

NewSyncCommand creates a new SyncCommand.

func (*SyncCommand) GetCobraCommand

func (c *SyncCommand) GetCobraCommand() *cobra.Command

GetCobraCommand returns the cobra command for sync operations.

func (*SyncCommand) Run added in v0.21.0

func (c *SyncCommand) Run(ctx context.Context, app *App, opts SyncOptions, deps SyncDeps) error

Run executes the sync command with injected dependencies.

type SyncDeps added in v0.21.0

type SyncDeps struct {
	CommonDeps
	GitSyncer        GitSyncerInterface
	ComposeProcessor ComposeProcessorInterface
	Renderer         RendererInterface
	ArtifactStore    ArtifactStoreInterface
	Lifecycle        LifecycleInterface
}

SyncDeps holds sync dependencies.

type SyncOptions added in v0.21.0

type SyncOptions struct {
	DryRun   bool
	RepoName string
	Force    bool
	PullOnly bool
}

SyncOptions holds sync command options.

type SyncRunner added in v0.22.0

type SyncRunner interface {
	Run(context.Context, *App, SyncOptions, SyncDeps) error
	// contains filtered or unexported methods
}

SyncRunner defines the interface for performing sync operations.

type SystemValidator added in v0.21.0

type SystemValidator interface {
	SystemRequirements() error
}

SystemValidator provides system validation capabilities for commands.

type UnitCommand added in v0.18.0

type UnitCommand struct{}

UnitCommand represents the unit command for quad-ops CLI.

func NewUnitCommand added in v0.21.0

func NewUnitCommand() *UnitCommand

NewUnitCommand creates a new UnitCommand.

func (*UnitCommand) GetCobraCommand added in v0.18.0

func (c *UnitCommand) GetCobraCommand() *cobra.Command

GetCobraCommand returns the cobra command for unit operations.

type UnsupportedPlatformError added in v0.22.0

type UnsupportedPlatformError struct {
	Platform string
	Feature  string
}

UnsupportedPlatformError is returned when a platform-specific feature is not available.

func (*UnsupportedPlatformError) Error added in v0.22.0

func (e *UnsupportedPlatformError) Error() string

type UpCommand added in v0.9.0

type UpCommand struct{}

UpCommand represents the up command for quad-ops CLI.

func NewUpCommand added in v0.21.0

func NewUpCommand() *UpCommand

NewUpCommand creates a new UpCommand.

func (*UpCommand) GetCobraCommand added in v0.9.0

func (c *UpCommand) GetCobraCommand() *cobra.Command

GetCobraCommand returns the cobra command for starting managed units.

func (*UpCommand) Run added in v0.21.0

func (c *UpCommand) Run(ctx context.Context, app *App, opts UpOptions, deps UpDeps) error

Run executes the up command with injected dependencies. This method orchestrates the workflow: ComposeProcessor → Renderer → ArtifactStore → Lifecycle.

type UpDeps added in v0.21.0

type UpDeps struct {
	CommonDeps
	ComposeProcessor ComposeProcessorInterface
	Renderer         RendererInterface
	ArtifactStore    ArtifactStoreInterface
	Lifecycle        LifecycleInterface
}

UpDeps holds up dependencies.

type UpOptions added in v0.21.0

type UpOptions struct {
	Services []string
	Force    bool
	DryRun   bool
	RepoName string
}

UpOptions holds up command options.

type UpdateCommand added in v0.11.0

type UpdateCommand struct{}

UpdateCommand represents the update command.

func NewUpdateCommand added in v0.21.0

func NewUpdateCommand() *UpdateCommand

NewUpdateCommand creates a new UpdateCommand.

func (*UpdateCommand) GetCobraCommand added in v0.11.0

func (c *UpdateCommand) GetCobraCommand() *cobra.Command

GetCobraCommand returns the cobra command for updating the binary.

type ValidateCommand added in v0.20.0

type ValidateCommand struct{}

ValidateCommand represents the validate command for quad-ops CLI.

func NewValidateCommand added in v0.21.0

func NewValidateCommand() *ValidateCommand

NewValidateCommand creates a new ValidateCommand.

func (*ValidateCommand) GetCobraCommand added in v0.20.0

func (c *ValidateCommand) GetCobraCommand() *cobra.Command

GetCobraCommand returns the cobra command for validate operations.

type VersionCommand added in v0.11.0

type VersionCommand struct{}

VersionCommand represents the version command.

func NewVersionCommand added in v0.21.0

func NewVersionCommand() *VersionCommand

NewVersionCommand creates a new VersionCommand.

func (*VersionCommand) GetCobraCommand added in v0.11.0

func (c *VersionCommand) GetCobraCommand() *cobra.Command

GetCobraCommand returns the cobra command for displaying version information.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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