dns

package
v0.0.0-...-27a864e Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2015 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultEndpoint is the default URL for onedari API.
	DefaultEndpoint = "http://127.0.0.1:63412"
	// DefaultAddress is the default listen address for the DNS server.
	DefaultAddress = "127.0.0.1:15353"
	// DefaultDomain is the default DNS domain.
	DefaultDomain = "onedari.local."
	// DefaultTTL is the default DNS ttl.
	DefaultTTL = 0
)
View Source
const (
	//DNS Query types
	UnknownQueryType = iota
	NodeQueryType
	ServiceQueryType
)

Variables

This section is empty.

Functions

This section is empty.

Types

type OptionFunc

type OptionFunc func(*Server) error

func Domain

func Domain(d string) OptionFunc

Domain sets the DNS domain.

func Endpoint

func Endpoint(endpoint string) OptionFunc

Endpoint sets the API endpoint.

func HTTPClient

func HTTPClient(client *http.Client) OptionFunc

HTTPClient sets the http client to use.

func TTL

func TTL(ttl uint32) OptionFunc

TTL sets the DNS ttl in seconds

type Server

type Server struct {
	// contains filtered or unexported fields
}

func New

func New(options ...OptionFunc) (*Server, error)

New creates a new DNS Server.

func (*Server) DoHTTP

func (s *Server) DoHTTP(uri string, v interface{}) error

func (*Server) NodeQuery

func (s *Server) NodeQuery(name string, w d.ResponseWriter, r *d.Msg)

func (*Server) Run

func (s *Server) Run() error

Run starts the server. It does not return, generally.

func (*Server) ServeDNS

func (s *Server) ServeDNS(w d.ResponseWriter, r *d.Msg)

ServeDNS implements the dns.Server interface.

func (*Server) ServiceQueryA

func (s *Server) ServiceQueryA(name string, w d.ResponseWriter, r *d.Msg)

func (*Server) ServiceQuerySRV

func (s *Server) ServiceQuerySRV(name string, w d.ResponseWriter, r *d.Msg)

Jump to

Keyboard shortcuts

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