gce

package
v0.0.0-...-298395c Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2019 License: MIT Imports: 9 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 {
	Enabled         bool          `toml:"enabled" override:"enabled"`
	ID              string        `toml:"id" override:"id"`
	Project         string        `toml:"project" override:"project"`
	Zone            string        `toml:"zone" override:"zone"`
	Filter          string        `toml:"filter" override:"filter"`
	RefreshInterval toml.Duration `toml:"refresh-interval" override:"refresh-interval"`
	Port            int           `toml:"port" override:"port"`
	TagSeparator    string        `toml:"tag-separator" override:"tag-separator"`
}

Config is GCE service discovery configuration

func (*Config) Init

func (g *Config) Init()

Init adds defaults to existing GCE configuration

func (Config) Prom

func (g Config) Prom(c *config.ScrapeConfig)

Prom writes the prometheus configuration for discoverer into ScrapeConfig

func (Config) PromConfig

func (g Config) PromConfig() *config.GCESDConfig

PromConfig returns the prometheus configuration for this discoverer

func (Config) Service

func (g Config) Service() string

Service return discoverer type

func (Config) ServiceID

func (g Config) ServiceID() string

ServiceID returns the discoverers name

func (Config) Validate

func (g Config) Validate() error

Validate validates the GCE configuration values

type Diagnostic

type Diagnostic scraper.Diagnostic

type Service

type Service struct {
	Configs []Config
	// contains filtered or unexported fields
}

Service is the gce discovery service

func NewService

func NewService(c []Config, r scraper.Registry, d Diagnostic) *Service

NewService creates a new unopened service

func (*Service) Close

func (s *Service) Close() error

Close stops the service

func (*Service) Open

func (s *Service) Open() error

Open starts the service

func (*Service) Test

func (s *Service) Test(options interface{}) error

Test a service with the provided options.

func (*Service) TestOptions

func (s *Service) TestOptions() interface{}

TestOptions returns an object that is in turn passed to Test.

func (*Service) Update

func (s *Service) Update(newConfigs []interface{}) error

Update updates configuration while running

Jump to

Keyboard shortcuts

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