handlers

package
v0.0.0-...-8c56ab2 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2021 License: BSD-3-Clause Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewApiConf

func NewApiConf(scs *scs.SessionManager, dh *repo.DBHolder)

Types

type ApiConfig

type ApiConfig struct {
	ScsManager *scs.SessionManager
	DHolder    *repo.DBHolder
}
var ApiConf *ApiConfig

func (*ApiConfig) AddCarHandler

func (ac *ApiConfig) AddCarHandler(w http.ResponseWriter, r *http.Request)

AddCarHandler use for adding cars associated with user into db

func (*ApiConfig) AddUserHandler

func (ac *ApiConfig) AddUserHandler(w http.ResponseWriter, r *http.Request)

AddUserHandler use for adding users into the db

func (*ApiConfig) CheckStatus

func (ac *ApiConfig) CheckStatus(w http.ResponseWriter, r *http.Request)

CheckStatus just for showing the status of app

func (*ApiConfig) DeleteUserHandler

func (ac *ApiConfig) DeleteUserHandler(w http.ResponseWriter, r *http.Request)

DeleteUserHandler use for deleting users from database

func (*ApiConfig) EnableCORS

func (ac *ApiConfig) EnableCORS(next http.Handler) http.Handler

func (*ApiConfig) GetAllUsersHandler

func (ac *ApiConfig) GetAllUsersHandler(w http.ResponseWriter, r *http.Request)

GetAllUsersHandler get everything we have in db by limit & offset

func (*ApiConfig) GetUserHandler

func (ac *ApiConfig) GetUserHandler(w http.ResponseWriter, r *http.Request)

GetUserHandler use for get a user by its ID with associated cars

func (*ApiConfig) UpdateCarHandler

func (ac *ApiConfig) UpdateCarHandler(w http.ResponseWriter, r *http.Request)

UpdateCarHandler use for updating a car by its id

func (*ApiConfig) UpdateUserHandler

func (ac *ApiConfig) UpdateUserHandler(w http.ResponseWriter, r *http.Request)

UpdateUserHandler use for updating a user its ID

Jump to

Keyboard shortcuts

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