dns

package
v1.16.109 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2023 License: MPL-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BufferResponseWriter

type BufferResponseWriter struct {
	LocalAddress  net.Addr
	RemoteAddress net.Addr
	Logger        hclog.Logger
	// contains filtered or unexported fields
}

BufferResponseWriter writes a DNS response to a byte buffer.

func (*BufferResponseWriter) Close

func (b *BufferResponseWriter) Close() error

Close closes the connection.

func (*BufferResponseWriter) Hijack

func (b *BufferResponseWriter) Hijack()

Hijack lets the caller take over the connection. After a call to Hijack(), the DNS package will not do anything with the connection. {

func (*BufferResponseWriter) LocalAddr

func (b *BufferResponseWriter) LocalAddr() net.Addr

LocalAddr returns the net.Addr of the server

func (*BufferResponseWriter) RemoteAddr

func (b *BufferResponseWriter) RemoteAddr() net.Addr

RemoteAddr returns the net.Addr of the client that sent the current request.

func (*BufferResponseWriter) TsigStatus

func (b *BufferResponseWriter) TsigStatus() error

TsigStatus returns the status of the Tsig.

func (*BufferResponseWriter) TsigTimersOnly

func (b *BufferResponseWriter) TsigTimersOnly(bool)

TsigTimersOnly sets the tsig timers only boolean.

func (*BufferResponseWriter) Write

func (b *BufferResponseWriter) Write(m []byte) (int, error)

Write writes a raw buffer back to the client.

func (*BufferResponseWriter) WriteMsg

func (b *BufferResponseWriter) WriteMsg(m *dns.Msg) error

WriteMsg writes a reply back to the client.

type Config

type Config struct {
	Logger      hclog.Logger
	DNSServeMux *dns.ServeMux
	LocalAddr   LocalAddr
}

type LocalAddr

type LocalAddr struct {
	IP   net.IP
	Port int
}

type Server

type Server struct {
	Config
}

func NewServer

func NewServer(cfg Config) *Server

func (*Server) Query

func (s *Server) Query(ctx context.Context, req *pbdns.QueryRequest) (*pbdns.QueryResponse, error)

Query is a gRPC endpoint that will serve dns requests. It will be consumed primarily by the consul dataplane to proxy dns requests to consul.

func (*Server) Register

func (s *Server) Register(grpcServer *grpc.Server)

Jump to

Keyboard shortcuts

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