corednsplugin

package
v0.0.0-...-7ddeb54 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package corednsplugin is an adaptor which converts gslbcore.Core to a CoreDNS plugin.

By using the adaptor, we can focus on the GSLB logic in gslbcore.Core, and split the DNS protocol details.

Overview:

  • `setup.go` is primarily about how to handle the custom directives in the configuration file and configure `gslbcore.Config` accordingly.
  • `handler.go` provides the CoreDNS plugin implementation. It focuses on how to handle DNS requests and generate corresponding responses.

Index

Constants

View Source
const PluginName = "ncdn_gslb"
View Source
const Ttl = 120

Variables

This section is empty.

Functions

This section is empty.

Types

type Gslb

type Gslb struct {
	Next plugin.Handler
	// contains filtered or unexported fields
}

func NewGslb

func NewGslb(next plugin.Handler, core *gslbcore.GslbCore, zone string, nsA net.IP) *Gslb

func (*Gslb) A

func (p *Gslb) A(ctx context.Context, qname, subdomain string, srcIP net.IP) ([]dns.RR, error)

func (*Gslb) Name

func (p *Gslb) Name() string

Name implements the Handler interface.

func (*Gslb) Run

func (p *Gslb) Run(ctx context.Context) error

func (*Gslb) ServeDNS

func (p *Gslb) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.Msg) (int, error)

Jump to

Keyboard shortcuts

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