github.com/cloud-green/juju@v0.0.0-20151002100041-a00291338d3d/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  // EntityWatcher will send events when something changes.
    28  // The content for the changes is a list of tag strings.
    29  type EntityWatcher interface {
    30  	Changes() <-chan []string
    31  	Stop() error
    32  	Err() error
    33  }
    34  
    35  // RelationUnitsWatcher will send events when something changes.
    36  // The content for the changes is a params.RelationUnitsChange struct.
    37  type RelationUnitsWatcher interface {
    38  	Changes() <-chan multiwatcher.RelationUnitsChange
    39  	Stop() error
    40  	Err() error
    41  }
    42  
    43  // MachineStorageIdsWatcher will send events when the lifecycle states
    44  // of machine/storage entities change. The content for the changes is a
    45  // list of params.MachineStorageId.
    46  type MachineStorageIdsWatcher interface {
    47  	Changes() <-chan []params.MachineStorageId
    48  	Stop() error
    49  	Err() error
    50  }