Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DocTemplate ¶
DocTemplate struct combines data and methods from both the Document interface and golang's templating library
func GetTemplate ¶
func GetTemplate(filePath string) (*DocTemplate, error)
GetTemplate uses the file extension to determin the correct document struct to use
func GetTemplateFromBase64 ¶
func GetTemplateFromBase64(b64 string) (*DocTemplate, error)
func (*DocTemplate) AddFunctions ¶
func (docTemplate *DocTemplate) AddFunctions(funcMap template.FuncMap)
AddFunctions adds functions to the template
func (*DocTemplate) Execute ¶
func (docTemplate *DocTemplate) Execute(exportPath string, data interface{}) error
Execute func runs the template and sends the output to the export path
func (*DocTemplate) ExecuteToBytes ¶
func (docTemplate *DocTemplate) ExecuteToBytes(data interface{}) ([]byte, error)
type Document ¶
type Document interface { LoadFileFromBase64(b64 string) error ReadFile(string) error UpdateContent(string) GetContent() string WriteToFile(string, string) error WriteToBytes(*bytes.Buffer, string) error Close() error }
Document interface is a combintation of methods use for generic data files
Click to show internal directories.
Click to hide internal directories.