resolver

package
v0.3.0-rc2 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2017 License: Apache-2.0 Imports: 14 Imported by: 6

Documentation

Index

Constants

View Source
const (
	GATEWAY = "gateway"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Counter

type Counter struct {
	Requests  uint64 `json:"requests"`  // nb of client requests
	Fails     uint64 `json:"fails"`     // nb of failed requests
	Authority uint64 `json:"authority"` // nb of authority requests
	Forward   uint64 `json:"forward"`   // nb of forward requests
	TypeA     uint64 `json:"type_a"`    // nb of A requests
	TypeSRV   uint64 `json:"type_srv"`  // nb of SRV requests
}

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
}

func (*Record) String

func (r *Record) String() string

type Resolver

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

func NewResolver

func NewResolver(cfg *config.DNS, AdvertiseIP string) *Resolver

func (*Resolver) DelRecord

func (s *Resolver) DelRecord(c *gin.Context)

func (*Resolver) Forward

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

func (*Resolver) GetRecord added in v0.2.3

func (s *Resolver) GetRecord(c *gin.Context)

func (*Resolver) ListRecords

func (s *Resolver) ListRecords(c *gin.Context)

func (*Resolver) ShowConfigs

func (s *Resolver) ShowConfigs(c *gin.Context)

func (*Resolver) ShowParentStats

func (s *Resolver) ShowParentStats(c *gin.Context)

func (*Resolver) ShowStats

func (s *Resolver) ShowStats(c *gin.Context)

func (*Resolver) Start

func (r *Resolver) Start() error

func (*Resolver) Upsert

func (r *Resolver) Upsert(record *Record) error

func (*Resolver) UpsertRecord

func (s *Resolver) UpsertRecord(c *gin.Context)

type Stats

type Stats struct {
	sync.RWMutex                     // protect the followings two
	Global       *Counter            `json:"global"`
	Parents      map[string]*Counter `json:"parents"` // parent -> counter
	// contains filtered or unexported fields
}

func (*Stats) Del

func (s *Stats) Del(p string)

func (*Stats) Get

func (s *Stats) Get() *Stats

func (*Stats) Incr

func (s *Stats) Incr(p string, delta *Counter)

func (*Stats) MarshalJSON

func (s *Stats) MarshalJSON() ([]byte, error)

type StatsAlias

type StatsAlias Stats

Jump to

Keyboard shortcuts

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