triton

package
v2.2.0-rc.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2018 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	// DefaultSDConfig is the default Triton SD configuration.
	DefaultSDConfig = SDConfig{
		Port:            9163,
		RefreshInterval: model.Duration(60 * time.Second),
		Version:         1,
	}
)

Functions

This section is empty.

Types

type Discovery

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

Discovery periodically performs Triton-SD requests. It implements the Discoverer interface.

func New

func New(logger log.Logger, conf *SDConfig) (*Discovery, error)

New returns a new Discovery which periodically refreshes its targets.

func (*Discovery) Run

func (d *Discovery) Run(ctx context.Context, ch chan<- []*targetgroup.Group)

Run implements the Discoverer interface.

type DiscoveryResponse

type DiscoveryResponse struct {
	Containers []struct {
		ServerUUID  string `json:"server_uuid"`
		VMAlias     string `json:"vm_alias"`
		VMBrand     string `json:"vm_brand"`
		VMImageUUID string `json:"vm_image_uuid"`
		VMUUID      string `json:"vm_uuid"`
	} `json:"containers"`
}

DiscoveryResponse models a JSON response from the Triton discovery.

type SDConfig

type SDConfig struct {
	Account         string                `yaml:"account"`
	DNSSuffix       string                `yaml:"dns_suffix"`
	Endpoint        string                `yaml:"endpoint"`
	Port            int                   `yaml:"port"`
	RefreshInterval model.Duration        `yaml:"refresh_interval,omitempty"`
	TLSConfig       config_util.TLSConfig `yaml:"tls_config,omitempty"`
	Version         int                   `yaml:"version"`
	// Catches all undefined fields and must be empty after parsing.
	XXX map[string]interface{} `yaml:",inline"`
}

SDConfig is the configuration for Triton based service discovery.

func (*SDConfig) UnmarshalYAML

func (c *SDConfig) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML implements the yaml.Unmarshaler interface.

Jump to

Keyboard shortcuts

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