Documentation
¶
Overview ¶
Package stdgotenbergfx provides a client of Gotenberg (https://gotenberg.dev), which converts documents as a service of its own, so no document is processed in Go.
Gotenberg reads and writes the files itself, with requests that the caller pre-signs (stds3fx): it downloads its input (downloadFrom) and uploads its output (its webhook), so file contents pass through neither the service nor its workers. Run Gotenberg with WEBHOOK_ENABLE_SYNC_MODE, so a conversion returns once the upload is done.
Gotenberg answers a conversion the same whether its upload succeeded or not, and reports why only to its events URL: callers check that the output arrived.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrRejected = errors.New("stdgotenbergfx: rejected")
ErrRejected reports that Gotenberg refused a conversion, such as of a file it cannot download; sending it again fails the same way.
Functions ¶
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client converts documents with Gotenberg. It is safe for concurrent use.
func New ¶
New builds the client, which sends its requests with client, such as that of stdhttpclientfx.
func (*Client) ConvertOffice ¶
ConvertOffice has Gotenberg convert the office document that source downloads into a PDF with LibreOffice, and upload it with target, a pre-signed PUT. Source's response must name the file (Content-Disposition), whose extension tells Gotenberg the format. It returns once Gotenberg is done, but Gotenberg answers the same whether the upload succeeded or not: callers check the output.
It fails with ErrRejected when Gotenberg refuses the request, such as when it cannot download source.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package stdgotenbergtestfx provides the stdgotenbergfx client for tests, on a Gotenberg server that is started for the tests (stdtestcontainer.Gotenberg), so they need no Docker Compose or other prior setup.
|
Package stdgotenbergtestfx provides the stdgotenbergfx client for tests, on a Gotenberg server that is started for the tests (stdtestcontainer.Gotenberg), so they need no Docker Compose or other prior setup. |