func (r *DefaultRegistry) UpdateTTL(uuid string, ttl uint32, expires time.Time) error {
	r.mutex.Lock()
	defer r.mutex.Unlock()
	if n, ok := r.nodes[uuid]; ok {
		n.value.TTL = ttl
		n.value.Expires = expires
		return nil
	}
	return ErrNotExists
}
UpdateTTL updates the TTL of a service, as well as pushes the expiration time out TTL seconds from now.
This serves as a ping, for the service to keep SkyDNS aware of it's existence so that it is not expired, and purged.
package registry
import (
	"errors"
	"fmt"
	"github.com/miekg/dns"
	"github.com/skynetservices/skydns1/msg"
	"log"
	"sort"
	"strings"
	"sync"
	"time"
)
var (
	ErrExists    = errors.New("Service already exists in registry")
	ErrNotExists = errors.New("Service does not exist in registry")
)
type Registry interface {
	Add(s msg.Service) error
	Get(domain string) ([]msg.Service, error)
	GetUUID(uuid string) (msg.Service, error)
	GetExpired() []string
	Remove(s msg.Service) error
	RemoveUUID(uuid string) error
	UpdateTTL(uuid string, ttl uint32, expires time.Time) error
	AddCallback(s msg.Service, c msg.Callback) error
	Len() int
	GetNSEC(key string) (string, string)
	DNSSEC(bool) bool
}
func New() Registry {
	return &DefaultRegistry{
		tree:  newNode(),
		nodes: make(map[string]*node),
		nsec:  make([]denialReference, 0, 10),
	}
}
type DefaultRegistry struct {
	tree  *node
	nodes map[string]*node
	mutex sync.Mutex
	nsec   []denialReference  
	dnssec bool               
}
type denialReference struct {
	name      string  
	reference int     
}
func (r *DefaultRegistry) Add(s msg.Service) error {
	r.mutex.Lock()
	defer r.mutex.Unlock()
	if _, ok := r.nodes[s.UUID]; ok {
		return ErrExists
	}
	k := getRegistryKey(s)
	n, err := r.tree.add(strings.Split(k, "."), s)
	if err == nil {
		r.nodes[n.value.UUID] = n
		if r.dnssec {
			r.addNSEC(s.Region + "." + s.Version + "." + s.Name + "." + s.Environment)
			r.addNSEC(s.Version + "." + s.Name + "." + s.Environment)
			r.addNSEC(s.Name + "." + s.Environment)
			r.addNSEC(s.Environment)
		}
	}
	return err
}
func (r *DefaultRegistry) addNSEC(key string) {
	i := sort.Search(len(r.nsec), func(i int) bool { return r.nsec[i].name >= key })
	if i < len(r.nsec) && r.nsec[i].name == key {
		r.nsec[i].reference++
		return
	}
	r.nsec = append(r.nsec, denialReference{"", 0})
	copy(r.nsec[i+1:], r.nsec[i:])
	r.nsec[i].name = key
	r.nsec[i].reference = 1
}
func (r *DefaultRegistry) RemoveUUID(uuid string) error {
	r.mutex.Lock()
	defer r.mutex.Unlock()
	if n, ok := r.nodes[uuid]; ok {
		return r.removeService(n.value)
	}
	return ErrNotExists
}