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

package remotestate

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


Package Files

interface.go snapshot.go watcher.go

type Logger Uses

type Logger interface {
    Debugf(message string, args ...interface{})

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


type WatcherConfig Uses

type WatcherConfig struct {
    Logger             Logger
    Application        string
    CharmGetter        charmGetter
    ApplicationWatcher applicationWatcher

WatcherConfig holds configuration parameters for the remote state watcher.

Package remotestate imports 8 packages (graph) and is imported by 5 packages. Updated 2020-05-01. Refresh now. Tools for package owners.