Documentation ¶
Index ¶
- Variables
- func GenerateJWT(user *model.User) (string, time.Time, error)
- type CreateAccountRequest
- type CustomClaims
- type Handler
- type LoginRequest
- type Service
- func (s *Service) Authenticate(username, password string) (*model.User, error)
- func (s *Service) CreateAccountService(input CreateAccountRequest) error
- func (s *Service) GenerateRefreshToken(userID uint) (string, time.Time, error)
- func (s *Service) ValidateRefreshToken(tokenString string) (uint, error)
- type UserRetriever
Constants ¶
This section is empty.
Variables ¶
View Source
var JWTKey = []byte("your_secret_key")
Functions ¶
Types ¶
type CreateAccountRequest ¶
type CustomClaims ¶
type CustomClaims struct { UserID uint `json:"user_id"` jwt.StandardClaims }
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
func NewHandler ¶
func (*Handler) CreateAccount ¶
type LoginRequest ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewService ¶
func NewService(db *gorm.DB, userRetriever UserRetriever) *Service
func (*Service) Authenticate ¶
func (*Service) CreateAccountService ¶
func (s *Service) CreateAccountService(input CreateAccountRequest) error
func (*Service) GenerateRefreshToken ¶
Click to show internal directories.
Click to hide internal directories.