zkns

package
v0.0.0-...-7c5168d Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2013 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LookupName

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

zkPath is the path to a json file in zk. It can also reference a named port: /zk/cell/zkns/path:_named_port

Types

type ZknsAddr

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

func NewAddr

func NewAddr(host string, port int) *ZknsAddr

type ZknsAddrs

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

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

func ReadAddrs

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

Jump to

Keyboard shortcuts

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