Documentation
¶
Index ¶
- type BuildHook
- type ConfigHook
- type DevHook
- type Hook
- type HookType
- type Info
- type Loader
- func (l *Loader) Close() error
- func (l *Loader) DiscoverPlugins() ([]string, error)
- func (l *Loader) LoadFromConfig(ctx context.Context, enabled []string, configs map[string]PluginOptions) error
- func (l *Loader) LoadPlugin(ctx context.Context, name string, config PluginOptions) error
- func (l *Loader) LoadedPlugins() []string
- func (l *Loader) UnloadPlugin(name string) error
- type MiddlewareHook
- type Plugin
- type PluginContext
- func (p *PluginContext) ConfigBool(key string) bool
- func (p *PluginContext) ConfigInt(key string) int
- func (p *PluginContext) ConfigString(key string) string
- func (p *PluginContext) ConfigStringSlice(key string) []string
- func (p *PluginContext) Get(key string) (interface{}, bool)
- func (p *PluginContext) GetBool(key string) (bool, bool)
- func (p *PluginContext) GetInt(key string) (int, bool)
- func (p *PluginContext) GetString(key string) (string, bool)
- func (p *PluginContext) GetStringSlice(key string) ([]string, bool)
- func (p *PluginContext) Set(key string, value interface{})
- type PluginOptions
- type Registry
- func (r *Registry) All() []Plugin
- func (r *Registry) AllInfo() []*Info
- func (r *Registry) CloseAll() error
- func (r *Registry) Count() int
- func (r *Registry) Get(name string) (Plugin, bool)
- func (r *Registry) GetConfig(name string) map[string]interface{}
- func (r *Registry) GetHooks(hookType HookType) []interface{}
- func (r *Registry) Info(name string) (*Info, bool)
- func (r *Registry) Names() []string
- func (r *Registry) Register(p Plugin) error
- func (r *Registry) SetConfig(name string, config map[string]interface{})
- func (r *Registry) Unregister(name string) error
- type RequestHook
- type ResponseHook
- type Router
- type RouterHook
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConfigHook ¶
type Loader ¶
type Loader struct {
// contains filtered or unexported fields
}
func (*Loader) DiscoverPlugins ¶
func (*Loader) LoadFromConfig ¶
func (*Loader) LoadPlugin ¶
func (*Loader) LoadedPlugins ¶
func (*Loader) UnloadPlugin ¶
type MiddlewareHook ¶
type PluginContext ¶
type PluginContext struct {
Config map[string]interface{}
Logger *slog.Logger
HTTPClient *http.Client
Context context.Context
// contains filtered or unexported fields
}
func NewPluginContext ¶
func (*PluginContext) ConfigBool ¶
func (p *PluginContext) ConfigBool(key string) bool
func (*PluginContext) ConfigInt ¶
func (p *PluginContext) ConfigInt(key string) int
func (*PluginContext) ConfigString ¶
func (p *PluginContext) ConfigString(key string) string
func (*PluginContext) ConfigStringSlice ¶
func (p *PluginContext) ConfigStringSlice(key string) []string
func (*PluginContext) Get ¶
func (p *PluginContext) Get(key string) (interface{}, bool)
func (*PluginContext) GetStringSlice ¶
func (p *PluginContext) GetStringSlice(key string) ([]string, bool)
func (*PluginContext) Set ¶
func (p *PluginContext) Set(key string, value interface{})
type PluginOptions ¶
type PluginOptions map[string]interface{}
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
func NewRegistry ¶
func (*Registry) Unregister ¶
type ResponseHook ¶
type Router ¶
type Router interface {
Get(pattern string, handler http.HandlerFunc)
Post(pattern string, handler http.HandlerFunc)
Put(pattern string, handler http.HandlerFunc)
Delete(pattern string, handler http.HandlerFunc)
Use(middleware func(http.Handler) http.Handler)
Mount(pattern string, handler http.Handler)
}
type RouterHook ¶
Click to show internal directories.
Click to hide internal directories.