github.com/Pankov404/juju@v0.0.0-20150703034450-be266991dceb/api/watcher/interfaces.go (about)

     1  // Copyright 2012, 2013 Canonical Ltd.
     2  // Licensed under the AGPLv3, see LICENCE file for details.
     3  
     4  package watcher
     5  
     6  import (
     7  	"github.com/juju/juju/apiserver/params"
     8  	"github.com/juju/juju/state/multiwatcher"
     9  )
    10  
    11  // NotifyWatcher will send events when something changes.
    12  // It does not send content for those changes.
    13  type NotifyWatcher interface {
    14  	Changes() <-chan struct{}
    15  	Stop() error
    16  	Err() error
    17  }
    18  
    19  // StringsWatcher will send events when something changes.
    20  // The content for the changes is a list of strings.
    21  type StringsWatcher interface {
    22  	Changes() <-chan []string
    23  	Stop() error
    24  	Err() error
    25  }
    26  
    27  // RelationUnitsWatcher will send events when something changes.
    28  // The content for the changes is a params.RelationUnitsChange struct.
    29  type RelationUnitsWatcher interface {
    30  	Changes() <-chan multiwatcher.RelationUnitsChange
    31  	Stop() error
    32  	Err() error
    33  }
    34  
    35  // MachineStorageIdsWatcher will send events when the lifecycle states
    36  // of machine/storage entities change. The content for the changes is a
    37  // list of params.MachineStorageId.
    38  type MachineStorageIdsWatcher interface {
    39  	Changes() <-chan []params.MachineStorageId
    40  	Stop() error
    41  	Err() error
    42  }