Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(626)

Side by Side Diff: state/apiserver/root.go

Issue 13691043: Implement the client part for the logger worker.
Patch Set: Created 11 years, 7 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2013 Canonical Ltd. 1 // Copyright 2013 Canonical Ltd.
2 // Licensed under the AGPLv3, see LICENCE file for details. 2 // Licensed under the AGPLv3, see LICENCE file for details.
3 3
4 package apiserver 4 package apiserver
5 5
6 import ( 6 import (
7 "launchpad.net/juju-core/state" 7 "launchpad.net/juju-core/state"
8 "launchpad.net/juju-core/state/apiserver/agent" 8 "launchpad.net/juju-core/state/apiserver/agent"
9 "launchpad.net/juju-core/state/apiserver/client" 9 "launchpad.net/juju-core/state/apiserver/client"
10 "launchpad.net/juju-core/state/apiserver/common" 10 "launchpad.net/juju-core/state/apiserver/common"
11 "launchpad.net/juju-core/state/apiserver/deployer" 11 "launchpad.net/juju-core/state/apiserver/deployer"
12 "launchpad.net/juju-core/state/apiserver/logger"
12 "launchpad.net/juju-core/state/apiserver/machine" 13 "launchpad.net/juju-core/state/apiserver/machine"
13 "launchpad.net/juju-core/state/apiserver/uniter" 14 "launchpad.net/juju-core/state/apiserver/uniter"
14 "launchpad.net/juju-core/state/apiserver/upgrader" 15 "launchpad.net/juju-core/state/apiserver/upgrader"
15 "launchpad.net/juju-core/state/multiwatcher" 16 "launchpad.net/juju-core/state/multiwatcher"
16 ) 17 )
17 18
18 type clientAPI struct{ *client.API } 19 type clientAPI struct{ *client.API }
19 20
20 type taggedAuthenticator interface { 21 type taggedAuthenticator interface {
21 state.Entity 22 state.Entity
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 // Deployer returns an object that provides access to the Deployer API facade. 115 // Deployer returns an object that provides access to the Deployer API facade.
115 // The id argument is reserved for future use and must be empty. 116 // The id argument is reserved for future use and must be empty.
116 func (r *srvRoot) Deployer(id string) (*deployer.DeployerAPI, error) { 117 func (r *srvRoot) Deployer(id string) (*deployer.DeployerAPI, error) {
117 if id != "" { 118 if id != "" {
118 // TODO(dimitern): There is no direct test for this 119 // TODO(dimitern): There is no direct test for this
119 return nil, common.ErrBadId 120 return nil, common.ErrBadId
120 } 121 }
121 return deployer.NewDeployerAPI(r.srv.state, r.resources, r) 122 return deployer.NewDeployerAPI(r.srv.state, r.resources, r)
122 } 123 }
123 124
125 // Logger returns an object that provides access to the Logger API facade.
126 // The id argument is reserved for future use and must be empty.
127 func (r *srvRoot) Logger(id string) (*logger.LoggerAPI, error) {
128 if id != "" {
129 // TODO: There is no direct test for this
130 return nil, common.ErrBadId
131 }
132 return logger.NewLoggerAPI(r.srv.state, r.resources, r)
133 }
134
124 // Upgrader returns an object that provides access to the Upgrader API facade. 135 // Upgrader returns an object that provides access to the Upgrader API facade.
125 // The id argument is reserved for future use and must be empty. 136 // The id argument is reserved for future use and must be empty.
126 func (r *srvRoot) Upgrader(id string) (*upgrader.UpgraderAPI, error) { 137 func (r *srvRoot) Upgrader(id string) (*upgrader.UpgraderAPI, error) {
127 if id != "" { 138 if id != "" {
128 // TODO: There is no direct test for this 139 // TODO: There is no direct test for this
129 return nil, common.ErrBadId 140 return nil, common.ErrBadId
130 } 141 }
131 return upgrader.NewUpgraderAPI(r.srv.state, r.resources, r) 142 return upgrader.NewUpgraderAPI(r.srv.state, r.resources, r)
132 } 143 }
133 144
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
247 258
248 // GetAuthTag returns the tag of the authenticated entity. 259 // GetAuthTag returns the tag of the authenticated entity.
249 func (r *srvRoot) GetAuthTag() string { 260 func (r *srvRoot) GetAuthTag() string {
250 return r.entity.Tag() 261 return r.entity.Tag()
251 } 262 }
252 263
253 // GetAuthEntity returns the authenticated entity. 264 // GetAuthEntity returns the authenticated entity.
254 func (r *srvRoot) GetAuthEntity() state.Entity { 265 func (r *srvRoot) GetAuthEntity() state.Entity {
255 return r.entity 266 return r.entity
256 } 267 }
OLDNEW

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b