Example #1
0
func Get(ctx *app.Context, id int64) (app.User, error) {
	_, userVal := newEmptyUser(ctx)
	key := "gnd:la:user:"******"User.UserId", id), userVal)
	if err != nil {
		return nil, err
	}
	if !ok {
		return nil, errNoSuchUser
	}
	ctx.Cache().Set(key, userVal, 300)
	return userVal.(app.User), nil
}