Documentation
¶
Index ¶
Constants ¶
View Source
const (
ExpiredTokenTime = 2 * time.Hour
)
Variables ¶
View Source
var ( ErrSignTokenFailed = errcode.ErrorUnauthorized("Failed to sign token") ErrTokenInvalid = errcode.ErrorUnauthorized("Token is invalid") ErrTokenExpired = errcode.ErrorUnauthorized("Token is expired") )
View Source
var ProviderSet = wire.NewSet(NewAuthnInterface)
Functions ¶
This section is empty.
Types ¶
type AuthnInterface ¶
type AuthnInterface interface { Sign(ctx context.Context, userId int64) (string, error) Destroy(ctx context.Context, accessToken string) error Verify(ctx context.Context, accessToken string) (int64, error) }
func NewAuthnInterface ¶
func NewAuthnInterface(cache redis.Cmdable, c *conf.Jwt) AuthnInterface
Click to show internal directories.
Click to hide internal directories.