Documentation ¶
Index ¶
- type AccessDetails
- type HashAdapter
- type IHashAdapter
- type IJwtAdapter
- type IRandomAdapter
- type IUuidAdapter
- type JwtAdapter
- func (t *JwtAdapter) CreateTokenJWT(userid, email string) (*TokenDetails, error)
- func (t *JwtAdapter) ExtractToken(r *fiber.Ctx) string
- func (t *JwtAdapter) ExtractTokenMetadata(tokenString string) (*AccessDetails, error)
- func (t *JwtAdapter) TokenValid(tokenString string) error
- func (t *JwtAdapter) VerifyRefresh(tokenString string) (*jwt.Token, error)
- func (t *JwtAdapter) VerifyToken(tokenString string) (*jwt.Token, error)
- type RandomAdapter
- type TokenDetails
- type UuidAdapter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccessDetails ¶
type HashAdapter ¶
type HashAdapter struct{}
func (*HashAdapter) CheckHash ¶
func (h *HashAdapter) CheckHash(hash, str string) bool
func (*HashAdapter) GenerateHash ¶
func (h *HashAdapter) GenerateHash(str string) (string, error)
type IHashAdapter ¶
type IHashAdapter interface { GenerateHash(str string) (string, error) CheckHash(hash, str string) bool }
func NewHashAdapter ¶
func NewHashAdapter() IHashAdapter
type IJwtAdapter ¶
type IJwtAdapter interface { CreateTokenJWT(userid, email string) (*TokenDetails, error) ExtractToken(r *fiber.Ctx) (token string) TokenValid(token string) error VerifyToken(token string) (*jwt.Token, error) VerifyRefresh(token string) (*jwt.Token, error) ExtractTokenMetadata(tokenString string) (*AccessDetails, error) }
func NewJwtAdapter ¶
func NewJwtAdapter() IJwtAdapter
type IRandomAdapter ¶
type IRandomAdapter interface {
GenerateRandom() string
}
func NewRandomAdapter ¶
func NewRandomAdapter() IRandomAdapter
type IUuidAdapter ¶
type IUuidAdapter interface {
GenerateUuid() string
}
func NewUuidAdapter ¶
func NewUuidAdapter() IUuidAdapter
type JwtAdapter ¶
type JwtAdapter struct{}
func (*JwtAdapter) CreateTokenJWT ¶
func (t *JwtAdapter) CreateTokenJWT(userid, email string) (*TokenDetails, error)
func (*JwtAdapter) ExtractToken ¶
func (t *JwtAdapter) ExtractToken(r *fiber.Ctx) string
ExtractToken get the token from the request body
func (*JwtAdapter) ExtractTokenMetadata ¶
func (t *JwtAdapter) ExtractTokenMetadata(tokenString string) (*AccessDetails, error)
func (*JwtAdapter) TokenValid ¶
func (t *JwtAdapter) TokenValid(tokenString string) error
func (*JwtAdapter) VerifyRefresh ¶
func (t *JwtAdapter) VerifyRefresh(tokenString string) (*jwt.Token, error)
func (*JwtAdapter) VerifyToken ¶
func (t *JwtAdapter) VerifyToken(tokenString string) (*jwt.Token, error)
type RandomAdapter ¶
type RandomAdapter struct { }
func (*RandomAdapter) GenerateRandom ¶
func (u *RandomAdapter) GenerateRandom() string
type TokenDetails ¶
type UuidAdapter ¶
type UuidAdapter struct { }
func (*UuidAdapter) GenerateUuid ¶
func (u *UuidAdapter) GenerateUuid() string
Click to show internal directories.
Click to hide internal directories.