hectocorn

package
v0.0.0-...-e5d9080 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2021 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Log = Logger{Device: os.Stderr}

Functions

func DecodeConfig

func DecodeConfig(v interface{}) error

DecodeConfig decodes the configuration of the plugin from environment variable to the v. Method returns nil when configuration is missing in environment.

func ServeCore

func ServeCore(h CoreHandler)

Types

type CoreHandler

type CoreHandler interface {
	ServeDNS(context.Context, dns.ResponseWriter, *dns.Msg) (int, error)
}

CoreHandler is an interface for CoreDNS plugins without the Name method. This extension allows to reuse CoreDNS plugins almost without modifications.

type Logger

type Logger struct {
	Device io.Writer
}

func (*Logger) Debug

func (l *Logger) Debug(format string, a ...interface{})

func (*Logger) Error

func (l *Logger) Error(format string, a ...interface{})

func (*Logger) Fatal

func (l *Logger) Fatal(format string, a ...interface{})

Fatal is equivalent to Error() followed by a call to os.Exit(1).

func (*Logger) Info

func (l *Logger) Info(format string, a ...interface{})

func (*Logger) Warn

func (l *Logger) Warn(format string, a ...interface{})

Jump to

Keyboard shortcuts

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