instancepoller

package
v0.0.0-...-8ff1004 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2019 License: AGPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ShortPoll        = 1 * time.Second
	ShortPollBackoff = 2.0
	LongPoll         = 15 * time.Minute
)

ShortPoll and LongPoll hold the polling intervals for the instance updater. When a machine has no address or is not started, it will be polled at ShortPoll intervals until it does, exponentially backing off with an exponent of ShortPollBackoff until a maximum(ish) of LongPoll.

When a machine has an address and is started LongPoll will be used to check that the instance address or status has not changed.

Functions

func Manifold

func Manifold(config ManifoldConfig) dependency.Manifold

Manifold returns a Manifold that encapsulates the instancepoller worker.

func NewWorker

func NewWorker(config Config) (worker.Worker, error)

NewWorker returns a worker that keeps track of the machines in the state and polls their instance addresses and status periodically to keep them up to date.

Types

type Config

type Config struct {
	Clock   clock.Clock
	Delay   time.Duration
	Facade  *instancepoller.API
	Environ InstanceGetter

	CredentialAPI common.CredentialAPI
}

func (Config) Validate

func (config Config) Validate() error

type InstanceGetter

type InstanceGetter interface {
	Instances(ctx context.ProviderCallContext, ids []instance.Id) ([]instances.Instance, error)
}

type ManifoldConfig

type ManifoldConfig struct {
	APICallerName string
	ClockName     string
	Delay         time.Duration
	EnvironName   string

	NewCredentialValidatorFacade func(base.APICaller) (common.CredentialAPI, error)
}

ManifoldConfig describes the resources used by the instancepoller worker.

Jump to

Keyboard shortcuts

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