bind

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2022 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteRRS

func DeleteRRS(record *Record)

DeleteRRS will remove a resource record and convert the behavior of the record back to that of the defaultHandler

func UpsertRRS

func UpsertRRS(record *Record)

UpsertRRS will update or insert a resource record to override the the defaultHandler

Types

type BindConfig

type BindConfig struct {
	Configs        []BindServerConfig
	Zones          []string
	PollingManager *polling.PollingServer
	PublicAddress  string
}

BindConfig holds all the server configurations and a list of zones to serve

type BindServerConfig

type BindServerConfig struct {
	// Address is the IP address that the listener will be
	// bound to when starting the server.
	// Address cannot be nil. If it is requested to bind
	// to a generic interface, use 0.0.0.0 to represent *:<port>
	Address *string
	Port    *int
	Net     *string    // tcp, tcp-tls, udp
	TLS     *TLSConfig // If TLS is enabled, Net is forced to tcp-tls
}

BindServerConfig contains fields necessary to build a listener to serve requests

type Record

type Record struct {
	FQDN       *string     // Required. All addresses are converted to a FQDN
	RecordType *string     // Optional for Delete; Required for Upsert
	TTL        *uint32     // Optional for Delete; Required for Upsert
	Value      interface{} // Optional for Delete; Required for Upsert
}

Record is used to update or delete a record from the zone

func GetRRS

func GetRRS(record *Record) (*Record, bool)

GetRRS will return the RR if it was found in the cache. Otherwise, GetRRS will return nil and false

type Server

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

Server is a facade to work with DNS

func BindServer

func BindServer(cfg *BindConfig) *Server

BindServer creates a new configured Server struct that can be started or stopped

func (*Server) Start

func (s *Server) Start()

Start will register listeners based on the server spec and start the defaultHandlers

func (*Server) Stop

func (s *Server) Stop()

Stop will gracefully shutdown the server

type TLSConfig

type TLSConfig struct {
	// CertFile must contain PEM encoded data. The CertFile
	// should contain intermediate certificates following the leaf
	// certificate to form a certificate chain.
	CertFile *string
	// KeyFile contains the private key that corresponds to the public key
	// in CertFile.
	KeyFile *string
}

TLSConfig contains the path to PEM encoded certs

Jump to

Keyboard shortcuts

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