Documentation
¶
Index ¶
Constants ¶
Variables ¶
This section is empty.
Functions ¶
func NewEnvironment ¶
NewEnvironment constructs a Zookeeper-based service.Environment using both a zookeeper Options (typically unmarshaled from configuration) and an optional extra set of environment options.
Types ¶
type Client ¶
type Client struct {
// Connection is the comma-delimited Zookeeper connection string. Both this and
// Servers may be set, and they will be merged together when connecting to Zookeeper.
Connection string `json:"connection,omitempty"`
// Servers is the array of Zookeeper servers. Both this and Connection may be set,
// and they will be merged together when connecting to Zookeeper.
Servers []string `json:"servers,omitempty"`
// ConnectTimeout is the Zookeeper connection timeout.
ConnectTimeout time.Duration `json:"connectTimeout"`
// SessionTimeout is the Zookeeper session timeout.
SessionTimeout time.Duration `json:"sessionTimeout"`
}
Client is the client portion of the options struct
type Options ¶
type Options struct {
// Client holds the zookeeper client options
Client Client `json:"client"`
// Registrations are the ways in which the host process should be registered with zookeeper.
// There is no default for this field.
Registrations []Registration `json:"registrations,omitempty"`
// Watches are the zookeeper paths to watch for updates. There is no default for this field.
Watches []string `json:"watches,omitempty"`
}
Options represents the set of configurable attributes for Zookeeper
type Registration ¶
type Registration struct {
// Name is the service name under which to register. If not supplied, DefaultServiceName is used.
Name string `json:"name,omitempty"`
// Path is the znode path under which to register. If not supplied, DefaultPath is used.
Path string `json:"path,omitempty"`
// Address is the FQDN or hostname of the server which hosts the service. If not supplied, DefaultAddress is used.
Address string `json:"address,omitempty"`
// Port is the TCP port on which the service listens. If not supplied, DefaultPort is used.
Port int `json:"port,omitempty"`
// Scheme specific the protocl used for the service. If not supplied, DefaultScheme is used.
Scheme string `json:"scheme,omitempty"`
}
Click to show internal directories.
Click to hide internal directories.