handlers

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2024 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddContactPage

func AddContactPage(e echo.Context) error

AddContactPage renders a page for adding a contact with a form that make a POST call to /api/contacts and adds a contact to the database

func ContactPage

func ContactPage(e echo.Context) error

ContactPage renders a single page showing all the details about an existing contact

func ContactsPage

func ContactsPage(e echo.Context) error

func CreateContact

func CreateContact(e echo.Context) error

CreateContact creates a new contact

func DashboardPage

func DashboardPage(e echo.Context) error

DashboardPage redirects to /

func DeleteContact

func DeleteContact(e echo.Context) error

DeleteContact deletes a contact

func EditContactPage

func EditContactPage(e echo.Context) error

EditContactPage renders a page for editing a contact with a form that makes a PUT call to /api/contacts/:id and updates the contact in the database

func GetContact

func GetContact(e echo.Context) error

GetContact returns a single contact

func GetContacts

func GetContacts(e echo.Context) error

GetContacts returns all contacts

func IndexPage

func IndexPage(e echo.Context) error

IndexPage is the handler for the index route that renders the index template

func Login

func Login(e echo.Context) error

Login is the handler for the login route it checks if the username and password are correct and sets the session cookie if they are

func LoginPage

func LoginPage(e echo.Context) error

LoginPage is the handler for the login route that renders the login template

func Logout

func Logout(e echo.Context) error

Logout is the handler for the logout route it deletes the session cookie and redirects to the index page

func PageNotFound

func PageNotFound(err error, e echo.Context)

PageNotFound renders a 404 page when a url that does not exist is accessed

func SettingsPage

func SettingsPage(e echo.Context) error

SettingsPage renders a static page for showing the current settings

func StaticFiles

func StaticFiles(e echo.Context) error

StaticFiles is the handler for serving all static files from the configured static directory

func UpdateContact

func UpdateContact(e echo.Context) error

UpdateContact updates a contact

Types

This section is empty.

Jump to

Keyboard shortcuts

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