helpers

package
Version: v0.0.0-...-fe9e027 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 5, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Claims

type Claims struct {
	Login string `json:"login"`
	jwt.StandardClaims
}

type JWT

type JWT struct {
	// contains filtered or unexported fields
}

func NewJWT

func NewJWT(secretKey string) (*JWT, error)

func (*JWT) CreateAccessToken

func (j *JWT) CreateAccessToken(claims *Claims) (string, error)

func (*JWT) CreateRefreshToken

func (j *JWT) CreateRefreshToken() string

func (*JWT) IsCorrectJWT

func (j *JWT) IsCorrectJWT(accessToken string) (bool, error)

func (*JWT) ParseJWT

func (j *JWT) ParseJWT(accessToken string) (*Claims, error)

type JWTManager

type JWTManager interface {
	CreateAccessToken(claims *Claims) (string, error)
	ParseJWT(accessToken string) (*Claims, error)
	CreateRefreshToken() string
	IsCorrectJWT(accessToken string) (bool, error)
}

JWTManager ...

type Md5

type Md5 struct {
	Salt string
}

func NewHasher

func NewHasher(salt string) *Md5

func (*Md5) PasswordToMD5Hash

func (m *Md5) PasswordToMD5Hash(pass string) string

type PasswordHasher

type PasswordHasher interface {
	PasswordToMD5Hash(pass string) string
}

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL