format

package
v0.64.0 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2026 License: Apache-2.0 Imports: 7 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ISO8601Extended

func ISO8601Extended(t time.Time) string

ISO8601Extended format

func JSONMarshalIndent

func JSONMarshalIndent(src any, prefix, indent string) string

JSONMarshalIndent call json.MarshalIndent and replace encoded angle brackets

func PrettyPrintJSON

func PrettyPrintJSON(outStream io.Writer, src any, query string) error

PrettyPrintJSON outputs JSON or filtered result by jq query via stdout.

Types

type Host

type Host struct {
	ID            string            `json:"id,omitempty"`
	Name          string            `json:"name,omitempty"`
	DisplayName   string            `json:"displayName,omitempty"`
	Status        string            `json:"status,omitempty"`
	Memo          string            `json:"memo,omitempty"`
	RoleFullnames []string          `json:"roleFullnames,omitempty"`
	IsRetired     bool              `json:"isRetired"` // 'omitempty' regard boolean 'false' as empty.
	CreatedAt     string            `json:"createdAt,omitempty"`
	IPAddresses   map[string]string `json:"ipAddresses,omitempty"`
}

Host defines output json structure.

Jump to

Keyboard shortcuts

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