cli

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: May 29, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func OutputJSONError

func OutputJSONError(err error) error

func OutputJSONSuccess

func OutputJSONSuccess(data any) error

func PrintBands

func PrintBands(bands []resistor.Color)

func PrintHeader

func PrintHeader(title string)

func Respond

func Respond(jsonOutput bool, data any, err error) error

Unified handler for success + error

Types

type JSONResponse

type JSONResponse struct {
	Success bool   `json:"success"`
	Data    any    `json:"data,omitempty"`
	Error   string `json:"error,omitempty"`
}

Jump to

Keyboard shortcuts

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