Documentation ¶
Index ¶
- Constants
- Variables
- func CanIgnoreSheetCell(cell *xlsx.Cell) (ignore bool, err error)
- func CanIgnoreSheetRow(sheet *xlsx.Sheet, row int) (ignore bool, err error)
- func IndexType2Name(i IndexType) (o string, ok bool)
- func ParseEnumValueAliasString(aliasesString string) (aliases []string)
- func ParseSchemaString(input string) (output map[string]string)
- func ReadType(path string) (err error)
- func XlsxType2GoType(i string) (o string, ok bool)
- type Attribute
- type Data
- type Enum
- type EnumValue
- type ErrIgnoreField
- type ErrNeedSchema
- type ErrNeedType
- type ErrNotField
- type ErrTableFieldEmpty
- type Excel
- type Field
- type FieldType
- type IndexType
- type Offset
- type Sheet
- func (s *Sheet) AppendField(newField *Field) (err error)
- func (s *Sheet) AppendXlsxField(newField *XlsxField) (err error)
- func (s *Sheet) Format(sd *StaticData, clientMode bool) (err error)
- func (s *Sheet) ReadData(sheet *xlsx.Sheet, sd *StaticData, clientMode bool) (err error)
- func (s Sheet) String() string
- type StaticData
- type XlsxField
Constants ¶
View Source
const ( IndexTypeNot IndexType = iota // 不是索引 IndexTypeUnique // 唯一索引,值不可以重复 IndexTypeNormal // 普通索引,值可以重复 IndexNameNot = "" IndexNameUnique = "unique" IndexNameNormal = "normal" )
View Source
const ( DefaultSchema = "t=int" NameSchemaKey = "n" TypeSchemaKey = "t" IndexSchemaKey = "i" SliceSchemaKey = "s" ObjectSchemaKey = "o" // todo ObjectSliceSchemaKey = "os" // todo )
Variables ¶
View Source
var ( MaxRow = 10000 MaxCol = 150 )
Functions ¶
func CanIgnoreSheetCell ¶
数据是否可以跳过
func CanIgnoreSheetRow ¶
行是否可以跳过
func IndexType2Name ¶
func ParseSchemaString ¶
func XlsxType2GoType ¶
Types ¶
type Enum ¶
type Enum struct { Name string `xml:",attr"` Comment string `xml:",attr"` Values []*EnumValue // contains filtered or unexported fields }
func GetEnumByName ¶
func (*Enum) AppendValue ¶
type EnumValue ¶
type EnumValue struct { Name string `xml:",attr"` Value int Aliases []string Comment string `xml:",attr"` // contains filtered or unexported fields }
func NewEnumValue ¶
type ErrIgnoreField ¶
type ErrIgnoreField struct { }
func (ErrIgnoreField) Error ¶
func (e ErrIgnoreField) Error() string
type ErrNeedSchema ¶
type ErrNeedSchema struct { }
func (ErrNeedSchema) Error ¶
func (e ErrNeedSchema) Error() string
type ErrNeedType ¶
type ErrNeedType struct { }
func (ErrNeedType) Error ¶
func (e ErrNeedType) Error() string
type ErrNotField ¶
type ErrNotField struct { }
func (ErrNotField) Error ¶
func (e ErrNotField) Error() string
type ErrTableFieldEmpty ¶
type ErrTableFieldEmpty struct { }
func (ErrTableFieldEmpty) Error ¶
func (e ErrTableFieldEmpty) Error() string
type Field ¶
type Field struct { Name string Type string Comment string Column int `json:"-"` // contains filtered or unexported fields }
func (*Field) CheckAndFormat ¶
type Sheet ¶
type Sheet struct { Name string Comment string Fields []*Field UniqueIndexes []*XlsxField `json:",omitempty"` // 唯一索引 NormalIndexes []*XlsxField `json:",omitempty"` // 普通索引 Attributes []*Attribute Global Data Datas []Data SheetName string `json:"-"` TableNameOffset *Offset `json:"-"` AttributeBeginOffset *Offset `json:"-"` DataBeginOffset *Offset `json:"-"` // contains filtered or unexported fields }
func (*Sheet) AppendField ¶
func (*Sheet) AppendXlsxField ¶
type StaticData ¶
func New ¶
func New() *StaticData
func (*StaticData) AppendTable ¶
func (sd *StaticData) AppendTable(newTable *Sheet) (err error)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.