output

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: May 11, 2026 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FilterDefaultContexts

func FilterDefaultContexts(contexts []config.Context, defaultContext string, wantDefault bool) []config.Context

Types

type ConfigInfo

type ConfigInfo struct {
	Context  string         `json:"context" yaml:"context"`
	Endpoint string         `json:"endpoint" yaml:"endpoint"`
	Config   map[string]any `json:"config" yaml:"config"`
}

type Formatter

type Formatter struct {
	// contains filtered or unexported fields
}

Formatter represents formatter struct with custom io.Writer

func NewFormatter

func NewFormatter(cmd *cobra.Command, manager *config.Manager) *Formatter

NewFormatter creates new formatter with specified io.Writer

func (*Formatter) Format

func (f *Formatter) Format(v any) error

Format formats data according to format

func (*Formatter) FormatContexts

func (f *Formatter) FormatContexts(contexts []config.Context, defaultContext string) error

func (*Formatter) FormatSkeleton added in v0.10.0

func (f *Formatter) FormatSkeleton(path string) error

FormatSkeleton formats skeleton template in json format

func (*Formatter) FormatText added in v0.2.0

func (f *Formatter) FormatText(v any) error

FormatText formats data in text format

func (*Formatter) GetOutput added in v0.2.0

func (f *Formatter) GetOutput() string

GetOutput returns output type

func (*Formatter) GetTemplateStr added in v0.2.0

func (f *Formatter) GetTemplateStr() string

GetTemplateStr returns template string

func (*Formatter) ListEntityFields added in v0.2.0

func (f *Formatter) ListEntityFields(fields []entities.Field)

ListEntityFields prints available fields

func (*Formatter) SetOutput added in v0.10.0

func (f *Formatter) SetOutput(o string)

SetOutput sets output

func (*Formatter) SetTemplate added in v0.2.0

func (f *Formatter) SetTemplate(t *template.Template)

SetTemplate sets template

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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