Documentation ¶
Index ¶
- type Context
- func (c *Context) Abort()
- func (c *Context) AbortWithError(err error) error
- func (c *Context) AfterResponse(responseError error)
- func (c *Context) ClientIP() net.IP
- func (c *Context) Deadline() (deadline time.Time, ok bool)
- func (c *Context) Done() <-chan struct{}
- func (c *Context) Err() error
- func (c *Context) Error(err error) error
- func (c *Context) Get(key string) (value interface{}, exists bool)
- func (c *Context) GetBool(key string) (value bool)
- func (c *Context) GetFloat64(key string) (value float64)
- func (c *Context) GetInt(key string) (value int)
- func (c *Context) GetInt64(key string) (value int64)
- func (c *Context) GetString(key string) (value string)
- func (c *Context) HasError() bool
- func (c *Context) IsAborted() bool
- func (c *Context) Logger() *logrus.Entry
- func (c *Context) MustRegisterPluginsOnce(chain PluginChain)
- func (c *Context) Patch()
- func (c *Context) Set(key string, value interface{})
- func (c *Context) Value(key interface{}) interface{}
- func (c *Context) Warmup()
- type Object
- type PluginChain
- type PluginFunc
- type PluginFuncChain
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Context ¶
type Context struct { Writer dns.ResponseWriter Msg *dns.Msg Errors []error KV map[string]interface{} // contains filtered or unexported fields }
Context pack up with a dns message, and is the most important part of apex It allow us to pass variables throught plugins, manage the work flow
func NewContext ¶
NewContext with basic properties
func (*Context) Abort ¶
func (c *Context) Abort()
Abort prevents plugins calling after current plugin
func (*Context) AbortWithError ¶
AbortWithError calls `Abort()` and `Error()`
func (*Context) AfterResponse ¶
AfterResponse func
func (*Context) GetFloat64 ¶
GetFloat64 by key
func (*Context) MustRegisterPluginsOnce ¶
func (c *Context) MustRegisterPluginsOnce(chain PluginChain)
MustRegisterPluginsOnce register plugins
type Object ¶
type Object interface { // Name get plugin object name Name() string // Initialize plugin object Initialize() error // Warmup before patch Warmup(*Context) // Patch dns message and return it back for chain-call Patch(*Context) // AfterResponse call after response with response status AfterResponse(*Context, error) }
Object of Plugin system for APEX inject into lifecycle of DNS server handle
Click to show internal directories.
Click to hide internal directories.