auth

package
v0.0.0-...-73eed44 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Auth

type Auth struct {
	AuthKey []byte
}

func NewAuth

func NewAuth(authKey []byte) Auth

func (Auth) CreateToken

func (a Auth) CreateToken(c *UserClaim) (string, error)

func (Auth) ParseToken

func (a Auth) ParseToken(signedToken string) (*UserClaim, error)

type IAuth

type IAuth interface {
	CreateToken(c *UserClaim) (string, error)
	ParseToken(signedToken string) (*UserClaim, error)
}

type UserClaim

type UserClaim struct {
	jwt.StandardClaims
	Email string
}

func (*UserClaim) Compare

func (uc *UserClaim) Compare(compareTo *UserClaim) (bool, error)

Jump to

Keyboard shortcuts

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