feat(redis): session repository with native TTL and main connection

This commit is contained in:
Голиков Maximillian Антон
2026-10-02 14:02:55 +03:00
parent 5a3f6114a4
commit 812efa67bb
4 changed files with 166 additions and 6 deletions
+26
View File
@@ -0,0 +1,26 @@
package redis
import (
"context"
"errors"
"high-loud-apps-labs/internal/domain"
)
type coded interface {
Code() domain.ErrorCode
}
func mapError(err error) error {
if err == nil {
return nil
}
var c coded
if errors.As(err, &c) {
return err
}
if errors.Is(err, context.Canceled) || errors.Is(err, context.DeadlineExceeded) {
return err
}
return &domain.UnavailableError{Reason: err.Error()}
}