cli

package
v0.92.0 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2023 License: GPL-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package cli provides a client SDK for outputting data to a terminal in multiple formats

Index

Constants

View Source
const (
	OutputStyleJSON       = "json"
	OutputStyleJSONPretty = "json_pretty"
	OutputStyleTabby      = "tabby" // Default
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CLIClient added in v0.58.0

type CLIClient struct {
	APIClient    *apiclient.APIClient
	OutputStyle  string
	TabbyHeaders []string
}

func New

func New(client *http.Client, host, key string, port int, protocol, outputStyle string) (*CLIClient, error)

func NewFromViper added in v0.58.0

func NewFromViper(client *http.Client) (*CLIClient, error)

func (*CLIClient) FetchAndOutput added in v0.60.0

func (c *CLIClient) FetchAndOutput(f func() (apiresponse.TabbyPrinter, error)) error

func (*CLIClient) OutputObject added in v0.58.0

func (c *CLIClient) OutputObject(tabby_printer apiresponse.TabbyPrinter) error

OutputObject prints indented or unindented json, or an ascii table (tabby) (depending on *CLIClient#OutputStyle) to stdout

func (*CLIClient) PromptForAttribute added in v0.58.0

func (c *CLIClient) PromptForAttribute() (models.Attribute, error)

func (*CLIClient) PromptForAttributes added in v0.72.0

func (c *CLIClient) PromptForAttributes() (attributes []models.Attribute, err error)

func (*CLIClient) PromptForTags added in v0.78.0

func (c *CLIClient) PromptForTags() (tags []models.Tag, err error)

Jump to

Keyboard shortcuts

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