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 ChromeRequest
- type Client
- type HTMLRequest
- func (html *HTMLRequest) SetAssets(fpaths ...string) error
- func (html *HTMLRequest) SetFooter(fpath string) error
- func (html *HTMLRequest) SetHeader(fpath string) error
- func (html *HTMLRequest) SetLandscape(isLandscape bool)
- func (html *HTMLRequest) SetMargins(margins [4]float64)
- func (html *HTMLRequest) SetPaperSize(size [2]float64)
- func (html *HTMLRequest) SetWebFontsTimeout(timeout int64)
- func (html *HTMLRequest) SetWebhookURL(webhookURL string)
- type MarkdownRequest
- func (markdown *MarkdownRequest) SetAssets(fpaths ...string) error
- func (markdown *MarkdownRequest) SetFooter(fpath string) error
- func (markdown *MarkdownRequest) SetHeader(fpath string) error
- func (markdown *MarkdownRequest) SetLandscape(isLandscape bool)
- func (markdown *MarkdownRequest) SetMargins(margins [4]float64)
- func (markdown *MarkdownRequest) SetPaperSize(size [2]float64)
- func (markdown *MarkdownRequest) SetWebFontsTimeout(timeout int64)
- func (markdown *MarkdownRequest) SetWebhookURL(webhookURL string)
- type MergeRequest
- type OfficeRequest
- type Request
- type URLRequest
- func (url *URLRequest) SetFooter(fpath string) error
- func (url *URLRequest) SetHeader(fpath string) error
- func (url *URLRequest) SetLandscape(isLandscape bool)
- func (url *URLRequest) SetMargins(margins [4]float64)
- func (url *URLRequest) SetPaperSize(size [2]float64)
- func (url *URLRequest) SetWebFontsTimeout(timeout int64)
- func (url *URLRequest) SetWebhookURL(webhookURL string)
- type UnoconvRequest
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} )
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} )
Functions ¶
This section is empty.
Types ¶
type ChromeRequest ¶
type ChromeRequest interface {
SetHeader(fpath string) error
SetPaperSize(size [2]float64)
SetMargins(margins [4]float64)
SetLandscape(isLandscape bool)
SetWebFontsTimeout(timeout int64)
}
ChromeRequest is a type for sending conversion requests which will be handle by Google Chrome.
type Client ¶
type Client struct {
Hostname string
}
Client facilitates interacting with the Gotenberg API.
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) SetAssets ¶
func (html *HTMLRequest) SetAssets(fpaths ...string) error
SetAssets sets assets form files.
func (*HTMLRequest) SetFooter ¶
func (html *HTMLRequest) SetFooter(fpath string) error
SetFooter sets footer form file.
func (*HTMLRequest) SetHeader ¶
func (html *HTMLRequest) SetHeader(fpath string) error
SetHeader sets header form file.
func (*HTMLRequest) SetLandscape ¶
func (html *HTMLRequest) SetLandscape(isLandscape bool)
SetLandscape sets landscape form field.
func (*HTMLRequest) SetMargins ¶
func (html *HTMLRequest) SetMargins(margins [4]float64)
SetMargins sets marginTop, marginBottom, marginLeft and marginRight form fields.
func (*HTMLRequest) SetPaperSize ¶
func (html *HTMLRequest) SetPaperSize(size [2]float64)
SetPaperSize sets paperWidth and paperHeight form fields.
func (*HTMLRequest) SetWebFontsTimeout ¶
func (html *HTMLRequest) SetWebFontsTimeout(timeout int64)
SetWebFontsTimeout sets webFontsTimeout form field.
func (*HTMLRequest) SetWebhookURL ¶
func (html *HTMLRequest) SetWebhookURL(webhookURL string)
SetWebhookURL sets webhookURL form field.
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) SetAssets ¶
func (markdown *MarkdownRequest) SetAssets(fpaths ...string) error
SetAssets sets assets form files.
func (*MarkdownRequest) SetFooter ¶
func (markdown *MarkdownRequest) SetFooter(fpath string) error
SetFooter sets footer form file.
func (*MarkdownRequest) SetHeader ¶
func (markdown *MarkdownRequest) SetHeader(fpath string) error
SetHeader sets header form file.
func (*MarkdownRequest) SetLandscape ¶
func (markdown *MarkdownRequest) SetLandscape(isLandscape bool)
SetLandscape sets landscape form field.
func (*MarkdownRequest) SetMargins ¶
func (markdown *MarkdownRequest) SetMargins(margins [4]float64)
SetMargins sets marginTop, marginBottom, marginLeft and marginRight form fields.
func (*MarkdownRequest) SetPaperSize ¶
func (markdown *MarkdownRequest) SetPaperSize(size [2]float64)
SetPaperSize sets paperWidth and paperHeight form fields.
func (*MarkdownRequest) SetWebFontsTimeout ¶
func (markdown *MarkdownRequest) SetWebFontsTimeout(timeout int64)
SetWebFontsTimeout sets webFontsTimeout form field.
func (*MarkdownRequest) SetWebhookURL ¶
func (markdown *MarkdownRequest) SetWebhookURL(webhookURL string)
SetWebhookURL sets webhookURL form field.
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) SetWebhookURL ¶
func (merge *MergeRequest) SetWebhookURL(webhookURL string)
SetWebhookURL sets webhookURL 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(fpaths ...string) (*OfficeRequest, error)
NewOfficeRequest create OfficeRequest.
func (*OfficeRequest) SetLandscape ¶
func (office *OfficeRequest) SetLandscape(isLandscape bool)
SetLandscape sets landscape form field.
func (*OfficeRequest) SetWebhookURL ¶
func (office *OfficeRequest) SetWebhookURL(webhookURL string)
SetWebhookURL sets webhookURL form field.
type Request ¶
type Request interface {
SetWebhookURL(webhookURL string)
// 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) SetFooter ¶
func (url *URLRequest) SetFooter(fpath string) error
SetFooter sets footer form file.
func (*URLRequest) SetHeader ¶
func (url *URLRequest) SetHeader(fpath string) error
SetHeader sets header form file.
func (*URLRequest) SetLandscape ¶
func (url *URLRequest) SetLandscape(isLandscape bool)
SetLandscape sets landscape form field.
func (*URLRequest) SetMargins ¶
func (url *URLRequest) SetMargins(margins [4]float64)
SetMargins sets marginTop, marginBottom, marginLeft and marginRight form fields.
func (*URLRequest) SetPaperSize ¶
func (url *URLRequest) SetPaperSize(size [2]float64)
SetPaperSize sets paperWidth and paperHeight form fields.
func (*URLRequest) SetWebFontsTimeout ¶
func (url *URLRequest) SetWebFontsTimeout(timeout int64)
SetWebFontsTimeout sets webFontsTimeout form field.
func (*URLRequest) SetWebhookURL ¶
func (url *URLRequest) SetWebhookURL(webhookURL string)
SetWebhookURL sets webhookURL form field.
type UnoconvRequest ¶
type UnoconvRequest interface {
SetLandscape(landscape bool)
}
UnoconvRequest is a type for sending conversion requests which will be handle by unoconv.