settings

package
v0.2.82 Latest Latest
Warning

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

Go to latest
Published: May 26, 2023 License: MIT Imports: 27 Imported by: 43

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetupProcessor

func SetupProcessor(ps map[string]interface{}) (*processor.GlazeProcessor, error)

Types

type FieldsFilterFlagsDefaults

type FieldsFilterFlagsDefaults struct {
	Fields           []string `glazed.parameter:"fields"`
	Filter           []string `glazed.parameter:"filter"`
	SortColumns      bool     `glazed.parameter:"sort-columns"`
	RemoveNulls      bool     `glazed.parameter:"remove-nulls"`
	RemoveDuplicates []string `glazed.parameter:"remove-duplicates"`
}

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(of formatters.OutputFormatter)

type FieldsFiltersParameterLayer

type FieldsFiltersParameterLayer struct {
	*layers.ParameterLayerImpl
}

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
	OutputParameterLayer        *OutputParameterLayer
	RenameParameterLayer        *RenameParameterLayer
	ReplaceParameterLayer       *ReplaceParameterLayer
	SelectParameterLayer        *SelectParameterLayer
	TemplateParameterLayer      *TemplateParameterLayer
	JqParameterLayer            *JqParameterLayer
	SortParameterLayer          *SortParameterLayer
}

func NewGlazedParameterLayers

func NewGlazedParameterLayers(options ...GlazeParameterLayerOption) (*GlazedParameterLayers, error)

func (*GlazedParameterLayers) AddFlag

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) ParseFlagsFromCobraCommand

func (g *GlazedParameterLayers) ParseFlagsFromCobraCommand(cmd *cobra.Command) (map[string]interface{}, error)

type JqParameterLayer

type JqParameterLayer struct {
	*layers.ParameterLayerImpl
}

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"`
	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
}

func NewOutputFormatterSettings

func NewOutputFormatterSettings(ps map[string]interface{}) (*OutputFormatterSettings, error)

func (*OutputFormatterSettings) CreateOutputFormatter

func (ofs *OutputFormatterSettings) CreateOutputFormatter() (formatters.OutputFormatter, error)

type OutputParameterLayer

type OutputParameterLayer struct {
	*layers.ParameterLayerImpl
}

func NewOutputParameterLayer

func NewOutputParameterLayer(options ...layers.ParameterLayerOptions) (*OutputParameterLayer, error)

type RenameFlagsDefaults

type RenameFlagsDefaults struct {
	Rename       []string          `glazed.parameter:"rename"`
	RenameRegexp map[string]string `glazed.parameter:"rename-regexp"`
	RenameYaml   string            `glazed.parameter:"rename-yaml"`
}

type RenameParameterLayer

type RenameParameterLayer struct {
	*layers.ParameterLayerImpl
}

func NewRenameParameterLayer

func NewRenameParameterLayer(options ...layers.ParameterLayerOptions) (*RenameParameterLayer, error)

type RenameSettings

type RenameSettings struct {
	RenameFields  map[types.FieldName]string
	RenameRegexps table.RegexpReplacements
	YamlFile      string
}

func NewRenameSettingsFromParameters

func NewRenameSettingsFromParameters(ps map[string]interface{}) (*RenameSettings, error)

func (*RenameSettings) AddMiddlewares

func (rs *RenameSettings) AddMiddlewares(of formatters.OutputFormatter) error

type ReplaceParameterLayer

type ReplaceParameterLayer struct {
	*layers.ParameterLayerImpl
}

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 formatters.OutputFormatter) error

type SelectParameterLayer

type SelectParameterLayer struct {
	*layers.ParameterLayerImpl
}

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(of formatters.OutputFormatter)

type SortParameterLayer

type SortParameterLayer struct {
	*layers.ParameterLayerImpl
}

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

type TemplateFormatterSettings struct {
	TemplateFuncMaps []template.FuncMap
}

TemplateFormatterSettings is probably obsolete...

type TemplateParameterLayer

type TemplateParameterLayer struct {
	*layers.ParameterLayerImpl
}

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(of formatters.OutputFormatter) error

func (*TemplateSettings) UpdateWithSelectSettings

func (tf *TemplateSettings) UpdateWithSelectSettings(ss *SelectSettings)

Jump to

Keyboard shortcuts

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