Documentation
¶
Index ¶
- Constants
- func ParseGPUUUIDs(raw string) []string
- func ParseOutputFormat(raw string) (string, error)
- func ResolveDataDir(cliContext *cli.Context) (string, error)
- func StateFileFromContext(cliContext *cli.Context) (string, error)
- func VersionFileFromContext(cliContext *cli.Context, flagValue string, flagSet bool) (string, error)
- func WrapOutputError(outputFormat, code string, err error) error
- func WriteJSON(v any) error
- func WriteJSONToWriter(w io.Writer, v any) error
- type JSONCommandError
- type JSONCommandErrorPayload
- type JSONCommandErrorResponse
Constants ¶
View Source
const ( OutputFormatPlain = "plain" OutputFormatJSON = "json" )
Variables ¶
This section is empty.
Functions ¶
func ParseGPUUUIDs ¶
ParseGPUUUIDs parses a comma-separated string of GPU UUIDs and returns a slice of trimmed UUIDs. Empty strings and strings with only spaces are filtered out.
func ParseOutputFormat ¶ added in v0.11.0
ParseOutputFormat validates and normalizes output format values. Empty values default to plain output.
func ResolveDataDir ¶ added in v0.9.0
ResolveDataDir resolves the data directory using the --data-dir flag when provided, otherwise it falls back to the default GPUd data directory selection logic.
func StateFileFromContext ¶ added in v0.9.0
StateFileFromContext returns the state file path derived from the resolved data directory.
func VersionFileFromContext ¶ added in v0.9.0
func VersionFileFromContext(cliContext *cli.Context, flagValue string, flagSet bool) (string, error)
VersionFileFromContext returns the version file path, honoring user overrides.
func WrapOutputError ¶ added in v0.11.0
Types ¶
type JSONCommandError ¶ added in v0.11.0
type JSONCommandError struct {
// contains filtered or unexported fields
}
func AsJSONCommandError ¶ added in v0.11.0
func AsJSONCommandError(err error) (*JSONCommandError, bool)
func NewJSONCommandError ¶ added in v0.11.0
func NewJSONCommandError(code string, message string, exitCode int) *JSONCommandError
func (*JSONCommandError) Code ¶ added in v0.11.0
func (e *JSONCommandError) Code() string
func (*JSONCommandError) Error ¶ added in v0.11.0
func (e *JSONCommandError) Error() string
func (*JSONCommandError) ExitStatus ¶ added in v0.11.0
func (e *JSONCommandError) ExitStatus() int
func (*JSONCommandError) Response ¶ added in v0.11.0
func (e *JSONCommandError) Response() JSONCommandErrorResponse
type JSONCommandErrorPayload ¶ added in v0.11.0
type JSONCommandErrorResponse ¶ added in v0.11.0
type JSONCommandErrorResponse struct {
Error JSONCommandErrorPayload `json:"error"`
}
Click to show internal directories.
Click to hide internal directories.