types

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 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
}

func NewContext

func NewContext(uuid string, queryMessage *dns.Msg) *Context

func (*Context) Abort

func (c *Context) Abort()

func (*Context) AbortWithErr

func (c *Context) AbortWithErr(err error)

func (*Context) Error

func (c *Context) Error() error

func (*Context) Get

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

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 DNSQuestion

type DNSQuestion struct {
	Name string `json:"name"`
	Type uint16 `json:"type"`
}

type DNSRR

type DNSRR struct {
	DNSQuestion
	TTL  uint32 `json:"TTL"`
	Data string `json:"data"`
}

type DNSResponse

type DNSResponse struct {
	Status             uint32        `json:"Status"`
	Truncated          bool          `json:"TC"`
	RecursionDesired   bool          `json:"RD"`
	RecursionAvailable bool          `json:"RA"`
	AuthenticatedData  bool          `json:"AD"`
	CheckingDisabled   bool          `json:"CD"`
	Question           []DNSQuestion `json:"Question"`
	Answer             []DNSRR       `json:"Answer"`
	Authority          []DNSRR       `json:"Authority,omitempty"`
	Additional         []DNSRR       `json:"Additional,omitempty"`
	Comment            string        `json:"Comment,omitempty"`
	EdnsClientSubnet   string        `json:"edns_client_subnet,omitempty"`
}

func ParseDNSResponseFromMessage

func ParseDNSResponseFromMessage(msg *dns.Msg) DNSResponse

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)
}

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