Documentation ¶
Overview ¶
Package apihandler defines haul's v1 API endpoint logic
It defines the APIHandler struct that allows more a efficient reuse of single *db.PostgresClient.
The APIHandler also implements the Declare method for activation of the `/v1/*` routes by cmd.apiCmd
This package is a work-in-progress during haul's migration from the old `/v1/*` routes (which now reside at `/v0/*`) to the ones declared here.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Declare ¶
func Declare(e *echo.Group, h *APIHandler)
Declare adds routes defined in its scope to the specified *echo.Group
It is used by cmd.apiCmd to declare the `/v1/*` routes.
Types ¶
type APIHandler ¶
type APIHandler struct {
PostgresClient *db.PostgresClient
}
func New ¶
func New(postgresClient *db.PostgresClient) *APIHandler
func (*APIHandler) AssetsAllGET ¶ added in v0.60.0
func (h *APIHandler) AssetsAllGET(c echo.Context) error
AssetsAllGET
func (*APIHandler) HealthGET ¶
func (h *APIHandler) HealthGET(c echo.Context) error
HealthGET is the handler for `GET /health`
Click to show internal directories.
Click to hide internal directories.