generator

package
v0.0.0-...-692bca9 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2022 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewBcryptPasswordGenerator

func NewBcryptPasswordGenerator() *bcryptPasswordGenerator

func NewJWTTokenGenerator

func NewJWTTokenGenerator() *jwtTokenGenerator

func NewNanoidIDGenerator

func NewNanoidIDGenerator() *nanoidIDGenerator

Types

type IDGenerator

type IDGenerator interface {
	GenerateUserID() (id string, err error)
	GenerateCategoryID() (id string, err error)
	GenerateThreadID() (id string, err error)
	GenerateModeratorID() (id string, err error)
	GenerateReportID() (id string, err error)
	GenerateThreadFollowID() (id string, err error)
	GenerateLikeID() (id string, err error)
	GenerateCommentID() (id string, err error)
	GenerateUserFollowID() (id string, err error)
}

type PasswordGenerator

type PasswordGenerator interface {
	GenerateFromPassword(password []byte, cost int) ([]byte, error)
	CompareHashAndPassword(hashedPassword, password []byte) error
}

type TokenGenerator

type TokenGenerator interface {
	GenerateToken(payload TokenPayload) (token string, err error)
	ExtractToken(c echo.Context) (payload TokenPayload)
}

type TokenPayload

type TokenPayload struct {
	ID       string
	Username string
	Role     string
	IsActive bool
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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