servergroup

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2018 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Scheme string         `yaml:"scheme"`
	Labels model.LabelSet `json:"labels"`
	// List of target relabel configurations.
	RelabelConfigs []*config.RelabelConfig       `yaml:"relabel_configs,omitempty"`
	Hosts          config.ServiceDiscoveryConfig `yaml:",inline"`
	// TODO cache this as a model.Time after unmarshal
	AntiAffinity *time.Duration `yaml:"anti_affinity,omitempty"`
}

func (*Config) GetAntiAffinity

func (c *Config) GetAntiAffinity() model.Time

func (*Config) GetScheme

func (c *Config) GetScheme() string

type ServerGroup

type ServerGroup struct {
	Ready chan struct{}

	Cfg *Config

	OriginalURLs []string
	// contains filtered or unexported fields
}

func New

func New() *ServerGroup

TODO: pass in parent context

func (*ServerGroup) ApplyConfig

func (s *ServerGroup) ApplyConfig(cfg *Config) error

func (*ServerGroup) Cancel

func (s *ServerGroup) Cancel()

func (*ServerGroup) GetData

func (s *ServerGroup) GetData(ctx context.Context, path string, values url.Values, client *http.Client) (model.Value, error)

func (*ServerGroup) GetSeries

func (s *ServerGroup) GetSeries(ctx context.Context, path string, values url.Values, client *http.Client) (*promclient.SeriesResult, error)

func (*ServerGroup) GetValuesForLabelName

func (s *ServerGroup) GetValuesForLabelName(ctx context.Context, path string, client *http.Client) (*promclient.LabelResult, error)

func (*ServerGroup) Sync

func (s *ServerGroup) Sync(tgs []*config.TargetGroup)

func (*ServerGroup) Targets

func (s *ServerGroup) Targets() []string

type ServerGroups

type ServerGroups []*ServerGroup

func (ServerGroups) GetData

func (s ServerGroups) GetData(ctx context.Context, path string, values url.Values, client *http.Client) (model.Value, error)

func (ServerGroups) GetSeries

func (s ServerGroups) GetSeries(ctx context.Context, path string, values url.Values, client *http.Client) (*promclient.SeriesResult, error)

func (ServerGroups) GetValuesForLabelName

func (s ServerGroups) GetValuesForLabelName(ctx context.Context, path string, client *http.Client) (*promclient.LabelResult, error)

Jump to

Keyboard shortcuts

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