types

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 22, 2020 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Context

type Context struct {
	// contains filtered or unexported fields
}

Context used for processing every DNS resolve request during server, endpoints and plugins

func NewContext

func NewContext(clientIP net.IP, queryMessage *dns.Msg) *Context

NewContext returns a brand new context with query DNS message

func (*Context) Abort

func (c *Context) Abort()

func (*Context) AbortWithErr

func (c *Context) AbortWithErr(err error)

func (*Context) ClientIP added in v0.2.0

func (c *Context) ClientIP() net.IP

func (*Context) Error

func (c *Context) Error() error

func (*Context) Get

func (c *Context) Get(key string) (interface{}, bool)

func (*Context) GetLogger added in v0.2.0

func (c *Context) GetLogger(logger *logrus.Entry) *logrus.Entry

func (*Context) GetQueryMessage

func (c *Context) GetQueryMessage() *dns.Msg

func (*Context) GetResponse

func (c *Context) GetResponse() *dns.Msg

func (*Context) GetUUID

func (c *Context) GetUUID() string

func (*Context) IsAbort

func (c *Context) IsAbort() bool

func (*Context) Set

func (c *Context) Set(key string, value interface{})

func (*Context) SetResponse

func (c *Context) SetResponse(msg *dns.Msg)

type ContextHandler

type ContextHandler func(*Context)

type Endpoint

type Endpoint interface {
	Run() error
	Close() error
}

type EndpointConfig

type EndpointConfig struct {
	Logger *logrus.Entry
	caddyfile.Dispenser
	Handler ContextHandler
}

type EndpointInitializer

type EndpointInitializer struct {
	Name        string
	Description string
	SetupFunc   EndpointSetupFunc
}

type EndpointSetupFunc

type EndpointSetupFunc func(EndpointConfig) (Endpoint, error)

type HandleFunc

type HandleFunc func(*Context)

type Plugin

type Plugin interface {
	Name() string
	Handle(*Context)
	Tail(*Context)
}

type PluginConfig

type PluginConfig struct {
	Logger *logrus.Entry
	caddyfile.Dispenser
}

type PluginInitializer

type PluginInitializer struct {
	Name        string
	Description string
	SetupFunc   PluginSetupFunc
}

type PluginSetupFunc

type PluginSetupFunc func(PluginConfig) (Plugin, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL