github.com/cloud-green/juju@v0.0.0-20151002100041-a00291338d3d/state/leadership/config.go (about) 1 // Copyright 2015 Canonical Ltd. 2 // Licensed under the AGPLv3, see LICENCE file for details. 3 4 package leadership 5 6 import ( 7 "github.com/juju/errors" 8 "github.com/juju/utils/clock" 9 10 "github.com/juju/juju/state/lease" 11 ) 12 13 // ManagerConfig contains the resources and information required to create a 14 // Manager. 15 type ManagerConfig struct { 16 Client lease.Client 17 Clock clock.Clock 18 } 19 20 // Validate returns an error if the configuration contains invalid information 21 // or missing resources. 22 func (config ManagerConfig) Validate() error { 23 if config.Client == nil { 24 return errors.New("missing client") 25 } 26 if config.Clock == nil { 27 return errors.New("missing clock") 28 } 29 return nil 30 }