Documentation ¶
Index ¶
- func AddCommand[T CommandGroup](parent *flags.Command, ctxBuilder ContextBulder, group T, ...)
- func ReadPassword(message ...string) string
- type AppBuilder
- type CommandGroup
- type CommandGroupBase
- type Commands
- func (c Commands[T]) AddCommand(parent *flags.Command, ctxBuilder ContextBulder, group T)
- func (c *Commands[T]) AddHandlers(handlers ...HandlerBuilder[T])
- func (c *Commands[T]) Construct(self T, name string, description string)
- func (c *Commands[T]) Description() string
- func (c *Commands[T]) Handlers(ctxBuilder ContextBulder, parser *flags.Parser) *flags.Command
- func (c *Commands[T]) InvokeInTenancy() bool
- func (c *Commands[T]) Name() string
- func (c *Commands[T]) SubHandlers(ctxBuilder ContextBulder, parent *flags.Command) *flags.Command
- type ConsoleUtility
- func (c *ConsoleUtility) AddCommandGroup(handler func(ctxBuilder ContextBulder, parser *flags.Parser) *flags.Command) *flags.Command
- func (c *ConsoleUtility) AddCommandSubgroup(parent *flags.Command, ...) *flags.Command
- func (c *ConsoleUtility) Close()
- func (c *ConsoleUtility) InitCommandContext(group string, command string) multitenancy.TenancyContext
- func (c *ConsoleUtility) Parse()
- type ContextBulder
- type Dummy
- type GroupByData
- type Handler
- type HandlerBase
- func (h *HandlerBase[T]) Construct(ctxBuilder ContextBulder, group T)
- func (h *HandlerBase[T]) Context(opData interface{}) (multitenancy.TenancyContext, error)
- func (h *HandlerBase[T]) CtxBuilder() ContextBulder
- func (h *HandlerBase[T]) Data() interface{}
- func (h *HandlerBase[T]) HandlerDescription() string
- func (h *HandlerBase[T]) HandlerGroup() T
- func (h *HandlerBase[T]) HandlerName() string
- func (h *HandlerBase[T]) Init(name string, description string)
- type HandlerBaseHolder
- type HandlerBuilder
- type InitApp
- type MainOptions
- type QueryData
- type QueryWithGroupBy
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddCommand ¶
func AddCommand[T CommandGroup](parent *flags.Command, ctxBuilder ContextBulder, group T, makeHandler HandlerBuilder[T])
func ReadPassword ¶
Types ¶
type AppBuilder ¶
type AppBuilder interface { NewApp(buildConfig *app_context.BuildConfig) app_context.Context InitApp(app app_context.Context, configFile string, args []string, configType ...string) error NewSetupApp(buildConfig *app_context.BuildConfig) app_context.Context InitSetupApp(app app_context.Context, configFile string, args []string, configType ...string) error HasSetupApp() bool Tenancy(ctx op_context.Context, id string) (multitenancy.Tenancy, error) PoolController() pool.PoolController }
type CommandGroup ¶
type CommandGroupBase ¶
func NewCommandGroup ¶
func NewCommandGroup(groupName string, groupDescription string) *CommandGroupBase
func (*CommandGroupBase) Description ¶
func (c *CommandGroupBase) Description() string
func (*CommandGroupBase) InvokeInTenancy ¶
func (c *CommandGroupBase) InvokeInTenancy() bool
func (*CommandGroupBase) Name ¶
func (c *CommandGroupBase) Name() string
type Commands ¶
type Commands[T CommandGroup] struct { *CommandGroupBase Self T ExtraHandlers []HandlerBuilder[T] InTenancy bool }
func (Commands[T]) AddCommand ¶
func (c Commands[T]) AddCommand(parent *flags.Command, ctxBuilder ContextBulder, group T)
func (*Commands[T]) AddHandlers ¶
func (c *Commands[T]) AddHandlers(handlers ...HandlerBuilder[T])
func (*Commands[T]) Description ¶
func (*Commands[T]) Handlers ¶
func (c *Commands[T]) Handlers(ctxBuilder ContextBulder, parser *flags.Parser) *flags.Command
func (*Commands[T]) InvokeInTenancy ¶
func (*Commands[T]) SubHandlers ¶
func (c *Commands[T]) SubHandlers(ctxBuilder ContextBulder, parent *flags.Command) *flags.Command
type ConsoleUtility ¶
type ConsoleUtility struct { Parser *flags.Parser App app_context.Context Opts MainOptions Args []string AppBuilder AppBuilder BuildConfig *app_context.BuildConfig }
func New ¶
func New(buildConfig *app_context.BuildConfig, appBuilder ...AppBuilder) *ConsoleUtility
func (*ConsoleUtility) AddCommandGroup ¶
func (c *ConsoleUtility) AddCommandGroup(handler func(ctxBuilder ContextBulder, parser *flags.Parser) *flags.Command) *flags.Command
func (*ConsoleUtility) AddCommandSubgroup ¶
func (c *ConsoleUtility) AddCommandSubgroup(parent *flags.Command, handler func(ctxBuilder ContextBulder, parent *flags.Command) *flags.Command) *flags.Command
func (*ConsoleUtility) Close ¶
func (c *ConsoleUtility) Close()
func (*ConsoleUtility) InitCommandContext ¶
func (c *ConsoleUtility) InitCommandContext(group string, command string) multitenancy.TenancyContext
func (*ConsoleUtility) Parse ¶
func (c *ConsoleUtility) Parse()
type ContextBulder ¶
type ContextBulder = func(group string, command string) multitenancy.TenancyContext
type GroupByData ¶
type GroupByData struct {
GroupBy []string `long:"groupby" description:"Fields to group by, can be specified multiple times"`
}
type Handler ¶
type Handler[T CommandGroup] interface { CtxBuilder() ContextBulder HandlerGroup() T Construct(ctxBuilder ContextBulder, group T) HandlerName() string HandlerDescription() string Data() interface{} }
type HandlerBase ¶
type HandlerBase[T CommandGroup] struct { HandlerBaseHolder[T] }
func (*HandlerBase[T]) Construct ¶
func (h *HandlerBase[T]) Construct(ctxBuilder ContextBulder, group T)
func (*HandlerBase[T]) Context ¶
func (h *HandlerBase[T]) Context(opData interface{}) (multitenancy.TenancyContext, error)
func (*HandlerBase[T]) CtxBuilder ¶
func (h *HandlerBase[T]) CtxBuilder() ContextBulder
func (*HandlerBase[T]) Data ¶
func (h *HandlerBase[T]) Data() interface{}
func (*HandlerBase[T]) HandlerDescription ¶
func (h *HandlerBase[T]) HandlerDescription() string
func (*HandlerBase[T]) HandlerGroup ¶
func (h *HandlerBase[T]) HandlerGroup() T
func (*HandlerBase[T]) HandlerName ¶
func (h *HandlerBase[T]) HandlerName() string
func (*HandlerBase[T]) Init ¶
func (h *HandlerBase[T]) Init(name string, description string)
type HandlerBaseHolder ¶
type HandlerBaseHolder[T CommandGroup] struct { CtxBuilder ContextBulder `no-flag:"true"` Group T `no-flag:"true"` Name string `no-flag:"true"` Description string `no-flag:"true"` }
type HandlerBuilder ¶
type HandlerBuilder[T CommandGroup] func() Handler[T]
type MainOptions ¶
type MainOptions struct { ConfigFile string `short:"c" long:"config" description:"Configuration file"` ConfigFormat string `short:"f" long:"config-format" description:"Format of configuration file" default:"json"` NoInitDb bool `short:"w" long:"without-database" description:"Don't initialize database"` Setup bool `short:"s" long:"setup" description:"Use minimal application features for initial setup"` DbSection string `short:"d" long:"database-section" description:"Database section in configuration file" default:"db"` Tenancy string `` /* 137-byte string literal not displayed */ Args string `short:"a" long:"args" description:"Additional configuration arguments."` }
type QueryData ¶
type QueryData struct {
Query string `long:"query" description:"Query to filter items in response"`
}
type QueryWithGroupBy ¶
type QueryWithGroupBy struct { QueryData GroupByData }
Click to show internal directories.
Click to hide internal directories.