eio

package
v1.6.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 7, 2024 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PDF  Format = "pdf"
	ODT  Format = "odt"
	DOCX Format = "docx"
	DOC  Format = "doc"

	Linux  OSArchType = "linux_x86_64"
	Win64  OSArchType = "win_x86_64"
	Win32  OSArchType = "win_x86"
	Darwin OSArchType = "mac_x86_64"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type DocumentServiceClient

type DocumentServiceClient struct{ Url string }

func (*DocumentServiceClient) Compile

func (ds *DocumentServiceClient) Compile(db storage.FilesIF, template Template) (resp *http.Response, err error)

Compile packs the provided files into a ZIP and sends it to the document-service to be compiled as the format you have provided. if format is empty, it will take the default one which is PDF.

func (*DocumentServiceClient) DownloadExtension

func (ds *DocumentServiceClient) DownloadExtension(arch string) (resp *http.Response, err error)

Download the template assistance extension for your writer.

func (*DocumentServiceClient) Vars

func (ds *DocumentServiceClient) Vars(templateBuf *bytes.Buffer) ([]string, error)

Vars returns a list of the vars contained in the provided template. You can filter them with the prefix if needed.

type Format

type Format string

func (Format) String

func (f Format) String() string

type OSArchType

type OSArchType string

func (OSArchType) String

func (f OSArchType) String() string

type Template

type Template struct {
	Format       Format      //the result format, default PDF
	Data         interface{} //the data the template is going to resolved with
	TemplatePath string      //odt template
	Assets       []string    //assets that are referenced in Data and you want to include into the ZIP
	EmbedError   bool        //print compilation error in the document
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL