coredns

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2021 License: MIT Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const GrpcPluginName = "coredns-grpc"
View Source
const PluginName = "coredns"

Variables

This section is empty.

Functions

func GetServer

func GetServer(plugin apis.StartStopPlugin) (*server, error)

GetServer returns the backend grpc server if it is the grpcPlugin. Otherwise it returns an error.

func IsIPv4

func IsIPv4(ip net.IP) bool

IsIPv4 checks if the given ip address is an IPv4 address. It returns true if it is a IPv4 address. Otherwise false.

func IsIPv6

func IsIPv6(ip net.IP) bool

IsIPv6 checks if the given ip address is an IPv6 address. It returns true if it is a IPv6 address. Otherwise false.

func NewGrpcPlugin

func NewGrpcPlugin(prefix string) apis.StartStopPlugin

NewGrpcPlugin initializes a new StartStopPlugin that will controls the lifecycle of the server instance.

func NewInstaller

func NewInstaller(prefix string, ghClient github.Client) apis.InstallablePlugin

func NewServer

func NewServer() *server

NewServer initializes the grpc core dns service.

Types

type AddResourceRecordFunc

type AddResourceRecordFunc func(string, string) error

AddResourceRecordFunc is the function signature for adding resource records. It is used to add A, AAAA and CNAME entries.

type Manager

type Manager interface {
	// AddHost adds a new host to ip resource record. Depending on the type of
	// the ip it can be either an "A" or an "AAAA" record.
	// It allows to store multiple targets for the same host name. In this case
	// the regular round-robin mechanism for load balancing will be used.
	// If either the hostname or the target ip is not valid it will return an error.
	AddHost(hostName string, ip string) error

	// AddAlias adds a new host to CNAME resource record.
	// It allows to store multiple targets for the same host name. In this case
	// the regular round-robin mechanism for load balancing will be used.
	// If either the hostname or the target is not valid it will return an error.
	AddAlias(hostName string, target string) error

	// RemoveHost removes all "A", "AAAA" and "CNAME" records for the given hostname.
	RemoveHost(hostName string)
}

Manager defines the interface for plugins to interact with the CoreDNS backend.

func NewManager

func NewManager(plugin apis.StartStopPlugin) (Manager, error)

NewManager initializes a new Manager instance with the given plugin as backend.

func NewNoOpManager

func NewNoOpManager() Manager

NewNoOpManager initializes the noOpManager for the Manager interface.

type RemoveResourceRecordFunc

type RemoveResourceRecordFunc func(string)

AddResourceRecordFunc is the function signature for adding resource records. It is used to add A, AAAA and CNAME entries.

type Runner

type Runner interface {
	// Start starts the coreDns server.
	Start() error
	// Stop stops the coreDns server.
	Stop() error
}

Runner defines the interface for running the coreDns server in non daemon mode.

Directories

Path Synopsis
Package fake is a generated GoMock package.
Package fake is a generated GoMock package.

Jump to

Keyboard shortcuts

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