Documentation ¶
Index ¶
Constants ¶
View Source
const ( Content = "Content-Type" AppJson = "application/json" RandChar = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Auth ¶
type Auth interface { TokenJWT(claimName string, userId uuid.UUID) (string, string, error) ParseJWT(claimName string, tokenString string) (string, float64, error) ExtractJWT() (string, error) MiddlewarePerm(claimName string) bool HashPassword(password string) ([]byte, error) ComparePassword(userPassword []byte, dtoPassword string) error RandomPassword(length int) (string, error) UUID(param string) (uuid.UUID, error) MiddlewareApiKey(apiKeyName, apiValueName string, r *http.Request) (bool, string) }
type PasetoMaker ¶
type PasetoMaker struct {
// contains filtered or unexported fields
}
func NewPasetoMaker ¶
func NewPasetoMaker(symmetricKey string) (*PasetoMaker, error)
func (*PasetoMaker) CreatePasetoToken ¶
func (maker *PasetoMaker) CreatePasetoToken(userID uuid.UUID, duration time.Duration) (string, error)
func (*PasetoMaker) VerifyPasetoToken ¶
func (maker *PasetoMaker) VerifyPasetoToken(token string) (*Payload, error)
Click to show internal directories.
Click to hide internal directories.