fns

package module
v0.1.0 Latest Latest
Warning

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

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

README

4ever-Name-Server

CoreDNS plugin for authoritative server.
This project needs to paired with a Resource Record (RR) repository.

Syntax

fns {
  api-url URL
}
  • api-url is the query URL of the Resource Record (RR).

Examples

. {
  fns {
    api-url https://ns.example.com/resouce-records
  }
}  

Compilation from Source

sh build.sh

Compilation with Docker

docker build -t fns .

Documentation

Index

Constants

View Source
const PluginName = "fns"

Variables

This section is empty.

Functions

This section is empty.

Types

type CAAValue

type CAAValue struct {
	Flags uint8
	Tag   string
	Value string
}

type Condition

type Condition map[string]interface{}

type FNS

type FNS struct {
	Next    plugin.Handler
	RRsRepo RRsRepository
}

func (FNS) Name

func (f FNS) Name() string

func (FNS) Resolve

func (f FNS) Resolve(name string, rrType, rrClass uint16) []dns.RR

func (*FNS) ServeDNS

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

type MXValue

type MXValue struct {
	Priority uint16
	Domain   string
}

type RR

type RR struct {
	Name   string `json:"name"`
	Value  string `json:"value"`
	Domain string `json:"domain"`
	TTL    uint32 `json:"ttl"`
}

func (RR) ValueToCAA

func (rr RR) ValueToCAA() (v CAAValue)

func (RR) ValueToMX

func (rr RR) ValueToMX() (v MXValue)

func (RR) ValueToSRV

func (rr RR) ValueToSRV() (v SRVValue)

type RRsRepository

type RRsRepository interface {
	GetRRs(cond Condition) []RR
}

func NewRRsSDK

func NewRRsSDK(apiURL string) RRsRepository

type SRVValue

type SRVValue struct {
	Priority uint16
	Weight   uint16
	Port     uint16
	Target   string
}

Jump to

Keyboard shortcuts

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