Documentation
¶
Index ¶
- type AuthResponse
- type Claims
- type LoginRequest
- type RegisterRequest
- type Service
- func (s *Service) JWTMiddleware() echo.MiddlewareFunc
- func (s *Service) Login(ctx context.Context, req LoginRequest) (*AuthResponse, error)
- func (s *Service) Register(ctx context.Context, req RegisterRequest) (*AuthResponse, error)
- func (s *Service) ValidateToken(tokenString string) (*Claims, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthResponse ¶
type Claims ¶
type Claims struct {
UserID int32 `json:"user_id"`
Email string `json:"email"`
jwt.RegisteredClaims
}
type LoginRequest ¶
type RegisterRequest ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewService ¶
func NewService(queries db.Querier, config config.AuthConfig) *Service
func (*Service) JWTMiddleware ¶
func (s *Service) JWTMiddleware() echo.MiddlewareFunc
func (*Service) Login ¶
func (s *Service) Login(ctx context.Context, req LoginRequest) (*AuthResponse, error)
func (*Service) Register ¶
func (s *Service) Register(ctx context.Context, req RegisterRequest) (*AuthResponse, error)
Click to show internal directories.
Click to hide internal directories.