auth

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidToken = errors.New("token is invalid")

Functions

func CreateToken

func CreateToken(secret, username string, expiresIn time.Duration) (string, error)

func IsAuthorized

func IsAuthorized(secret, tokenString string) (bool, error)

Types

type Claims

type Claims struct {
	Username string `json:"username"`
	jwt.StandardClaims
}

type Credentials

type Credentials struct {
	Username string `json:"username"`
	Password string `json:"password"`
}

Jump to

Keyboard shortcuts

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