xvdoc

package module
v0.0.0-...-42db062 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2023 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppendCellConstructor

func AppendCellConstructor(constructor CellConstructor)

func Export

func Export(format string, docs []*XVDoc) ([]byte, error)

func ImportXLSXToJSON

func ImportXLSXToJSON(r io.Reader) (res []byte, err error)

func ImportXLSXToJSONFromFile

func ImportXLSXToJSONFromFile(fileName string) (res []byte, err error)

Types

type Cell

type Cell interface {
	Val() interface{}
	Type() string
	Styles() []string
}

type CellArg

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

CellArg is argument object of cell

func (CellArg) Coords

func (s CellArg) Coords(x, y int) (dx, dy int)

Coords calculate real argument coords by current args

func (CellArg) String

func (s CellArg) String() string

func (CellArg) Value

func (s CellArg) Value() interface{}

Value is getter of argument value

type CellConstructor

type CellConstructor func(*json.Decoder, json.Token) (Cell, error)

type CellFloat

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

func (*CellFloat) String

func (s *CellFloat) String() string

func (*CellFloat) Styles

func (s *CellFloat) Styles() []string

func (*CellFloat) Type

func (s *CellFloat) Type() string

func (*CellFloat) Val

func (s *CellFloat) Val() interface{}

type CellFormula

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

CellFormula is cell of formula for excel or other types with formula support

func (*CellFormula) ReplaceArgs

func (s *CellFormula) ReplaceArgs(args []string) (res string)

ReplaceArgs is replace variable templates ($1, $2, etc) to valus from incoming array

func (*CellFormula) String

func (s *CellFormula) String() string

func (*CellFormula) Styles

func (s *CellFormula) Styles() (res []string)

Style is getter of cell style

func (*CellFormula) Type

func (s *CellFormula) Type() string

Type method is value type getter (formula)

func (*CellFormula) Val

func (s *CellFormula) Val() interface{}

Val is method of getter formula string (Cell interface)

type CellInteger

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

CellInteger is cell with integer type value

func (*CellInteger) String

func (s *CellInteger) String() string

func (*CellInteger) Styles

func (s *CellInteger) Styles() []string

func (*CellInteger) Type

func (s *CellInteger) Type() string

Type method is value type getter

func (*CellInteger) Val

func (s *CellInteger) Val() interface{}

Val method is value getter

type CellObj

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

func (*CellObj) String

func (s *CellObj) String() string

func (*CellObj) Styles

func (s *CellObj) Styles() (res []string)

func (*CellObj) Type

func (s *CellObj) Type() string

func (*CellObj) Val

func (s *CellObj) Val() interface{}

type CellString

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

func (*CellString) String

func (s *CellString) String() string

func (*CellString) Styles

func (s *CellString) Styles() []string

func (*CellString) Type

func (s *CellString) Type() string

func (*CellString) Val

func (s *CellString) Val() interface{}

type ExportMethod

type ExportMethod func(matrix []Matrix) ([]byte, error)

type JSONMap

type JSONMap map[string]interface{}

func (JSONMap) Array

func (s JSONMap) Array(key string) (res []interface{})

func (JSONMap) Bool

func (s JSONMap) Bool(key string, defaultVal bool) bool

func (JSONMap) Copy

func (s JSONMap) Copy() JSONMap

func (JSONMap) Int

func (s JSONMap) Int(key string, defaultVal int64) int64

func (JSONMap) Interface

func (s JSONMap) Interface(key string) interface{}

func (JSONMap) JSON

func (s JSONMap) JSON() (res []byte)

func (JSONMap) JSONMap

func (s JSONMap) JSONMap(key string) (res JSONMap)

func (JSONMap) KeyExists

func (s JSONMap) KeyExists(key string) (check bool)

func (JSONMap) Map

func (s JSONMap) Map() map[string]interface{}

func (JSONMap) StringArray

func (s JSONMap) StringArray(key string) (res []string)

func (JSONMap) StringVal

func (s JSONMap) StringVal(key, defaultVal string) string

func (JSONMap) ToGraphicOptions

func (s JSONMap) ToGraphicOptions() (res *excelize.GraphicOptions)

func (JSONMap) ToStyle

func (s JSONMap) ToStyle() (res *excelize.Style)

func (JSONMap) Value

func (s JSONMap) Value(key string, defaultVal interface{}) interface{}

type Matrix

type Matrix struct {
	Name         string
	Cells        [][]Cell
	RowsHeight   map[int]float64
	Styles       map[string]Style
	RowsStyle    map[int]JSONMap
	Style        string
	StyleRects   []*styleRect
	Dropdowns    []*dropDown
	Merges       []*rectMerge
	Images       []*cellImage
	ColumnsWidth []*rectWidths
}

type ObjConstructor

type ObjConstructor func(JSONMap) (Cell, error)

type Row

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

func (*Row) Height

func (s *Row) Height() float64

func (*Row) IsCustomHeight

func (s *Row) IsCustomHeight() bool

func (*Row) String

func (s *Row) String() (res string)

func (*Row) Styles

func (s *Row) Styles() (res []string)

func (*Row) UnmarshalJSON

func (s *Row) UnmarshalJSON(src []byte) (err error)

type Sheet

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

func ImportXLSX

func ImportXLSX(r io.Reader) (res []*Sheet, err error)

func ImportXLSXFromFile

func ImportXLSXFromFile(fileName string) (res []*Sheet, err error)

func (*Sheet) MarshalJSON

func (s *Sheet) MarshalJSON() ([]byte, error)

func (*Sheet) String

func (s *Sheet) String() string

type Style

type Style struct {
	JSONMap
}

func (*Style) Result

func (s *Style) Result(m map[string]Style, childName string, cLevel ...int) (res JSONMap, err error)

func (*Style) UnmarshalJSON

func (s *Style) UnmarshalJSON(src []byte) (err error)

type XVDoc

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

func FromJSON

func FromJSON(src []byte) (res []*XVDoc, err error)

func (*XVDoc) String

func (s *XVDoc) String() (res string)

func (*XVDoc) UnmarshalJSON

func (s *XVDoc) UnmarshalJSON(src []byte) (err error)

Jump to

Keyboard shortcuts

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