dns

package
v0.6.15 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2023 License: GPL-3.0 Imports: 45 Imported by: 0

Documentation

Index

Constants

View Source
const BlockyForwarderType = "forward_blocky"
View Source
const CoreDNSType = "coredns"
View Source
const (
	DefaultTTL = 3600
)
View Source
const EtcdType = "etcd"
View Source
const IPForwarderType = "forward_ip"
View Source
const MemoryType = "memory"
View Source
const TXTSeparator = "\n"

Variables

This section is empty.

Functions

This section is empty.

Types

type APIRecord

type APIRecord struct {
	UID      string `json:"uid" required:"true"`
	FQDN     string `json:"fqdn" required:"true"`
	Hostname string `json:"hostname" required:"true"`
	Type     string `json:"type" required:"true"`

	Data         string `json:"data" required:"true"`
	MXPreference uint16 `json:"mxPreference,omitempty"`
	SRVPort      uint16 `json:"srvPort,omitempty"`
	SRVPriority  uint16 `json:"srvPriority,omitempty"`
	SRVWeight    uint16 `json:"srvWeight,omitempty"`
}

type APIRecordsDeleteInput

type APIRecordsDeleteInput struct {
	Zone     string `query:"zone" required:"true"`
	Hostname string `query:"hostname" required:"true"`
	UID      string `query:"uid" required:"true"`
	Type     string `query:"type" required:"true"`
}

type APIRecordsGetInput

type APIRecordsGetInput struct {
	Zone     string `query:"zone"`
	Hostname string `query:"hostname"  description:"Optionally get DNS Records for hostname"`
}

type APIRecordsGetOutput

type APIRecordsGetOutput struct {
	Records []APIRecord `json:"records" required:"true"`
}

type APIRecordsPutInput

type APIRecordsPutInput struct {
	Zone     string `query:"zone" required:"true" maxLength:"255"`
	Hostname string `query:"hostname" required:"true" maxLength:"255"`
	UID      string `query:"uid" maxLength:"255"`

	Type string `json:"type" required:"true"`

	Data         string `json:"data" required:"true"`
	MXPreference uint16 `json:"mxPreference,omitempty"`
	SRVPort      uint16 `json:"srvPort,omitempty"`
	SRVPriority  uint16 `json:"srvPriority,omitempty"`
	SRVWeight    uint16 `json:"srvWeight,omitempty"`
}

type APIRoleConfigInput

type APIRoleConfigInput struct {
	Config RoleConfig `json:"config" required:"true"`
}

type APIRoleConfigOutput

type APIRoleConfigOutput struct {
	Config RoleConfig `json:"config" required:"true"`
}

type APIZone

type APIZone struct {
	Name           string              `json:"name" required:"true"`
	HandlerConfigs []map[string]string `json:"handlerConfigs" required:"true"`
	DefaultTTL     uint32              `json:"defaultTTL" required:"true"`
	Authoritative  bool                `json:"authoritative" required:"true"`
}

type APIZonesDeleteInput

type APIZonesDeleteInput struct {
	Zone string `query:"zone"`
}

type APIZonesGetInput added in v0.4.6

type APIZonesGetInput struct {
	Name string `query:"name"  description:"Optionally get DNS Zone by name"`
}

type APIZonesGetOutput

type APIZonesGetOutput struct {
	Zones []APIZone `json:"zones" required:"true"`
}

type APIZonesPutInput

type APIZonesPutInput struct {
	Name           string              `query:"zone" required:"true" maxLength:"255"`
	HandlerConfigs []map[string]string `json:"handlerConfigs" required:"true"`
	DefaultTTL     uint32              `json:"defaultTTL" required:"true"`
	Authoritative  bool                `json:"authoritative" required:"true"`
}

type BlockyForwarder

type BlockyForwarder struct {
	*IPForwarderHandler
	// contains filtered or unexported fields
}

func NewBlockyForwarder

func NewBlockyForwarder(z *Zone, rawConfig map[string]string) *BlockyForwarder

func (*BlockyForwarder) Handle

func (bfwd *BlockyForwarder) Handle(w *utils.FakeDNSWriter, r *utils.DNSRequest) *dns.Msg

func (*BlockyForwarder) Identifier

func (bfwd *BlockyForwarder) Identifier() string

type CoreDNS added in v0.5.0

type CoreDNS struct {
	// contains filtered or unexported fields
}

func NewCoreDNS added in v0.5.0

func NewCoreDNS(z *Zone, rawConfig map[string]string) *CoreDNS

func (*CoreDNS) Handle added in v0.5.0

func (core *CoreDNS) Handle(w *utils.FakeDNSWriter, r *utils.DNSRequest) *dns.Msg

func (*CoreDNS) Identifier added in v0.5.0

func (core *CoreDNS) Identifier() string

type EtcdHandler

type EtcdHandler struct {
	// contains filtered or unexported fields
}

func NewEtcdHandler

func NewEtcdHandler(z *Zone, config map[string]string) *EtcdHandler

func (*EtcdHandler) Handle

func (eh *EtcdHandler) Handle(w *utils.FakeDNSWriter, r *utils.DNSRequest) *dns.Msg

func (*EtcdHandler) Identifier

func (eh *EtcdHandler) Identifier() string

type Handler

type Handler interface {
	Handle(w *utils.FakeDNSWriter, r *utils.DNSRequest) *dns.Msg
	Identifier() string
}

type IPForwarderHandler

type IPForwarderHandler struct {
	CacheTTL int
	// contains filtered or unexported fields
}

func NewIPForwarderHandler

func NewIPForwarderHandler(z *Zone, config map[string]string) *IPForwarderHandler

func (*IPForwarderHandler) Handle

func (*IPForwarderHandler) Identifier

func (ipf *IPForwarderHandler) Identifier() string

type MemoryHandler

type MemoryHandler struct {
	// contains filtered or unexported fields
}

func NewMemoryHandler

func NewMemoryHandler(z *Zone, config map[string]string) *MemoryHandler

func (*MemoryHandler) Handle

func (eh *MemoryHandler) Handle(w *utils.FakeDNSWriter, r *utils.DNSRequest) *dns.Msg

func (*MemoryHandler) Identifier

func (eh *MemoryHandler) Identifier() string

type Record

type Record struct {
	Name string `json:"-"`
	Type string `json:"-"`

	Data string `json:"data"`

	TTL uint32 `json:"ttl,omitempty"`

	MXPreference uint16 `json:"mxPreference,omitempty"`
	SRVPort      uint16 `json:"srvPort,omitempty"`
	SRVPriority  uint16 `json:"srvPriority,omitempty"`
	SRVWeight    uint16 `json:"srvWeight,omitempty"`
	// contains filtered or unexported fields
}

func (*Record) ToDNS

func (r *Record) ToDNS(qname string, t uint16) dns.RR

type Role

type Role struct {
	// contains filtered or unexported fields
}

func New

func New(instance roles.Instance) *Role

func (*Role) APIMetrics

func (r *Role) APIMetrics() usecase.Interactor

func (*Role) APIRecordsDelete

func (r *Role) APIRecordsDelete() usecase.Interactor

func (*Role) APIRecordsGet

func (r *Role) APIRecordsGet() usecase.Interactor

func (*Role) APIRecordsPut

func (r *Role) APIRecordsPut() usecase.Interactor

func (*Role) APIRoleConfigGet

func (r *Role) APIRoleConfigGet() usecase.Interactor

func (*Role) APIRoleConfigPut

func (r *Role) APIRoleConfigPut() usecase.Interactor

func (*Role) APIZonesDelete

func (r *Role) APIZonesDelete() usecase.Interactor

func (*Role) APIZonesGet

func (r *Role) APIZonesGet() usecase.Interactor

func (*Role) APIZonesPut

func (r *Role) APIZonesPut() usecase.Interactor

func (*Role) FindZone

func (r *Role) FindZone(fqdn string) *Zone

Find a zone for the given fqdn

func (*Role) Handler

func (ro *Role) Handler(w dns.ResponseWriter, r *dns.Msg)

func (*Role) Start

func (r *Role) Start(ctx context.Context, config []byte) error

func (*Role) Stop

func (r *Role) Stop()

type RoleConfig

type RoleConfig struct {
	Port int32 `json:"port"`
}

type Zone

type Zone struct {
	Name string `json:"-"`

	HandlerConfigs []map[string]string `json:"handlerConfigs"`

	DefaultTTL uint32 `json:"defaultTTL"`

	Authoritative bool `json:"authoritative"`
	// contains filtered or unexported fields
}

func (*Zone) Init

func (z *Zone) Init(ctx context.Context)

func (*Zone) StopWatchingRecords

func (z *Zone) StopWatchingRecords()

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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