v0.1.4 Latest Latest

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

Go to latest
Published: May 6, 2020 License: Apache-2.0 Imports: 5 Imported by: 8



Copyright (c) 2016-2019 Uber Technologies, Inc.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.



This section is empty.


This section is empty.


This section is empty.


type ActiveConfig

type ActiveConfig struct {
	Hosts       hostlist.Config         `yaml:"hosts"`
	HealthCheck ActiveHealthCheckConfig `yaml:"healthcheck"`
	// contains filtered or unexported fields

ActiveConfig composes host configuration for an upstream service with an active health check.

func (ActiveConfig) Build

func (c ActiveConfig) Build(opts ...ActiveOption) (healthcheck.List, error)

Build creates a healthcheck.List with built-in active health checks.

func (ActiveConfig) StableAddr

func (c ActiveConfig) StableAddr() (string, error)

StableAddr returns a stable address that can be advertised as the address for this service. If c is backed by DNS, returns the DNS record. If c is backed by a static list, returns a random address.

type ActiveHealthCheckConfig

type ActiveHealthCheckConfig struct {
	Filter   healthcheck.FilterConfig  `yaml:"filter"`
	Monitor  healthcheck.MonitorConfig `yaml:"monitor"`
	Disabled bool                      `yaml:"disabled"`

ActiveHealthCheckConfig wraps health check configuration.

type ActiveOption

type ActiveOption func(*ActiveConfig)

ActiveOption allows setting optional ActiveConfig parameters.

func WithHealthCheck

func WithHealthCheck(checker healthcheck.Checker) ActiveOption

WithHealthCheck configures ActiveConfig with a custom health check.

type PassiveConfig

type PassiveConfig struct {
	Hosts       hostlist.Config                 `yaml:"hosts"`
	HealthCheck healthcheck.PassiveFilterConfig `yaml:"healthcheck"`

PassiveConfig composes host configuruation for an upstream service with a passive health check.

func (PassiveConfig) Build

func (c PassiveConfig) Build() (healthcheck.List, error)

Build creates healthcheck.List enabled with passive health checks.

type PassiveHashRingConfig

type PassiveHashRingConfig struct {
	Hosts       hostlist.Config                 `yaml:"hosts"`
	HealthCheck healthcheck.PassiveFilterConfig `yaml:"healthcheck"`
	HashRing    hashring.Config                 `yaml:"hashring"`

PassiveRingConfig composes host configuration for an upstream service with a passively health checked hash ring.

func (PassiveHashRingConfig) Build

Build creates a hashring.PassiveRing.

Jump to

Keyboard shortcuts

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