Documentation
¶
Index ¶
- Constants
- func InvokeBackendModulesHook(ctx context.Context, reg *plugin.Registry, ...) ([]app.BackendModuleFactory, error)
- func InvokeBackendModulesHookWithContext(ctx context.Context, factories []app.BackendModuleFactory) ([]app.BackendModuleFactory, error)
- func InvokeCommandsHook(ctx context.Context, reg *plugin.Registry, commands []*cli.Command) ([]*cli.Command, error)
- func InvokeConfigHook(ctx context.Context, reg *plugin.Registry, ...) error
- func InvokeDumpConfigHook(ctx context.Context, config *config.Config) error
- func InvokeMountRoutesHook(ctx context.Context, r chi.Router) error
- func ServiceProvider(registry *plugin.Registry) service.Provider
- type BackendModules
- type Commands
- type Config
- type DumpConfig
- type MountRoutes
- type Service
Constants ¶
const (
ServiceName service.Name = "hook"
)
Variables ¶
This section is empty.
Functions ¶
func InvokeBackendModulesHook ¶
func InvokeBackendModulesHook(ctx context.Context, reg *plugin.Registry, factories []app.BackendModuleFactory) ([]app.BackendModuleFactory, error)
InvokeBackendModulesHook invokes the registered plugins implementing the BackendModules interface and extending backend modules factories.
func InvokeBackendModulesHookWithContext ¶
func InvokeBackendModulesHookWithContext(ctx context.Context, factories []app.BackendModuleFactory) ([]app.BackendModuleFactory, error)
InvokeBackendModulesHookWithContext extracts hook.Service from the given context and returns the InvokeBackendModulesHook result.
func InvokeCommandsHook ¶
func InvokeConfigHook ¶
func InvokeConfigHook(ctx context.Context, reg *plugin.Registry, config map[string]map[string]interface{}) error
InvokeConfigHook invokes plugins implementing the Config interface with their associated configuration options.
func InvokeDumpConfigHook ¶
InvokeDumpConfigHook invokes plugins implementing the DumpConfig interface.
Types ¶
type BackendModules ¶
type BackendModules interface { // HookBackendModules handles backend modules factories and // returns a modified version, if necessary. HookBackendModules(ctx context.Context, factories []app.BackendModuleFactory) ([]app.BackendModuleFactory, error) }
HookBackendModules is an interface allowing compatible plugins to modify apps backend exposed modules.
type Commands ¶
type Commands interface { // HookCommands handles default commands // returns a modified slice of commands, if necessary. HookCommands(ctx context.Context, defaultCommands []*cli.Command) ([]*cli.Command, error) }
Commands is an interface allowing compatible plugins to modify available commands.
type Config ¶
type Config interface { // ConfigureHook handles plugins configuration options given by the host process. HookConfig(ctx context.Context, options map[string]interface{}) error }
Config is an interface allowing compatible plugins to receive configuration options on application startup.
type DumpConfig ¶
type DumpConfig interface { // HookDumpConfig handles configuration file dump HookDumpConfig(ctx context.Context) (map[string]interface{}, error) }
HookConfig is an interface allowing compatible plugins to dump configuration options on 'dump-config' command execution.
type MountRoutes ¶
type MountRoutes interface { // HookMountRoutes handles the chi.Router used by the http server HookMountRoutes(ctx context.Context, r chi.Router) error }
HookMountRoutes is an interface allowing compatible plugins to mount additional http routes.