# Packages
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
# README
BlazingDocs GO client
High-performance document generation API. Generate documents and reports from СSV, JSON, XML with 99,9% uptime and 24/7 monitoring.
Installation
import (
"github.com/blazingdocs/blazingdocs-go"
"github.com/blazingdocs/blazingdocs-go/config"
)
go get -u github.com/blazingdocs/blazingdocs-go
Integration basics
Setup
You can get your API Key at https://app.blazingdocs.com
config.Default = config.Init("YOUR-API-KEY")
client := blazingdocs.Client{
Config: *config.Default,
}
Getting account info
resp, err := client.GetAccount()
Getting merge templates list
var s string
tempResp, tempErr := client.GetTemplates(s)
Getting usage info
usageResp, usageErr := client.GetUsage()
Executing merge
file, _ := ioutil.ReadFile("../PO-Template.json")
s := string(file)
params := parameters.MergeParameters{
DataSourceName: "data", // data source name
DataSourceType: utils.JSON_TYPE, // data in json format
Strict: true, // keep json types
ParseColumns: false, // true if data is csv file with column names
Sequence: false, // data is object
}
ffile, _ := os.Open("../PO-Template.docx")
formFile := utils.FormFile{
Name: "PO-Template.docx",
Content: ffile,
}
config.Default = config.Init("YOUR-API-KEY")
client := blazingdocs.Client{
Config: *config.Default,
}
resp, err := client.MergeWithFile(s, "output.pdf", params, formFile)
Documentation
See more details here https://docs.blazingdocs.com