feat: add metrics system, move webhook feature to dedicated module (#372)

This commit is contained in:
Julien Neuhart
2021-10-19 18:35:24 +02:00
committed by GitHub
parent b839069af1
commit d4c47cecf2
39 changed files with 3359 additions and 1309 deletions

View File

@@ -7,13 +7,18 @@ import (
"github.com/gotenberg/gotenberg/v7/pkg/gotenberg"
"github.com/gotenberg/gotenberg/v7/pkg/modules/api"
"github.com/labstack/echo/v4"
)
// mergeRoute returns an api.MultipartFormDataRoute which can merge PDFs.
func mergeRoute(engine gotenberg.PDFEngine) api.MultipartFormDataRoute {
return api.MultipartFormDataRoute{
Path: "/pdfengines/merge",
Handler: func(ctx *api.Context) error {
// mergeRoute returns an api.Route which can merge PDFs.
func mergeRoute(engine gotenberg.PDFEngine) api.Route {
return api.Route{
Method: http.MethodPost,
Path: "/forms/pdfengines/merge",
IsMultipart: true,
Handler: func(c echo.Context) error {
ctx := c.Get("context").(*api.Context)
// Let's get the data from the form and validate them.
var (
inputPaths []string
@@ -79,12 +84,16 @@ func mergeRoute(engine gotenberg.PDFEngine) api.MultipartFormDataRoute {
}
}
// convertRoute returns an api.MultipartFormDataRoute which can convert a PDF
// to a specific PDF format.
func convertRoute(engine gotenberg.PDFEngine) api.MultipartFormDataRoute {
return api.MultipartFormDataRoute{
Path: "/pdfengines/convert",
Handler: func(ctx *api.Context) error {
// convertRoute returns an api.Route which can convert a PDF to a specific PDF
// format.
func convertRoute(engine gotenberg.PDFEngine) api.Route {
return api.Route{
Method: http.MethodPost,
Path: "/forms/pdfengines/convert",
IsMultipart: true,
Handler: func(c echo.Context) error {
ctx := c.Get("context").(*api.Context)
// Let's get the data from the form and validate them.
var (
inputPaths []string