Documentation
¶
Overview ¶
Package gotenberg provides a client for the Gotenberg service. It offers a convenient API for document conversion using various engines.
Index ¶
- type CircuitBreakerConfig
- type Client
- func (c *Client) Chromium() *chromium.Chromium
- func (c *Client) GetHealth(ctx context.Context) (*HealthResponse, error)
- func (c *Client) GetMetrics(ctx context.Context) (string, error)
- func (c *Client) GetVersion(ctx context.Context) (string, error)
- func (c *Client) LibreOffice() *libreoffice.LibreOffice
- func (c *Client) PDFEngines() *pdfengines.PDFEngines
- func (c *Client) WithCircuitBreaker() *Client
- func (c *Client) WithCircuitBreakerConfig(config CircuitBreakerConfig) *Client
- func (c *Client) WithLogging() *Client
- func (c *Client) WithRateLimit(capacity int, refillRate time.Duration) *Client
- func (c *Client) WithRetry() *Client
- func (c *Client) WithRetryConfig(config RetryConfig) *Client
- type HealthResponse
- type Response
- type RetryConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CircuitBreakerConfig ¶ added in v1.8.7
type CircuitBreakerConfig = httpclient.CircuitBreakerConfig
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a Gotenberg HTTP client that wraps the base HTTP client with Gotenberg-specific functionality for document conversion.
func NewClient ¶
NewClient creates a new Gotenberg client with the given HTTP client and base URL. Returns an error if the base URL is invalid.
func (*Client) GetHealth ¶ added in v1.8.6
func (c *Client) GetHealth(ctx context.Context) (*HealthResponse, error)
GetHealth performs a health check on the Gotenberg service. It returns the overall status and details about each module (e.g., Chromium, LibreOffice).
func (*Client) GetMetrics ¶ added in v1.8.6
func (*Client) GetVersion ¶ added in v1.8.6
func (*Client) LibreOffice ¶ added in v1.7.1
func (c *Client) LibreOffice() *libreoffice.LibreOffice
func (*Client) PDFEngines ¶ added in v1.7.1
func (c *Client) PDFEngines() *pdfengines.PDFEngines
func (*Client) WithCircuitBreaker ¶ added in v1.8.7
WithCircuitBreaker adds circuit breaker middleware with default config
func (*Client) WithCircuitBreakerConfig ¶ added in v1.8.7
func (c *Client) WithCircuitBreakerConfig(config CircuitBreakerConfig) *Client
WithCircuitBreakerConfig adds circuit breaker middleware with custom config
func (*Client) WithLogging ¶ added in v1.8.7
WithLogging adds logging middleware
func (*Client) WithRateLimit ¶ added in v1.8.7
WithRateLimit adds rate limiting middleware
func (*Client) WithRetryConfig ¶ added in v1.8.7
func (c *Client) WithRetryConfig(config RetryConfig) *Client
WithRetryConfig adds retry middleware with custom config
type HealthResponse ¶ added in v1.8.6
type HealthResponse struct {
Status string `json:"status"`
Details map[string]any `json:"details"`
}
HealthResponse represents the response from the health check endpoint.
type RetryConfig ¶ added in v1.8.7
type RetryConfig = httpclient.RetryConfig
Re-export middleware types for easier access.
Directories
¶
| Path | Synopsis |
|---|---|
|
examples
|
|
|
cmd/chromium/converturl
command
|
|
|
cmd/chromium/helloworld
command
|
|
|
cmd/chromium/markdown
command
|
|
|
cmd/chromium/timeout
command
|
|
|
cmd/chromium/trace
command
|
|
|
cmd/chromium/webhook
command
|
|
|
cmd/health
command
|
|
|
cmd/libreoffice/convert
command
|
|
|
cmd/pdfengines/merge
command
|
|
|
internal
|
|
|
chromium
Package chromium provides a client for the Gotenberg Chromium service.
|
Package chromium provides a client for the Gotenberg Chromium service. |
|
gotenberg
Package common provides shared types and constants for Gotenberg client modules.
|
Package common provides shared types and constants for Gotenberg client modules. |
|
libreoffice
Package libreoffice provides a client for the Gotenberg LibreOffice service.
|
Package libreoffice provides a client for the Gotenberg LibreOffice service. |
|
pdfengines
Package pdfengines provides a client for the Gotenberg PDF Engines service.
|
Package pdfengines provides a client for the Gotenberg PDF Engines service. |