minor refactoring of const + better timeout handling in pinter package + api package tests

This commit is contained in:
Julien Neuhart
2019-07-10 11:46:58 +02:00
parent 0c1e4e6888
commit f6b357691c
27 changed files with 604 additions and 213 deletions

View File

@@ -35,7 +35,7 @@ const (
)
func convert(ctx *context.Context, p printer.Printer) error {
const op = "handler.convert"
const op string = "handler.convert"
r := ctx.Resource()
logger := ctx.StandardLogger()
baseFilename := random.Get()

View File

@@ -10,7 +10,7 @@ import (
// HTML is the endpoint for converting
// HTML to PDF.
func HTML(c echo.Context) error {
const op = "handler.HTML"
const op string = "handler.HTML"
ctx := context.MustCastFromEchoContext(c)
ctx.StandardLogger().DebugfOp(op, "html request")
r := ctx.Resource()

View File

@@ -10,7 +10,7 @@ import (
// Markdown is the endpoint for converting
// Markdown to PDF.
func Markdown(c echo.Context) error {
const op = "handler.Markdown"
const op string = "handler.Markdown"
ctx := context.MustCastFromEchoContext(c)
ctx.StandardLogger().DebugfOp(op, "markdown request")
r := ctx.Resource()

View File

@@ -10,7 +10,7 @@ import (
// Merge is the endpoint for
// merging PDF files.
func Merge(c echo.Context) error {
const op = "handler.Merge"
const op string = "handler.Merge"
ctx := context.MustCastFromEchoContext(c)
ctx.StandardLogger().DebugfOp(op, "merge request")
r := ctx.Resource()

View File

@@ -10,7 +10,7 @@ import (
// Office is the endpoint for converting
// Office files to PDF.
func Office(c echo.Context) error {
const op = "handler.Office"
const op string = "handler.Office"
ctx := context.MustCastFromEchoContext(c)
ctx.StandardLogger().DebugfOp(op, "office request")
r := ctx.Resource()

View File

@@ -11,7 +11,7 @@ import (
// URL is the endpoint for converting
// a URL to PDF.
func URL(c echo.Context) error {
const op = "handler.URL"
const op string = "handler.URL"
ctx := context.MustCastFromEchoContext(c)
ctx.StandardLogger().DebugfOp(op, "url request")
r := ctx.Resource()