(ctx context.Context)
| 34 | type authTokenKey struct{} |
| 35 | |
| 36 | func AuthTokenFromContext(ctx context.Context) (string, bool) { |
| 37 | token, ok := ctx.Value(authTokenKey{}).(string) |
| 38 | return token, ok |
| 39 | } |
| 40 | |
| 41 | func ContextWithAuthToken(ctx context.Context, token string) context.Context { |
| 42 | return context.WithValue(ctx, authTokenKey{}, token) |