Documentation ¶
Index ¶
- Constants
- Variables
- func Auth(handlerFunc http.HandlerFunc, userStore models.UserRepo) http.HandlerFunc
- func CheckPassword(hashedPassword string, password []byte) bool
- func CreateJWT(secret []byte, userId int) (string, error)
- func Forbidden(w http.ResponseWriter)
- func GetRiderIDFromContext(ctx context.Context) int
- func GetUserIDFromContext(ctx context.Context) int
- func HashPassword(password string) (string, error)
- func RiderAuth(handlerFunc http.HandlerFunc, riderStore models.RiderRepository) http.HandlerFunc
- func UserAuth(handlerFunc http.HandlerFunc, riderStore models.RiderRepository) http.HandlerFunc
Constants ¶
View Source
const RiderKey contextKey = "RiderID"
Variables ¶
View Source
var UserKey contextKey = "UserID"
Functions ¶
func Auth ¶
func Auth(handlerFunc http.HandlerFunc, userStore models.UserRepo) http.HandlerFunc
func CheckPassword ¶
func Forbidden ¶
func Forbidden(w http.ResponseWriter)
func GetRiderIDFromContext ¶
func GetUserIDFromContext ¶
func HashPassword ¶
func RiderAuth ¶
func RiderAuth(handlerFunc http.HandlerFunc, riderStore models.RiderRepository) http.HandlerFunc
func UserAuth ¶
func UserAuth(handlerFunc http.HandlerFunc, riderStore models.RiderRepository) http.HandlerFunc
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.