discovery

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2021 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package discovery provides discovery configuration.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Configuration

type Configuration struct {
	// Type defines the type of discovery configuration being used.
	Type *ConfigurationType `yaml:"type"`

	// M3DBCluster defines M3DB discovery via etcd.
	M3DBCluster *M3DBClusterDiscoveryConfiguration `yaml:"m3dbCluster"`

	// M3AggregatorCluster defines M3Aggregator discovery via etcd.
	M3AggregatorCluster *M3AggregatorClusterDiscoveryConfiguration `yaml:"m3AggregatorCluster"`

	// Config defines a generic definition for service discovery via etcd.
	Config *environment.Configuration `yaml:"config"`
}

Configuration defines how services are to be discovered.

func (*Configuration) EnvironmentConfig

func (c *Configuration) EnvironmentConfig(
	hostID string,
) (environment.Configuration, error)

EnvironmentConfig provides the environment configuration based on the type of discovery configuration set.

type ConfigurationType

type ConfigurationType uint

ConfigurationType defines the type of discovery configuration.

const (
	// ConfigType defines a generic definition for service discovery via etcd.
	ConfigType ConfigurationType = iota
	// M3DBSingleNodeType defines configuration for a single M3DB node via etcd.
	M3DBSingleNodeType
	// M3DBClusterType defines M3DB discovery via etcd.
	M3DBClusterType
	// M3AggregatorClusterType defines M3DB discovery via etcd.
	M3AggregatorClusterType
)

func (ConfigurationType) String

func (t ConfigurationType) String() string

String returns the discovery configuration type as a string.

func (*ConfigurationType) UnmarshalYAML

func (t *ConfigurationType) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML unmarshals an ConfigurationType into a valid type from string.

type M3AggregatorClusterDiscoveryConfiguration

type M3AggregatorClusterDiscoveryConfiguration struct {
	Env       string   `yaml:"env"`
	Zone      *string  `yaml:"zone"`
	Endpoints []string `yaml:"endpoints"`
}

M3AggregatorClusterDiscoveryConfiguration defines discovery configuration for M3Aggregator.

type M3DBClusterDiscoveryConfiguration

type M3DBClusterDiscoveryConfiguration struct {
	Env       string   `yaml:"env" validate:"nonzero"`
	Zone      *string  `yaml:"zone"`
	Endpoints []string `yaml:"endpoints"`
}

M3DBClusterDiscoveryConfiguration defines discovery configuration for M3DB.

Jump to

Keyboard shortcuts

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