Documentation ¶
Index ¶
- func CreateJWT(payload JWTPayload, privateKey *rsa.PrivateKey) (string, error)
- func GenerateHash(password []byte) ([]byte, error)
- func Login(username, password string, privateKey *rsa.PrivateKey, u *model.UserModel) (string, error)
- func ParsePrivateKey(keypair string) (*rsa.PrivateKey, error)
- func Register(username, email, password string, u *model.UserModel, ...) (string, error)
- func RegisterRevolt(email string) error
- func ValidateJWT(jwt string, privateKey rsa.PrivateKey) (int64, error)
- type JWTPayload
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateJWT ¶
func CreateJWT(payload JWTPayload, privateKey *rsa.PrivateKey) (string, error)
func GenerateHash ¶
func ParsePrivateKey ¶
func ParsePrivateKey(keypair string) (*rsa.PrivateKey, error)
Must be pem encoded
func RegisterRevolt ¶
func ValidateJWT ¶
func ValidateJWT(jwt string, privateKey rsa.PrivateKey) (int64, error)
Types ¶
type JWTPayload ¶
type JWTPayload struct {
UID int64 `json:"uid"`
}
Click to show internal directories.
Click to hide internal directories.