ЛР 2: PostgreSQL, сессии в Valkey, кэш истории (трек 1)

This commit is contained in:
Нурлыгаянова Екатерина
2026-10-29 11:29:38 +03:00
parent 65003b6119
commit 1503b5db81
132 changed files with 15114 additions and 20 deletions
+21
View File
@@ -0,0 +1,21 @@
package session
import (
"context"
"errors"
"time"
)
type Session struct {
UserID string `json:"user_id"`
ExpiresAt time.Time `json:"expires_at"`
}
var ErrNotFound = errors.New("session: not found")
type Store interface {
Save(ctx context.Context, tokenHash []byte, s Session) error
Get(ctx context.Context, tokenHash []byte) (Session, error)
Delete(ctx context.Context, tokenHash []byte) error
Ping(ctx context.Context) error
}