예제 #1
0
파일: funcs.go 프로젝트: rainycape/gondola
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
}