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

package globalclockupdater

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


Package Files

manifold.go worker.go

func Manifold Uses

func Manifold(config ManifoldConfig) dependency.Manifold

Manifold returns a dependency.Manifold that will run a global clock updater worker.

func NewWorker Uses

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

NewWorker returns a new global clock updater worker, using the given configuration.

type Config Uses

type Config struct {
    // NewUpdater returns a new global clock updater.
    NewUpdater func() (globalclock.Updater, error)

    // LocalClock is the local wall clock. The times returned must
    // contain a monotonic component (Go 1.9+).
    LocalClock clock.Clock

    // UpdateInterval is the amount of time in between clock updates.
    UpdateInterval time.Duration

    // BackoffDelay is the amount of time to delay before attempting
    // another update when a concurrent write is detected.
    BackoffDelay time.Duration

    // Logger determines where we write log messages.
    Logger Logger

Config contains the configuration for the global clock updater worker.

func (Config) Validate Uses

func (config Config) Validate() error

Validate validates the configuration.

type Logger Uses

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

Logger defines the methods we use from loggo.Logger.

type ManifoldConfig Uses

type ManifoldConfig struct {
    Clock            clock.Clock
    LeaseManagerName string
    RaftName         string

    NewWorker      func(Config) (worker.Worker, error)
    UpdateInterval time.Duration
    BackoffDelay   time.Duration
    Logger         Logger

ManifoldConfig holds the information necessary to run a GlobalClockUpdater worker in a dependency.Engine.

func (ManifoldConfig) Validate Uses

func (config ManifoldConfig) Validate() error

Package globalclockupdater imports 7 packages (graph) and is imported by 4 packages. Updated 2020-06-22. Refresh now. Tools for package owners.