Documentation
¶
Index ¶
- func RegisterPlugin(typ Type, name string, fn func() Plugin)
- type BasePlugin
- func (p *BasePlugin[T]) ExecuteInbound(c *Context) error
- func (p *BasePlugin[T]) ExecuteOutbound(c *Context) error
- func (p *BasePlugin[T]) GetConfig() map[string]interface{}
- func (p *BasePlugin[T]) Init(config map[string]interface{}) error
- func (p *BasePlugin[T]) Priority() int
- func (p *BasePlugin[T]) ValidateConfig(config map[string]interface{}) error
- type Configuration
- type Context
- func (c *Context) Context() context.Context
- func (c *Context) GetRequestBody() []byte
- func (c *Context) IsTerminated() bool
- func (c *Context) JSON(code int, obj interface{})
- func (c *Context) Response(headers map[string]string, code int, body []byte)
- func (c *Context) SetRequestBody(body []byte)
- func (c *Context) WithContext(ctx context.Context) *Context
- type Plugin
- type Registration
- type Type
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterPlugin ¶ added in v0.7.0
Types ¶
type BasePlugin ¶ added in v0.7.0
type BasePlugin[T Configuration] struct { Config T }
func (*BasePlugin[T]) ExecuteInbound ¶ added in v0.7.0
func (p *BasePlugin[T]) ExecuteInbound(c *Context) error
func (*BasePlugin[T]) ExecuteOutbound ¶ added in v0.7.0
func (p *BasePlugin[T]) ExecuteOutbound(c *Context) error
func (*BasePlugin[T]) GetConfig ¶ added in v1.0.0
func (p *BasePlugin[T]) GetConfig() map[string]interface{}
func (*BasePlugin[T]) Init ¶ added in v1.0.0
func (p *BasePlugin[T]) Init(config map[string]interface{}) error
func (*BasePlugin[T]) Priority ¶ added in v1.0.0
func (p *BasePlugin[T]) Priority() int
func (*BasePlugin[T]) ValidateConfig ¶ added in v1.0.0
func (p *BasePlugin[T]) ValidateConfig(config map[string]interface{}) error
type Configuration ¶ added in v1.0.0
Configuration plugin configuration
type Context ¶ added in v0.7.0
func NewContext ¶ added in v1.0.1
func (*Context) GetRequestBody ¶ added in v1.0.1
func (*Context) IsTerminated ¶ added in v1.0.1
func (*Context) SetRequestBody ¶ added in v1.0.1
type Plugin ¶ added in v0.7.0
type Plugin interface {
// Name returns plugin's name
Name() string
// Priority returns plugin's priority
Priority() int
// Init inits plugin with configuration
Init(config map[string]interface{}) error
// GetConfig returns plugin's configuration
GetConfig() map[string]interface{}
// ValidateConfig validates plugin's configuration
ValidateConfig(config map[string]interface{}) error
// ExecuteInbound executes inbound
ExecuteInbound(c *Context) error
// ExecuteOutbound executes outbound
ExecuteOutbound(c *Context) error
}
type Registration ¶ added in v0.7.0
func GetRegistration ¶ added in v0.7.0
func GetRegistration(name string) *Registration
Click to show internal directories.
Click to hide internal directories.