Documentation ¶
Overview ¶
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
http://www.apache.org/licenses/LICENSE-2.0
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.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
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 ¶
func (c PassiveHashRingConfig) Build() (hashring.PassiveRing, error)
Build creates a hashring.PassiveRing.