Esempio n. 1
0
// 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}
	})
}
Esempio n. 2
0
// useUser adds a user service implementation to context, accessible
// by "github.com/luci/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)}
	})
}