d2

package
v0.9.5 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2020 License: GPL-3.0 Imports: 14 Imported by: 0

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

Functions

func ClustersPath

func ClustersPath(cluster string) string

func EnableD2Logging

func EnableD2Logging()

func ServicesPath

func ServicesPath(service string) string

func UrisPath

func UrisPath(uri string) string

Types

type Cluster

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

type R2D2Client struct {
	// contains filtered or unexported fields
}

func NewR2D2Client

func NewR2D2Client(conn *zk.Conn) *R2D2Client

func (*R2D2Client) ResolveHostnameAndContextForQuery

func (c *R2D2Client) ResolveHostnameAndContextForQuery(resourceBaseName string, query *url.URL) (*url.URL, error)

type Service

type Service struct {
	Path        string
	ServiceName string `json:"serviceName"`
	ClusterName string `json:"clusterName"`
}

type SingleServiceClient

type SingleServiceClient struct {
	// contains filtered or unexported fields
}

func NewSingleServiceClient

func NewSingleServiceClient(name string, conn *zk.Conn) (c *SingleServiceClient, err error)

func (*SingleServiceClient) ResolveHostnameAndContextForQuery

func (c *SingleServiceClient) ResolveHostnameAndContextForQuery(serviceName string, query *url.URL) (*url.URL, error)

type TreeCache

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

func NewTreeCache(conn *zk.Conn, path string, events chan TreeCacheEvent) *TreeCache

NewTreeCache creates a new TreeCache for a given path.

func (*TreeCache) Stop

func (tc *TreeCache) Stop()

Stop stops the tree cache.

type TreeCacheEvent

type TreeCacheEvent struct {
	Path string
	Data *[]byte
}

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

func (u *Uri) UnmarshalJSON(data []byte) error

type UriProperty

type UriProperty struct {
	AppName    string `json:"com.linkedin.app.name"`
	AppVersion string `json:"com.linkedin.app.version"`
}

Jump to

Keyboard shortcuts

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