Help us shape the future of Go! Take the 2026 Go Developer Survey

output

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const APIVersion = "1.0"

Variables

View Source
var JSONMode bool

Functions

func FormatError

func FormatError(err error) error

func FormatErrorCode

func FormatErrorCode(code, message string) error

func FormatPS

func FormatPS(containers []ContainerJSON) error

func FormatProjectList

func FormatProjectList(projects []ProjectJSON) error

func IsJSONMode

func IsJSONMode() bool

func PrintError

func PrintError(code, message string) error

func PrintJSON

func PrintJSON(data interface{}) error

func PrintSuccess

func PrintSuccess(message string) error

func SetJSONMode

func SetJSONMode(enabled bool)

Types

type ContainerJSON

type ContainerJSON struct {
	Name         string     `json:"name"`
	Image        string     `json:"image"`
	Command      string     `json:"command"`
	Service      string     `json:"service"`
	State        string     `json:"state"`
	Status       string     `json:"status"`
	Ports        []PortJSON `json:"ports"`
	ExposedPorts []string   `json:"exposed_ports,omitempty"`
	Networks     []string   `json:"networks,omitempty"`
	Mounts       []string   `json:"mounts,omitempty"`
	CreatedAt    time.Time  `json:"created_at"`
	ExitedAt     time.Time  `json:"exited_at,omitempty"`
	ExitCode     int        `json:"exit_code,omitempty"`
	DBusActive   string     `json:"dbus_active,omitempty"`
	DBusSub      string     `json:"dbus_sub,omitempty"`
}

type Envelope

type Envelope struct {
	Version string      `json:"version"`
	Data    interface{} `json:"data"`
}

type ErrorEnvelope

type ErrorEnvelope struct {
	Version string     `json:"version"`
	Error   *ErrorInfo `json:"error"`
}

type ErrorInfo

type ErrorInfo struct {
	Code    string `json:"code"`
	Message string `json:"message"`
}

type PSData

type PSData struct {
	Containers []ContainerJSON `json:"containers"`
}

type PortJSON

type PortJSON struct {
	Protocol      string `json:"protocol"`
	ContainerPort int    `json:"container_port"`
	HostIP        string `json:"host_ip"`
	HostPort      int    `json:"host_port"`
}

type ProjectJSON

type ProjectJSON struct {
	Name       string         `json:"name"`
	SourcePath string         `json:"source_path"`
	Files      int            `json:"files"`
	Resources  *ResourcesJSON `json:"resources,omitempty"`
}

type ProjectListData

type ProjectListData struct {
	Projects []ProjectJSON `json:"projects"`
}

type ResourcesJSON

type ResourcesJSON struct {
	Containers []string `json:"containers"`
	Networks   []string `json:"networks"`
	Volumes    []string `json:"volumes"`
	Images     []string `json:"images"`
	Builds     []string `json:"builds"`
}

Jump to

Keyboard shortcuts

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