auth

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2024 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.RegisteredClaims
	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