dns

package
v1.6.1 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2024 License: MPL-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrServerDisabled error = errors.New("server is disabled")

ErrServerDisabled is returned when the server is disabled

View Source
var ErrServerRunning error = errors.New("server is already running")

ErrServerRunning is returned when the server is already running

Functions

This section is empty.

Types

type DNSServer

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

DNSServer is the implementation of the DNSServerInterface

func (*DNSServer) Start

func (d *DNSServer) Start(ctx context.Context) error

Run starts the tcp and udp listeners and forwards requests to consul

func (*DNSServer) Stop

func (d *DNSServer) Stop()

Stop will shut down the server

func (*DNSServer) TcpPort

func (d *DNSServer) TcpPort() int

TcpPort is a helper func for the purpose of returning the port that the OS chose if the user specified 0

func (*DNSServer) UdpPort

func (d *DNSServer) UdpPort() int

UdpPort is a helper func for the purpose of returning the port that the OS chose if the user specified 0 in the server config

type DNSServerInterface

type DNSServerInterface interface {
	Start(context.Context) error
	Stop()
	TcpPort() int
	UdpPort() int
}

DNSServerInterface is the interface for athe DNSServer

func NewDNSServer

func NewDNSServer(p DNSServerParams) (DNSServerInterface, error)

NewDNSServer creates a new DNS proxy server

type DNSServerParams

type DNSServerParams struct {
	BindAddr string
	Port     int
	Logger   hclog.Logger
	Client   pbdns.DNSServiceClient

	Partition string
	Namespace string
	Token     string
}

DNSServerParams is the configuration for creating a new DNS server

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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