Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Backend ¶
type Backend struct { // The text the backend will serve to a successful hello message Banner string // The protocol version negotiated with the remote end ProtocolVersion int // contains filtered or unexported fields }
func New ¶
Build a new backend object. The banner is reported to the client upon successful negotiation; the io can be anything.
type Callback ¶
A callback of this type is executed whenever a query is received. If an error is returned, the responses are ignored and the error text is returned to the backend. Otherwise, the responses are serialised and sent back in order.
type Query ¶
type Query struct { ProtocolVersion int QName string QClass string QType string Id string RemoteIpAddress string LocalIpAddress string EdnsSubnetAddress string }
Represents a query received by the backend. Certain fields may be blank, depending on negotiated protocol version - which is stored in ProtocolVersion
QName, QClass, QType, Id and RemoteIpAddress are present in all versions LocalIpAddress was added in version 2 EdnsSubnetAddress was added in version 3
type Response ¶
type Response struct { ProtocolVersion int ScopeBits string Auth string QName string QClass string QType string TTL string Id string Content string }
A response to be sent back in answer to a query. Again, some fields may be blank, depending on protocol version.
QName, QClass, QType, TTL, Id and Content are present in all versions No additions in version 2 ScopeBits and Auth were added in version 3