Documentation ¶
Index ¶
- func NewJqMiddlewaresFromSettings(settings *JqSettings) (*middlewares.JqObjectMiddleware, *middlewares.JqTableMiddleware, error)
- func SetupProcessorOutput(gp *middlewares.TableProcessor, ps map[string]interface{}, w io.Writer) (formatters.OutputFormatter, error)
- func SetupRowOutputFormatter(ps map[string]interface{}) (formatters.RowOutputFormatter, error)
- func SetupTableOutputFormatter(ps map[string]interface{}) (formatters.TableOutputFormatter, error)
- func SetupTableProcessor(ps map[string]interface{}, options ...middlewares.TableProcessorOption) (*middlewares.TableProcessor, error)
- type ErrorRowFormatUnsupported
- type ErrorTableFormatUnsupported
- type ErrorUnknownFormat
- type FieldsFilterFlagsDefaults
- type FieldsFilterSettings
- type FieldsFiltersParameterLayer
- type GlazeParameterLayerOption
- func WithFieldsFiltersParameterLayerOptions(options ...layers.ParameterLayerOptions) GlazeParameterLayerOption
- func WithJqParameterLayerOptions(options ...layers.ParameterLayerOptions) GlazeParameterLayerOption
- func WithOutputParameterLayerOptions(options ...layers.ParameterLayerOptions) GlazeParameterLayerOption
- func WithRenameParameterLayerOptions(options ...layers.ParameterLayerOptions) GlazeParameterLayerOption
- func WithReplaceParameterLayerOptions(options ...layers.ParameterLayerOptions) GlazeParameterLayerOption
- func WithSelectParameterLayerOptions(options ...layers.ParameterLayerOptions) GlazeParameterLayerOption
- func WithSortParameterLayerOptions(options ...layers.ParameterLayerOptions) GlazeParameterLayerOption
- func WithTemplateParameterLayerOptions(options ...layers.ParameterLayerOptions) GlazeParameterLayerOption
- type GlazedParameterLayers
- func (g *GlazedParameterLayers) AddFlag(*parameters.ParameterDefinition)
- func (g *GlazedParameterLayers) AddFlagsToCobraCommand(cmd *cobra.Command) error
- func (g *GlazedParameterLayers) GetDescription() string
- func (g *GlazedParameterLayers) GetName() string
- func (g *GlazedParameterLayers) GetParameterDefinitions() map[string]*parameters.ParameterDefinition
- func (g *GlazedParameterLayers) GetPrefix() string
- func (g *GlazedParameterLayers) GetSlug() string
- func (g *GlazedParameterLayers) InitializeParameterDefaultsFromStruct(s interface{}) error
- func (g *GlazedParameterLayers) MarshalYAML() (interface{}, error)
- func (g *GlazedParameterLayers) ParseFlagsFromCobraCommand(cmd *cobra.Command) (map[string]interface{}, error)
- func (g *GlazedParameterLayers) ParseFlagsFromJSON(m map[string]interface{}, onlyProvided bool) (map[string]interface{}, error)
- type JqParameterLayer
- type JqSettings
- type OutputFormatterSettings
- type OutputParameterLayer
- type RenameFlagsDefaults
- type RenameParameterLayer
- type RenameSettings
- type ReplaceParameterLayer
- type ReplaceSettings
- type SelectParameterLayer
- type SelectSettings
- type SortFlagsSettings
- type SortParameterLayer
- type TemplateFlagsDefaults
- type TemplateFormatterSettings
- type TemplateParameterLayer
- type TemplateSettings
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewJqMiddlewaresFromSettings ¶
func NewJqMiddlewaresFromSettings(settings *JqSettings) (*middlewares.JqObjectMiddleware, *middlewares.JqTableMiddleware, error)
func SetupProcessorOutput ¶ added in v0.3.2
func SetupProcessorOutput(gp *middlewares.TableProcessor, ps map[string]interface{}, w io.Writer) (formatters.OutputFormatter, error)
SetupProcessorOutput creates a new Output middleware (either row or table, depending on the format and the stream flag set in ps) and adds it to the TableProcessor. Additional middlewares required by ] the chosen output format might be added as well (for example, flattening rows when using table-oriented output formats).
It also returns the output formatter that was created.
func SetupRowOutputFormatter ¶ added in v0.3.1
func SetupRowOutputFormatter(ps map[string]interface{}) (formatters.RowOutputFormatter, error)
func SetupTableOutputFormatter ¶ added in v0.3.1
func SetupTableOutputFormatter(ps map[string]interface{}) (formatters.TableOutputFormatter, error)
func SetupTableProcessor ¶ added in v0.3.1
func SetupTableProcessor(ps map[string]interface{}, options ...middlewares.TableProcessorOption) (*middlewares.TableProcessor, error)
SetupTableProcessor processes all the glazed flags out of ps and returns a TableProcessor configured with all the necessary middlewares except for the output formatter.
DO(manuel, 2023-06-30) It would be good to used a parsedLayer here, if we ever refactor that part
Types ¶
type ErrorRowFormatUnsupported ¶ added in v0.3.2
type ErrorRowFormatUnsupported struct {
// contains filtered or unexported fields
}
func (*ErrorRowFormatUnsupported) Error ¶ added in v0.3.2
func (e *ErrorRowFormatUnsupported) Error() string
type ErrorTableFormatUnsupported ¶ added in v0.3.2
type ErrorTableFormatUnsupported struct {
// contains filtered or unexported fields
}
func (*ErrorTableFormatUnsupported) Error ¶ added in v0.3.2
func (e *ErrorTableFormatUnsupported) Error() string
type ErrorUnknownFormat ¶ added in v0.3.2
type ErrorUnknownFormat struct {
// contains filtered or unexported fields
}
func (*ErrorUnknownFormat) Error ¶ added in v0.3.2
func (e *ErrorUnknownFormat) Error() string
type FieldsFilterSettings ¶
type FieldsFilterSettings struct { Filters []string `glazed.parameter:"filter"` Fields []string `glazed.parameter:"fields"` SortColumns bool `glazed.parameter:"sort-columns"` RemoveNulls bool `glazed.parameter:"remove-nulls"` RemoveDuplicates []string `glazed.parameter:"remove-duplicates"` ReorderColumns []string }
func NewFieldsFilterSettings ¶
func NewFieldsFilterSettings(ps map[string]interface{}) (*FieldsFilterSettings, error)
func (*FieldsFilterSettings) AddMiddlewares ¶
func (ffs *FieldsFilterSettings) AddMiddlewares(p_ *middlewares.TableProcessor)
type FieldsFiltersParameterLayer ¶
type FieldsFiltersParameterLayer struct {
*layers.ParameterLayerImpl `yaml:",inline"`
}
func NewFieldsFiltersParameterLayer ¶
func NewFieldsFiltersParameterLayer(options ...layers.ParameterLayerOptions) (*FieldsFiltersParameterLayer, error)
func (*FieldsFiltersParameterLayer) AddFlagsToCobraCommand ¶
func (f *FieldsFiltersParameterLayer) AddFlagsToCobraCommand(cmd *cobra.Command) error
func (*FieldsFiltersParameterLayer) ParseFlagsFromCobraCommand ¶
func (f *FieldsFiltersParameterLayer) ParseFlagsFromCobraCommand(cmd *cobra.Command) (map[string]interface{}, error)
type GlazeParameterLayerOption ¶
type GlazeParameterLayerOption func(*GlazedParameterLayers) error
func WithFieldsFiltersParameterLayerOptions ¶
func WithFieldsFiltersParameterLayerOptions(options ...layers.ParameterLayerOptions) GlazeParameterLayerOption
func WithJqParameterLayerOptions ¶
func WithJqParameterLayerOptions(options ...layers.ParameterLayerOptions) GlazeParameterLayerOption
func WithOutputParameterLayerOptions ¶
func WithOutputParameterLayerOptions(options ...layers.ParameterLayerOptions) GlazeParameterLayerOption
func WithRenameParameterLayerOptions ¶
func WithRenameParameterLayerOptions(options ...layers.ParameterLayerOptions) GlazeParameterLayerOption
func WithReplaceParameterLayerOptions ¶
func WithReplaceParameterLayerOptions(options ...layers.ParameterLayerOptions) GlazeParameterLayerOption
func WithSelectParameterLayerOptions ¶
func WithSelectParameterLayerOptions(options ...layers.ParameterLayerOptions) GlazeParameterLayerOption
func WithSortParameterLayerOptions ¶
func WithSortParameterLayerOptions(options ...layers.ParameterLayerOptions) GlazeParameterLayerOption
func WithTemplateParameterLayerOptions ¶
func WithTemplateParameterLayerOptions(options ...layers.ParameterLayerOptions) GlazeParameterLayerOption
type GlazedParameterLayers ¶
type GlazedParameterLayers struct { FieldsFiltersParameterLayer *FieldsFiltersParameterLayer `yaml:"fieldsFiltersParameterLayer"` OutputParameterLayer *OutputParameterLayer `yaml:"outputParameterLayer"` RenameParameterLayer *RenameParameterLayer `yaml:"renameParameterLayer"` ReplaceParameterLayer *ReplaceParameterLayer `yaml:"replaceParameterLayer"` SelectParameterLayer *SelectParameterLayer `yaml:"selectParameterLayer"` TemplateParameterLayer *TemplateParameterLayer `yaml:"templateParameterLayer"` JqParameterLayer *JqParameterLayer `yaml:"jqParameterLayer"` SortParameterLayer *SortParameterLayer `yaml:"sortParameterLayer"` }
func NewGlazedParameterLayers ¶
func NewGlazedParameterLayers(options ...GlazeParameterLayerOption) (*GlazedParameterLayers, error)
func (*GlazedParameterLayers) AddFlag ¶
func (g *GlazedParameterLayers) AddFlag(*parameters.ParameterDefinition)
func (*GlazedParameterLayers) AddFlagsToCobraCommand ¶
func (g *GlazedParameterLayers) AddFlagsToCobraCommand(cmd *cobra.Command) error
func (*GlazedParameterLayers) GetDescription ¶
func (g *GlazedParameterLayers) GetDescription() string
func (*GlazedParameterLayers) GetName ¶
func (g *GlazedParameterLayers) GetName() string
func (*GlazedParameterLayers) GetParameterDefinitions ¶
func (g *GlazedParameterLayers) GetParameterDefinitions() map[string]*parameters.ParameterDefinition
func (*GlazedParameterLayers) GetPrefix ¶
func (g *GlazedParameterLayers) GetPrefix() string
func (*GlazedParameterLayers) GetSlug ¶
func (g *GlazedParameterLayers) GetSlug() string
func (*GlazedParameterLayers) InitializeParameterDefaultsFromStruct ¶
func (g *GlazedParameterLayers) InitializeParameterDefaultsFromStruct(s interface{}) error
func (*GlazedParameterLayers) MarshalYAML ¶ added in v0.4.0
func (g *GlazedParameterLayers) MarshalYAML() (interface{}, error)
func (*GlazedParameterLayers) ParseFlagsFromCobraCommand ¶
func (g *GlazedParameterLayers) ParseFlagsFromCobraCommand(cmd *cobra.Command) (map[string]interface{}, error)
func (*GlazedParameterLayers) ParseFlagsFromJSON ¶ added in v0.4.10
func (g *GlazedParameterLayers) ParseFlagsFromJSON(m map[string]interface{}, onlyProvided bool) (map[string]interface{}, error)
type JqParameterLayer ¶
type JqParameterLayer struct {
*layers.ParameterLayerImpl `yaml:",inline"`
}
func NewJqParameterLayer ¶
func NewJqParameterLayer(options ...layers.ParameterLayerOptions) (*JqParameterLayer, error)
type JqSettings ¶
type JqSettings struct { JqExpression string `glazed.parameter:"jq"` JqFile string `glazed.parameter:"jq-file"` JqFieldExpressions map[string]string `glazed.parameter:"field-jq"` }
func NewJqSettingsFromParameters ¶
func NewJqSettingsFromParameters(ps map[string]interface{}) (*JqSettings, error)
type OutputFormatterSettings ¶
type OutputFormatterSettings struct { Output string `glazed.parameter:"output"` OutputFile string `glazed.parameter:"output-file"` OutputFileTemplate string `glazed.parameter:"output-file-template"` OutputMultipleFiles bool `glazed.parameter:"output-multiple-files"` Stream bool `glazed.parameter:"stream"` SheetName string `glazed.parameter:"sheet-name"` TableFormat string `glazed.parameter:"table-format"` TableStyle string `glazed.parameter:"table-style"` TableStyleFile string `glazed.parameter:"table-style-file"` PrintTableStyle bool `glazed.parameter:"print-table-style"` OutputAsObjects bool `glazed.parameter:"output-as-objects"` FlattenObjects bool `glazed.parameter:"flatten"` WithHeaders bool `glazed.parameter:"with-headers"` CsvSeparator string `glazed.parameter:"csv-separator"` Template string `glazed.parameter:"template-file"` TemplateData map[string]interface{} `glazed.parameter:"template-data"` TemplateFormatterSettings *TemplateFormatterSettings SqlTableName string `glazed.parameter:"sql-table-name"` WithUpsert bool `glazed.parameter:"sql-upsert"` SqlSplitByRows int `glazed.parameter:"sql-split-by-rows"` }
func NewOutputFormatterSettings ¶
func NewOutputFormatterSettings(ps map[string]interface{}) (*OutputFormatterSettings, error)
func (*OutputFormatterSettings) CreateRowOutputFormatter ¶ added in v0.3.1
func (ofs *OutputFormatterSettings) CreateRowOutputFormatter() (formatters.RowOutputFormatter, error)
func (*OutputFormatterSettings) CreateTableOutputFormatter ¶ added in v0.3.1
func (ofs *OutputFormatterSettings) CreateTableOutputFormatter() (formatters.TableOutputFormatter, error)
type OutputParameterLayer ¶
type OutputParameterLayer struct {
*layers.ParameterLayerImpl `yaml:",inline"`
}
func NewOutputParameterLayer ¶
func NewOutputParameterLayer(options ...layers.ParameterLayerOptions) (*OutputParameterLayer, error)
type RenameFlagsDefaults ¶
type RenameParameterLayer ¶
type RenameParameterLayer struct {
*layers.ParameterLayerImpl `yaml:",inline"`
}
func NewRenameParameterLayer ¶
func NewRenameParameterLayer(options ...layers.ParameterLayerOptions) (*RenameParameterLayer, error)
type RenameSettings ¶
type RenameSettings struct { RenameFields map[types.FieldName]string RenameRegexps row.RegexpReplacements YamlFile string }
func NewRenameSettingsFromParameters ¶
func NewRenameSettingsFromParameters(ps map[string]interface{}) (*RenameSettings, error)
func (*RenameSettings) AddMiddlewares ¶
func (rs *RenameSettings) AddMiddlewares(processor *middlewares.TableProcessor) error
type ReplaceParameterLayer ¶
type ReplaceParameterLayer struct {
*layers.ParameterLayerImpl `yaml:",inline"`
}
func NewReplaceParameterLayer ¶
func NewReplaceParameterLayer(options ...layers.ParameterLayerOptions) (*ReplaceParameterLayer, error)
type ReplaceSettings ¶
type ReplaceSettings struct { ReplaceFile string `glazed.parameter:"replace-file"` AddFields map[string]string `glazed.parameter:"add-fields"` }
func NewReplaceSettingsFromParameters ¶
func NewReplaceSettingsFromParameters(ps map[string]interface{}) (*ReplaceSettings, error)
func (*ReplaceSettings) AddMiddlewares ¶
func (rs *ReplaceSettings) AddMiddlewares(of *middlewares.TableProcessor) error
type SelectParameterLayer ¶
type SelectParameterLayer struct {
*layers.ParameterLayerImpl `yaml:",inline"`
}
func NewSelectParameterLayer ¶
func NewSelectParameterLayer(options ...layers.ParameterLayerOptions) (*SelectParameterLayer, error)
type SelectSettings ¶
type SelectSettings struct { SelectField string `glazed.parameter:"select"` SelectSeparator string `glazed.parameter:"select-separator"` SelectTemplate string `glazed.parameter:"select-template"` }
func NewSelectSettingsFromParameters ¶
func NewSelectSettingsFromParameters(ps map[string]interface{}) (*SelectSettings, error)
type SortFlagsSettings ¶
type SortFlagsSettings struct {
SortBy []string `glazed.parameter:"sort-by"`
}
func NewSortSettingsFromParameters ¶
func NewSortSettingsFromParameters(ps map[string]interface{}) (*SortFlagsSettings, error)
func (*SortFlagsSettings) AddMiddlewares ¶
func (s *SortFlagsSettings) AddMiddlewares(p_ *middlewares.TableProcessor)
type SortParameterLayer ¶
type SortParameterLayer struct {
*layers.ParameterLayerImpl `yaml:",inline"`
}
func NewSortParameterLayer ¶
func NewSortParameterLayer(options ...layers.ParameterLayerOptions) (*SortParameterLayer, error)
type TemplateFlagsDefaults ¶
type TemplateFlagsDefaults struct { Template string `glazed.parameter:"template"` TemplateField map[string]string `glazed.parameter:"template-field"` UseRowTemplates bool `glazed.parameter:"use-row-templates"` }
func NewTemplateFlagsDefaults ¶
func NewTemplateFlagsDefaults() *TemplateFlagsDefaults
type TemplateFormatterSettings ¶
TemplateFormatterSettings is probably obsolete...
type TemplateParameterLayer ¶
type TemplateParameterLayer struct {
*layers.ParameterLayerImpl `yaml:",inline"`
}
func NewTemplateParameterLayer ¶
func NewTemplateParameterLayer(options ...layers.ParameterLayerOptions) (*TemplateParameterLayer, error)
type TemplateSettings ¶
type TemplateSettings struct { RenameSeparator string UseRowTemplates bool `glazed.parameter:"use-row-templates"` Templates map[types.FieldName]string }
func NewTemplateSettings ¶
func NewTemplateSettings(parameters map[string]interface{}) (*TemplateSettings, error)
func (*TemplateSettings) AddMiddlewares ¶
func (tf *TemplateSettings) AddMiddlewares(p_ *middlewares.TableProcessor) error
func (*TemplateSettings) UpdateWithSelectSettings ¶
func (tf *TemplateSettings) UpdateWithSelectSettings(ss *SelectSettings)