backend

package
v0.0.0-...-3c806ea Latest Latest
Warning

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

Go to latest
Published: May 4, 2015 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const SOATemplate = "%s. hostmaster.localhost. 1 28800 7200 604800 86400"

Variables

This section is empty.

Functions

func ReverseNetwork

func ReverseNetwork(net *net.IPNet) string

Types

type AutoBackend

type AutoBackend struct {
	Encode         yaml.MapSlice `yaml:"encode"`
	Filler         bool          `yaml:"filler"`
	Prefix, Suffix string
	SOA            *SOA
	DNS            []string
	Answers        map[string]*AutoBackendAnswer
	// contains filtered or unexported fields
}

func (*AutoBackend) Check

func (b *AutoBackend) Check() (err error)

func (*AutoBackend) Query

func (b *AutoBackend) Query(m *message.Message) (r []*message.Message, err error)

type AutoBackendAnswer

type AutoBackendAnswer struct {
	Network        *net.IPNet
	Size           int
	Zone           string
	Encode         yaml.MapSlice `yaml:"encode"`
	Filler         bool          `yaml:"filler"`
	Prefix, Suffix string
	SOA            *SOA
	DNS            []string
	Version        uint8
	// contains filtered or unexported fields
}

type Backend

type Backend interface {
	Check() error
	Query(*message.Message) ([]*message.Message, error)
}

type BackendConfig

type BackendConfig struct {
	AutoBackends []*AutoBackend `yaml:"auto"`
	GeoBackends  []*GeoBackend  `yaml:"geo"`
}

type GeoBackend

type GeoBackend struct {
	Zones   []string `yaml:"zones"`
	Options struct {
		Database string `yaml:"database"`
		Answers  struct {
			Continent map[string][]*Record
			Country   map[string][]*Record
		}
		Default struct {
			Continent string
			Country   string
		}
	}
	// contains filtered or unexported fields
}

func (*GeoBackend) Check

func (b *GeoBackend) Check() (err error)

func (*GeoBackend) Query

func (b *GeoBackend) Query(m *message.Message) (r []*message.Message, err error)

type Record

type Record struct {
	Class   string `yaml:"class"`
	Type    string `yaml:"type"`
	TTL     int    `yaml:"ttl"`
	Content string `yaml:"content"`
}

func (*Record) Message

func (r *Record) Message() (*message.Message, error)

type SOA

type SOA struct {
	Source, Contact             string
	Serial                      uint64
	Refresh, Retry, Expire, TTL uint32
}

func NewSOA

func NewSOA() *SOA

func (*SOA) Bytes

func (s *SOA) Bytes() []byte

func (*SOA) Copy

func (s *SOA) Copy() *SOA

func (*SOA) String

func (s *SOA) String() string

Jump to

Keyboard shortcuts

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