Documentation ¶
Index ¶
- func NewApiConf(scs *scs.SessionManager, dh *repo.DBHolder)
- type ApiConfig
- func (ac *ApiConfig) AddCarHandler(w http.ResponseWriter, r *http.Request)
- func (ac *ApiConfig) AddUserHandler(w http.ResponseWriter, r *http.Request)
- func (ac *ApiConfig) CheckStatus(w http.ResponseWriter, r *http.Request)
- func (ac *ApiConfig) DeleteUserHandler(w http.ResponseWriter, r *http.Request)
- func (ac *ApiConfig) EnableCORS(next http.Handler) http.Handler
- func (ac *ApiConfig) GetAllUsersHandler(w http.ResponseWriter, r *http.Request)
- func (ac *ApiConfig) GetUserHandler(w http.ResponseWriter, r *http.Request)
- func (ac *ApiConfig) UpdateCarHandler(w http.ResponseWriter, r *http.Request)
- func (ac *ApiConfig) UpdateUserHandler(w http.ResponseWriter, r *http.Request)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewApiConf ¶
Types ¶
type ApiConfig ¶
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) 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
Click to show internal directories.
Click to hide internal directories.