forked from mtusi2026/mtusi2026lab3
14 lines
380 B
Go
14 lines
380 B
Go
package repository
|
|
|
|
import (
|
|
"context"
|
|
"highload/internal/model"
|
|
"time"
|
|
)
|
|
|
|
type SessionRepository interface {
|
|
Create(ctx context.Context, tokenHash []byte, userID string, sessionTTL time.Duration) (*model.Session, error)
|
|
GetSessionByTokenHash(ctx context.Context, tokenHash []byte) (*model.Session, error)
|
|
RevokeSession(ctx context.Context, tokenHash []byte) (int, error)
|
|
}
|