agent

package
v0.0.0-...-83adff0 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2020 License: GPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Agent

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

Agent easyns agent

func New

func New(c *conf.Config) (*Agent, error)

New agent

func (*Agent) DefaultSel

func (a *Agent) DefaultSel() backend.Selector

DefaultSel default selector from config

func (*Agent) Query

func (a *Agent) Query(name string) ([]*backend.Instance, error)

Query name

func (*Agent) ShutDown

func (a *Agent) ShutDown(ctx context.Context) error

ShutDown agent

func (*Agent) Start

func (a *Agent) Start() error

Start agent

type Answers

type Answers []dns.RR

Answers answers

func (Answers) Len

func (as Answers) Len() int

Len the number of answer

func (Answers) Swap

func (as Answers) Swap(i, j int)

Swap order

type DNSServer

type DNSServer struct {
	*dns.Server
	// contains filtered or unexported fields
}

DNSServer is used to wrap an Agent and expose various service discovery endpoints using a DNS interface.

func NewDNSServer

func NewDNSServer(a *Agent, cfg *conf.DNSServer) (*DNSServer, error)

NewDNSServer new dns server

func (*DNSServer) ListenAndServe

func (s *DNSServer) ListenAndServe(network, addr string, notif func()) error

ListenAndServe listen and serve dns

type HTTPServer

type HTTPServer struct {
	*http.Server
	// contains filtered or unexported fields
}

HTTPServer provides an HTTP api for an agent.

func NewHTTPServer

func NewHTTPServer(addr string, a *Agent) *HTTPServer

NewHTTPServer http server provide simple query api

func (*HTTPServer) NSTranslation

func (s *HTTPServer) NSTranslation(resp http.ResponseWriter, req *http.Request) (interface{}, error)

NSTranslation query name from http api

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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