Documentation ¶
Index ¶
- func ListCommandsIntoProcessor(ctx context.Context, commands []cmds.Command, gp middlewares.Processor) error
- type CommandLoader
- type CommandLocations
- type EmbeddedCommandLocation
- type LoadCommandsOption
- func WithAdditionalLayers(layers ...layers.ParameterLayer) LoadCommandsOption
- func WithEmbeddedLocations(locations ...EmbeddedCommandLocation) LoadCommandsOption
- func WithHelpSystem(helpSystem *help.HelpSystem) LoadCommandsOption
- func WithLoadEmbeddedFirst(loadEmbeddedFirst bool) LoadCommandsOption
- func WithRepositories(locations ...string) LoadCommandsOption
- type RawCommand
- type RawCommandLoader
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ListCommandsIntoProcessor ¶ added in v0.0.19
Types ¶
type CommandLoader ¶
type CommandLoader[T glazed_cmds.Command] struct { // contains filtered or unexported fields }
CommandLoader wraps a series of command locations and can be ued to load them all at once. This is usually used to load all available commands on startup.
func NewCommandLoader ¶
func NewCommandLoader[T glazed_cmds.Command](locations *CommandLocations) *CommandLoader[T]
func (*CommandLoader[T]) LoadCommands ¶
func (c *CommandLoader[T]) LoadCommands( loader loaders.FSCommandLoader, helpSystem *help.HelpSystem, options ...glazed_cmds.CommandDescriptionOption, ) ([]T, []*alias.CommandAlias, error)
type CommandLocations ¶
type CommandLocations struct { // List of embedded filesystems to load commands from Embedded []EmbeddedCommandLocation // List of repositories directories Repositories []string // List of additional layers to add to every command AdditionalLayers []layers.ParameterLayer // Help system to register commands with HelpSystem *help.HelpSystem // Load embedded commands first LoadEmbeddedFirst bool }
CommandLocations groups all possible sources for loading commands on appplication start and is used by the LoadCommands function.
func NewCommandLocations ¶
func NewCommandLocations(options ...LoadCommandsOption) *CommandLocations
type EmbeddedCommandLocation ¶
EmbeddedCommandLocation describes the location of a command inside an embedded fs.FS.
type LoadCommandsOption ¶
type LoadCommandsOption func(*CommandLocations)
func WithAdditionalLayers ¶
func WithAdditionalLayers(layers ...layers.ParameterLayer) LoadCommandsOption
func WithEmbeddedLocations ¶
func WithEmbeddedLocations(locations ...EmbeddedCommandLocation) LoadCommandsOption
func WithHelpSystem ¶
func WithHelpSystem(helpSystem *help.HelpSystem) LoadCommandsOption
func WithLoadEmbeddedFirst ¶ added in v0.0.19
func WithLoadEmbeddedFirst(loadEmbeddedFirst bool) LoadCommandsOption
func WithRepositories ¶
func WithRepositories(locations ...string) LoadCommandsOption
type RawCommand ¶ added in v0.0.19
type RawCommand struct { *cmds.CommandDescription YAMLContent map[string]interface{} Content []byte }
type RawCommandLoader ¶ added in v0.0.19
type RawCommandLoader struct{}
func (*RawCommandLoader) LoadCommandAliasFromYAML ¶ added in v0.0.19
func (r *RawCommandLoader) LoadCommandAliasFromYAML(s io.Reader, options ...alias.Option) ([]*alias.CommandAlias, error)
func (*RawCommandLoader) LoadCommandFromYAML ¶ added in v0.0.19
func (r *RawCommandLoader) LoadCommandFromYAML(s io.Reader, options ...cmds.CommandDescriptionOption) ([]cmds.Command, error)
Click to show internal directories.
Click to hide internal directories.