Documentation
¶
Index ¶
- func RegisterPlugin(typ Type, name string, fn func() Plugin)
- type BasePlugin
- func (p *BasePlugin[T]) ExecuteInbound(ctx context.Context, inbound *Inbound) (InboundResult, error)
- func (p *BasePlugin[T]) ExecuteOutbound(ctx context.Context, outbound *Outbound) 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 Inbound
- type InboundResult
- type Outbound
- 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(ctx context.Context, inbound *Inbound) (InboundResult, error)
func (*BasePlugin[T]) ExecuteOutbound ¶ added in v0.7.0
func (p *BasePlugin[T]) ExecuteOutbound(ctx context.Context, outbound *Outbound) 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 Inbound ¶ added in v0.7.0
type Inbound struct {
Request *http.Request
Response http.ResponseWriter
RawBody []byte
}
type InboundResult ¶ added in v0.7.0
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(ctx context.Context, inbound *Inbound) (InboundResult, error)
// ExecuteOutbound executes outbound
ExecuteOutbound(ctx context.Context, outbound *Outbound) 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.