taprw

package
v0.0.0-...-c2105a4 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2017 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package taprw takes a query and intercepts the response. It will log both after the response is written.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ResponseWriter

type ResponseWriter struct {
	Query *dns.Msg
	dns.ResponseWriter
	Tapper
	// contains filtered or unexported fields
}

ResponseWriter captures the client response and logs the query to dnstap. Single request use.

func (ResponseWriter) DnstapError

func (w ResponseWriter) DnstapError() error

DnstapError check if a dnstap error occurred during Write and returns it.

func (*ResponseWriter) QueryEpoch

func (w *ResponseWriter) QueryEpoch()

QueryEpoch sets the query epoch as reported by dnstap.

func (*ResponseWriter) WriteMsg

func (w *ResponseWriter) WriteMsg(resp *dns.Msg) (writeErr error)

WriteMsg writes back the response to the client and THEN works on logging the request and response to dnstap. Dnstap errors are to be checked by DnstapError.

type Tapper

type Tapper interface {
	TapMessage(m *tap.Message) error
	TapBuilder() msg.Builder
}

Tapper is what ResponseWriter needs to log to dnstap.

Jump to

Keyboard shortcuts

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