nameserver

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2017 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GATEWAY = "gateway"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Record

type Record struct {
	ID          string  `json:"id"`
	Parent      string  `json:"parent"`
	IP          string  `json:"ip"`
	Port        string  `json:"port"`
	Weight      float64 `json:"weight"`
	ProxyRecord bool    `json:"proxy_record"`
	CleanName   string  `json:"clean_name"`
	// contains filtered or unexported fields
}

type RecordEvent

type RecordEvent struct {
	Action string
	Record
}

func BuildRecordEvent

func BuildRecordEvent(act, id, parent, ip, port string, weight float64, isProxyRecord bool) *RecordEvent

func (*RecordEvent) String

func (ev *RecordEvent) String() string

type Resolver

type Resolver struct {
	sync.RWMutex // protect m
	// contains filtered or unexported fields
}

func NewResolver

func NewResolver(cfg *config.DNS) *Resolver

func (*Resolver) ApiServe

func (s *Resolver) ApiServe(r *gin.RouterGroup)

func (*Resolver) EmitChange

func (r *Resolver) EmitChange(ev *RecordEvent)

func (*Resolver) Forward

func (r *Resolver) Forward(req *dns.Msg) (reply *dns.Msg, err error)

func (*Resolver) Start

func (r *Resolver) Start() error

Jump to

Keyboard shortcuts

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