示例#1
0
文件: user.go 项目: tetrafolium/gae
// useUser adds a user.Interface implementation to context, accessible
// by user.Get(c)
func useUser(c context.Context) context.Context {
	data := &userData{}

	return user.SetFactory(c, func(ic context.Context) user.Interface {
		return &userImpl{data}
	})
}
示例#2
0
文件: user.go 项目: tetrafolium/gae
// useUser adds a user service implementation to context, accessible
// by "github.com/tetrafolium/gae/service/user".Get(c)
func useUser(c context.Context) context.Context {
	return gae_user.SetFactory(c, func(ci context.Context) gae_user.Interface {
		return userImpl{AEContext(ci)}
	})
}