handlers

package
v0.0.0-...-23016c8 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type JWTCustomClaims

type JWTCustomClaims struct {
	Username string `json:"username"`
	jwt.RegisteredClaims
}

JWTCustomClaims are custom claims extending default ones.

type UserAuthService

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

func NewUserAuthService

func NewUserAuthService(secret string, dbService db.DatabaseService) *UserAuthService

func (*UserAuthService) AddUserNote

func (authService *UserAuthService) AddUserNote(c echo.Context) error

AddUserNote adds a note belonging to the given user

func (*UserAuthService) EncodeToken

func (us *UserAuthService) EncodeToken(username string) (string, error)

func (*UserAuthService) GetUserNotes

func (authService *UserAuthService) GetUserNotes(c echo.Context) error

GetUserNotes returns all the notes of a given user.

func (*UserAuthService) Login

func (authService *UserAuthService) Login(c echo.Context) error

func (*UserAuthService) RestrictedPath

func (authService *UserAuthService) RestrictedPath(c echo.Context) error

func (*UserAuthService) SignUp

func (authService *UserAuthService) SignUp(c echo.Context) error

type UserRequest

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

UserRequest represents a login or sign up request

Jump to

Keyboard shortcuts

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