juju: github.com/juju/juju/worker/caasoperator/remotestate Index | Files

package remotestate

import "github.com/juju/juju/worker/caasoperator/remotestate"

Index

Package Files

interface.go snapshot.go watcher.go

type RemoteStateWatcher Uses

type RemoteStateWatcher struct {
    // contains filtered or unexported fields
}

RemoteStateWatcher collects application information from separate state watchers, and updates a Snapshot which is sent on a channel upon change.

func NewWatcher Uses

func NewWatcher(config WatcherConfig) (*RemoteStateWatcher, error)

NewWatcher returns a RemoteStateWatcher that handles state changes pertaining to the supplied application.

func (*RemoteStateWatcher) Kill Uses

func (w *RemoteStateWatcher) Kill()

Kill is part of the worker.Worker interface.

func (*RemoteStateWatcher) RemoteStateChanged Uses

func (w *RemoteStateWatcher) RemoteStateChanged() <-chan struct{}

func (*RemoteStateWatcher) Snapshot Uses

func (w *RemoteStateWatcher) Snapshot() Snapshot

func (*RemoteStateWatcher) Wait Uses

func (w *RemoteStateWatcher) Wait() error

Wait is part of the worker.Worker interface.

type Snapshot Uses

type Snapshot struct {
    // CharmModifiedVersion is increased whenever the application's charm was
    // changed in some way.
    CharmModifiedVersion int

    // CharmURL is the charm URL that the unit is
    // expected to run.
    CharmURL *charm.URL

    // ForceCharmUpgrade reports whether the unit
    // should upgrade even in an error state.
    ForceCharmUpgrade bool
}

Snapshot is a snapshot of the remote state of the unit.

type Watcher Uses

type Watcher interface {
    // RemoteStateChanged returns a channel which is signalled
    // whenever the remote state is changed.
    RemoteStateChanged() <-chan struct{}

    // Snapshot returns the current snapshot of the remote state.
    Snapshot() Snapshot

    worker.Worker
}

type WatcherConfig Uses

type WatcherConfig struct {
    Application        string
    CharmGetter        charmGetter
    ApplicationWatcher applicationWatcher
}

WatcherConfig holds configuration parameters for the remote state watcher.

Package remotestate imports 7 packages (graph) and is imported by 4 packages. Updated 2019-09-20. Refresh now. Tools for package owners.