taprw

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2018 License: Apache-2.0 Imports: 5 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 {
	QueryEpoch time.Time
	Query      *dns.Msg
	dns.ResponseWriter
	Tapper
	Send *SendOption
	// contains filtered or unexported fields
}

ResponseWriter captures the client response and logs the query to dnstap. Single request use. SendOption configures Dnstap to selectively send Dnstap messages. Default is send all.

func (*ResponseWriter) DnstapError

func (w *ResponseWriter) DnstapError() error

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

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.

type SendOption

type SendOption struct {
	Cq bool
	Cr bool
}

SendOption stores the flag to indicate whether a certain DNSTap message to be sent out or not.

type Tapper

type Tapper interface {
	TapMessage(*tap.Message)
	Pack() bool
}

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