Documentation
¶
Index ¶
- type AmbiguousCommand
- type CommandNotFound
- type GenericCommandHandler
- func (gch *GenericCommandHandler) ServeData(c echo.Context, command cmds.Command) error
- func (gch *GenericCommandHandler) ServeDataTables(c echo.Context, command cmds.Command, downloadPath string) error
- func (gch *GenericCommandHandler) ServeDownload(c echo.Context, command cmds.Command) error
- func (gch *GenericCommandHandler) ServeRepository(server *parka.Server, basePath string, repository *repositories.Repository) error
- func (gch *GenericCommandHandler) ServeSingleCommand(server *parka.Server, basePath string, command cmds.Command) error
- func (gch *GenericCommandHandler) ServeStreaming(c echo.Context, command cmds.Command) error
- func (gch *GenericCommandHandler) ServeText(c echo.Context, command cmds.Command) error
- type GenericCommandHandlerOption
- func WithDefaultIndexTemplateName(name string) GenericCommandHandlerOption
- func WithDefaultTemplateName(name string) GenericCommandHandlerOption
- func WithIndexTemplateName(name string) GenericCommandHandlerOption
- func WithMergeAdditionalData(data map[string]interface{}, override bool) GenericCommandHandlerOption
- func WithParameterFilter(overridesAndDefaults *config.ParameterFilter) GenericCommandHandlerOption
- func WithParameterFilterOptions(opts ...config.ParameterFilterOption) GenericCommandHandlerOption
- func WithPostMiddlewares(middlewares ...sources.Middleware) GenericCommandHandlerOption
- func WithPreMiddlewares(middlewares ...sources.Middleware) GenericCommandHandlerOption
- func WithTemplateLookup(lookup render.TemplateLookup) GenericCommandHandlerOption
- func WithTemplateName(name string) GenericCommandHandlerOption
- func WithWhitelistedLayers(layers ...string) GenericCommandHandlerOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AmbiguousCommand ¶
func (AmbiguousCommand) Error ¶
func (e AmbiguousCommand) Error() string
type CommandNotFound ¶
type CommandNotFound struct {
CommandPath string
}
func (CommandNotFound) Error ¶
func (e CommandNotFound) Error() string
type GenericCommandHandler ¶
type GenericCommandHandler struct {
// 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
// AdditionalData is passed to the template being rendered.
AdditionalData map[string]interface{}
ParameterFilter *config.ParameterFilter
// 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
// path under which the command handler is served
BasePath string
// WhitelistedLayers contains the list of layers that are allowed to be modified through query parameters.
// If empty, all layers are allowed.
WhitelistedLayers []string
// contains filtered or unexported fields
}
func NewGenericCommandHandler ¶
func NewGenericCommandHandler(options ...GenericCommandHandlerOption) (*GenericCommandHandler, error)
func (*GenericCommandHandler) ServeDataTables ¶
func (*GenericCommandHandler) ServeDownload ¶
func (*GenericCommandHandler) ServeRepository ¶
func (gch *GenericCommandHandler) ServeRepository(server *parka.Server, basePath string, repository *repositories.Repository) error
func (*GenericCommandHandler) ServeSingleCommand ¶
func (*GenericCommandHandler) ServeStreaming ¶
type GenericCommandHandlerOption ¶
type GenericCommandHandlerOption func(handler *GenericCommandHandler)
func WithDefaultIndexTemplateName ¶
func WithDefaultIndexTemplateName(name string) GenericCommandHandlerOption
func WithDefaultTemplateName ¶
func WithDefaultTemplateName(name string) GenericCommandHandlerOption
func WithIndexTemplateName ¶
func WithIndexTemplateName(name string) GenericCommandHandlerOption
func WithMergeAdditionalData ¶
func WithMergeAdditionalData(data map[string]interface{}, override bool) GenericCommandHandlerOption
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 ¶
func WithParameterFilter(overridesAndDefaults *config.ParameterFilter) GenericCommandHandlerOption
func WithParameterFilterOptions ¶
func WithParameterFilterOptions(opts ...config.ParameterFilterOption) GenericCommandHandlerOption
func WithPostMiddlewares ¶ added in v0.5.16
func WithPostMiddlewares(middlewares ...sources.Middleware) GenericCommandHandlerOption
func WithPreMiddlewares ¶ added in v0.5.16
func WithPreMiddlewares(middlewares ...sources.Middleware) GenericCommandHandlerOption
func WithTemplateLookup ¶
func WithTemplateLookup(lookup render.TemplateLookup) GenericCommandHandlerOption
func WithTemplateName ¶
func WithTemplateName(name string) GenericCommandHandlerOption
func WithWhitelistedLayers ¶ added in v0.5.21
func WithWhitelistedLayers(layers ...string) GenericCommandHandlerOption
Click to show internal directories.
Click to hide internal directories.