Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(200)

Side by Side Diff: impl/prod/module.go

Issue 2460473003: impl/prod: Make AEContext private. (Closed)
Patch Set: Update comment. Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « impl/prod/memcache.go ('k') | impl/prod/taskqueue.go » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The LUCI Authors. All rights reserved. 1 // Copyright 2016 The LUCI Authors. All rights reserved.
2 // Use of this source code is governed under the Apache License, Version 2.0 2 // Use of this source code is governed under the Apache License, Version 2.0
3 // that can be found in the LICENSE file. 3 // that can be found in the LICENSE file.
4 4
5 package prod 5 package prod
6 6
7 import ( 7 import (
8 "github.com/luci/gae/service/module" 8 "github.com/luci/gae/service/module"
9 "golang.org/x/net/context" 9 "golang.org/x/net/context"
10 aeModule "google.golang.org/appengine/module" 10 aeModule "google.golang.org/appengine/module"
11 ) 11 )
12 12
13 // useModule adds a Module implementation to context. 13 // useModule adds a Module implementation to context.
14 func useModule(usrCtx context.Context) context.Context { 14 func useModule(usrCtx context.Context) context.Context {
15 return module.SetFactory(usrCtx, func(ci context.Context) module.RawInte rface { 15 return module.SetFactory(usrCtx, func(ci context.Context) module.RawInte rface {
16 » » return modImpl{AEContext(ci)} 16 » » return modImpl{getAEContext(ci)}
17 }) 17 })
18 } 18 }
19 19
20 type modImpl struct { 20 type modImpl struct {
21 aeCtx context.Context 21 aeCtx context.Context
22 } 22 }
23 23
24 func (m modImpl) List() ([]string, error) { 24 func (m modImpl) List() ([]string, error) {
25 return aeModule.List(m.aeCtx) 25 return aeModule.List(m.aeCtx)
26 } 26 }
(...skipping 14 matching lines...) Expand all
41 return aeModule.DefaultVersion(m.aeCtx, module) 41 return aeModule.DefaultVersion(m.aeCtx, module)
42 } 42 }
43 43
44 func (m modImpl) Start(module, version string) error { 44 func (m modImpl) Start(module, version string) error {
45 return aeModule.Start(m.aeCtx, module, version) 45 return aeModule.Start(m.aeCtx, module, version)
46 } 46 }
47 47
48 func (m modImpl) Stop(module, version string) error { 48 func (m modImpl) Stop(module, version string) error {
49 return aeModule.Stop(m.aeCtx, module, version) 49 return aeModule.Stop(m.aeCtx, module, version)
50 } 50 }
OLDNEW
« no previous file with comments | « impl/prod/memcache.go ('k') | impl/prod/taskqueue.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698