ctx

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2018 License: MIT Imports: 4 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 {
	DNSWriter  ResponseWriter
	DNSRequest *dns.Msg

	HTTPWriter  http.ResponseWriter
	HTTPRequest *http.Request
	// contains filtered or unexported fields
}

Context type

func New

func New(handlers []Handler) *Context

New return new dnscontext

func (*Context) Abort

func (dc *Context) Abort()

Abort calls

func (*Context) NextDNS

func (dc *Context) NextDNS()

NextDNS call next dns middleware

func (*Context) NextHTTP

func (dc *Context) NextHTTP()

NextHTTP call next http middleware

func (*Context) ResetDNS

func (dc *Context) ResetDNS(w dns.ResponseWriter, r *dns.Msg)

ResetDNS reset dns vars

func (*Context) ResetHTTP

func (dc *Context) ResetHTTP(w http.ResponseWriter, r *http.Request)

ResetHTTP reset http vars

type Handler

type Handler interface {
	Name() string
	ServeDNS(*Context)
	ServeHTTP(*Context)
}

Handler interface

type ResponseWriter

type ResponseWriter interface {
	dns.ResponseWriter
	Msg() *dns.Msg
	Rcode() int
	Written() bool
	Reset(dns.ResponseWriter)
}

ResponseWriter implement of dns.ResponseWriter

Jump to

Keyboard shortcuts

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