apihandler

package
v0.60.0 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2023 License: GPL-2.0 Imports: 6 Imported by: 0

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`

Jump to

Keyboard shortcuts

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