Documentation ¶
Index ¶
- func ExportRichFrames(data map[string]RichFrame, outExcelFile, excelDefFile string, opts *Options) error
- func ExportRichFramesByTemp(data map[string]RichFrame, outExcelFile, tmpExcelFile, excelDefFile string, ...) error
- func ExportToFile(data map[string][]map[string]interface{}, outExcelFile, excelDefFile string, ...) error
- func LoadFromFile(excelFile, excelDefFile string, opts *Options) (map[string]RichFrame, error)
- func LoadRichFrames(excelFile, excelDefFile string, opts *Options) (map[string]RichFrame, error)
- func LoadXlsxFileDef(in io.Reader, def *XlsxFileDef) error
- func Marshal(outFilePath string, input interface{}, def *XlsxFileDef) error
- func MarshalByTemp(outFilePath, tmpExcelFile string, input interface{}, def *XlsxFileDef) error
- func MatchGroup(left RichMap, right RichMap, leftBys []string, rightBys []string) bool
- func ParseExcelDate(valueStr string, ops interface{}) (interface{}, error)
- func ParseFloat(valueStr string, ops interface{}) (interface{}, error)
- func ParseInt(valueStr string, ops interface{}) (interface{}, error)
- func ParseString(valueStr string, ops interface{}) (interface{}, error)
- func PrepareRow(values []string, columns *Columns) map[string]interface{}
- func SaveCSV(csvpath string, rf RichFrame, keys []string, isAppend bool) error
- func Unmarshal(xslxFile string, result interface{}, def *XlsxFileDef, opts *Options) error
- type AggregateFunc
- type ApplyFunc
- type Columns
- type CompareFunc
- type FieldDef
- type FilterFunc
- type MutateFunc
- type Options
- type ParseDataFunc
- type ParseDataFuncFactory
- type RichFrame
- func (rf RichFrame) Aggregate(groupBy []string, cols []string, funcs []AggregateFunc) RichFrame
- func (rf RichFrame) Apply(f ApplyFunc) RichFrame
- func (rf RichFrame) Col(col string) []interface{}
- func (rf RichFrame) Del(old string) RichFrame
- func (rf RichFrame) Distinct(col string) []interface{}
- func (rf RichFrame) Filter(f FilterFunc) RichFrame
- func (rf RichFrame) Join(rights RichFrame, leftBys []string, rightBys []string, ...)
- func (rf RichFrame) Mutate(title string, f MutateFunc) RichFrame
- func (rf RichFrame) OrderByInt(rowKey string) RichFrame
- func (rf RichFrame) Rename(old string, new string) RichFrame
- func (rf RichFrame) Sort(f CompareFunc) RichFrame
- func (rf RichFrame) String() string
- func (rf RichFrame) Unique(col string) RichFrame
- type RichMap
- type SheetDef
- type XlsxFileDef
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExportRichFrames ¶
func ExportRichFramesByTemp ¶ added in v1.0.3
func ExportToFile ¶
func LoadFromFile ¶
func LoadRichFrames ¶
func LoadXlsxFileDef ¶
func LoadXlsxFileDef(in io.Reader, def *XlsxFileDef) error
func Marshal ¶
func Marshal(outFilePath string, input interface{}, def *XlsxFileDef) error
func MarshalByTemp ¶ added in v1.0.3
func MarshalByTemp(outFilePath, tmpExcelFile string, input interface{}, def *XlsxFileDef) error
func MatchGroup ¶
func ParseExcelDate ¶
func ParseFloat ¶
func ParseString ¶
func PrepareRow ¶
Types ¶
type AggregateFunc ¶
type AggregateFunc func(interface{}, RichMap) interface{}
type CompareFunc ¶ added in v1.0.1
type FieldDef ¶
type FieldDef struct { Key string `json:"key"` Index int `json:"index"` Aliases []string `json:"aliases"` DataType string `json:"dataType"` DataOption string `json:"dataOption"` }
func (*FieldDef) ParseValue ¶
func (*FieldDef) ValidAlias ¶
type FilterFunc ¶
type MutateFunc ¶
type MutateFunc func(RichMap) interface{}
type ParseDataFunc ¶
type ParseDataFuncFactory ¶
type ParseDataFuncFactory struct {
ParseDataFuncs map[string]ParseDataFunc
}
var ParseDataFuncs *ParseDataFuncFactory
func GetParseDataFuncFactory ¶
func GetParseDataFuncFactory() *ParseDataFuncFactory
func (*ParseDataFuncFactory) AddFunc ¶
func (factory *ParseDataFuncFactory) AddFunc(dataType string, pdFunc ParseDataFunc)
func (*ParseDataFuncFactory) Get ¶
func (factory *ParseDataFuncFactory) Get(dataType string) ParseDataFunc
type RichFrame ¶
type RichFrame []RichMap
func (RichFrame) Aggregate ¶
func (rf RichFrame) Aggregate(groupBy []string, cols []string, funcs []AggregateFunc) RichFrame
func (RichFrame) Filter ¶
func (rf RichFrame) Filter(f FilterFunc) RichFrame
func (RichFrame) OrderByInt ¶ added in v1.0.1
func (RichFrame) Sort ¶ added in v1.0.1
func (rf RichFrame) Sort(f CompareFunc) RichFrame
type SheetDef ¶
type SheetDef struct { Key string `json:"key"` Aliases []string `json:"aliases"` FieldDefs []*FieldDef `json:"fields"` }
func (*SheetDef) GetFieldDef ¶
func (*SheetDef) ValidAlias ¶
type XlsxFileDef ¶
type XlsxFileDef struct {
SheetDefs []*SheetDef `json:"sheets"`
}
func (*XlsxFileDef) GetSheetDef ¶
func (file *XlsxFileDef) GetSheetDef(name string) *SheetDef
Click to show internal directories.
Click to hide internal directories.