Documentation ¶
Overview ¶
Package gotenberg is a Go client for interacting with a Gotenberg API.
For more complete usages, head to the documentation: https://thecodingmachine.github.io/gotenberg/
Index ¶
- Variables
- type Client
- type HTMLRequest
- func (req *HTMLRequest) Assets(fpaths ...string) error
- func (req HTMLRequest) Footer(fpath string) error
- func (req HTMLRequest) GoogleChromeRpccBufferSize(bufferSize int64)
- func (req HTMLRequest) Header(fpath string) error
- func (req HTMLRequest) Landscape(isLandscape bool)
- func (req HTMLRequest) Margins(margins [4]float64)
- func (req HTMLRequest) PaperSize(size [2]float64)
- func (req HTMLRequest) WaitDelay(delay float64)
- type MarkdownRequest
- func (req *MarkdownRequest) Assets(fpaths ...string) error
- func (req MarkdownRequest) Footer(fpath string) error
- func (req MarkdownRequest) GoogleChromeRpccBufferSize(bufferSize int64)
- func (req MarkdownRequest) Header(fpath string) error
- func (req MarkdownRequest) Landscape(isLandscape bool)
- func (req MarkdownRequest) Margins(margins [4]float64)
- func (req MarkdownRequest) PaperSize(size [2]float64)
- func (req MarkdownRequest) WaitDelay(delay float64)
- type MergeRequest
- type OfficeRequest
- type Request
- type URLRequest
- func (req URLRequest) Footer(fpath string) error
- func (req URLRequest) GoogleChromeRpccBufferSize(bufferSize int64)
- func (req URLRequest) Header(fpath string) error
- func (req URLRequest) Landscape(isLandscape bool)
- func (req URLRequest) Margins(margins [4]float64)
- func (req URLRequest) PaperSize(size [2]float64)
- func (req URLRequest) WaitDelay(delay float64)
Constants ¶
This section is empty.
Variables ¶
var ( // A3 paper size. A3 = [2]float64{11.7, 16.5} // A4 paper size. A4 = [2]float64{8.27, 11.7} // A5 paper size. A5 = [2]float64{5.8, 8.3} // A6 paper size. A6 = [2]float64{4.1, 5.8} // Letter paper size. Letter = [2]float64{8.5, 11} // Legal paper size. Legal = [2]float64{8.5, 14} // Tabloid paper size. Tabloid = [2]float64{11, 17} )
nolint: gochecknoglobals
var ( // NoMargins removes margins. NoMargins = [4]float64{0, 0, 0, 0} // NormalMargins uses 1 inche margins. NormalMargins = [4]float64{1, 1, 1, 1} // LargeMargins uses 2 inche margins. LargeMargins = [4]float64{2, 2, 2, 2} )
nolint: gochecknoglobals
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
Hostname string
}
Client facilitates interacting with the Gotenberg API.
func (*Client) Healthy ¶ added in v6.0.7
Healthy returns true if the gotenberg server at c.Hostname is healthy, false otherwise.
type HTMLRequest ¶
type HTMLRequest struct {
// contains filtered or unexported fields
}
HTMLRequest facilitates HTML conversion with the Gotenberg API.
func NewHTMLRequest ¶
func NewHTMLRequest(indexFilePath string) (*HTMLRequest, error)
NewHTMLRequest create HTMLRequest.
func (*HTMLRequest) Assets ¶
func (req *HTMLRequest) Assets(fpaths ...string) error
Assets sets assets form files.
func (HTMLRequest) GoogleChromeRpccBufferSize ¶
func (req HTMLRequest) GoogleChromeRpccBufferSize(bufferSize int64)
GoogleChromeRpccBufferSize sets googleChromeRpccBufferSize form field.
func (HTMLRequest) Landscape ¶
func (req HTMLRequest) Landscape(isLandscape bool)
Landscape sets landscape form field.
func (HTMLRequest) Margins ¶
func (req HTMLRequest) Margins(margins [4]float64)
Margins sets marginTop, marginBottom, marginLeft and marginRight form fields.
type MarkdownRequest ¶
type MarkdownRequest struct {
// contains filtered or unexported fields
}
MarkdownRequest facilitates Markdown conversion with the Gotenberg API.
func NewMarkdownRequest ¶
func NewMarkdownRequest(indexFilePath string, markdownFilePaths ...string) (*MarkdownRequest, error)
NewMarkdownRequest create MarkdownRequest.
func (*MarkdownRequest) Assets ¶
func (req *MarkdownRequest) Assets(fpaths ...string) error
Assets sets assets form files.
func (MarkdownRequest) GoogleChromeRpccBufferSize ¶
func (req MarkdownRequest) GoogleChromeRpccBufferSize(bufferSize int64)
GoogleChromeRpccBufferSize sets googleChromeRpccBufferSize form field.
func (MarkdownRequest) Landscape ¶
func (req MarkdownRequest) Landscape(isLandscape bool)
Landscape sets landscape form field.
func (MarkdownRequest) Margins ¶
func (req MarkdownRequest) Margins(margins [4]float64)
Margins sets marginTop, marginBottom, marginLeft and marginRight form fields.
type MergeRequest ¶
type MergeRequest struct {
// contains filtered or unexported fields
}
MergeRequest facilitates merging PDF with the Gotenberg API.
func NewMergeRequest ¶
func NewMergeRequest(fpaths ...string) (*MergeRequest, error)
NewMergeRequest create MergeRequest.
func (MergeRequest) ResultFilename ¶
func (req MergeRequest) ResultFilename(filename string)
ResultFilename sets resultFilename form field.
func (MergeRequest) WaitTimeout ¶
func (req MergeRequest) WaitTimeout(timeout float64)
WaitTiemout sets waitTimeout form field.
func (MergeRequest) WebhookURL ¶
func (req MergeRequest) WebhookURL(url string)
WebhookURL sets webhookURL form field.
func (MergeRequest) WebhookURLTimeout ¶
func (req MergeRequest) WebhookURLTimeout(timeout float64)
WebhookURLTimeout sets webhookURLTimeout form field.
type OfficeRequest ¶
type OfficeRequest struct {
// contains filtered or unexported fields
}
OfficeRequest facilitates Office documents conversion with the Gotenberg API.
func NewOfficeRequest ¶
func NewOfficeRequest(filename string, fileReader io.Reader) (*OfficeRequest, error)
NewOfficeRequest create OfficeRequest.
func NewOfficeRequestWithBuffer ¶ added in v6.0.6
func NewOfficeRequestWithBuffer(filename string, fileReader io.Reader, readerCopyBuffer []byte) (*OfficeRequest, error)
NewOfficeRequestWithBuffer create OfficeRequest.
func (*OfficeRequest) Landscape ¶
func (req *OfficeRequest) Landscape(isLandscape bool)
Landscape sets landscape form field.
func (OfficeRequest) ResultFilename ¶
func (req OfficeRequest) ResultFilename(filename string)
ResultFilename sets resultFilename form field.
func (OfficeRequest) WaitTimeout ¶
func (req OfficeRequest) WaitTimeout(timeout float64)
WaitTiemout sets waitTimeout form field.
func (OfficeRequest) WebhookURL ¶
func (req OfficeRequest) WebhookURL(url string)
WebhookURL sets webhookURL form field.
func (OfficeRequest) WebhookURLTimeout ¶
func (req OfficeRequest) WebhookURLTimeout(timeout float64)
WebhookURLTimeout sets webhookURLTimeout form field.
type Request ¶
type Request interface {
// contains filtered or unexported methods
}
Request is a type for sending form values and form files to the Gotenberg API.
type URLRequest ¶
type URLRequest struct {
// contains filtered or unexported fields
}
URLRequest facilitates remote URL conversion with the Gotenberg API.
func (URLRequest) GoogleChromeRpccBufferSize ¶
func (req URLRequest) GoogleChromeRpccBufferSize(bufferSize int64)
GoogleChromeRpccBufferSize sets googleChromeRpccBufferSize form field.
func (URLRequest) Landscape ¶
func (req URLRequest) Landscape(isLandscape bool)
Landscape sets landscape form field.
func (URLRequest) Margins ¶
func (req URLRequest) Margins(margins [4]float64)
Margins sets marginTop, marginBottom, marginLeft and marginRight form fields.