handlers

package
v0.0.0-...-366731b Latest Latest
Warning

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

Go to latest
Published: May 8, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package handlers provides HTTP handlers for the golang-ecolabel-backend project.

Package handlers provides HTTP handlers for the golang-ecolabel-backend project.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HandleDashboard

func HandleDashboard(w http.ResponseWriter, r *http.Request)

HandleDashboard is an HTTP handler that returns a welcome message for the dashboard. This handler requires JWT authentication and should be protected by the JwtAuthMiddleware.

func HandleGetCSRFToken

func HandleGetCSRFToken(w http.ResponseWriter, r *http.Request)

func HandleGetSessionValue

func HandleGetSessionValue(w http.ResponseWriter, r *http.Request)

HandleGetSessionValue retrieves a value from the session.

func HandleLogin

func HandleLogin(w http.ResponseWriter, r *http.Request)

HandleLogin is an HTTP handler that processes login requests. It reads a JSON request body containing a username and password, authenticates the credentials using the userService, and returns a JSON response with a JWT token if the authentication is successful.

func HandleSetSessionValue

func HandleSetSessionValue(w http.ResponseWriter, r *http.Request)

HandleSetSessionValue sets a value in the session.

func HandleSubmit

func HandleSubmit(w http.ResponseWriter, r *http.Request)

Types

This section is empty.

Jump to

Keyboard shortcuts

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