Version: v0.0.0-...-642703f Latest Latest

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

Go to latest
Published: Nov 21, 2018 License: Apache-2.0 Imports: 6 Imported by: 0




This section is empty.


This section is empty.


This section is empty.


type Builder

type Builder struct {
	Packed      []byte
	SocketProto tap.SocketProtocol
	SocketFam   tap.SocketFamily
	Address     net.IP
	Port        uint32
	TimeSec     uint64
	TimeNsec    uint32
	// contains filtered or unexported fields

Builder helps to build a Dnstap message.

func New

func New() *Builder

New returns a new Builder

func (*Builder) Addr

func (b *Builder) Addr(remote net.Addr) *Builder

Addr adds the remote address to the message.

func (*Builder) HostPort

func (b *Builder) HostPort(addr string) *Builder

HostPort adds the remote address as encoded by dnsutil.ParseHostPortOrFile to the message.

func (*Builder) Msg

func (b *Builder) Msg(m *dns.Msg) *Builder

Msg adds the raw DNS message to the dnstap message.

func (*Builder) Time

func (b *Builder) Time(ts time.Time) *Builder

Time adds the timestamp to the message.

func (*Builder) ToClientQuery

func (b *Builder) ToClientQuery() (*tap.Message, error)

ToClientQuery transforms Data into a client query message.

func (*Builder) ToClientResponse

func (b *Builder) ToClientResponse() (*tap.Message, error)

ToClientResponse transforms Data into a client response message.

func (*Builder) ToOutsideQuery

func (b *Builder) ToOutsideQuery(t tap.Message_Type) (*tap.Message, error)

ToOutsideQuery transforms the data into a forwarder or resolver query message.

func (*Builder) ToOutsideResponse

func (b *Builder) ToOutsideResponse(t tap.Message_Type) (*tap.Message, error)

ToOutsideResponse transforms the data into a forwarder or resolver response message.

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL