WithUser creates a new context with the given user
(ctx context.Context, user *database.User)
| 30 | |
| 31 | // WithUser creates a new context with the given user |
| 32 | func WithUser(ctx context.Context, user *database.User) context.Context { |
| 33 | return context.WithValue(ctx, userKey, user) |
| 34 | } |
| 35 | |
| 36 | // WithToken creates a new context with the given user |
| 37 | func WithToken(ctx context.Context, tok *database.Token) context.Context { |