Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RemoteStateWatcher ¶
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 ¶
func NewWatcher(config WatcherConfig) (*RemoteStateWatcher, error)
NewWatcher returns a RemoteStateWatcher that handles state changes pertaining to the supplied application.
func (*RemoteStateWatcher) Kill ¶
func (w *RemoteStateWatcher) Kill()
Kill is part of the worker.Worker interface.
func (*RemoteStateWatcher) RemoteStateChanged ¶
func (w *RemoteStateWatcher) RemoteStateChanged() <-chan struct{}
func (*RemoteStateWatcher) Snapshot ¶
func (w *RemoteStateWatcher) Snapshot() Snapshot
func (*RemoteStateWatcher) Wait ¶
func (w *RemoteStateWatcher) Wait() error
Wait is part of the worker.Worker interface.
type Snapshot ¶
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 ¶
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 ¶
type WatcherConfig struct { Application string CharmGetter charmGetter ApplicationWatcher applicationWatcher }
WatcherConfig holds configuration parameters for the remote state watcher.
Click to show internal directories.
Click to hide internal directories.