utils

package
v0.0.0-...-39d7215 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HeaderBearerType = "Bearer"
)

Variables

This section is empty.

Functions

func DecodeId

func DecodeId(hashId string) (int, error)

func EncodeId

func EncodeId(id int) string

func GetTokenFromAuthHeader

func GetTokenFromAuthHeader(authHeader string, headerType string) (string, error)

func Initialize

func Initialize(config *config.Config) error

func InitializeHashId

func InitializeHashId(config *config.Config) error

func InitializeJWT

func InitializeJWT(config *config.Config)

func VerifyLoginJWT

func VerifyLoginJWT(authHeader string) (int, error)

Types

type Claims

type Claims struct {
	Email string `json:"email"`
	jwt.StandardClaims
}

type JWT

type JWT struct {
	// contains filtered or unexported fields
}

type TokenResponse

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

func CreateLoginJWT

func CreateLoginJWT(email string) (*TokenResponse, error)

type Utils

type Utils struct {
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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