formatter

package
v0.5.1-rc2 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Format

func Format(resp *http.Response, opts Options) ([]byte, error)

Format generate formatted result for response.

Types

type Formatter

type Formatter interface {
	Format(*http.Response) ([]byte, error)
}

Formatter generate formatted result for response.

type JsonFormatter

type JsonFormatter struct{}

JsonFormatter use to convert response to json format.

func (*JsonFormatter) Format

func (f *JsonFormatter) Format(resp *http.Response) ([]byte, error)

type Options added in v0.5.0

type Options struct {
	Format    string
	Columns   []string
	Group     string
	Operation string
}

type TableFormatter

type TableFormatter struct {
	Columns   []string
	Group     string
	Operation string
}

TableFormatter use to convert response to table format.

func (*TableFormatter) Format

func (f *TableFormatter) Format(resp *http.Response) ([]byte, error)

type YamlFormatter

type YamlFormatter struct{}

YamlFormatter use to convert response to yaml format.

func (*YamlFormatter) Format

func (f *YamlFormatter) Format(resp *http.Response) ([]byte, error)

Jump to

Keyboard shortcuts

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