gotenberg

package
v0.0.0-...-96b67c4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 27, 2019 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package gotenberg is a Gotenberg client with stream (io.Reader) support.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Gotenberg

type Gotenberg struct {
	// contains filtered or unexported fields
}

Gotenberg is a client for Gotenberg server. for more info see: https://github.com/thecodingmachine/gotenberg warning! don't forget to set proper timeouts as you need in Gotenberg server because default ones are too low. ex: - docker run -d -p 4798:3000 --env DEFAULT_WAIT_TIMEOUT=600 --env MAXIMUM_WAIT_TIMEOUT=600 thecodingmachine/gotenberg:6

func New

func New(addr string, options ...Option) *Gotenberg

New creates new Gotenberg client with given Gotenberg server addr and options.

func (*Gotenberg) Convert

func (g *Gotenberg) Convert(name, extension string, file io.Reader) (pdf io.ReadCloser, err error)

Convert converts file with given name and extension to PDF. caller is responsible to Close() PDF stream after done.

func (*Gotenberg) Status

func (g *Gotenberg) Status() (err error)

Status checks if Gotenberg server is running and ready to accept connections. err is returned when Gotenberg server is not running nor ready or can be related to anything else.

type Option

type Option func(*Gotenberg)

Option used to customize Gotenberg defaults.

func ConvertTimeoutOption

func ConvertTimeoutOption(convertTimeout time.Duration) Option

ConversionTimeoutOption sets the timeout for conversion requests. to Gotenberg server.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL