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 ¶
- func Declare(e *echo.Group, h *APIHandler)
- type APIHandler
- func (h *APIHandler) AssetAttributeDELETE(c echo.Context) error
- func (h *APIHandler) AssetAttributeDetailedGET(c echo.Context) error
- func (h *APIHandler) AssetAttributeGET(c echo.Context) error
- func (h *APIHandler) AssetAttributeValuePUT(c echo.Context) error
- func (h *APIHandler) AssetAttributesGET(c echo.Context) error
- func (h *APIHandler) AssetDELETE(c echo.Context) error
- func (h *APIHandler) AssetDescriptionGET(c echo.Context) error
- func (h *APIHandler) AssetDescriptionPUT(c echo.Context) error
- func (h *APIHandler) AssetGET(c echo.Context) error
- func (h *APIHandler) AssetRestorePOST(c echo.Context) error
- func (h *APIHandler) AssetStatusDELETE(c echo.Context) error
- func (h *APIHandler) AssetStatusGET(c echo.Context) error
- func (h *APIHandler) AssetStatusPUT(c echo.Context) error
- func (h *APIHandler) AssetTargetDELETE(c echo.Context) error
- func (h *APIHandler) AssetTargetGET(c echo.Context) error
- func (h *APIHandler) AssetTargetPUT(c echo.Context) error
- func (h *APIHandler) AssetsAllGET(c echo.Context) error
- func (h *APIHandler) AssetsAttributesDELETE(c echo.Context) error
- func (h *APIHandler) AssetsAttributesGET(c echo.Context) error
- func (h *APIHandler) AssetsAttributesPOST(c echo.Context) error
- func (h *APIHandler) AssetsDELETE(c echo.Context) error
- func (h *APIHandler) AssetsDetailedGET(c echo.Context) error
- func (h *APIHandler) AssetsGET(c echo.Context) error
- func (h *APIHandler) AssetsPOST(c echo.Context) error
- func (h *APIHandler) AssetsRestorePOST(c echo.Context) error
- func (h *APIHandler) AttributeAssetsGET(c echo.Context) error
- func (h *APIHandler) AttributeDELETE(c echo.Context) error
- func (h *APIHandler) AttributeGET(c echo.Context) error
- func (h *APIHandler) AttributeRestorePOST(c echo.Context) error
- func (h *APIHandler) AttributesGET(c echo.Context) error
- func (h *APIHandler) AttributesPOST(c echo.Context) error
- func (h *APIHandler) EventsGET(c echo.Context) error
- func (h *APIHandler) HealthGET(c echo.Context) error
- func (h *APIHandler) SeedPOST(c echo.Context) error
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 { APIClient *apiclient.APIClient PostgresClient *db.PostgresClient }
func New ¶
func New(postgresClient *db.PostgresClient) *APIHandler
func NewWithAPIClient ¶ added in v0.66.0
func NewWithAPIClient(apiClient *apiclient.APIClient, postgresClient *db.PostgresClient) *APIHandler
func (*APIHandler) AssetAttributeDELETE ¶ added in v0.63.0
func (h *APIHandler) AssetAttributeDELETE(c echo.Context) error
AssetAttributeDELETE is the handler for `DELETE /v1/asset-attributes/{asset_attribute_id}`
func (*APIHandler) AssetAttributeDetailedGET ¶ added in v0.66.0
func (h *APIHandler) AssetAttributeDetailedGET(c echo.Context) error
func (*APIHandler) AssetAttributeGET ¶ added in v0.64.0
func (h *APIHandler) AssetAttributeGET(c echo.Context) error
AssetAttributeGET is the handler for `GET /v1/asset-attributes/{asset_attribute_id}`
func (*APIHandler) AssetAttributeValuePUT ¶ added in v0.65.0
func (h *APIHandler) AssetAttributeValuePUT(c echo.Context) error
func (*APIHandler) AssetAttributesGET ¶ added in v0.63.0
func (h *APIHandler) AssetAttributesGET(c echo.Context) error
AssetAttributesGET is the handler for `GET /v1/assets/{asset_id}/attributes`
func (*APIHandler) AssetDELETE ¶ added in v0.63.0
func (h *APIHandler) AssetDELETE(c echo.Context) error
AssetDELETE is the handler for `DELETE /v1/assets/{asset_id}`
func (*APIHandler) AssetDescriptionGET ¶ added in v0.63.0
func (h *APIHandler) AssetDescriptionGET(c echo.Context) error
AssetDescriptionGET is the handler for `GET /v1/assets/{asset_id}/description`
func (*APIHandler) AssetDescriptionPUT ¶ added in v0.63.0
func (h *APIHandler) AssetDescriptionPUT(c echo.Context) error
AssetDescriptionPUT is the handler for `PUT /v1/assets/{asset_id}/description`
func (*APIHandler) AssetGET ¶ added in v0.63.0
func (h *APIHandler) AssetGET(c echo.Context) error
AssetGET is the handler for `GET /v1/assets/{asset_id}`
func (*APIHandler) AssetRestorePOST ¶ added in v0.63.0
func (h *APIHandler) AssetRestorePOST(c echo.Context) error
AssetRestorePOST is the handler for `POST /v1/assets/{asset_id}/restore`
func (*APIHandler) AssetStatusDELETE ¶ added in v0.63.0
func (h *APIHandler) AssetStatusDELETE(c echo.Context) error
AssetStatusDELETE is the handler for `DELETE /v1/assets/{asset_id}/status`
func (*APIHandler) AssetStatusGET ¶ added in v0.63.0
func (h *APIHandler) AssetStatusGET(c echo.Context) error
AssetStatusGET is the handler for `GET /v1/assets/{asset_id}/status`
func (*APIHandler) AssetStatusPUT ¶ added in v0.63.0
func (h *APIHandler) AssetStatusPUT(c echo.Context) error
AssetStatusPUT is the handler for `PUT /v1/assets/{asset_id}/status`
func (*APIHandler) AssetTargetDELETE ¶ added in v0.63.0
func (h *APIHandler) AssetTargetDELETE(c echo.Context) error
AssetTargetDELETE is the handler for `DELETE /v1/assets/{asset_id}/target`
func (*APIHandler) AssetTargetGET ¶ added in v0.63.0
func (h *APIHandler) AssetTargetGET(c echo.Context) error
AssetTargetGET is the handler for `GET /v1/assets/{asset_id}/target`
func (*APIHandler) AssetTargetPUT ¶ added in v0.63.0
func (h *APIHandler) AssetTargetPUT(c echo.Context) error
AssetTargetPUT is the handler for `PUT /v1/assets/{asset_id}/target`
func (*APIHandler) AssetsAllGET ¶ added in v0.60.0
func (h *APIHandler) AssetsAllGET(c echo.Context) error
AssetsAllGET is the handler for `GET /v1/assets/all`
func (*APIHandler) AssetsAttributesDELETE ¶ added in v0.70.0
func (h *APIHandler) AssetsAttributesDELETE(c echo.Context) error
AssetsAttributesDELETE is the handler for `DELETE /v1/asset-attributes`
func (*APIHandler) AssetsAttributesGET ¶ added in v0.63.0
func (h *APIHandler) AssetsAttributesGET(c echo.Context) error
AssetsAttributesGET is the handler for `GET /v1/asset-attributes`
func (*APIHandler) AssetsAttributesPOST ¶ added in v0.63.1
func (h *APIHandler) AssetsAttributesPOST(c echo.Context) error
AssetsAttributesPOST
func (*APIHandler) AssetsDELETE ¶ added in v0.63.0
func (h *APIHandler) AssetsDELETE(c echo.Context) error
AssetsDELETE is the handler for `DELETE /v1/assets`
func (*APIHandler) AssetsDetailedGET ¶ added in v0.74.0
func (h *APIHandler) AssetsDetailedGET(c echo.Context) error
AssetsDetailedGET is the handler for `GET /v1/assets/detailed`
func (*APIHandler) AssetsGET ¶ added in v0.63.0
func (h *APIHandler) AssetsGET(c echo.Context) error
AssetsGET is the handler for `GET /v1/assets`
func (*APIHandler) AssetsPOST ¶ added in v0.63.0
func (h *APIHandler) AssetsPOST(c echo.Context) error
AssetsPOST is the handler for `POST /v1/assets`
func (*APIHandler) AssetsRestorePOST ¶ added in v0.67.0
func (h *APIHandler) AssetsRestorePOST(c echo.Context) error
AssetsRestorePOST is the handler for `POST /v1/assets/restore`
func (*APIHandler) AttributeAssetsGET ¶ added in v0.63.0
func (h *APIHandler) AttributeAssetsGET(c echo.Context) error
AttributeAssetsGET is the handler for `GET /v1/attributes/{attribute_id}/assets`
func (*APIHandler) AttributeDELETE ¶ added in v0.63.0
func (h *APIHandler) AttributeDELETE(c echo.Context) error
AttributeDELETE is the handler for `DELETE /v1/attributes/{attribute_id}`
func (*APIHandler) AttributeGET ¶ added in v0.63.0
func (h *APIHandler) AttributeGET(c echo.Context) error
AttributeGET is the handler for `GET /v1/attributes/{attribute_id}`
func (*APIHandler) AttributeRestorePOST ¶ added in v0.63.0
func (h *APIHandler) AttributeRestorePOST(c echo.Context) error
AttributeRestorePOST
func (*APIHandler) AttributesGET ¶ added in v0.63.0
func (h *APIHandler) AttributesGET(c echo.Context) error
AttributesGET is the handler for `GET /v1/attributes`
func (*APIHandler) AttributesPOST ¶ added in v0.63.0
func (h *APIHandler) AttributesPOST(c echo.Context) error
AttributesPOST is the handler for `POST /v1/attributes`
func (*APIHandler) EventsGET ¶ added in v0.62.0
func (h *APIHandler) EventsGET(c echo.Context) error
EventsGET is the handler for `GET /events`
func (*APIHandler) HealthGET ¶
func (h *APIHandler) HealthGET(c echo.Context) error
HealthGET is the handler for `GET /v1/health`
func (*APIHandler) SeedPOST ¶ added in v0.61.0
func (h *APIHandler) SeedPOST(c echo.Context) error
SeedPOST is the handler for `POST /v1/seed`