vl3dns

package
v1.14.0-rc.6 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2024 License: Apache-2.0 Imports: 23 Imported by: 1

Documentation

Overview

Package vl3dns provides a possible for vl3 networkservice endpoint to use distributed dns

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewClient added in v1.5.0

func NewClient(dnsServerIP net.IP, dnsConfigs *genericsync.Map[string, []*networkservice.DNSConfig]) networkservice.NetworkServiceClient

NewClient - returns a new null client that does nothing but call next.Client(ctx).{Request/Close} and return the result

This is very useful in testing

func NewServer

func NewServer(chainCtx context.Context, dnsServerIPCh <-chan net.IP, opts ...Option) networkservice.NetworkServiceServer

NewServer creates a new vl3dns netwrokservice server. It starts dns server on the passed port/url. By default listens ":53". By default is using fanout dns handler to connect to other vl3 nses. chainCtx is using for signal to stop dns server. opts configure vl3dns networkservice instance with specific behavior.

Types

type Option

type Option func(*vl3DNSServer)

Option configures vl3DNSServer

func WithConfigs added in v1.5.0

func WithConfigs(m *genericsync.Map[string, []*networkservice.DNSConfig]) Option

WithConfigs sets initial list to fanout queries

func WithDNSListenAndServeFunc

func WithDNSListenAndServeFunc(listenAndServeDNS func(ctx context.Context, handler dnsutils.Handler, listenOn string)) Option

WithDNSListenAndServeFunc replaces default listen and serve behavior for inner dns server

func WithDNSPort

func WithDNSPort(dnsPort int) Option

WithDNSPort replaces default dns port for the inner dns server.

func WithDNSServerHandler

func WithDNSServerHandler(handler dnsutils.Handler) Option

WithDNSServerHandler replaces default dns handler to specific one

func WithDomainSchemes

func WithDomainSchemes(domainSchemes ...string) Option

WithDomainSchemes sets domain schemes for vl3 dns server. Schemes are using to get dns names for clients

Jump to

Keyboard shortcuts

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