github.com/niedbalski/juju@v0.0.0-20190215020005-8ff100488e47/core/watcher/relationstatus.go (about)

     1  // Copyright 2017 Canonical Ltd.
     2  // Licensed under the AGPLv3, see LICENCE file for details.
     3  
     4  package watcher
     5  
     6  import (
     7  	"github.com/juju/juju/core/life"
     8  )
     9  
    10  // RelationStatusChange describes changes to some relation.
    11  type RelationStatusChange struct {
    12  	// Key is the relation key of the changed relation.
    13  	Key string
    14  
    15  	// Suspended is the suspended status of the relation.
    16  	Suspended bool
    17  
    18  	// SuspendedReason is an optional message to explain why suspend is true.
    19  	SuspendedReason string
    20  
    21  	// Life is the relation life value, eg Alive.
    22  	Life life.Value
    23  }
    24  
    25  // RelationStatusChannel is a channel used to notify of changes to
    26  // a relation's life or suspended status.
    27  type RelationStatusChannel <-chan []RelationStatusChange
    28  
    29  // RelationStatusWatcher conveniently ties a RelationStatusChannel to the
    30  // worker.Worker that represents its validity.
    31  type RelationStatusWatcher interface {
    32  	CoreWatcher
    33  	Changes() RelationStatusChannel
    34  }