| Index: service/mail/context.go
|
| diff --git a/service/user/context.go b/service/mail/context.go
|
| similarity index 85%
|
| copy from service/user/context.go
|
| copy to service/mail/context.go
|
| index 21061667e825d2daa91f650b699b345b983fb8f7..d17287c1bdce19b19803f96bd470e277bc206f30 100644
|
| --- a/service/user/context.go
|
| +++ b/service/mail/context.go
|
| @@ -2,7 +2,7 @@
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
|
|
| -package user
|
| +package mail
|
|
|
| import (
|
| "golang.org/x/net/context"
|
| @@ -19,8 +19,8 @@ var (
|
| // SetFactory.
|
| type Factory func(context.Context) Interface
|
|
|
| -// Filter is the function signature for a filter user implementation. It
|
| -// gets the current user implementation, and returns a new user implementation
|
| +// Filter is the function signature for a filter mail implementation. It
|
| +// gets the current mail implementation, and returns a new mail implementation
|
| // backed by the one passed in.
|
| type Filter func(context.Context, Interface) Interface
|
|
|
| @@ -41,7 +41,7 @@ func getCurFilters(c context.Context) []Filter {
|
| return nil
|
| }
|
|
|
| -// Get pulls the user service implementation from context or nil if it
|
| +// Get pulls the mail service implementation from context or nil if it
|
| // wasn't set.
|
| func Get(c context.Context) Interface {
|
| ret := getUnfiltered(c)
|
| @@ -54,13 +54,13 @@ func Get(c context.Context) Interface {
|
| return ret
|
| }
|
|
|
| -// SetFactory sets the function to produce user.Interface instances,
|
| +// SetFactory sets the function to produce mail.Interface instances,
|
| // as returned by the Get method.
|
| func SetFactory(c context.Context, f Factory) context.Context {
|
| return context.WithValue(c, serviceKey, f)
|
| }
|
|
|
| -// Set sets the user service in this context. Useful for testing with a quick
|
| +// Set sets the mail service in this context. Useful for testing with a quick
|
| // mock. This is just a shorthand SetFactory invocation to set a factory which
|
| // always returns the same object.
|
| func Set(c context.Context, u Interface) context.Context {
|
|
|