Documentation ¶
Index ¶
- func AssertCanStopWhenSending(c *gc.C, stopper Stopper)
- func AssertStop(c *gc.C, stopper Stopper)
- func SetAgentVersion(st *state.State, vers version.Number) error
- func UpdateConfig(st *state.State, newValues map[string]interface{}) error
- type NotifyWatcher
- type NotifyWatcherC
- type RelationUnitsWatcher
- type RelationUnitsWatcherC
- type Stopper
- type StringsWatcher
- type StringsWatcherC
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AssertCanStopWhenSending ¶
AssertCanStopWhenSending ensures even when there are changes pending to be delivered by the watcher it can still stop cleanly. This is necessary to check for deadlocks in case the watcher's inner loop is blocked trying to send and its tomb is already dying.
func AssertStop ¶
func SetAgentVersion ¶
SetAgentVersion sets the current agent version in the state's environment configuration.
Types ¶
type NotifyWatcher ¶
type NotifyWatcher interface {
Changes() <-chan struct{}
}
type NotifyWatcherC ¶
type NotifyWatcherC struct { *gc.C State *state.State Watcher NotifyWatcher }
NotifyWatcherC embeds a gocheck.C and adds methods to help verify the behaviour of any watcher that uses a <-chan struct{}.
func NewNotifyWatcherC ¶
func NewNotifyWatcherC(c *gc.C, st *state.State, w NotifyWatcher) NotifyWatcherC
NewNotifyWatcherC returns a NotifyWatcherC that checks for aggressive event coalescence.
func (NotifyWatcherC) AssertClosed ¶
func (c NotifyWatcherC) AssertClosed()
func (NotifyWatcherC) AssertNoChange ¶
func (c NotifyWatcherC) AssertNoChange()
func (NotifyWatcherC) AssertOneChange ¶
func (c NotifyWatcherC) AssertOneChange()
type RelationUnitsWatcher ¶
type RelationUnitsWatcher interface { Stop() error Changes() <-chan params.RelationUnitsChange }
type RelationUnitsWatcherC ¶
type RelationUnitsWatcherC struct { *gc.C State *state.State Watcher RelationUnitsWatcher // contains filtered or unexported fields }
RelationUnitsWatcherC embeds a gocheck.C and adds methods to help verify the behaviour of any watcher that uses a <-chan params.RelationUnitsChange.
func NewRelationUnitsWatcherC ¶
func NewRelationUnitsWatcherC(c *gc.C, st *state.State, w RelationUnitsWatcher) RelationUnitsWatcherC
NewRelationUnitsWatcherC returns a RelationUnitsWatcherC that checks for aggressive event coalescence.
func (RelationUnitsWatcherC) AssertChange ¶
func (c RelationUnitsWatcherC) AssertChange(changed []string, departed []string)
AssertChange asserts the given changes was reported by the watcher, but does not assume there are no following changes.
func (RelationUnitsWatcherC) AssertClosed ¶
func (c RelationUnitsWatcherC) AssertClosed()
func (RelationUnitsWatcherC) AssertNoChange ¶
func (c RelationUnitsWatcherC) AssertNoChange()
type StringsWatcher ¶
type StringsWatcherC ¶
type StringsWatcherC struct { *gc.C State *state.State Watcher StringsWatcher }
StringsWatcherC embeds a gocheck.C and adds methods to help verify the behaviour of any watcher that uses a <-chan []string.
func NewStringsWatcherC ¶
func NewStringsWatcherC(c *gc.C, st *state.State, w StringsWatcher) StringsWatcherC
NewStringsWatcherC returns a StringsWatcherC that checks for aggressive event coalescence.
func (StringsWatcherC) AssertChange ¶
func (c StringsWatcherC) AssertChange(expect ...string)
func (StringsWatcherC) AssertChangeInSingleEvent ¶
func (c StringsWatcherC) AssertChangeInSingleEvent(expect ...string)
func (StringsWatcherC) AssertClosed ¶
func (c StringsWatcherC) AssertClosed()
func (StringsWatcherC) AssertNoChange ¶
func (c StringsWatcherC) AssertNoChange()