changed cards on movie search

This commit is contained in:
2026-01-10 17:10:26 +11:00
parent a0cd269466
commit 6e03c98ae8
5 changed files with 97 additions and 41 deletions

View File

@@ -5,8 +5,3 @@ type contextKey string
func (c contextKey) String() string {
return "projectreshoot context key " + string(c)
}
var (
contextKeyAuthorizedUser = contextKey("auth-user")
contextKeyRequestTime = contextKey("req-time")
)

View File

@@ -1,21 +0,0 @@
package contexts
import (
"context"
"errors"
"time"
)
// Set the start time of the request
func SetStart(ctx context.Context, time time.Time) context.Context {
return context.WithValue(ctx, contextKeyRequestTime, time)
}
// Get the start time of the request
func GetStartTime(ctx context.Context) (time.Time, error) {
start, ok := ctx.Value(contextKeyRequestTime).(time.Time)
if !ok {
return time.Time{}, errors.New("Failed to get start time of request")
}
return start, nil
}