Documentation ¶
Index ¶
- Constants
- Variables
- func AddAccessTokenMiddleware(router chi.Router)
- func AddRefreshTokenMiddleware(router chi.Router)
- func Hash(plain string) (string, error)
- func NewAccessToken(userId int64) (string, time.Time, error)
- func NewRefreshToken(userId int64) (string, time.Time, error)
- func VerifyPlainWithHash(plain string, encodedHash string) error
- type Claims
Constants ¶
View Source
const ( HashTime = 1 HashMemory = 64 * 1024 HashThreads = 4 HashKeyLen = 32 HashSaltLen = 32 )
Variables ¶
View Source
var AccessTokenTTL = 15 * time.Minute
View Source
var RefreshTokenTTL = 24 * time.Hour * 7
Functions ¶
func AddAccessTokenMiddleware ¶
func AddAccessTokenMiddleware(router chi.Router)
func AddRefreshTokenMiddleware ¶
func AddRefreshTokenMiddleware(router chi.Router)
func VerifyPlainWithHash ¶
Types ¶
Click to show internal directories.
Click to hide internal directories.