excellib

package
v1.6.4 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Export

func Export(req *ExportReq) (*excelize.File, error)

func ExportAssoc

func ExportAssoc(req *ExportAssocReq) (*excelize.File, error)

rows [{id:xx,name:xx,username},{}] headers [{id:"ID"},{name,姓名}]

Types

type D

type D []E

D{{"foo","bar","hello","world"}}

type E

type E struct {
	Key   string      `json:"key"`
	Value interface{} `json:"value"`
}

type ExportAssocReq

type ExportAssocReq struct {
	Rows      []Hash
	Headers   D
	SheetName string
	AutoAlign bool
}

type ExportReq

type ExportReq struct {
	Rows      []List
	Headers   []string
	SheetName string
	AutoAlign bool
}

func (*ExportReq) GetSheetName

func (r *ExportReq) GetSheetName() string

type Hash

type Hash = map[string]interface{}

type ImportReq

type ImportReq struct {
	Filename       string
	Reader         io.Reader
	DivideFirstRow bool
	SheetName      string
}

func (*ImportReq) GetSheetName

func (r *ImportReq) GetSheetName() string

type ImportResp

type ImportResp struct {
	Rows    [][]string
	Headers []string
}

func ImportFile

func ImportFile(req *ImportReq) (resp *ImportResp, err error)

func ImportReader

func ImportReader(req *ImportReq) (resp *ImportResp, err error)

type List

type List = []interface{}

Jump to

Keyboard shortcuts

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