auth

package
v0.0.0-...-d9604ce Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2021 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrAlreadyExist error = errors.New("User already exist")

ErrAlreadyExist should have a comment.

View Source
var ErrInvalidCredential error = errors.New("Invalid Credentials")

ErrInvalidCredential should have a comment.

View Source
var ErrInvalidToken error = errors.New("Invalid Token")

ErrInvalidToken should have a comment.

View Source
var ErrNotExist error = errors.New("User not exist")

ErrNotExist should have a comment.

Functions

func Register

func Register(user *model.User) (int32, error)

Register should have a comment.

func Update

func Update(id int32, user *model.User) error

Update should have a comment.

Types

type JWTClaims

type JWTClaims struct {
	ID        int32  `json:"id"`
	Username  string `json:"username"`
	FirstName string `json:"firstName"`
	LastName  string `json:"lastName"`
	RoleID    int32  `json:"roleId"`
	jwt.StandardClaims
}

JWTClaims should have a comment.

func ParseToken

func ParseToken(token string) (*JWTClaims, error)

ParseToken should have a comment.

type UserToken

type UserToken struct {
	Token    string `json:"token"`
	ExpireAt int64  `json:"expireAt"`
}

UserToken should have a comment.

func Login

func Login(user *model.User) (*UserToken, error)

Login should have a comment.

func RefreshToken

func RefreshToken(token string) (*UserToken, error)

RefreshToken should have a comment.

Jump to

Keyboard shortcuts

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