Feat: add example config
This commit is contained in:
@ -1,12 +1,10 @@
|
||||
package handlers
|
||||
|
||||
import (
|
||||
"context"
|
||||
"crypto/hmac"
|
||||
"crypto/sha256"
|
||||
"encoding/base64"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"golias/models"
|
||||
"golias/utils"
|
||||
@ -178,11 +176,12 @@ func cacheSetSession(key string, session *models.Session) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func updateRoomInSession(ctx context.Context, roomID string) (context.Context, error) {
|
||||
s, ok := ctx.Value(models.CtxSessionKey).(*models.Session)
|
||||
if !ok {
|
||||
return context.TODO(), errors.New("failed to extract session from ctx")
|
||||
}
|
||||
s.CurrentRoom = roomID
|
||||
return context.WithValue(ctx, "session", s), nil
|
||||
}
|
||||
// unused
|
||||
// func updateRoomInSession(ctx context.Context, roomID string) (context.Context, error) {
|
||||
// s, ok := ctx.Value(models.CtxSessionKey).(*models.Session)
|
||||
// if !ok {
|
||||
// return context.TODO(), errors.New("failed to extract session from ctx")
|
||||
// }
|
||||
// s.CurrentRoom = roomID
|
||||
// return context.WithValue(ctx, "session", s), nil
|
||||
// }
|
||||
|
Reference in New Issue
Block a user