Documentation ¶
Overview ¶
This file is largely a copy of https://github.com/prometheus/prometheus/blob/master/util/treecache/treecache.go, minus the external Prometheus dependencies. I will try my bet to keep these up to date if any changes are made to the original file
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Logger = log.New(ioutil.Discard, "[D2] ", log.Ldate|log.Ltime|log.Lmicroseconds|log.Lshortfile|log.LUTC)
Functions ¶
func ClustersPath ¶ added in v0.1.1
func EnableD2Logging ¶ added in v0.1.1
func EnableD2Logging()
func ServicesPath ¶
Types ¶
type Cluster ¶ added in v0.1.1
type Cluster struct { ClusterName string `json:"clusterName"` PartitionProperties struct { HashAlgorithm string `json:"hashAlgorithm"` PartitionCount int `json:"partitionCount"` PartitionKeyRegex string `json:"partitionKeyRegex"` PartitionType string `json:"partitionType"` } `json:"partitionProperties"` }
type R2D2Client ¶ added in v0.4.0
type R2D2Client struct {
// contains filtered or unexported fields
}
func NewR2D2Client ¶ added in v0.4.0
func NewR2D2Client(conn *zk.Conn) *R2D2Client
func (*R2D2Client) GetHostnameForQuery ¶ added in v0.4.0
func (c *R2D2Client) GetHostnameForQuery(query string) (*url.URL, error)
type SingleServiceClient ¶ added in v0.4.0
type SingleServiceClient struct {
// contains filtered or unexported fields
}
func NewSingleServiceClient ¶ added in v0.4.0
func NewSingleServiceClient(name string, conn *zk.Conn) (c *SingleServiceClient, err error)
func (*SingleServiceClient) GetHostnameForQuery ¶ added in v0.4.0
func (c *SingleServiceClient) GetHostnameForQuery(query string) (*url.URL, error)
type TreeCache ¶ added in v0.4.0
type TreeCache struct {
// contains filtered or unexported fields
}
A TreeCache keeps data from all children of a Zookeeper path locally cached and updated according to received events.
func NewTreeCache ¶ added in v0.4.0
func NewTreeCache(conn *zk.Conn, path string, events chan TreeCacheEvent) *TreeCache
NewTreeCache creates a new TreeCache for a given path.
type TreeCacheEvent ¶ added in v0.4.0
A TreeCacheEvent models a Zookeeper event for a path.
type Uri ¶
type Uri struct { Weights map[url.URL]float64 ClusterName string Properties map[url.URL]UriProperty PartitionDesc map[url.URL]map[int]float64 }
func (*Uri) UnmarshalJSON ¶
type UriProperty ¶
Click to show internal directories.
Click to hide internal directories.