msg

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2015 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Domain

func Domain(s string) string

Domain is the opposite of Path.

func Path

func Path(s string) string

Path converts a domainname to an etcd path. If s looks like service.staging.skydns.local., the resulting key will be /skydns/local/skydns/staging/service .

func PathWithWildcard

func PathWithWildcard(s string) (string, bool)

As Path, but if a name contains wildcards (*), the name will be chopped of before the (first) wildcard, and we do a highler evel search and later find the matching names. So service.*.skydns.local, will look for all services under skydns.local and will later check for names that match service.*.skydns.local. If a wildcard is found the returned bool is true.

Types

type Service

type Service struct {
	Host     string `json:"host,omitempty"`
	Port     int    `json:"port,omitempty"`
	Priority int    `json:"priority,omitempty"`
	Weight   int    `json:"weight,omitempty"`
	Ttl      uint32 `json:"ttl,omitempty"`
	// etcd key where we found this service and ignore from json un-/marshalling
	Key string `json:"-"`
}

This *is* the rdata from a SRV record, but with a twist. Host (Target in SRV) must be a domain name, but if it looks like an IP address (4/6), we will treat it like an IP address.

func (*Service) NewA

func (s *Service) NewA(name string, ip net.IP) *dns.A

NewA returns a new A record based on the Service.

func (*Service) NewAAAA

func (s *Service) NewAAAA(name string, ip net.IP) *dns.AAAA

NewAAAA returns a new AAAA record based on the Service.

func (*Service) NewCNAME

func (s *Service) NewCNAME(name string, target string) *dns.CNAME

NewCNAME returns a new CNAME record based on the Service.

func (*Service) NewNS

func (s *Service) NewNS(name string, target string) *dns.NS

NewNS returns a new NS record based on the Service.

func (*Service) NewPTR

func (s *Service) NewPTR(name string, ttl uint32) *dns.PTR

NewPTR returns a new PTR record based on the Service.

func (*Service) NewSRV

func (s *Service) NewSRV(name string, weight uint16) *dns.SRV

NewSRV returns a new SRV record based on the Service.

Jump to

Keyboard shortcuts

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