dns

package
v0.0.0-...-0cd5192 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2021 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrRecordAlreadyExists = errors.New("dns record already exists")
	ErrRecordNotFound      = errors.New("dns record not found")
)

Functions

func MessageFromRecord

func MessageFromRecord(zone string, rec libdns.Record) (dns.RR, error)

MessageFromRecord parses a libdns.Record and returns a dns.Msg value, using the `zone` argument.

Types

type Server

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

Server is used for capturing DNS requests, and storing/serving TXT records for the ACME DNS-01 challenge. It implements certmagic.ACMEDNSProvider.

func NewServer

func NewServer(opts ...ServerOption) *Server

func (*Server) AppendRecords

func (srv *Server) AppendRecords(ctx context.Context, zone string, newRecs []libdns.Record) ([]libdns.Record, error)

func (*Server) DeleteRecords

func (srv *Server) DeleteRecords(ctx context.Context, zone string, deleteRecs []libdns.Record) ([]libdns.Record, error)

func (*Server) GetRecords

func (srv *Server) GetRecords(ctx context.Context, zone string) ([]libdns.Record, error)

func (*Server) Run

func (srv *Server) Run(ctx context.Context) error

Run starts the DNS server.

func (*Server) ServeDNS

func (srv *Server) ServeDNS(w dns.ResponseWriter, r *dns.Msg)

func (*Server) Shutdown

func (srv *Server) Shutdown(ctx context.Context) error

type ServerOption

type ServerOption func(*Server)

func WithAddress

func WithAddress(addr string) ServerOption

func WithLogger

func WithLogger(logger *zap.Logger) ServerOption

WithLogger provides a logger, which is used for HTTP related logs.

func WithSOAHostname

func WithSOAHostname(soaHostname string) ServerOption

func WithStorage

func WithStorage(s certmagic.Storage) ServerOption

Jump to

Keyboard shortcuts

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