auth

package
v0.0.0-...-b7f17af Latest Latest
Warning

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

Go to latest
Published: May 31, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Claim

type Claim struct {
	Username string
	jwt.StandardClaims
}

type UserAuth

type UserAuth struct {
	Token string `json:"token"`
}

func GetUserToken

func GetUserToken(u entity.User) (UserAuth, error)

type Wrapper

type Wrapper struct {
	Secret          string
	Issuer          string
	ExpirationHours int
}

func (*Wrapper) GenerateToken

func (aw *Wrapper) GenerateToken(user entity.User) (signedToken string, err error)

func (*Wrapper) ValidateToken

func (aw *Wrapper) ValidateToken(signedToken string) (claim *Claim, err error)

Jump to

Keyboard shortcuts

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