juju: github.com/juju/juju/worker/instancepoller Index | Files

package instancepoller

import "github.com/juju/juju/worker/instancepoller"

Index

Package Files

aggregate.go manifold.go updater.go worker.go

Variables

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.

func Manifold Uses

func Manifold(config ManifoldConfig) dependency.Manifold

Manifold returns a Manifold that encapsulates the instancepoller worker.

func NewWorker Uses

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.

type Config Uses

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

    CredentialAPI common.CredentialAPI
}

func (Config) Validate Uses

func (config Config) Validate() error

type InstanceGetter Uses

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

type Logger Uses

type Logger interface {
    Tracef(string, ...interface{})
    Infof(string, ...interface{})
    Warningf(string, ...interface{})
    Errorf(string, ...interface{})
}

Logger represents the methods used by the worker to log details.

type ManifoldConfig Uses

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

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

ManifoldConfig describes the resources used by the instancepoller worker.

Package instancepoller imports 18 packages (graph) and is imported by 43 packages. Updated 2019-10-21. Refresh now. Tools for package owners.