Documentation ¶
Index ¶
- type CommandHandler
- type CommandHandlerOption
- func WithDefaultTemplateName(defaultTemplateName string) CommandHandlerOption
- func WithDevMode(devMode bool) CommandHandlerOption
- func WithMergeAdditionalData(data map[string]interface{}, override bool) CommandHandlerOption
- func WithOverridesAndDefaults(overridesAndDefaults *config.OverridesAndDefaults) CommandHandlerOption
- func WithOverridesAndDefaultsOptions(opts ...config.OverridesAndDefaultsOption) CommandHandlerOption
- func WithTemplateLookup(templateLookup render.TemplateLookup) CommandHandlerOption
- func WithTemplateName(templateName string) CommandHandlerOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CommandHandler ¶
type CommandHandler struct { DevMode bool // TemplateName is the name of the template that is lookup up through the given TemplateLookup // used to render the glazed command. TemplateName string // TemplateLookup is used to look up both TemplateName and IndexTemplateName TemplateLookup render.TemplateLookup // can be any of BareCommand, WriterCommand or GlazeCommand Command cmds.GlazeCommand // AdditionalData is passed to the template being rendered. AdditionalData map[string]interface{} OverridesAndDefaults *config.OverridesAndDefaults // If true, all glazed outputs will try to use a row output if possible. // This means that "ragged" objects (where columns might not all be present) // will have missing columns, only the fields of the first object will be used // as rows. // // This is true per default, and needs to be explicitly set to false to use // a normal TableMiddleware oriented output. Stream bool }
func NewCommandHandler ¶
func NewCommandHandler( command cmds.GlazeCommand, options ...CommandHandlerOption, ) *CommandHandler
func NewCommandHandlerFromConfig ¶
func NewCommandHandlerFromConfig( config_ *config.Command, loader loaders.FSCommandLoader, options ...CommandHandlerOption, ) (*CommandHandler, error)
type CommandHandlerOption ¶
type CommandHandlerOption func(*CommandHandler)
func WithDefaultTemplateName ¶
func WithDefaultTemplateName(defaultTemplateName string) CommandHandlerOption
func WithDevMode ¶
func WithDevMode(devMode bool) CommandHandlerOption
func WithMergeAdditionalData ¶
func WithMergeAdditionalData(data map[string]interface{}, override bool) CommandHandlerOption
WithMergeAdditionalData merges the passed in map with the handler's AdditionalData map. If a value is already set in the AdditionalData map and override is true, it will get overwritten.
func WithOverridesAndDefaults ¶
func WithOverridesAndDefaults(overridesAndDefaults *config.OverridesAndDefaults) CommandHandlerOption
func WithOverridesAndDefaultsOptions ¶
func WithOverridesAndDefaultsOptions(opts ...config.OverridesAndDefaultsOption) CommandHandlerOption
func WithTemplateLookup ¶
func WithTemplateLookup(templateLookup render.TemplateLookup) CommandHandlerOption
func WithTemplateName ¶
func WithTemplateName(templateName string) CommandHandlerOption
Click to show internal directories.
Click to hide internal directories.