controllers

package
v0.0.0-...-75cb93a Latest Latest
Warning

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

Go to latest
Published: May 13, 2021 License: BSD-2-Clause Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type WebApp

type WebApp struct {
	Router *mux.Router
	DB     *gorm.DB
}

func (*WebApp) CreateCarpark

func (a *WebApp) CreateCarpark(w http.ResponseWriter, r *http.Request)

CreateCarpark parses requests, validates data and saves the new car park

func (*WebApp) DeleteCarpark

func (a *WebApp) DeleteCarpark(w http.ResponseWriter, r *http.Request)

func (*WebApp) GetAllUsers

func (a *WebApp) GetAllUsers(w http.ResponseWriter, r *http.Request)

GetAllUsers returns all users

func (*WebApp) GetCarPark

func (a *WebApp) GetCarPark(w http.ResponseWriter, r *http.Request)

func (*WebApp) GetCarParks

func (a *WebApp) GetCarParks(w http.ResponseWriter, r *http.Request)

GetCarPark ...

func (*WebApp) InitDB

func (a *WebApp) InitDB(DbHost, DbPort, DbUser, DbName, DbPassword string)

InitDB connects to the database and fires up the routes

func (*WebApp) Login

func (a *WebApp) Login(w http.ResponseWriter, r *http.Request)

Login signs in users

func (*WebApp) Register

func (a *WebApp) Register(w http.ResponseWriter, r *http.Request)

Register controller creates new users

func (*WebApp) RunServer

func (a *WebApp) RunServer()

RunServer starts the server

func (*WebApp) UpdateCarpark

func (a *WebApp) UpdateCarpark(w http.ResponseWriter, r *http.Request)

Jump to

Keyboard shortcuts

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