Skip to content
This repository has been archived by the owner on Apr 14, 2024. It is now read-only.

Releases: thecodingmachine/gotenberg-go-client

7.2.0

14 Jun 16:47
6e52fa8
Compare
Choose a tag to compare

This release adds the following methods:

func (c *Client) PostContext(ctx context.Context, req Request) (*http.Response, error)
func (c *Client) StoreContext(ctx context.Context, req Request, dest string) error

Thanks @ungerik

7.1.0

10 Feb 09:20
Compare
Choose a tag to compare

This release upgrades the client for Gotenberg 6.2.0 - thanks @mdjward

New feature

Scale

req := NewURLRequest("http://google.com")
req.Scale(0.75)

7.0.1

16 Dec 08:57
Compare
Choose a tag to compare

Header and footer were not added to the request (fixes #13 - thanks @spdrcd for the help!)

7.0.0

10 Dec 15:16
2fd4d87
Compare
Choose a tag to compare

This release upgrades the client for Gotenberg 6.1.0.

New features

Custom HTTP headers

# remote URL
req := NewURLRequest("http://google.com")
req.AddRemoteURLHTTPHeader("A-Header", "Foo")

# webhook URL
req := NewURLRequest("http://google.com")
req.WebhookURL("https://a-site.com/webhook")
req.AddWebhookURLHTTPHeader("A-Header", "Foo")

Page ranges

req := NewURLRequest("http://google.com")
req.PageRanges("1-1")

Document from a path, raw text, bytes (breaking change)

Before:

req, _ := gotenberg.NewHTMLRequest("index.html")

Now:

// from a path.
index, _ := gotenberg.NewDocumentFromPath("index.html", "/path/to/file")
// ... or from a string.
index, _ := gotenberg.NewDocumentFromString("index.html", "<html>Foo</html>")
// ... or from bytes.
index, _ := gotenberg.NewDocumentFromBytes("index.html", []byte("<html>Foo</html>"))

req := gotenberg.NewHTMLRequest(index)

Fixes #9.

Specify your own HTTP client

Before:

client := &gotenberg.Client{Hostname: "http://localhost:3000"}

Now:

client := &gotenberg.Client{Hostname: "http://localhost:3000"}
// ... or use your own *http.Client.
httpClient := &http.Client{
    Timeout: time.Duration(5) * time.Second,
}
client := &gotenberg.Client{Hostname: "http://localhost:3000", HTTPClient: httpClient}

Fixes #11.

Improvements

  • Improved README

6.0.2

09 Oct 18:27
921a34c
Compare
Choose a tag to compare

This release fixes the function func (c *Client) Store(req Request, dest string) error.

It now returns an error if response code from the API is not 200.

Thanks @chetanyakan 👍

6.0.1

07 Oct 16:31
6de9f02
Compare
Choose a tag to compare

This release upgrades the client for Gotenberg 6.0.1.

6.0.0

07 Oct 16:36
Compare
Choose a tag to compare

This release upgrades the client for Gotenberg 6.0.0.

5.0.1

17 Apr 11:40
Compare
Choose a tag to compare

This releases fixes the go.mod and go .sum files with go mod tidy.

5.0.0

14 Apr 15:38
cbf5207
Compare
Choose a tag to compare

This release upgrades the client for Gotenberg 5.0.0.

Breaking changes

  • Setters have been renamed to be more go like. For instance: SetHeader now becomes Header.

4.3.1

19 Mar 07:56
Compare
Choose a tag to compare

This release fixes an issue when no header or footer are set for HTML based conversion.