zkns

package
v2.0.0-alpha4+incompat... Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2015 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LookupName

func LookupName(zconn zk.Conn, addrPath string) ([]*net.SRV, error)

LookupName returns a list of SRV records. addrPath is the path to a json file in zk. It can also reference a named port (/zk/cell/zkns/path:_named_port)

func WriteAddrs

func WriteAddrs(zconn zk.Conn, zkPath string, addrs *ZknsAddrs) error

WriteAddrs writes a ZknsAddres record to a path in Zookeeper.

Types

type ZknsAddr

type ZknsAddr struct {
	// These fields came from a Python app originally that used a different
	// naming convention.
	Host    string           `json:"host"`
	PortMap map[string]int32 `json:"named_port_map"`
	IPv4    string           `json:"ipv4"`
	// contains filtered or unexported fields
}

ZknsAddr represents a variety if different address types, primarily in JSON.

func NewAddr

func NewAddr(host string) *ZknsAddr

NewAddr returns a new ZknsAddr.

type ZknsAddrs

type ZknsAddrs struct {
	Entries []ZknsAddr
	// contains filtered or unexported fields
}

ZknsAddrs represents a list of individual entries. SRV records can have multiple endpoints, so this is always a list. A record with one entry and a port number zero is interpreted as a CNAME. A record with one entry, a port number zero and an IP address is interpreted as an A.

func NewAddrs

func NewAddrs() *ZknsAddrs

NewAddrs returns a new ZknsAddrs.

func ReadAddrs

func ReadAddrs(zconn zk.Conn, zkPath string) (*ZknsAddrs, error)

ReadAddrs returns a ZknsAddrs record from the given path in Zookeeper.

func (*ZknsAddrs) IsValidA

func (zaddrs *ZknsAddrs) IsValidA() bool

IsValidA returns the answer to the eternal question - can this be interpreted as an A record?

func (*ZknsAddrs) IsValidCNAME

func (zaddrs *ZknsAddrs) IsValidCNAME() bool

IsValidCNAME returns true if this can be interpreted as a CNAME. This method is intentially loose - it allows a SRV record with a single entry to be interpreted as a CNAME.

func (*ZknsAddrs) IsValidSRV

func (zaddrs *ZknsAddrs) IsValidSRV() bool

IsValidSRV returns true if this can be interpreted as a SRV record.

Directories

Path Synopsis
Package pdns provides code to be used with PowerDNS (pdns) as a "pipe backend" CoProcess.
Package pdns provides code to be used with PowerDNS (pdns) as a "pipe backend" CoProcess.

Jump to

Keyboard shortcuts

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