Documentation ¶
Index ¶
- func Fields(fields ...interface{}) []string
- func FormatTable(ctx Context, gap string, data [][]string)
- func OutputModeCondition(opts *Options, mode string) options.Condition
- func Print(list []Object, msg string, args ...interface{})
- func SelectBest(name string, candidates ...string) (string, int)
- func Selected(mode string) func(o options.OptionSetProvider) bool
- type AttrProcessingOutput
- type AttributeSet
- type ChainFunction
- type ComplexProcessingOutput
- type Destination
- type DestinationOutput
- type ElementOutput
- type FunctionProcessingOutput
- type ItemList
- type JSONOutput
- type JSONProcessingOutput
- type Manifest
- type ManifestOutput
- type NopOutput
- type Object
- type Objects
- type Options
- func (o *Options) AdaptChain(errvar *error, chain processing.ProcessChain) processing.ProcessChain
- func (o *Options) AddFlags(fs *pflag.FlagSet)
- func (o *Options) CompleteAll(ctx clictx.Context) error
- func (o *Options) Configure(ctx clictx.Context) error
- func (o *Options) Get(proto interface{}) bool
- func (o *Options) LogContext() logging.Context
- func (o *Options) OptimizeColumns(n int) *Options
- func (o *Options) Options(proto options.Options) interface{}
- func (o *Options) SortColumns(fields ...string) *Options
- func (o *Options) Usage() string
- func (o *Options) UseColumnOptimization() bool
- func (o *Options) WithSession(s ocm.Session) *Options
- func (o *Options) WithStatusCheck(f StatusCheckFunction) *Options
- type Output
- type OutputFactory
- type OutputFunction
- type Outputs
- type SingleElementOutput
- type SortFields
- type StatusCheckFunction
- type StringOutput
- type TableOutput
- type TableProcessingOutput
- type TreeElemTitleFunc
- type TreeNodeMappingFunc
- type TreeOutputOption
- type TreeOutputOptions
- func (o TreeOutputOptions) Apply(opts ...TreeOutputOption) TreeOutputOptions
- func (o TreeOutputOptions) ApplyTreeOutputOption(opts *TreeOutputOptions)
- func (o TreeOutputOptions) ElemTitle(obj *tree.TreeObject) string
- func (o TreeOutputOptions) NodeMapping(n int, obj *tree.TreeObject) interface{}
- func (o TreeOutputOptions) NodeTitle(obj *tree.TreeObject) string
- type TreeSymbol
- type TreeSynthesizedTitleFunc
- type YAMLOutput
- type YAMLProcessingOutput
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Fields ¶
func Fields(fields ...interface{}) []string
Fields composes a (string) field list based on a sequence of strings and or field lists.
func FormatTable ¶
Types ¶
type AttrProcessingOutput ¶
type AttrProcessingOutput struct { ElementOutput // contains filtered or unexported fields }
func NewProcessingAttrOutput ¶
func NewProcessingAttrOutput(opts *Options, chain ProcessChain, header ...string) *AttrProcessingOutput
func (*AttrProcessingOutput) Out ¶
func (this *AttrProcessingOutput) Out() error
type AttributeSet ¶
type AttributeSet struct {
// contains filtered or unexported fields
}
func NewAttributeSet ¶
func NewAttributeSet() *AttributeSet
func (*AttributeSet) Attribute ¶
func (this *AttributeSet) Attribute(name, value string)
func (*AttributeSet) Attributef ¶
func (this *AttributeSet) Attributef(name, f string, args ...interface{})
func (*AttributeSet) PrintAttributes ¶
func (this *AttributeSet) PrintAttributes(ctx out.Context)
func (*AttributeSet) ResetAttributes ¶
func (this *AttributeSet) ResetAttributes()
type ChainFunction ¶
type ChainFunction func(opts *Options) processing.ProcessChain
func ComposeChain ¶
func ComposeChain(funcs ...ChainFunction) ChainFunction
type ComplexProcessingOutput ¶
type ComplexProcessingOutput struct { ElementOutput // contains filtered or unexported fields }
func NewProcessingComplexOutput ¶
func NewProcessingComplexOutput(opts *Options, chain ProcessChain, fields ...string) *ComplexProcessingOutput
func (*ComplexProcessingOutput) Out ¶
func (this *ComplexProcessingOutput) Out() error
type Destination ¶
Destination is an optional interface for outputs to set the payload output stream to use.
type DestinationOutput ¶
type DestinationOutput struct { Context Context // contains filtered or unexported fields }
func (*DestinationOutput) Print ¶
func (this *DestinationOutput) Print(args ...interface{})
func (*DestinationOutput) Printf ¶
func (this *DestinationOutput) Printf(msg string, args ...interface{})
func (*DestinationOutput) SetDestination ¶
func (this *DestinationOutput) SetDestination(d io.Writer)
type ElementOutput ¶
type ElementOutput struct { DestinationOutput Elems data.Iterable Status error // contains filtered or unexported fields }
func NewElementOutput ¶
func NewElementOutput(opts *Options, chain ProcessChain) *ElementOutput
func (*ElementOutput) Add ¶
func (this *ElementOutput) Add(e interface{}) error
func (*ElementOutput) Close ¶
func (this *ElementOutput) Close() error
func (*ElementOutput) Out ¶
func (this *ElementOutput) Out() error
type FunctionProcessingOutput ¶
type FunctionProcessingOutput struct { ElementOutput // contains filtered or unexported fields }
func NewProcessingFunctionOutput ¶
func NewProcessingFunctionOutput(opts *Options, chain ProcessChain, f OutputFunction) *FunctionProcessingOutput
func (*FunctionProcessingOutput) Out ¶
func (this *FunctionProcessingOutput) Out() error
type JSONOutput ¶
type JSONOutput struct { ManifestOutput // contains filtered or unexported fields }
func (*JSONOutput) Out ¶
func (this *JSONOutput) Out() error
type JSONProcessingOutput ¶
type JSONProcessingOutput struct { ElementOutput // contains filtered or unexported fields }
func NewProcessingJSONOutput ¶
func NewProcessingJSONOutput(opts *Options, chain processing.ProcessChain, pretty bool) *JSONProcessingOutput
func (*JSONProcessingOutput) Out ¶
func (this *JSONProcessingOutput) Out() error
type Manifest ¶
type Manifest interface {
AsManifest() interface{}
}
func AsManifest ¶
func AsManifest(i interface{}) Manifest
type ManifestOutput ¶
type ManifestOutput struct { DestinationOutput Status error // contains filtered or unexported fields }
func NewManifestOutput ¶
func NewManifestOutput(opts *Options) ManifestOutput
func (*ManifestOutput) Add ¶
func (this *ManifestOutput) Add(e interface{}) error
func (*ManifestOutput) Close ¶
func (this *ManifestOutput) Close() error
func (*ManifestOutput) Out ¶
func (this *ManifestOutput) Out() error
type Options ¶
type Options struct { options.OptionSet Outputs Outputs OutputMode string Output Output Sort []string StatusCheck StatusCheckFunction OptimizedColumns int FixedColums int Context clictx.Context // this context could be ocm context. Logging logging.Context Session ocm.Session // contains filtered or unexported fields }
func From ¶
func From(o options.OptionSetProvider) *Options
func (*Options) AdaptChain ¶
func (o *Options) AdaptChain(errvar *error, chain processing.ProcessChain) processing.ProcessChain
func (*Options) LogContext ¶
func (*Options) OptimizeColumns ¶
func (*Options) SortColumns ¶ added in v0.15.0
func (*Options) UseColumnOptimization ¶
func (*Options) WithSession ¶ added in v0.17.0
func (*Options) WithStatusCheck ¶
func (o *Options) WithStatusCheck(f StatusCheckFunction) *Options
WithStatusCheck provides the possibility to check every entry to influence the final out status.
type Output ¶
Output handles the output of elements. It consists of two phases: First, elements are added to the output using the Add method, This phase is finished calling the Close method. THis finalizes any ongoing input processing. Second, the final output is requested using the Out method.
func DefaultYAMLOutput ¶
type OutputFactory ¶
type OutputFunction ¶
type OutputFunction func(Context, interface{})
type Outputs ¶
type Outputs map[string]OutputFactory
func NewOutputs ¶
func NewOutputs(def OutputFactory, others ...Outputs) Outputs
func (Outputs) AddChainedManifestOutputs ¶
func (this Outputs) AddChainedManifestOutputs(chain ChainFunction) Outputs
func (Outputs) AddManifestOutputs ¶
func (Outputs) Select ¶
func (this Outputs) Select(name string) OutputFactory
type SingleElementOutput ¶
type SingleElementOutput struct {
Elem interface{}
}
func NewSingleElementOutput ¶
func NewSingleElementOutput() *SingleElementOutput
func (*SingleElementOutput) Add ¶
func (this *SingleElementOutput) Add(e interface{}) error
func (*SingleElementOutput) Close ¶
func (this *SingleElementOutput) Close() error
func (*SingleElementOutput) Out ¶
func (this *SingleElementOutput) Out() error
type SortFields ¶
type SortFields interface {
GetSortFields() []string
}
type StatusCheckFunction ¶
StatusCheckFunction manipulates the processing status error according to the state of the given entry.
type StringOutput ¶
type StringOutput struct { ElementOutput // contains filtered or unexported fields }
func NewStringOutput ¶
func NewStringOutput(opts *Options, mapper processing.MappingFunction, linesep string) *StringOutput
func (*StringOutput) Out ¶
func (this *StringOutput) Out() error
type TableOutput ¶
type TableOutput struct { Headers []string Options *Options Chain ProcessChain Mapping MappingFunction }
func TreeOutput ¶
func TreeOutput(t *TableOutput, header string, o ...TreeOutputOption) *TableOutput
func (*TableOutput) GetSortFields ¶
func (this *TableOutput) GetSortFields() []string
func (*TableOutput) New ¶
func (t *TableOutput) New() *TableProcessingOutput
type TableProcessingOutput ¶
type TableProcessingOutput struct { ElementOutput // contains filtered or unexported fields }
func NewProcessingTableOutput ¶
func NewProcessingTableOutput(opts *Options, chain ProcessChain, header ...string) *TableProcessingOutput
func (*TableProcessingOutput) GetSortFields ¶
func (this *TableProcessingOutput) GetSortFields() []string
func (*TableProcessingOutput) Out ¶
func (this *TableProcessingOutput) Out() error
type TreeElemTitleFunc ¶ added in v0.16.0
type TreeElemTitleFunc func(*tree.TreeObject) string
func (TreeElemTitleFunc) ApplyTreeOutputOption ¶ added in v0.16.0
func (f TreeElemTitleFunc) ApplyTreeOutputOption(o *TreeOutputOptions)
type TreeNodeMappingFunc ¶
type TreeNodeMappingFunc func(*tree.TreeObject) []string
func (TreeNodeMappingFunc) ApplyTreeOutputOption ¶
func (f TreeNodeMappingFunc) ApplyTreeOutputOption(o *TreeOutputOptions)
type TreeOutputOption ¶
type TreeOutputOption interface {
ApplyTreeOutputOption(*TreeOutputOptions)
}
type TreeOutputOptions ¶
type TreeOutputOptions struct {
// contains filtered or unexported fields
}
func (TreeOutputOptions) Apply ¶
func (o TreeOutputOptions) Apply(opts ...TreeOutputOption) TreeOutputOptions
func (TreeOutputOptions) ApplyTreeOutputOption ¶
func (o TreeOutputOptions) ApplyTreeOutputOption(opts *TreeOutputOptions)
func (TreeOutputOptions) ElemTitle ¶ added in v0.16.0
func (o TreeOutputOptions) ElemTitle(obj *tree.TreeObject) string
func (TreeOutputOptions) NodeMapping ¶
func (o TreeOutputOptions) NodeMapping(n int, obj *tree.TreeObject) interface{}
func (TreeOutputOptions) NodeTitle ¶
func (o TreeOutputOptions) NodeTitle(obj *tree.TreeObject) string
type TreeSymbol ¶ added in v0.16.0
type TreeSymbol string
func (TreeSymbol) ApplyTreeOutputOption ¶ added in v0.16.0
func (s TreeSymbol) ApplyTreeOutputOption(o *TreeOutputOptions)
type TreeSynthesizedTitleFunc ¶ added in v0.16.0
type TreeSynthesizedTitleFunc func(*tree.TreeObject) string
func (TreeSynthesizedTitleFunc) ApplyTreeOutputOption ¶ added in v0.16.0
func (f TreeSynthesizedTitleFunc) ApplyTreeOutputOption(o *TreeOutputOptions)
type YAMLOutput ¶
type YAMLOutput struct {
ManifestOutput
}
func (*YAMLOutput) Out ¶
func (this *YAMLOutput) Out() error
type YAMLProcessingOutput ¶
type YAMLProcessingOutput struct {
ElementOutput
}
func NewProcessingYAMLOutput ¶
func NewProcessingYAMLOutput(opts *Options, chain processing.ProcessChain) *YAMLProcessingOutput
func (*YAMLProcessingOutput) Out ¶
func (this *YAMLProcessingOutput) Out() error