Documentation ¶
Index ¶
- type CommandDirHandler
- type CommandDirHandlerOption
- func WithDefaultIndexTemplateName(name string) CommandDirHandlerOption
- func WithDefaultTemplateName(name string) CommandDirHandlerOption
- func WithDevMode(devMode bool) CommandDirHandlerOption
- func WithIndexTemplateName(name string) CommandDirHandlerOption
- func WithMergeAdditionalData(data map[string]interface{}, override bool) CommandDirHandlerOption
- func WithParameterFilter(overridesAndDefaults *config.ParameterFilter) CommandDirHandlerOption
- func WithParameterFilterOptions(opts ...config.ParameterFilterOption) CommandDirHandlerOption
- func WithRepository(r *repositories.Repository) CommandDirHandlerOption
- func WithTemplateLookup(lookup render.TemplateLookup) CommandDirHandlerOption
- func WithTemplateName(name string) CommandDirHandlerOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CommandDirHandler ¶
type CommandDirHandler 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 // IndexTemplateName is the name of the template that is looked up through TemplateLookup to render // command indexes. Leave empty to not render index pages at all. IndexTemplateName string // TemplateLookup is used to look up both TemplateName and IndexTemplateName TemplateLookup render.TemplateLookup // Repository is the command repository that is exposed over HTTP through this handler. Repository *repositories.Repository // AdditionalData is passed to the template being rendered. AdditionalData map[string]interface{} ParameterFilter *config.ParameterFilter // 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 NewCommandDirHandlerFromConfig ¶
func NewCommandDirHandlerFromConfig( config_ *config.CommandDir, options ...CommandDirHandlerOption, ) (*CommandDirHandler, error)
type CommandDirHandlerOption ¶
type CommandDirHandlerOption func(handler *CommandDirHandler)
func WithDefaultIndexTemplateName ¶
func WithDefaultIndexTemplateName(name string) CommandDirHandlerOption
func WithDefaultTemplateName ¶
func WithDefaultTemplateName(name string) CommandDirHandlerOption
func WithDevMode ¶
func WithDevMode(devMode bool) CommandDirHandlerOption
handling all the ways to configure overrides
func WithIndexTemplateName ¶
func WithIndexTemplateName(name string) CommandDirHandlerOption
func WithMergeAdditionalData ¶ added in v0.3.2
func WithMergeAdditionalData(data map[string]interface{}, override bool) CommandDirHandlerOption
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 WithParameterFilter ¶ added in v0.5.0
func WithParameterFilter(overridesAndDefaults *config.ParameterFilter) CommandDirHandlerOption
func WithParameterFilterOptions ¶ added in v0.5.0
func WithParameterFilterOptions(opts ...config.ParameterFilterOption) CommandDirHandlerOption
func WithRepository ¶
func WithRepository(r *repositories.Repository) CommandDirHandlerOption
func WithTemplateLookup ¶
func WithTemplateLookup(lookup render.TemplateLookup) CommandDirHandlerOption
func WithTemplateName ¶
func WithTemplateName(name string) CommandDirHandlerOption
Click to show internal directories.
Click to hide internal directories.