model

package
v0.0.0-...-07f90b3 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2020 License: GPL-3.0 Imports: 7 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadConfig

func LoadConfig(path string, name string, config interface{}) error

func SaveConfig

func SaveConfig(path string, name string, config interface{}) error

Types

type AnswerBlock

type AnswerBlock struct {
	Created time.Time
	TTL     time.Duration
	Answer  []dnsmessage.Resource
}

Collects indformation about any answer

func (*AnswerBlock) IsValid

func (answer *AnswerBlock) IsValid() bool

type ArgumentsList

type ArgumentsList []string

func (*ArgumentsList) Get

func (i *ArgumentsList) Get(index int) string

func (*ArgumentsList) Set

func (i *ArgumentsList) Set(value string) error

func (*ArgumentsList) String

func (i *ArgumentsList) String() string

type DNSServer

type DNSServer interface {
	Listen(ipAddress string, port int, pipeAddress string, pipePort int, pipeResponsePort int) error
	Query(Packet)
	GetService() DNSService
	Wait()
}

DNSServer will do Listen, Query and Send.

type DNSService

type DNSService interface {
	Save(key string, resource dnsmessage.Resource, addr net.IPAddr, recordData string, old *dnsmessage.Resource) bool
	SaveBulk(key string, resources []dnsmessage.Resource)
	All() []Get
	Remove(key string, r *dnsmessage.Resource) bool
}

type Get

type Get struct {
	Host string
	TTL  uint32
	Type string
	Data string
}

type Packet

type Packet struct {
	Addr    net.UDPAddr
	Message dnsmessage.Message
}

Packet carries DNS packet payload and sender address.

type ReBindConfig

type ReBindConfig struct {
	DataDirPath         string `yaml:"dataDir" json:"dataDir" xml:"data-dir"`
	ConfigDirPath       string `yaml:"configDir" json:"configDir" xml:"config-dir"`
	ListenIP            string `yaml:"listenIp" json:"listenIp" xml:"listen-ip"`
	ListenPort          int    `yaml:"listenPort" json:"listenPort" xml:"listen-port"`
	DnsPipeIP           string `yaml:"dnsPipeIp" json:"dnsPipeIp" xml:"dns-pipe-ip"`
	DnsPipePort         int    `yaml:"dnsPipePort" json:"dnsPipePort" xml:"dns-pipe-port"`
	DnsPipeResponsePort int    `yaml:"dnsPipeResponsePort" json:"dnsPipeResponsePort" xml:"dns-pipe-response-port"`
	EnableFileLogging   bool   `yaml:"enableFileLogging" json:"enableFileLogging" xml:"enable-file-logging"`
	LogVerbosity        string `yaml:"logVerbosity" json:"logVerbosity" xml:"log-verbosity"`
	LogFilePath         string `yaml:"logFilePath" json:"logFilePath" xml:"log-file-path"`
	EnableLogRotate     bool   `yaml:"enableLogRotate" json:"enableLogRotate" xml:"enable-log-rotate"`
	LogMaxFileSize      int64  `yaml:"logMaxFileSize" json:"logMaxFileSize" xml:"log-max-file-size"`
	LogFileCount        int    `yaml:"logFileCount" json:"logFileCount" xml:"log-file-count"`
}

type ReWebConfig

type ReWebConfig struct {
	DataDirPath         string `yaml:"dataDir" json:"dataDir" xml:"data-dir"`
	ConfigDirPath       string `yaml:"configDir" json:"configDir" xml:"config-dir"`
	ListenIP            string `yaml:"listenIp" json:"listenIp" xml:"listen-ip"`
	ListenPort          int    `yaml:"listenPort" json:"listenPort" xml:"listen-port"`
	DnsPipeIP           string `yaml:"dnsPipeIp" json:"dnsPipeIp" xml:"dns-pipe-ip"`
	DnsPipePort         int    `yaml:"dnsPipePort" json:"dnsPipePort" xml:"dns-pipe-port"`
	DnsPipeResponsePort int    `yaml:"dnsPipeResponsePort" json:"dnsPipeResponsePort" xml:"dns-pipe-response-port"`
	TlsCert             string `yaml:"tlsCertFilePath" json:"tlsCertFilePath" xml:"tls-cert-file-path"`
	TlsKey              string `yaml:"tlsKeyFilePath" json:"tlsKeyFilePath" xml:"tls-key-file-path"`
	EnableFileLogging   bool   `yaml:"enableFileLogging" json:"enableFileLogging" xml:"enable-file-logging"`
	LogVerbosity        string `yaml:"logVerbosity" json:"logVerbosity" xml:"log-verbosity"`
	LogFilePath         string `yaml:"logFilePath" json:"logFilePath" xml:"log-file-path"`
	EnableLogRotate     bool   `yaml:"enableLogRotate" json:"enableLogRotate" xml:"enable-log-rotate"`
	LogMaxFileSize      int64  `yaml:"logMaxFileSize" json:"logMaxFileSize" xml:"log-max-file-size"`
	LogFileCount        int    `yaml:"logFileCount" json:"logFileCount" xml:"log-file-count"`
}

type Request

type Request struct {
	Host    string     `yaml:"host" json:"host" xml:"host"`
	TTL     uint32     `yaml:"ttl" json:"ttl" xml:"ttl"`
	Type    string     `yaml:"type" json:"type" xml:"type"`
	Data    string     `yaml:"data" json:"data" xml:"data"`
	OldData string     `yaml:"oldData" json:"oldData" xml:"old-data"`
	SOA     RequestSOA `yaml:"soaData" json:"soaData" xml:"soa-data"`
	OldSOA  RequestSOA `yaml:"oldSoaData" json:"oldSoaData" xml:"old-soa-data"`
	MX      RequestMX  `yaml:"mxData" json:"mxData" xml:"mx-data"`
	OldMX   RequestMX  `yaml:"oldMxData" json:"oldMxData" xml:"old-mx-data"`
	SRV     RequestSRV `yaml:"srvData" json:"srvData" xml:"srv-data"`
	OldSRV  RequestSRV `yaml:"oldSrvData" json:"oldSrvData" xml:"old-srv-data"`
}

type RequestMX

type RequestMX struct {
	Pref uint16 `yaml:"pref" json:"pref" xml:"pref"`
	MX   string `yaml:"mx" json:"mx" xml:"mx"`
}

type RequestSOA

type RequestSOA struct {
	NS      string `yaml:"ns" json:"ns" xml:"ns"`
	MBox    string `yaml:"mBox" json:"mBox" xml:"mbox"`
	Serial  uint32 `yaml:"serial" json:"serial" xml:"serial"`
	Refresh uint32 `yaml:"refresh" json:"refresh" xml:"refresh"`
	Retry   uint32 `yaml:"retry" json:"retry" xml:"retry"`
	Expire  uint32 `yaml:"expire" json:"expire" xml:"expire"`
	MinTTL  uint32 `yaml:"minTTL" json:"minTTL" xml:"min-ttl"`
}

type RequestSRV

type RequestSRV struct {
	Priority uint16 `yaml:"priority" json:"priority" xml:"priority"`
	Weight   uint16 `yaml:"weight" json:"weight" xml:"weight"`
	Port     uint16 `yaml:"port" json:"port" xml:"port"`
	Target   string `yaml:"target" json:"target" xml:"target"`
}

type Response

type Response struct {
	Status  int         `yaml:"status" json:"status" xml:"status"`
	Message string      `yaml:"message" json:"message" xml:"message"`
	Data    interface{} `yaml:"data" json:"data" xml:"data"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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