util

package
v1.20.9 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2021 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ResponseInterceptor

type ResponseInterceptor struct {
	dns.ResponseWriter
	Msg *dns.Msg
}

func NewResponseInterceptor

func NewResponseInterceptor(w dns.ResponseWriter) *ResponseInterceptor

NewResponseReverter returns a pointer to a new ResponseReverter.

func (*ResponseInterceptor) Hijack

func (r *ResponseInterceptor) Hijack()

Hijack implements dns.Hijacker. It simply wraps the underlying ResponseWriter's Hijack method if there is one, or returns an error.

func (*ResponseInterceptor) Write

func (r *ResponseInterceptor) Write(buf []byte) (int, error)

Write is a wrapper that records the size of the message that gets written.

func (*ResponseInterceptor) WriteMsg

func (r *ResponseInterceptor) WriteMsg(res *dns.Msg) error

WriteMsg records the status code and calls the underlying ResponseWriter's WriteMsg method.

Jump to

Keyboard shortcuts

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