documents

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2024 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DOCX         = "docx"
	DOCXMIMEType = "vnd.openxmlformats-officedocument.wordprocessingml.document"
	PDF          = "pdf"
	CSV          = "csv"
	XLSX         = "xlsx"
	XLSXMIMEType = "vnd.openxmlformats-officedocument.spreadsheetml.sheet"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Csv added in v0.3.0

type Csv struct {
	// contains filtered or unexported fields
}

Csv struct implements the File and Document interface from the file package.

func NewCsv added in v0.3.0

func NewCsv(filename string) *Csv

NewCsv returns a pointer to Csv.

func (*Csv) ConvertTo added in v0.3.0

func (c *Csv) ConvertTo(fileType, subType string, file io.Reader) (io.Reader, error)

func (*Csv) DocumentType added in v0.3.0

func (c *Csv) DocumentType() string

func (*Csv) SupportedFormats added in v0.3.0

func (c *Csv) SupportedFormats() map[string][]string

SupportedFormats returns a map witht the compatible formats that CSv is compatible to be converted to.

func (*Csv) SupportedMIMETypes added in v0.3.0

func (c *Csv) SupportedMIMETypes() map[string][]string

SupportedMIMETypes returns a map witht the compatible MIME types that Docx is compatible to be converted to.

type Docx

type Docx struct {
	OutDir string
	// contains filtered or unexported fields
}

Docx struct implements the File and Document interface from the file package.

func NewDocx added in v0.2.0

func NewDocx(filename string) *Docx

NewDocx returns a pointer to Docx.

func (*Docx) ConvertTo

func (d *Docx) ConvertTo(fileType, subType string, file io.Reader) (io.Reader, error)

func (*Docx) DocumentType

func (d *Docx) DocumentType() string

func (*Docx) SupportedFormats

func (d *Docx) SupportedFormats() map[string][]string

SupportedFormats returns a map witht the compatible formats that Docx is compatible to be converted to.

func (*Docx) SupportedMIMETypes added in v0.2.0

func (d *Docx) SupportedMIMETypes() map[string][]string

SupportedMIMETypes returns a map witht the compatible MIME types that Docx is compatible to be converted to.

type Pdf

type Pdf struct {
	OutDir string
	// contains filtered or unexported fields
}

Pdf struct implements the File and Document interface from the file package.

func NewPdf

func NewPdf(filename string) *Pdf

NewPdf returns a pointer to Pdf.

func (*Pdf) ConvertTo

func (p *Pdf) ConvertTo(fileType, subType string, file io.Reader) (io.Reader, error)

ConvertTo converts the current PDF file to another given format. This method receives the file type, the sub-type and the file as an slice of bytes. Returns the converted file as an slice of bytes, if something wrong happens, an error is returned.

func (*Pdf) DocumentType

func (p *Pdf) DocumentType() string

DocumentType returns the type of ducument of Pdf.

func (*Pdf) SupportedFormats

func (p *Pdf) SupportedFormats() map[string][]string

SupportedFormats returns a map witht the compatible formats that Pdf is compatible to be converted to.

func (*Pdf) SupportedMIMETypes added in v0.2.0

func (p *Pdf) SupportedMIMETypes() map[string][]string

SupportedMIMETypes returns a map witht the compatible MIME types that Pdf is compatible to be converted to.

type Xlsx added in v0.3.0

type Xlsx struct {
	// contains filtered or unexported fields
}

Xlsx struct implements the File and Document interface from the file package.

func NewXlsx added in v0.3.0

func NewXlsx(filename string) *Xlsx

NewXlsx returns a pointer to Xlsx.

func (*Xlsx) ConvertTo added in v0.3.0

func (x *Xlsx) ConvertTo(fileType, subType string, file io.Reader) (io.Reader, error)

func (*Xlsx) DocumentType added in v0.3.0

func (x *Xlsx) DocumentType() string

func (*Xlsx) SupportedFormats added in v0.3.0

func (x *Xlsx) SupportedFormats() map[string][]string

SupportedFormats returns a map witht the compatible formats that Xlsx is compatible to be converted to.

func (*Xlsx) SupportedMIMETypes added in v0.3.0

func (x *Xlsx) SupportedMIMETypes() map[string][]string

SupportedMIMETypes returns a map witht the compatible MIME types that Docx is compatible to be converted to.

Jump to

Keyboard shortcuts

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