dnsproxy

package module
v0.0.0-...-86caab1 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2021 License: Apache-2.0 Imports: 11 Imported by: 0

README

demo

Name

demo - returns 1.1.1.1 for 172.0.0.0/8 or 127.0.0.0/8 and 8.8.8.8 otherwise

Description

This demo plugin showcases the implementation of source IP based service discovery. It is intended as a boilerplate code, so that anyone that is interested in coredns implementation could build their plugin on top of this demo plugin.

This demo plugin and its full code has been walked through in:

Note: In Barcelona during the demo we ran into a glitch. The issue was that with the latest coredns code, in order to add a new plugin, an additional step of make gen is needed. Therefore, to build the coredns with demo plugin the following should be used:

docker run -it --rm -v $PWD:/v -w /v golang:1.12 sh -c 'make gen && make'

Syntax

demo

Also See

See the manual.

Documentation

Overview

Package dnsproxy implements a plugin

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Dnsproxy

type Dnsproxy struct{}

Dnsproxy is a plugin in CoreDNS

func (Dnsproxy) Name

func (p Dnsproxy) Name() string

Name implements the Handler interface.

func (Dnsproxy) ServeDNS

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

ServeDNS implements the plugin.Handler interface.

Jump to

Keyboard shortcuts

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