Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrPlaceholderWithWhitespaces = utils.ErrPlaceholderWithWhitespaces ErrTemplatePlaceholdersNotFound = utils.ErrTemplatePlaceholdersNotFound ErrBadTemplate = utils.ErrBadTemplate ErrValidation = errors.New("error while validating input data") ErrIncompatible = errors.New("placeholders in template doesn't match with placeholders in data") ErrBadData = errors.New("data is bad, make sure it matches with json structure descripted in go-yadt documentation") ErrDataWithDifferentFields = errors.New("not all pageData's in data have the same fields, make sure they are similar") ErrFileDataWithoutPages = errors.New("file does not have any page data") )
Functions ¶
This section is empty.
Types ¶
type FileGenerator ¶
type FileGenerator struct {
// contains filtered or unexported fields
}
func NewFromBytes ¶ added in v0.2.0
func NewFromBytes(templateBytes []byte, jsonBytes []byte) (*FileGenerator, error)
FileGenerator constructor. Takes template and json data in byte slices.
func NewFromFiles ¶ added in v0.2.0
func NewFromFiles(templateFilename string, jsonFilename string) (*FileGenerator, error)
FileGenerator constructor. Takes template and json data filenames and read them.
func (*FileGenerator) GenerateZip ¶
func (s *FileGenerator) GenerateZip(path string) error
Generates docx files and packs them into zip file at the specified path.
Click to show internal directories.
Click to hide internal directories.