dns

package
v0.4.11 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const BlockyForwarderType = "forward_blocky"
View Source
const (
	DefaultTTL = 3600
)
View Source
const EtcdType = "etcd"
View Source
const IPForwarderType = "forward_ip"
View Source
const K8sGatewayType = "k8s_gateway"
View Source
const MemoryType = "memory"

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"`
	Authoritative  bool                `json:"authoritative" required:"true"`
	HandlerConfigs []map[string]string `json:"handlerConfigs" required:"true"`
	DefaultTTL     uint32              `json:"defaultTTL" 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"`
	Authoritative  bool                `json:"authoritative" required:"true"`
	HandlerConfigs []map[string]string `json:"handlerConfigs" required:"true"`
	DefaultTTL     uint32              `json:"defaultTTL" 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 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 K8sGateway

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

func NewK8sGateway

func NewK8sGateway(z *Zone, rawConfig map[string]string) *K8sGateway

func (*K8sGateway) Handle

func (k8gw *K8sGateway) Handle(w *utils.FakeDNSWriter, r *utils.DNSRequest) *dns.Msg

func (*K8sGateway) Identifier

func (k8gw *K8sGateway) 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:"-"`

	Authoritative  bool                `json:"authoritative"`
	HandlerConfigs []map[string]string `json:"handlerConfigs"`
	DefaultTTL     uint32              `json:"defaultTTL"`
	// 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