generator

package
v1.9.4 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2023 License: CC0-1.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCSV added in v0.6.0

func NewCSV() *csv

New - to initialize CSV struct object fileName: by default should be "generated-csv.csv"

func NewExcel added in v0.6.0

func NewExcel(options *ExcelOptions) *excel

New - to initialize Excel struct object fileName: by default should be "generated.xlsx"

Types

type Banner struct {
	BgProperty
	// contains filtered or unexported fields
}

func NewBanner added in v0.10.0

func NewBanner(opts ...Options) *Banner

NewBanner - by default will be w: 1200, h: 400, bgColor: white

func (*Banner) AddImageLayer added in v0.10.0

func (b *Banner) AddImageLayer(img *ImageLayer) Banners

func (*Banner) AddLabel added in v0.10.0

func (b *Banner) AddLabel(labelText *Label) Banners

func (*Banner) Generate added in v0.10.0

func (b *Banner) Generate() Banners

func (*Banner) Image added in v1.2.1

func (b *Banner) Image() image.Image

func (*Banner) Save added in v1.2.1

func (b *Banner) Save(destPath string) error

type Banners added in v0.10.0

type Banners interface {
	AddImageLayer(img *ImageLayer) Banners
	AddLabel(labelText *Label) Banners
	Generate() Banners
	Image() image.Image
	Save(destPath string) error
}

type BgProperty added in v0.10.0

type BgProperty struct {
	Width   int
	Height  int
	BgColor color.Color
}

BgProperty is background property struct

type CSVs added in v0.6.0

type CSVs interface {
	SetFileName(fileName string) CSVs
	AppendDataRow(data []string) CSVs
	SetHeader(data []string) CSVs
	Generate() error
}

type ConverterOptions

type ConverterOptions struct {
	PageSize     string
	MarginBottom uint
	MarginTop    uint
	MarginLeft   uint
	MarginRight  uint
}

type ExcelOptions added in v0.6.1

type ExcelOptions struct {
	Source string
	File   interface{}
}

type Excels added in v0.6.0

type Excels interface {
	SetFileName(fileName string) Excels
	GetExcelFile() *excelize.File
	Error() error
	SetSheetName(sheetName string) Excels
	AppendDataRow(data []string) Excels
	SetHeader(data []string) Excels
	ScanContentToStruct(sheetName string, destinationStruct interface{}) error
	GetContents(sheetName string) ([]map[string]string, error)
	GetMergeCell(sheetName string) ([]excelize.MergeCell, error)
	Generate() error
}

type ImageLayer added in v0.10.0

type ImageLayer struct {
	Image image.Image
	XPos  int
	YPos  int
}

ImageLayer is a struct

type Label added in v0.10.0

type Label struct {
	Text        string
	FontPath    string
	FontType    string
	Size        float64
	Color       color.Color
	DPI         float64
	Spacing     float64
	XPos        int
	YPos        int
	RightMargin float64
}

Label is a struct

type Options added in v1.2.1

type Options func(*Banner)

func WithBackgroudColor added in v1.2.1

func WithBackgroudColor(hexColor string) Options

func WithHeight added in v1.2.1

func WithHeight(height int) Options

func WithWidth added in v1.2.1

func WithWidth(width int) Options

type PDF

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

func NewPDF

func NewPDF(options ...*ConverterOptions) (*PDF, error)

func (*PDF) Error

func (c *PDF) Error() error

func (*PDF) Generate

func (c *PDF) Generate() error

func (*PDF) SetFileName

func (c *PDF) SetFileName(fileName *string) PDFs

func (*PDF) SetFooterHTMLTemplate

func (c *PDF) SetFooterHTMLTemplate(footerHTMLPath string) PDFs

func (*PDF) SetTemplate

func (c *PDF) SetTemplate(templatePath string, data interface{}) PDFs

type PDFs

type PDFs interface {
	SetTemplate(templatePath string, data interface{}) PDFs
	SetFooterHTMLTemplate(footerHTMLPath string) PDFs
	SetFileName(fileName *string) PDFs
	Generate() error
	Error() error
}

type QR

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

func (*QR) Generate

func (q *QR) Generate() error

func (*QR) SetFileName

func (q *QR) SetFileName(fileName *string) QRs

func (*QR) SetLogoImg

func (q *QR) SetLogoImg(logoPath string) QRs

type QRs

type QRs interface {
	SetLogoImg(logoPath string) QRs
	SetFileName(fileName *string) QRs
	Generate() error
}

func NewQR

func NewQR(content string) (QRs, error)

Jump to

Keyboard shortcuts

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