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 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) Usage() string
- func (o *Options) UseColumnOptimization() bool
- 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 TreeNodeMappingFunc
- type TreeNodeTitleFunc
- type TreeOutputOption
- type TreeOutputOptions
- 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 ElementOutput ¶
type ElementOutput struct { Elems data.Iterable Context Context 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 ManifestOutput ¶
type ManifestOutput struct { Status error Context Context // contains filtered or unexported fields }
func NewManifestOutput ¶ added in v0.4.1
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 ¶ added in v0.4.1
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 // contains filtered or unexported fields }
func From ¶
func From(o options.OptionSetProvider) *Options
func (*Options) AdaptChain ¶ added in v0.4.1
func (o *Options) AdaptChain(errvar *error, chain processing.ProcessChain) processing.ProcessChain
func (*Options) LogContext ¶
func (*Options) OptimizeColumns ¶ added in v0.4.1
func (*Options) UseColumnOptimization ¶ added in v0.4.1
func (*Options) WithStatusCheck ¶ added in v0.4.1
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.
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 ¶ added in v0.4.1
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 TreeNodeMappingFunc ¶
type TreeNodeMappingFunc func(*tree.TreeObject) []string
func (TreeNodeMappingFunc) ApplyTreeOutputOption ¶
func (f TreeNodeMappingFunc) ApplyTreeOutputOption(o *TreeOutputOptions)
type TreeNodeTitleFunc ¶
type TreeNodeTitleFunc func(*tree.TreeObject) string
func (TreeNodeTitleFunc) ApplyTreeOutputOption ¶
func (f TreeNodeTitleFunc) 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) NodeMapping ¶
func (o TreeOutputOptions) NodeMapping(n int, obj *tree.TreeObject) interface{}
func (TreeOutputOptions) NodeTitle ¶
func (o TreeOutputOptions) NodeTitle(obj *tree.TreeObject) string
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
Click to show internal directories.
Click to hide internal directories.