This section is empty.


This section is empty.


func Sort

func Sort(serversList []*AuthServer, called uint64)

    Sort sort servers by rtt


    type AuthServer

    type AuthServer struct {
    	// place atomic members at the start to fix alignment for ARM32
    	Rtt     int64
    	Count   int64
    	Addr    string
    	Version Version

      AuthServer type

      func NewAuthServer

      func NewAuthServer(addr string, version Version) *AuthServer

        NewAuthServer return a new server

        func (*AuthServer) String

        func (a *AuthServer) String() string

        type AuthServers

        type AuthServers struct {
        	// place atomic members at the start to fix alignment for ARM32
        	Called     uint64
        	ErrorCount uint32
        	Zone string
        	List []*AuthServer
        	Nss  []string
        	CheckingDisable bool
        	Checked         bool

          AuthServers type

          type NS

          type NS struct {
          	Servers *AuthServers
          	DSRR    []dns.RR
          	TTL     time.Duration
          	// contains filtered or unexported fields

            NS represents a cache entry

            type NSCache

            type NSCache struct {
            	// contains filtered or unexported fields

              NSCache type

              func NewNSCache

              func NewNSCache() *NSCache

                NewNSCache return new cache

                func (*NSCache) Get

                func (n *NSCache) Get(key uint64) (*NS, error)

                  Get returns the entry for a key or an error

                  func (*NSCache) Remove

                  func (n *NSCache) Remove(key uint64)

                    Remove remove a cache

                    func (*NSCache) Set

                    func (n *NSCache) Set(key uint64, dsRR []dns.RR, servers *AuthServers, ttl time.Duration)

                      Set sets a keys value to a NS

                      type Version

                      type Version byte

                        Version type

                        const (
                        	// IPv4 mode
                        	IPv4 Version = 0x1
                        	// IPv6 mode
                        	IPv6 Version = 0x2

                        func (Version) String

                        func (v Version) String() string