Documentation
¶
Index ¶
- func IsServerReachable(serverURL string) error
- type App
- func (app *App) Flash(_ http.ResponseWriter, r *http.Request, t string, m string, c bool)
- func (app *App) FlashAndGoBack(w http.ResponseWriter, r *http.Request, t string, message string)
- func (c *App) HandleHomePage(w http.ResponseWriter, r *http.Request)
- func (app *App) JSONResponse(w http.ResponseWriter, data any, c int)
- func (app *App) SendJSONError(w http.ResponseWriter, message string, statusCodeOption ...int)
- func (app *App) SendJSONSuccess(w http.ResponseWriter, message string, statusCodeOption ...int)
- func (app *App) SetupDB()
- func (app *App) SetupRoutes()
- func (app *App) Shutdown() error
- func (app *App) StartServer()
- type ServerOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsServerReachable ¶
Check Server is reachable Does not validate the status code
Types ¶
type App ¶
type App struct {
// contains filtered or unexported fields
}
func (*App) FlashAndGoBack ¶
func (*App) HandleHomePage ¶
func (c *App) HandleHomePage(w http.ResponseWriter, r *http.Request)
func (*App) JSONResponse ¶
func (app *App) JSONResponse(w http.ResponseWriter, data any, c int)
func (*App) SendJSONError ¶
func (app *App) SendJSONError(w http.ResponseWriter, message string, statusCodeOption ...int)
SendJSONError displays JSON error messages and exits the program.
func (*App) SendJSONSuccess ¶
func (app *App) SendJSONSuccess(w http.ResponseWriter, message string, statusCodeOption ...int)
SendJSONSuccess displays JSON success messages and exits the program.
func (*App) SetupRoutes ¶
func (app *App) SetupRoutes()
func (*App) StartServer ¶
func (app *App) StartServer()
Start launches the server, listening on the configured address.
type ServerOption ¶
type ServerOption func(*App)
ServerOption is a functional option that is used to configure the
Source Files
¶
Click to show internal directories.
Click to hide internal directories.