Merge lp:~thumper/juju-core/common-api-env-watcher into lp:~go-bot/juju-core/trunk

Proposed by Tim Penhey
Status: Merged
Approved by: Tim Penhey
Approved revision: no longer in the source branch.
Merged at revision: 2243
Proposed branch: lp:~thumper/juju-core/common-api-env-watcher
Merge into: lp:~go-bot/juju-core/trunk
Diff against target: 522 lines (+111/-75)
14 files modified
state/api/agent/state.go (+3/-3)
state/api/base/caller.go (+1/-1)
state/api/charmrevisionupdater/updater.go (+3/-3)
state/api/common/environwatcher.go (+56/-0)
state/api/common/life.go (+2/-1)
state/api/deployer/deployer.go (+3/-2)
state/api/firewaller/firewaller.go (+3/-2)
state/api/keyupdater/authorisedkeys.go (+3/-3)
state/api/logger/logger.go (+3/-3)
state/api/machiner/machiner.go (+3/-2)
state/api/provisioner/provisioner.go (+18/-43)
state/api/uniter/uniter.go (+3/-2)
state/api/upgrader/upgrader.go (+3/-3)
state/api/watcher/watcher.go (+7/-7)
To merge this branch: bzr merge lp:~thumper/juju-core/common-api-env-watcher
Reviewer Review Type Date Requested Status
Juju Engineering Pending
Review via email: mp+202766@code.launchpad.net

Commit message

Refactor client side api to have common behaviour

The apiserver components have a common packge that
enables other end points to share the implementation
of some common facilities.

The api client side should also have this common
behaviour.

This branch starts this with the environ watcher
and getter for the provisioner. This will be used
by the Uniter in the next branch.

In order to reduce import cycles the common.Caller
interface had to be moved. It was either that or to
have the common code in a different package. I
decided that it was better to have the same package
name for the common code on both the client and
server side for the api, so common.Caller becomes
base.Caller.

https://codereview.appspot.com/52610045/

Description of the change

Refactor client side api to have common behaviour

The apiserver components have a common packge that
enables other end points to share the implementation
of some common facilities.

The api client side should also have this common
behaviour.

This branch starts this with the environ watcher
and getter for the provisioner. This will be used
by the Uniter in the next branch.

In order to reduce import cycles the common.Caller
interface had to be moved. It was either that or to
have the common code in a different package. I
decided that it was better to have the same package
name for the common code on both the client and
server side for the api, so common.Caller becomes
base.Caller.

https://codereview.appspot.com/52610045/

To post a comment you must log in.
Revision history for this message
Tim Penhey (thumper) wrote :

Reviewers: mp+202766_code.launchpad.net,

Message:
Please take a look.

Description:
Refactor client side api to have common behaviour

The apiserver components have a common packge that
enables other end points to share the implementation
of some common facilities.

The api client side should also have this common
behaviour.

This branch starts this with the environ watcher
and getter for the provisioner. This will be used
by the Uniter in the next branch.

In order to reduce import cycles the common.Caller
interface had to be moved. It was either that or to
have the common code in a different package. I
decided that it was better to have the same package
name for the common code on both the client and
server side for the api, so common.Caller becomes
base.Caller.

https://code.launchpad.net/~thumper/juju-core/common-api-env-watcher/+merge/202766

(do not edit description out of merge proposal)

Please review this at https://codereview.appspot.com/52610045/

Affected files (+104, -75 lines):
   A [revision details]
   M state/api/agent/state.go
   M state/api/base/caller.go
   M state/api/charmrevisionupdater/updater.go
   A state/api/common/environwatcher.go
   M state/api/deployer/deployer.go
   M state/api/keyupdater/authorisedkeys.go
   M state/api/logger/logger.go
   M state/api/machiner/machiner.go
   M state/api/provisioner/provisioner.go
   M state/api/uniter/uniter.go
   M state/api/upgrader/upgrader.go
   M state/api/watcher/watcher.go

Revision history for this message
Ian Booth (wallyworld) wrote :

LGTM with tweaks

https://codereview.appspot.com/52610045/diff/1/state/api/common/environwatcher.go
File state/api/common/environwatcher.go (right):

https://codereview.appspot.com/52610045/diff/1/state/api/common/environwatcher.go#newcode13
state/api/common/environwatcher.go:13: type EnvironWatcher struct {
doc comment

https://codereview.appspot.com/52610045/diff/1/state/api/common/environwatcher.go#newcode14
state/api/common/environwatcher.go:14: name string
perhaps facadeName?

https://codereview.appspot.com/52610045/diff/1/state/api/common/environwatcher.go#newcode18
state/api/common/environwatcher.go:18: func NewEnvironWatcher(name
string, caller base.Caller) *EnvironWatcher {
ditto

https://codereview.appspot.com/52610045/diff/1/state/api/provisioner/provisioner.go
File state/api/provisioner/provisioner.go (right):

https://codereview.appspot.com/52610045/diff/1/state/api/provisioner/provisioner.go#newcode16
state/api/provisioner/provisioner.go:16: const Provisioner =
"Provisioner"
lower case please, no need to export

https://codereview.appspot.com/52610045/

Revision history for this message
Go Bot (go-bot) wrote :

Attempt to merge into lp:juju-core failed due to conflicts:

text conflict in state/api/deployer/deployer.go
text conflict in state/api/machiner/machiner.go
text conflict in state/api/provisioner/provisioner.go

Revision history for this message
Go Bot (go-bot) wrote :

The attempt to merge lp:~thumper/juju-core/common-api-env-watcher into lp:juju-core failed. Below is the output from the failed tests.

# launchpad.net/juju-core/state/api/deployer
state/api/deployer/deployer.go:24: undefined: common
state/api/deployer/deployer.go:24: not enough arguments to return
# launchpad.net/juju-core/state/api/common
state/api/common/life.go:14: undefined: Caller
# launchpad.net/juju-core/state/api/machiner
state/api/machiner/machiner.go:23: undefined: common
state/api/machiner/machiner.go:23: not enough arguments to return
# launchpad.net/juju-core/state/api/uniter
state/api/uniter/uniter.go:29: undefined: common
state/api/uniter/uniter.go:29: not enough arguments to return

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'state/api/agent/state.go'
--- state/api/agent/state.go 2013-10-01 10:00:26 +0000
+++ state/api/agent/state.go 2014-01-23 00:09:43 +0000
@@ -7,18 +7,18 @@
7 "fmt"7 "fmt"
88
9 "launchpad.net/juju-core/instance"9 "launchpad.net/juju-core/instance"
10 "launchpad.net/juju-core/state/api/common"10 "launchpad.net/juju-core/state/api/base"
11 "launchpad.net/juju-core/state/api/params"11 "launchpad.net/juju-core/state/api/params"
12)12)
1313
14// State provides access to an agent's view of the state.14// State provides access to an agent's view of the state.
15type State struct {15type State struct {
16 caller common.Caller16 caller base.Caller
17}17}
1818
19// NewState returns a version of the state that provides functionality19// NewState returns a version of the state that provides functionality
20// required by agent code.20// required by agent code.
21func NewState(caller common.Caller) *State {21func NewState(caller base.Caller) *State {
22 return &State{caller}22 return &State{caller}
23}23}
2424
2525
=== added directory 'state/api/base'
=== renamed file 'state/api/common/interfaces.go' => 'state/api/base/caller.go'
--- state/api/common/interfaces.go 2013-06-06 09:56:00 +0000
+++ state/api/base/caller.go 2014-01-23 00:09:43 +0000
@@ -1,7 +1,7 @@
1// Copyright 2012, 2013 Canonical Ltd.1// Copyright 2012, 2013 Canonical Ltd.
2// Licensed under the AGPLv3, see LICENCE file for details.2// Licensed under the AGPLv3, see LICENCE file for details.
33
4package common4package base
55
6// Caller is implemented by the client-facing State object.6// Caller is implemented by the client-facing State object.
7type Caller interface {7type Caller interface {
88
=== modified file 'state/api/charmrevisionupdater/updater.go'
--- state/api/charmrevisionupdater/updater.go 2014-01-15 07:23:28 +0000
+++ state/api/charmrevisionupdater/updater.go 2014-01-23 00:09:43 +0000
@@ -4,17 +4,17 @@
4package charmrevisionupdater4package charmrevisionupdater
55
6import (6import (
7 "launchpad.net/juju-core/state/api/common"7 "launchpad.net/juju-core/state/api/base"
8 "launchpad.net/juju-core/state/api/params"8 "launchpad.net/juju-core/state/api/params"
9)9)
1010
11// State provides access to a worker's view of the state.11// State provides access to a worker's view of the state.
12type State struct {12type State struct {
13 caller common.Caller13 caller base.Caller
14}14}
1515
16// NewState returns a version of the state that provides functionality required by the worker.16// NewState returns a version of the state that provides functionality required by the worker.
17func NewState(caller common.Caller) *State {17func NewState(caller base.Caller) *State {
18 return &State{caller}18 return &State{caller}
19}19}
2020
2121
=== added file 'state/api/common/environwatcher.go'
--- state/api/common/environwatcher.go 1970-01-01 00:00:00 +0000
+++ state/api/common/environwatcher.go 2014-01-23 00:09:43 +0000
@@ -0,0 +1,56 @@
1// Copyright 2014 Canonical Ltd.
2// Licensed under the AGPLv3, see LICENCE file for details.
3
4package common
5
6import (
7 "launchpad.net/juju-core/environs/config"
8 "launchpad.net/juju-core/state/api/base"
9 "launchpad.net/juju-core/state/api/params"
10 "launchpad.net/juju-core/state/api/watcher"
11)
12
13// EnvironWatcher provides common client side api functions
14// to call into the apiserver.common.EnvironWatcher.
15type EnvironWatcher struct {
16 façadeName string
17 caller base.Caller
18}
19
20// NewEnvironWatcher creates a EnvironWatcher on the specified façade,
21// and uses this name when calling through the caller.
22func NewEnvironWatcher(façadeName string, caller base.Caller) *EnvironWatcher {
23 return &EnvironWatcher{façadeName, caller}
24}
25
26// WatchForEnvironConfigChanges return a NotifyWatcher waiting for the
27// environment configuration to change.
28func (e *EnvironWatcher) WatchForEnvironConfigChanges() (watcher.NotifyWatcher, error) {
29 var result params.NotifyWatchResult
30 err := e.caller.Call(e.façadeName, "", "WatchForEnvironConfigChanges", nil, &result)
31 if err != nil {
32 return nil, err
33 }
34 if err := result.Error; err != nil {
35 return nil, result.Error
36 }
37 w := watcher.NewNotifyWatcher(e.caller, result)
38 return w, nil
39}
40
41// EnvironConfig returns the current environment configuration.
42func (e *EnvironWatcher) EnvironConfig() (*config.Config, error) {
43 var result params.EnvironConfigResult
44 err := e.caller.Call(e.façadeName, "", "EnvironConfig", nil, &result)
45 if err != nil {
46 return nil, err
47 }
48 if err := result.Error; err != nil {
49 return nil, err
50 }
51 conf, err := config.New(config.NoDefaults, result.Config)
52 if err != nil {
53 return nil, err
54 }
55 return conf, nil
56}
057
=== modified file 'state/api/common/life.go'
--- state/api/common/life.go 2014-01-22 22:36:32 +0000
+++ state/api/common/life.go 2014-01-23 00:09:43 +0000
@@ -6,12 +6,13 @@
6import (6import (
7 "fmt"7 "fmt"
88
9 "launchpad.net/juju-core/state/api/base"
9 "launchpad.net/juju-core/state/api/params"10 "launchpad.net/juju-core/state/api/params"
10)11)
1112
12// Life requests the life cycle of the given entity from the given13// Life requests the life cycle of the given entity from the given
13// server-side API facade via the given caller.14// server-side API facade via the given caller.
14func Life(caller Caller, facadeName, tag string) (params.Life, error) {15func Life(caller base.Caller, facadeName, tag string) (params.Life, error) {
15 var result params.LifeResults16 var result params.LifeResults
16 args := params.Entities{17 args := params.Entities{
17 Entities: []params.Entity{{Tag: tag}},18 Entities: []params.Entity{{Tag: tag}},
1819
=== modified file 'state/api/deployer/deployer.go'
--- state/api/deployer/deployer.go 2014-01-22 22:36:32 +0000
+++ state/api/deployer/deployer.go 2014-01-23 00:09:43 +0000
@@ -4,18 +4,19 @@
4package deployer4package deployer
55
6import (6import (
7 "launchpad.net/juju-core/state/api/base"
7 "launchpad.net/juju-core/state/api/common"8 "launchpad.net/juju-core/state/api/common"
8 "launchpad.net/juju-core/state/api/params"9 "launchpad.net/juju-core/state/api/params"
9)10)
1011
11// State provides access to the deployer worker's idea of the state.12// State provides access to the deployer worker's idea of the state.
12type State struct {13type State struct {
13 caller common.Caller14 caller base.Caller
14}15}
1516
16// NewState creates a new State instance that makes API calls17// NewState creates a new State instance that makes API calls
17// through the given caller.18// through the given caller.
18func NewState(caller common.Caller) *State {19func NewState(caller base.Caller) *State {
19 return &State{caller}20 return &State{caller}
20}21}
2122
2223
=== modified file 'state/api/firewaller/firewaller.go'
--- state/api/firewaller/firewaller.go 2014-01-22 22:36:32 +0000
+++ state/api/firewaller/firewaller.go 2014-01-23 00:09:43 +0000
@@ -5,6 +5,7 @@
55
6import (6import (
7 "launchpad.net/juju-core/environs/config"7 "launchpad.net/juju-core/environs/config"
8 "launchpad.net/juju-core/state/api/base"
8 "launchpad.net/juju-core/state/api/common"9 "launchpad.net/juju-core/state/api/common"
9 "launchpad.net/juju-core/state/api/params"10 "launchpad.net/juju-core/state/api/params"
10 "launchpad.net/juju-core/state/api/watcher"11 "launchpad.net/juju-core/state/api/watcher"
@@ -12,11 +13,11 @@
1213
13// State provides access to the Firewaller API facade.14// State provides access to the Firewaller API facade.
14type State struct {15type State struct {
15 caller common.Caller16 caller base.Caller
16}17}
1718
18// NewState creates a new client-side Firewaller facade.19// NewState creates a new client-side Firewaller facade.
19func NewState(caller common.Caller) *State {20func NewState(caller base.Caller) *State {
20 return &State{caller}21 return &State{caller}
21}22}
2223
2324
=== modified file 'state/api/keyupdater/authorisedkeys.go'
--- state/api/keyupdater/authorisedkeys.go 2013-12-09 11:40:27 +0000
+++ state/api/keyupdater/authorisedkeys.go 2014-01-23 00:09:43 +0000
@@ -6,18 +6,18 @@
6import (6import (
7 "fmt"7 "fmt"
88
9 "launchpad.net/juju-core/state/api/common"9 "launchpad.net/juju-core/state/api/base"
10 "launchpad.net/juju-core/state/api/params"10 "launchpad.net/juju-core/state/api/params"
11 "launchpad.net/juju-core/state/api/watcher"11 "launchpad.net/juju-core/state/api/watcher"
12)12)
1313
14// State provides access to a worker's view of the state.14// State provides access to a worker's view of the state.
15type State struct {15type State struct {
16 caller common.Caller16 caller base.Caller
17}17}
1818
19// NewState returns a version of the state that provides functionality required by the worker.19// NewState returns a version of the state that provides functionality required by the worker.
20func NewState(caller common.Caller) *State {20func NewState(caller base.Caller) *State {
21 return &State{caller}21 return &State{caller}
22}22}
2323
2424
=== modified file 'state/api/logger/logger.go'
--- state/api/logger/logger.go 2013-09-13 04:27:17 +0000
+++ state/api/logger/logger.go 2014-01-23 00:09:43 +0000
@@ -6,19 +6,19 @@
6import (6import (
7 "fmt"7 "fmt"
88
9 "launchpad.net/juju-core/state/api/common"9 "launchpad.net/juju-core/state/api/base"
10 "launchpad.net/juju-core/state/api/params"10 "launchpad.net/juju-core/state/api/params"
11 "launchpad.net/juju-core/state/api/watcher"11 "launchpad.net/juju-core/state/api/watcher"
12)12)
1313
14// State provides access to an logger worker's view of the state.14// State provides access to an logger worker's view of the state.
15type State struct {15type State struct {
16 caller common.Caller16 caller base.Caller
17}17}
1818
19// NewState returns a version of the state that provides functionality19// NewState returns a version of the state that provides functionality
20// required by the logger worker.20// required by the logger worker.
21func NewState(caller common.Caller) *State {21func NewState(caller base.Caller) *State {
22 return &State{caller}22 return &State{caller}
23}23}
2424
2525
=== modified file 'state/api/machiner/machiner.go'
--- state/api/machiner/machiner.go 2014-01-22 22:36:32 +0000
+++ state/api/machiner/machiner.go 2014-01-23 00:09:43 +0000
@@ -4,17 +4,18 @@
4package machiner4package machiner
55
6import (6import (
7 "launchpad.net/juju-core/state/api/base"
7 "launchpad.net/juju-core/state/api/common"8 "launchpad.net/juju-core/state/api/common"
8 "launchpad.net/juju-core/state/api/params"9 "launchpad.net/juju-core/state/api/params"
9)10)
1011
11// State provides access to the Machiner API facade.12// State provides access to the Machiner API facade.
12type State struct {13type State struct {
13 caller common.Caller14 caller base.Caller
14}15}
1516
16// NewState creates a new client-side Machiner facade.17// NewState creates a new client-side Machiner facade.
17func NewState(caller common.Caller) *State {18func NewState(caller base.Caller) *State {
18 return &State{caller}19 return &State{caller}
19}20}
2021
2122
=== modified file 'state/api/provisioner/provisioner.go'
--- state/api/provisioner/provisioner.go 2014-01-22 22:36:32 +0000
+++ state/api/provisioner/provisioner.go 2014-01-23 00:09:43 +0000
@@ -6,26 +6,33 @@
6import (6import (
7 "fmt"7 "fmt"
88
9 "launchpad.net/juju-core/environs/config"9 "launchpad.net/juju-core/state/api/base"
10 "launchpad.net/juju-core/state/api/common"10 "launchpad.net/juju-core/state/api/common"
11 "launchpad.net/juju-core/state/api/params"11 "launchpad.net/juju-core/state/api/params"
12 "launchpad.net/juju-core/state/api/watcher"12 "launchpad.net/juju-core/state/api/watcher"
13 "launchpad.net/juju-core/tools"13 "launchpad.net/juju-core/tools"
14)14)
1515
16const provisioner = "Provisioner"
17
16// State provides access to the Machiner API facade.18// State provides access to the Machiner API facade.
17type State struct {19type State struct {
18 caller common.Caller20 *common.EnvironWatcher
21
22 caller base.Caller
19}23}
2024
21// NewState creates a new client-side Machiner facade.25// NewState creates a new client-side Machiner facade.
22func NewState(caller common.Caller) *State {26func NewState(caller base.Caller) *State {
23 return &State{caller}27 return &State{
28 EnvironWatcher: common.NewEnvironWatcher(provisioner, caller),
29
30 caller: caller}
24}31}
2532
26// machineLife requests the lifecycle of the given machine from the server.33// machineLife requests the lifecycle of the given machine from the server.
27func (st *State) machineLife(tag string) (params.Life, error) {34func (st *State) machineLife(tag string) (params.Life, error) {
28 return common.Life(st.caller, "Provisioner", tag)35 return common.Life(st.caller, provisioner, tag)
29}36}
3037
31// Machine provides access to methods of a state.Machine through the facade.38// Machine provides access to methods of a state.Machine through the facade.
@@ -41,44 +48,12 @@
41 }, nil48 }, nil
42}49}
4350
44// WatchForEnvironConfigChanges return a NotifyWatcher waiting for the
45// environment configuration to change.
46func (st *State) WatchForEnvironConfigChanges() (watcher.NotifyWatcher, error) {
47 var result params.NotifyWatchResult
48 err := st.caller.Call("Provisioner", "", "WatchForEnvironConfigChanges", nil, &result)
49 if err != nil {
50 return nil, err
51 }
52 if err := result.Error; err != nil {
53 return nil, result.Error
54 }
55 w := watcher.NewNotifyWatcher(st.caller, result)
56 return w, nil
57}
58
59// EnvironConfig returns the current environment configuration.
60func (st *State) EnvironConfig() (*config.Config, error) {
61 var result params.EnvironConfigResult
62 err := st.caller.Call("Provisioner", "", "EnvironConfig", nil, &result)
63 if err != nil {
64 return nil, err
65 }
66 if err := result.Error; err != nil {
67 return nil, err
68 }
69 conf, err := config.New(config.NoDefaults, result.Config)
70 if err != nil {
71 return nil, err
72 }
73 return conf, nil
74}
75
76// WatchEnvironMachines returns a StringsWatcher that notifies of51// WatchEnvironMachines returns a StringsWatcher that notifies of
77// changes to the lifecycles of the machines (but not containers) in52// changes to the lifecycles of the machines (but not containers) in
78// the current environment.53// the current environment.
79func (st *State) WatchEnvironMachines() (watcher.StringsWatcher, error) {54func (st *State) WatchEnvironMachines() (watcher.StringsWatcher, error) {
80 var result params.StringsWatchResult55 var result params.StringsWatchResult
81 err := st.caller.Call("Provisioner", "", "WatchEnvironMachines", nil, &result)56 err := st.caller.Call(provisioner, "", "WatchEnvironMachines", nil, &result)
82 if err != nil {57 if err != nil {
83 return nil, err58 return nil, err
84 }59 }
@@ -92,7 +67,7 @@
92// StateAddresses returns the list of addresses used to connect to the state.67// StateAddresses returns the list of addresses used to connect to the state.
93func (st *State) StateAddresses() ([]string, error) {68func (st *State) StateAddresses() ([]string, error) {
94 var result params.StringsResult69 var result params.StringsResult
95 err := st.caller.Call("Provisioner", "", "StateAddresses", nil, &result)70 err := st.caller.Call(provisioner, "", "StateAddresses", nil, &result)
96 if err != nil {71 if err != nil {
97 return nil, err72 return nil, err
98 }73 }
@@ -102,7 +77,7 @@
102// APIAddresses returns the list of addresses used to connect to the API.77// APIAddresses returns the list of addresses used to connect to the API.
103func (st *State) APIAddresses() ([]string, error) {78func (st *State) APIAddresses() ([]string, error) {
104 var result params.StringsResult79 var result params.StringsResult
105 err := st.caller.Call("Provisioner", "", "APIAddresses", nil, &result)80 err := st.caller.Call(provisioner, "", "APIAddresses", nil, &result)
106 if err != nil {81 if err != nil {
107 return nil, err82 return nil, err
108 }83 }
@@ -112,7 +87,7 @@
112// CACert returns the certificate used to validate the state connection.87// CACert returns the certificate used to validate the state connection.
113func (st *State) CACert() ([]byte, error) {88func (st *State) CACert() ([]byte, error) {
114 var result params.BytesResult89 var result params.BytesResult
115 err := st.caller.Call("Provisioner", "", "CACert", nil, &result)90 err := st.caller.Call(provisioner, "", "CACert", nil, &result)
116 if err != nil {91 if err != nil {
117 return nil, err92 return nil, err
118 }93 }
@@ -125,7 +100,7 @@
125 args := params.Entities{100 args := params.Entities{
126 Entities: []params.Entity{{Tag: tag}},101 Entities: []params.Entity{{Tag: tag}},
127 }102 }
128 err := st.caller.Call("Provisioner", "", "Tools", args, &results)103 err := st.caller.Call(provisioner, "", "Tools", args, &results)
129 if err != nil {104 if err != nil {
130 // TODO: Not directly tested105 // TODO: Not directly tested
131 return nil, err106 return nil, err
@@ -144,6 +119,6 @@
144// ContainerConfig returns information from the environment config that are119// ContainerConfig returns information from the environment config that are
145// needed for container cloud-init.120// needed for container cloud-init.
146func (st *State) ContainerConfig() (result params.ContainerConfig, err error) {121func (st *State) ContainerConfig() (result params.ContainerConfig, err error) {
147 err = st.caller.Call("Provisioner", "", "ContainerConfig", nil, &result)122 err = st.caller.Call(provisioner, "", "ContainerConfig", nil, &result)
148 return result, err123 return result, err
149}124}
150125
=== modified file 'state/api/uniter/uniter.go'
--- state/api/uniter/uniter.go 2014-01-22 22:36:32 +0000
+++ state/api/uniter/uniter.go 2014-01-23 00:09:43 +0000
@@ -8,19 +8,20 @@
88
9 "launchpad.net/juju-core/charm"9 "launchpad.net/juju-core/charm"
10 "launchpad.net/juju-core/names"10 "launchpad.net/juju-core/names"
11 "launchpad.net/juju-core/state/api/base"
11 "launchpad.net/juju-core/state/api/common"12 "launchpad.net/juju-core/state/api/common"
12 "launchpad.net/juju-core/state/api/params"13 "launchpad.net/juju-core/state/api/params"
13)14)
1415
15// State provides access to the Uniter API facade.16// State provides access to the Uniter API facade.
16type State struct {17type State struct {
17 caller common.Caller18 caller base.Caller
18 // unitTag contains the authenticated unit's tag.19 // unitTag contains the authenticated unit's tag.
19 unitTag string20 unitTag string
20}21}
2122
22// NewState creates a new client-side Uniter facade.23// NewState creates a new client-side Uniter facade.
23func NewState(caller common.Caller, authTag string) *State {24func NewState(caller base.Caller, authTag string) *State {
24 return &State{caller, authTag}25 return &State{caller, authTag}
25}26}
2627
2728
=== modified file 'state/api/upgrader/upgrader.go'
--- state/api/upgrader/upgrader.go 2013-10-03 12:18:41 +0000
+++ state/api/upgrader/upgrader.go 2014-01-23 00:09:43 +0000
@@ -6,7 +6,7 @@
6import (6import (
7 "fmt"7 "fmt"
88
9 "launchpad.net/juju-core/state/api/common"9 "launchpad.net/juju-core/state/api/base"
10 "launchpad.net/juju-core/state/api/params"10 "launchpad.net/juju-core/state/api/params"
11 "launchpad.net/juju-core/state/api/watcher"11 "launchpad.net/juju-core/state/api/watcher"
12 "launchpad.net/juju-core/tools"12 "launchpad.net/juju-core/tools"
@@ -15,12 +15,12 @@
1515
16// State provides access to an upgrader worker's view of the state.16// State provides access to an upgrader worker's view of the state.
17type State struct {17type State struct {
18 caller common.Caller18 caller base.Caller
19}19}
2020
21// NewState returns a version of the state that provides functionality21// NewState returns a version of the state that provides functionality
22// required by the upgrader worker.22// required by the upgrader worker.
23func NewState(caller common.Caller) *State {23func NewState(caller base.Caller) *State {
24 return &State{caller}24 return &State{caller}
25}25}
2626
2727
=== modified file 'state/api/watcher/watcher.go'
--- state/api/watcher/watcher.go 2013-12-05 03:42:25 +0000
+++ state/api/watcher/watcher.go 2014-01-23 00:09:43 +0000
@@ -9,7 +9,7 @@
9 "launchpad.net/tomb"9 "launchpad.net/tomb"
1010
11 "launchpad.net/juju-core/log"11 "launchpad.net/juju-core/log"
12 "launchpad.net/juju-core/state/api/common"12 "launchpad.net/juju-core/state/api/base"
13 "launchpad.net/juju-core/state/api/params"13 "launchpad.net/juju-core/state/api/params"
14)14)
1515
@@ -114,14 +114,14 @@
114// It does not send content for those changes.114// It does not send content for those changes.
115type notifyWatcher struct {115type notifyWatcher struct {
116 commonWatcher116 commonWatcher
117 caller common.Caller117 caller base.Caller
118 notifyWatcherId string118 notifyWatcherId string
119 out chan struct{}119 out chan struct{}
120}120}
121121
122// If an API call returns a NotifyWatchResult, you can use this to turn it into122// If an API call returns a NotifyWatchResult, you can use this to turn it into
123// a local Watcher.123// a local Watcher.
124func NewNotifyWatcher(caller common.Caller, result params.NotifyWatchResult) NotifyWatcher {124func NewNotifyWatcher(caller base.Caller, result params.NotifyWatchResult) NotifyWatcher {
125 w := &notifyWatcher{125 w := &notifyWatcher{
126 caller: caller,126 caller: caller,
127 notifyWatcherId: result.NotifyWatcherId,127 notifyWatcherId: result.NotifyWatcherId,
@@ -172,12 +172,12 @@
172// The content of the changes is a list of strings.172// The content of the changes is a list of strings.
173type stringsWatcher struct {173type stringsWatcher struct {
174 commonWatcher174 commonWatcher
175 caller common.Caller175 caller base.Caller
176 stringsWatcherId string176 stringsWatcherId string
177 out chan []string177 out chan []string
178}178}
179179
180func NewStringsWatcher(caller common.Caller, result params.StringsWatchResult) StringsWatcher {180func NewStringsWatcher(caller base.Caller, result params.StringsWatchResult) StringsWatcher {
181 w := &stringsWatcher{181 w := &stringsWatcher{
182 caller: caller,182 caller: caller,
183 stringsWatcherId: result.StringsWatcherId,183 stringsWatcherId: result.StringsWatcherId,
@@ -230,12 +230,12 @@
230// those units known to have entered.230// those units known to have entered.
231type relationUnitsWatcher struct {231type relationUnitsWatcher struct {
232 commonWatcher232 commonWatcher
233 caller common.Caller233 caller base.Caller
234 relationUnitsWatcherId string234 relationUnitsWatcherId string
235 out chan params.RelationUnitsChange235 out chan params.RelationUnitsChange
236}236}
237237
238func NewRelationUnitsWatcher(caller common.Caller, result params.RelationUnitsWatchResult) RelationUnitsWatcher {238func NewRelationUnitsWatcher(caller base.Caller, result params.RelationUnitsWatchResult) RelationUnitsWatcher {
239 w := &relationUnitsWatcher{239 w := &relationUnitsWatcher{
240 caller: caller,240 caller: caller,
241 relationUnitsWatcherId: result.RelationUnitsWatcherId,241 relationUnitsWatcherId: result.RelationUnitsWatcherId,

Subscribers

People subscribed via source and target branches

to status/vote changes: