nspub

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2018 License: MIT Imports: 12 Imported by: 0

README

nspub

Package nspub provides a CoreDNS plugin to publish successful DNS lookups to NSQ.

To use this plugin, CoreDNS must be compiled with this plugin by adding nspub:jw4.us/nspub to the plugins.cfg file, at the desired level. If in doubt, put it right before the line that has log:log.

The plugin is configured in the Corefile, inside the desired definition block. The topic and address arguments are required.

Example Corefile:

  . {
    whoami
    nspub <topic> <address>
  }

Where <topic> is whatever the NSQ topic name should be, and <address> is the NSQ TCP address, like 10.0.0.1:4150.

Documentation

Overview

Package nspub provides a CoreDNS plugin to publish successful DNS lookups to NSQ.

To use this plugin, CoreDNS must be compiled with this plugin by adding 'nspub:jw4.us/nspub' to the plugins.cfg file, at the desired level. If in doubt, put it right before the line 'log:log'

The plugin is configured in the Corefile, inside the desired definition block. The topic and address arguments are required.

For example:

. {
  whoami
  nspub <topic> <address>
}

Where <topic> is whatever the NSQ topic name should be, and <address> is the NSQ TCP address, like '10.0.0.1:4150'

Index

Constants

View Source
const CoreDNSPluginName = "nspub"

CoreDNSPluginName is the canonical name for this plugin.

Variables

This section is empty.

Functions

This section is empty.

Types

type Answer

type Answer struct {
	Hdr  Header
	A    string
	AAAA string
}

Answer is the simplified structure for deserialization.

type Header struct {
	Name string
}

Header is the simplified structure for deserialization.

type Message

type Message struct {
	ClientIP string
	Time     time.Time
	Msg      Msg
}

Message is the simplified structure for deserialization.

type Msg

type Msg struct {
	ID       int
	Question []Question
	Answer   []Answer
}

Msg is the simplified structure for deserialization.

type Question

type Question struct {
	Name string
}

Question is the simplified structure for deserialization.

type SerializeMessage

type SerializeMessage struct {
	ClientIP net.IP
	Time     time.Time
	Msg      *dns.Msg
}

SerializeMessage is the structure serialized to send.

func (*SerializeMessage) String

func (m *SerializeMessage) String() string

Jump to

Keyboard shortcuts

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