Documentation ¶
Index ¶
Constants ¶
View Source
const ( DefaultTokenExpiredTime = 10 * time.Minute DefaultTokenSecretKey = "secret-key" DefaultSigningMethod = "HS256" )
Define constants
View Source
const (
UserDataKey = "user_data"
)
Define constants
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type IJWTAuth ¶
type IJWTAuth interface { GenerateToken(data interface{}) (string, *time.Time) ValidateToken(jwtToken string) (map[string]interface{}, error) }
IJWTAuth interface
type Option ¶
type Option interface {
// contains filtered or unexported methods
}
Option validation option
func WithExpiredTime ¶
WithExpiredTime set TokenExpiredTime
func WithSigningMethod ¶
WithSigningMethod set SigningMethod
func WithTokenSecretKey ¶
WithTokenSecretKey set TokenSecretKey
Click to show internal directories.
Click to hide internal directories.