Documentation
¶
Overview ¶
Package common provides shared types and constants for Gotenberg client modules.
Index ¶
- type Gotenberg
- func (r *Gotenberg) Bool(fieldName string, value bool) *Gotenberg
- func (r *Gotenberg) DownloadFrom(url string, headers map[string]string) *Gotenberg
- func (r *Gotenberg) File(fieldName, filename string, content io.Reader) *Gotenberg
- func (r *Gotenberg) Float(fieldName string, value float64) *Gotenberg
- func (r *Gotenberg) Header(key, value string) *Gotenberg
- func (r *Gotenberg) Metadata(key, value string) *Gotenberg
- func (r *Gotenberg) OutputFilename(filename string) *Gotenberg
- func (r *Gotenberg) Param(key, value string) *Gotenberg
- func (r *Gotenberg) Send() (*Response, error)
- func (r *Gotenberg) Timeout(duration time.Duration) *Gotenberg
- func (r *Gotenberg) Trace(trace string) *Gotenberg
- func (r *Gotenberg) WebhookErrorURL(url, method string) *Gotenberg
- func (r *Gotenberg) WebhookHeader(key, value string) *Gotenberg
- func (r *Gotenberg) WebhookURL(url, method string) *Gotenberg
- type Response
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Gotenberg ¶
type Gotenberg struct {
Client *httpclient.Client
Req *httpclient.Multipart
Wh map[string]string
Meta map[string]string
Df []downloadFrom
}
Gotenberg provides common functionality for building Gotenberg requests. It wraps the underlying multipart request and provides shared methods.
func NewGotenberg ¶
func NewGotenberg(client *httpclient.Client) *Gotenberg
NewGotenberg creates a new RequestBuilder with the given client.
func (*Gotenberg) DownloadFrom ¶
DownloadFrom sets the download from configuration.
func (*Gotenberg) OutputFilename ¶
OutputFilename sets the output filename.
func (*Gotenberg) Send ¶
Send executes the request and returns the response. It handles common fields like webhook headers, downloadFrom, and metadata.
func (*Gotenberg) Trace ¶
Trace sets the request trace identifier for debugging and monitoring. If not set, Gotenberg will assign a unique UUID trace.
func (*Gotenberg) WebhookErrorURL ¶
WebhookErrorURL sets the webhook URL and HTTP method for failed operations.
func (*Gotenberg) WebhookHeader ¶
WebhookHeader adds a custom header to be sent with webhook requests. Multiple headers can be added by calling this method multiple times.
func (*Gotenberg) WebhookURL ¶
WebhookURL sets the webhook URL and HTTP method for successful operations.