common

package
v0.0.0-...-26156a0 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2025 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CephExecutor

type CephExecutor struct {
	KeyringFile string
	ConfFile    string
}

CephExecutor implementation

func NewCephExecutor

func NewCephExecutor(keyringFile, confFile string) *CephExecutor

func (*CephExecutor) Execute

func (e *CephExecutor) Execute(command string, args []string, opts ...ExecuteOption) (*ExecuteResult, error)

type ExecuteOption

type ExecuteOption func(*executeOptions)

ExecuteOption defines the function type for execution options

func WithOutputFormat

func WithOutputFormat(format string) ExecuteOption

func WithPrintCommand

func WithPrintCommand() ExecuteOption

Define option setting functions

func WithTimeout

func WithTimeout(seconds int) ExecuteOption

func WithVerbose

func WithVerbose() ExecuteOption

type ExecuteResult

type ExecuteResult struct {
	Command  string   `json:"command"`
	Args     []string `json:"args"`
	Output   string   `json:"output"`
	Error    string   `json:"error,omitempty"`
	ExitCode int      `json:"exit_code"`
}

ExecuteResult defines the execution result

type Executor

type Executor interface {
	Execute(command string, args []string, opts ...ExecuteOption) (*ExecuteResult, error)
}

Command executor interface

Jump to

Keyboard shortcuts

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