Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Index your code
hub
/
github.com/gotenberg/gotenberg
/ functions
Functions
1,037 in github.com/gotenberg/gotenberg
⨍
Functions
1,037
◇
Types & classes
147
↓ 6 callers
Method
MustInt
MustInt returns the int value of a flag given by name. It panics if an error occurs.
pkg/gotenberg/flags.go:107
↓ 6 callers
Method
RequestTraceAttrs
RequestTraceAttrs returns trace attributes for an HTTP request received by a server. The server must be the primary server name if it is known. For e
pkg/gotenberg/semconv/server.go:97
↓ 6 callers
Function
ValidateFacturXCompat
ValidateFacturXCompat enforces the Factur-X pairing and PDF/A-3 rules. It returns a 400 error when the request is half-specified, or when an explicit
pkg/modules/pdfengines/routes.go:534
↓ 6 callers
Method
Warn
Warn logs a message at the warning level using the wrapped slog.Logger.
pkg/gotenberg/telemetry.go:236
↓ 6 callers
Function
detachAsyncContext
detachAsyncContext detaches ctx from the inbound request lifecycle so the webhook goroutine survives echo recycling the request, while preserving the
pkg/modules/webhook/async_context.go:30
↓ 6 callers
Function
isClientCancellation
isClientCancellation reports whether err originates from the client (for example Chromium) closing the connection or letting the request deadline pass
pkg/modules/chromium/pinning_proxy.go:361
↓ 6 callers
Method
mustMandatoryField
mustMandatoryField binds the target interface with a form field. It populates an error if the value is empty or the "key" does not exist. Currently, o
pkg/modules/api/formdata.go:595
↓ 6 callers
Method
onResponseReceived
onResponseReceived records the response origin and remembers the URL for the request id, so a later loading-finished event can attribute its bytes.
pkg/modules/chromium/network_aggregate.go:50
↓ 6 callers
Method
snapshot
()
pkg/modules/chromium/pinning_proxy_test.go:45
↓ 6 callers
Function
startProxy
(t *testing.T, opts outboundProxyOptions)
pkg/modules/libreoffice/api/proxy_test.go:36
↓ 5 callers
Function
EmbedFilesStub
EmbedFilesStub embeds files into PDF files.
pkg/modules/pdfengines/routes.go:717
↓ 5 callers
Function
EncryptPdfStub
EncryptPdfStub adds password protection and permission restrictions to PDF files. It does nothing when no password is provided.
pkg/modules/pdfengines/routes.go:701
↓ 5 callers
Function
FormDataPdfSplitMode
FormDataPdfSplitMode creates a [gotenberg.SplitMode] from the form data.
pkg/modules/pdfengines/routes.go:21
↓ 5 callers
Method
HttpError
()
pkg/modules/api/errors.go:7
↓ 5 callers
Method
MandatoryPath
MandatoryPath binds the absolute path of a form data file to a string variable. It populates an error if the file does not exist. var path string
pkg/modules/api/formdata.go:330
↓ 5 callers
Method
Module
Module returns a module which satisfies the requested interface. func (m *YourModule) Provision(ctx *gotenberg.Context) error { mod, _ := ctx.Modu
pkg/gotenberg/context.go:48
↓ 5 callers
Function
NewContext
NewContext creates a [Context]. In a module, prefer the [Provisioner] interface to get a [Context].
pkg/gotenberg/context.go:18
↓ 5 callers
Function
NewFileSystem
NewFileSystem initializes a new [FileSystem] instance with a unique working directory.
pkg/gotenberg/fs.go:50
↓ 5 callers
Function
RotateStub
RotateStub rotates pages of PDF files. If angle is 0, it does nothing.
pkg/modules/pdfengines/routes.go:206
↓ 5 callers
Function
SpanErrorType
SpanErrorType records errorType as the semconv error.type attribute on span. It is a no-op when errorType is empty.
pkg/gotenberg/errortype.go:47
↓ 5 callers
Function
StampStub
StampStub applies a stamp to a list of PDF files. If the stamp has no source, it does nothing.
pkg/modules/pdfengines/routes.go:897
↓ 5 callers
Function
WatermarkStub
WatermarkStub applies a watermark to a list of PDF files. If the stamp has no source, it does nothing.
pkg/modules/pdfengines/routes.go:880
↓ 5 callers
Function
WriteMetadataStub
WriteMetadataStub writes the metadata into PDF files. If no metadata, it does nothing.
pkg/modules/pdfengines/routes.go:371
↓ 5 callers
Function
handleErr
(err error)
pkg/gotenberg/semconv/util.go:113
↓ 5 callers
Function
newFallbackRecorder
(t *testing.T)
pkg/modules/pdfengines/fallback_test.go:17
↓ 5 callers
Function
newNetworkAggregate
()
pkg/modules/chromium/network_aggregate.go:41
↓ 5 callers
Function
newTestSpanRecorder
(t *testing.T)
pkg/gotenberg/cmd_test.go:15
↓ 5 callers
Function
parsePdfObjects
parsePdfObjects parses QPDF JSON v2 output and returns the objects map.
pkg/modules/qpdf/qpdf.go:486
↓ 5 callers
Function
patchFilespecMetadata
patchFilespecMetadata walks QPDF objects to find Filespecs matching the metadata keys. It sets /AFRelationship and /Subtype on matching objects and re
pkg/modules/qpdf/qpdf.go:509
↓ 5 callers
Function
setStreamSubtype
setStreamSubtype finds a stream object by reference and sets the /Subtype key in its dict.
pkg/modules/qpdf/qpdf.go:656
↓ 5 callers
Function
shouldCheckResourceHttpStatusCode
(rawURL string, ignoreDomains []string)
pkg/modules/chromium/events.go:289
↓ 4 callers
Function
Debug
Debug returns the debug data.
pkg/gotenberg/debug.go:57
↓ 4 callers
Method
DirPath
DirPath returns the path to the request's working directory.
pkg/modules/api/context.go:560
↓ 4 callers
Function
FlattenStub
FlattenStub merges annotation appearances with page content for each given PDF, effectively deleting the original annotations.
pkg/modules/pdfengines/routes.go:336
↓ 4 callers
Method
Kill
Kill kills the unix process and all its children without creating orphans. See https://medium.com/@felixge/killing-a-child-process-and-all-of-its-chi
pkg/gotenberg/cmd.go:246
↓ 4 callers
Method
Merge
Merge combines multiple PDFs into a single PDF. The resulting page order is determined by the order of files provided in inputPaths.
pkg/gotenberg/pdfengine.go:269
↓ 4 callers
Function
Meter
Meter returns a [metric.Meter] with the instrumentation name and version already set.
pkg/gotenberg/telemetry.go:200
↓ 4 callers
Method
MustDeprecatedBool
MustDeprecatedBool returns the boolean value of a deprecated flag if it was explicitly set or the int value of the new flag. It panics if an error occ
pkg/gotenberg/flags.go:75
↓ 4 callers
Method
MustDeprecatedString
MustDeprecatedString returns the string value of a deprecated flag if it was explicitly set or the string value of the new flag. It panics if an error
pkg/gotenberg/flags.go:31
↓ 4 callers
Method
MustHumanReadableBytes
MustHumanReadableBytes returns the human-readable bytes string of a flag given by name. It panics if an error occurs.
pkg/gotenberg/flags.go:174
↓ 4 callers
Function
NewHTTPClient
(meter metric.Meter)
pkg/gotenberg/semconv/client.go:32
↓ 4 callers
Function
NewHTTPServer
(meter metric.Meter)
pkg/gotenberg/semconv/server.go:45
↓ 4 callers
Method
Restricted
Restricted reports whether at least one permission is denied.
pkg/gotenberg/pdfengine.go:175
↓ 4 callers
Function
StringEnv
StringEnv retrieves the value of the environment variable named by the key. If the variable is present in the environment and not empty, the value is
pkg/gotenberg/env.go:12
↓ 4 callers
Function
ValidatePdfEncryptCompat
ValidatePdfEncryptCompat returns a 400 error when permission restrictions are requested without a password to anchor them.
pkg/modules/pdfengines/routes.go:688
↓ 4 callers
Function
ValidatePdfFormatsCompat
ValidatePdfFormatsCompat checks for incompatible combinations of PDF formats with other features and returns an appropriate error if found.
pkg/modules/pdfengines/routes.go:223
↓ 4 callers
Function
buildResource
buildResource assembles the OpenTelemetry resource shared by the tracer, meter, and logger providers. Detection is best-effort: a detector or merge fa
pkg/gotenberg/internal/otel/otel.go:27
↓ 4 callers
Function
conversionInputAttrs
conversionInputAttrs derives low-cardinality input attributes for a conversion span: the number of received files (when ctx is an [api.Context]) and t
pkg/modules/chromium/chromium.go:1056
↓ 4 callers
Function
findFallbackSpan
(recorder *tracetest.SpanRecorder, name string)
pkg/modules/pdfengines/fallback_test.go:27
↓ 4 callers
Function
hardTimeoutMiddleware
hardTimeoutMiddleware manages hard timeout scenarios, i.e., when a route handler fails to timeout as expected.
pkg/modules/api/middlewares.go:398
↓ 4 callers
Function
netProtocol
(proto string)
pkg/gotenberg/semconv/util.go:86
↓ 4 callers
Method
onLoadingFinished
onLoadingFinished records a successfully completed request and its size, tracking the single heaviest resource.
pkg/modules/chromium/network_aggregate.go:68
↓ 4 callers
Function
patchCatalogAF
patchCatalogAF ensures the Catalog /AF array references all filespec objects.
pkg/modules/qpdf/qpdf.go:573
↓ 4 callers
Function
requiredHTTPPort
(https bool, port int)
pkg/gotenberg/semconv/util.go:59
↓ 4 callers
Method
runWithDeadline
(ctx context.Context, task func() error)
pkg/gotenberg/supervisor.go:604
↓ 4 callers
Function
sanitizeFilename
sanitizeFilename strips path separators (including backslashes, which [filepath.Base] ignores on Linux) and control characters from a caller-supplied
pkg/modules/api/context.go:692
↓ 4 callers
Method
snapshot
()
pkg/modules/chromium/network_aggregate.go:99
↓ 4 callers
Function
xmlEscape
xmlEscape escapes a string for safe inclusion in XML character data.
pkg/modules/qpdf/qpdf.go:1088
↓ 3 callers
Method
BuildOutputFile
BuildOutputFile builds the output file according to the output paths registered in the context. If many output paths, an archive is created.
pkg/modules/api/context.go:628
↓ 3 callers
Function
CapAttr
CapAttr truncates s to at most [maxAttrRunes] runes, appending an ellipsis when it shortens the value. It is multibyte-safe.
pkg/gotenberg/attrs.go:14
↓ 3 callers
Function
ClassifyError
ClassifyError maps err to a bounded, engine-agnostic error.type value. It recognizes the failure modes shared by every engine: deadline, cancellation,
pkg/gotenberg/errortype.go:28
↓ 3 callers
Method
Content
Content binds the content of a form data file to a string variable. var content string ctx.FormData().Content("foo.txt", &content, "bar")
pkg/modules/api/formdata.go:339
↓ 3 callers
Method
CreateSubDirectory
CreateSubDirectory creates a subdirectory within the context's working directory.
pkg/modules/api/context.go:583
↓ 3 callers
Function
DefaultOptions
DefaultOptions returns the default values for Options.
pkg/modules/chromium/chromium.go:222
↓ 3 callers
Function
DialPinned
DialPinned dials each addr in turn until one connects, returning the first successful connection or the last error. Callers pass the Pinned slice from
pkg/gotenberg/outbound.go:441
↓ 3 callers
Method
EmbedFiles
EmbedFiles embeds files into a PDF. All files are embedded as file attachments without modifying the main PDF content. TODO: attachments instead? Rena
pkg/gotenberg/pdfengine.go:309
↓ 3 callers
Method
Enabled
(ctx context.Context, level slog.Level)
pkg/gotenberg/internal/log/handler.go:111
↓ 3 callers
Method
Error
()
pkg/gotenberg/semconv/httpconvtest_test.go:453
↓ 3 callers
Method
FileCount
FileCount returns the number of files received in the request.
pkg/modules/api/context.go:540
↓ 3 callers
Function
FormDataChromiumPdfOptions
FormDataChromiumPdfOptions creates [PdfOptions] from the form data. Fallback to the default value if the considered key is not present.
pkg/modules/chromium/routes.go:281
↓ 3 callers
Function
FormDataChromiumScreenshotOptions
FormDataChromiumScreenshotOptions creates [ScreenshotOptions] from the form data. Fallback to the default value if the considered key is not present.
pkg/modules/chromium/routes.go:339
↓ 3 callers
Function
GarbageCollect
GarbageCollect scans the root path and deletes files or directories with names containing specific substrings and before a given expiration time.
pkg/gotenberg/gc.go:15
↓ 3 callers
Method
GeneratePathFromFilename
GeneratePathFromFilename generates a path within the context's working directory. It uses a UUID-based name on disk to avoid filesystem NAME_MAX limit
pkg/modules/api/context.go:574
↓ 3 callers
Method
Handle
(ctx context.Context, r slog.Record)
pkg/gotenberg/internal/log/handler.go:120
↓ 3 callers
Method
Launch
Launch starts the managed [Process].
pkg/gotenberg/supervisor.go:54
↓ 3 callers
Function
Logger
Logger returns the global logger.
pkg/gotenberg/telemetry.go:179
↓ 3 callers
Method
MandatoryString
MandatoryString binds a form field to a string variable. It populates an error if the value is empty or the "key" does not exist. var foo string c
pkg/modules/api/formdata.go:82
↓ 3 callers
Method
MetricAttributes
(server string, req *http.Request, statusCode int, route string, additionalAttributes []attribute.KeyValue)
pkg/gotenberg/semconv/server.go:348
↓ 3 callers
Method
MustDeprecatedRegexpSlice
MustDeprecatedRegexpSlice returns the slice of compiled regular expressions of a deprecated flag if it was explicitly set or the slice of the new flag
pkg/gotenberg/flags.go:247
↓ 3 callers
Method
MustFloat64
MustFloat64 returns the float value of a flag given by name. It panics if an error occurs.
pkg/gotenberg/flags.go:129
↓ 3 callers
Method
MustRegexp
MustRegexp returns the regular expression of a flag given by name. It panics if an error occurs.
pkg/gotenberg/flags.go:206
↓ 3 callers
Method
NewDirPath
NewDirPath generates a new unique path for a directory inside the working directory.
pkg/gotenberg/fs.go:70
↓ 3 callers
Function
NewOutboundHttpClient
NewOutboundHttpClient returns an [http.Client] that validates every outbound request URL via the same logic as [FilterOutboundURL] and pins the result
pkg/gotenberg/outbound.go:392
↓ 3 callers
Method
OutputFilename
OutputFilename returns the filename based on the given output path or the "Gotenberg-Output-Filename" header's value.
pkg/modules/api/context.go:677
↓ 3 callers
Function
ParseError
ParseError parses an error and returns the corresponding HTTP status and HTTP message.
pkg/modules/api/middlewares.go:38
↓ 3 callers
Method
ReadBookmarks
ReadBookmarks reads the document outline (bookmarks) of a PDF file.
pkg/gotenberg/pdfengine.go:294
↓ 3 callers
Method
RecordMetrics
(ctx context.Context, md ServerMetricData)
pkg/gotenberg/semconv/server.go:270
↓ 3 callers
Function
RedactURL
RedactURL parses raw and returns a redacted, length-capped form safe to use as a span attribute or event value. Userinfo, query, and fragment are drop
pkg/gotenberg/attrs.go:26
↓ 3 callers
Function
ResolveAndCheckPublic
ResolveAndCheckPublic resolves host and rejects any resolved address that fails [IsPublicIP] with [ErrNonPublicIP]. It is the strict equivalent of [De
pkg/gotenberg/outbound.go:117
↓ 3 callers
Method
ResponseTraceAttrs
ResponseTraceAttrs returns trace attributes for telemetry from an HTTP response. If any of the fields in the ResponseTelemetry are not set the attrib
pkg/gotenberg/semconv/server.go:309
↓ 3 callers
Method
Route
Route returns the attribute for the route.
pkg/gotenberg/semconv/server.go:344
↓ 3 callers
Function
SplitPdfStub
SplitPdfStub splits a list of PDF files based on [gotenberg.SplitMode]. It returns a list of output paths or the list of provided input paths if no sp
pkg/modules/pdfengines/routes.go:279
↓ 3 callers
Method
Stamp
Stamp applies a stamp (on top of page content) to a PDF file.
pkg/gotenberg/pdfengine.go:321
↓ 3 callers
Method
Start
Start initiates the process and returns an error if the process cannot be started.
pkg/gotenberg/supervisor.go:34
↓ 3 callers
Method
Stop
Stop terminates the process and returns an error if the process cannot be stopped.
pkg/gotenberg/supervisor.go:38
↓ 3 callers
Method
Watermark
Watermark applies a watermark (behind page content) to a PDF file.
pkg/gotenberg/pdfengine.go:318
↓ 3 callers
Method
WriteBookmarks
WriteBookmarks adds a document outline (bookmarks) to a PDF file. The bookmarks parameter represents the hierarchical tree of the outline.
pkg/gotenberg/pdfengine.go:298
↓ 3 callers
Function
chromiumErrorType
chromiumErrorType maps a conversion error to chromium's bounded reason value, reused as the span error.type. queueReason preserves the historical, rou
pkg/modules/chromium/chromium.go:1078
↓ 3 callers
Function
containerHttpEndpoint
(ctx context.Context, container testcontainers.Container, port string)
test/integration/scenario/containers.go:211
↓ 3 callers
Function
convertUrl
(ctx *api.Context, chromium Api, engine gotenberg.PdfEngine, url string, options PdfOptions, mode gotenberg.Sp
pkg/modules/chromium/routes.go:784
← previous
next →
101–200 of 1,037, ranked by callers