bannerify-go is the Bannerify client for Go. It takes a context.Context on each request and returns errors as values.
Install
Create a client
You need an API key. Create one on the API Keys page of the dashboard and keep it on the server.Generate an image
EveryModification field except Name is a pointer. The examples build them with this helper:
result.Result is a []byte that holds the image.
Methods
Render videos covers the video methods. The Go SDK has no method for stored images. Call Create stored image over REST.
Create images and PDFs covers the first two, and Signed URL covers the last one.
Handle errors
CreateImage and CreatePDF return a *Response. Check Error before you read Result.
HTTP_ERROR. For CreateImage the message holds the status and the response body, which is the JSON error object from the API. For CreatePDF the message holds the status only.
The SDK creates a few other errors itself.
GenerateImageSignedURL returns an error when the format is not supported.
Options
Pass options toNewClient after the API key.