Documentation
¶
Index ¶
- Variables
- type Axis
- type ContainerInfo
- type Excel
- func (e *Excel) GetSheetIndex() int
- func (e *Excel) GetSheetName() string
- func (e *Excel) Marshal(container any) error
- func (e *Excel) SetAxis(axis string)
- func (e *Excel) SetAxisCoordinates(col int, row int)
- func (e *Excel) SetSheetIndex(index int)
- func (e *Excel) SetSheetName(sheet string)
- func (e *Excel) Unmarshal(container any) error
- func (e *Excel) Validate() error
- type FieldInfo
- func (f *FieldInfo) ColumnNameIn() string
- func (f *FieldInfo) ColumnNameOut() string
- func (f *FieldInfo) DefaultValueIn() interface{}
- func (f *FieldInfo) DefaultValueOut() interface{}
- func (f *FieldInfo) EncodingIn() string
- func (f *FieldInfo) EncodingOut() string
- func (f *FieldInfo) FormatIn() string
- func (f *FieldInfo) FormatOut() string
- func (f *FieldInfo) IgnoreIn() bool
- func (f *FieldInfo) IgnoreOut() bool
- func (f *FieldInfo) IsRequiredIn() bool
- func (f *FieldInfo) IsRequiredOut() bool
- func (f *FieldInfo) SplitIn() string
- func (f *FieldInfo) SplitOut() string
- type FieldTags
- type FieldsTags
- type FieldsTagsIn
- type FieldsTagsOut
- type Marshaller
- type Reader
- type ReaderInfo
- func (r *ReaderInfo) GetSheetIndex() (int, error)
- func (r *ReaderInfo) GetSheetName() string
- func (r *ReaderInfo) SetAxis(axis string)
- func (r *ReaderInfo) SetAxisCoordinates(col int, row int)
- func (r *ReaderInfo) SetSheetIndex(i int)
- func (r *ReaderInfo) SetSheetName(n string)
- func (r *ReaderInfo) Validate() error
- type Sheet
- type StructInfo
- type Unmarshaller
- type Writer
- type WriterInfo
- func (w *WriterInfo) GetSheetIndex() (int, error)
- func (w *WriterInfo) GetSheetName() string
- func (w *WriterInfo) SetAxis(axis string)
- func (w *WriterInfo) SetAxisCoordinates(col int, row int)
- func (w *WriterInfo) SetSheetIndex(i int)
- func (w *WriterInfo) SetSheetName(n string)
- func (w *WriterInfo) Validate() error
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrFileIsNil = errors.New("excel: the file is nil") ErrSheetNotValid = errors.New("excel: the sheet name is not valid") ErrAxisNotValid = errors.New("excel: the axis is not valid") ErrConfigNotValid = errors.New("excel: the configuration is not valid") ErrNoReaderFound = errors.New("excel: unable to create an appropriate reader") ErrNoWriterFound = errors.New("excel: unable to create an appropriate writer") ErrContainerInvalid = errors.New("excel: the ContainerInfo must be a slice or a pointer") ErrColumnRequired = errors.New("excel: required colum") ErrNotImplemented = errors.New("excel: not implemented") )
Functions ¶
This section is empty.
Types ¶
type ContainerInfo ¶
type ContainerInfo struct {
// contains filtered or unexported fields
}
type Excel ¶
type Excel struct {
File *excelize.File
ReaderInfo *ReaderInfo
WriterInfo *WriterInfo
}
func (*Excel) GetSheetIndex ¶
func (*Excel) GetSheetName ¶
func (*Excel) SetAxisCoordinates ¶
func (*Excel) SetSheetIndex ¶
func (*Excel) SetSheetName ¶
type FieldInfo ¶
type FieldInfo struct {
FieldIndex int
FieldType reflect.Type
Tags *FieldTags
TagsIn *FieldTags
TagsOut *FieldTags
}
func (*FieldInfo) ColumnNameIn ¶
func (*FieldInfo) ColumnNameOut ¶
func (*FieldInfo) DefaultValueIn ¶
func (f *FieldInfo) DefaultValueIn() interface{}
func (*FieldInfo) DefaultValueOut ¶
func (f *FieldInfo) DefaultValueOut() interface{}
func (*FieldInfo) EncodingIn ¶
func (*FieldInfo) EncodingOut ¶
func (*FieldInfo) IsRequiredIn ¶
func (*FieldInfo) IsRequiredOut ¶
type FieldTags ¶
type FieldTags struct {
ColumnName string
DefaultValue interface{}
Format string
Encoding string
Split string
IsRequired bool
Ignore bool
// contains filtered or unexported fields
}
FieldTags which can be used when reading or writing
type FieldsTags ¶
The FieldsTags interface can be used as a replacement of the tags parameters.
type FieldsTagsIn ¶
The FieldsTagsIn interface can be used as a replacement of the tags parameters when importing an Excel file.
type FieldsTagsOut ¶
The FieldsTagsOut interface can be used as a replacement of the tags parameters when exporting an Excel file.
type Marshaller ¶
type Marshaller interface {
Marshall() (interface{}, error)
}
Marshaller can be implemented by any value that has a Marshal method This converter is used to convert the value to the desired representation
type ReaderInfo ¶
func (*ReaderInfo) GetSheetIndex ¶
func (r *ReaderInfo) GetSheetIndex() (int, error)
func (*ReaderInfo) GetSheetName ¶
func (r *ReaderInfo) GetSheetName() string
func (*ReaderInfo) SetAxis ¶
func (r *ReaderInfo) SetAxis(axis string)
func (*ReaderInfo) SetAxisCoordinates ¶
func (r *ReaderInfo) SetAxisCoordinates(col int, row int)
func (*ReaderInfo) SetSheetIndex ¶
func (r *ReaderInfo) SetSheetIndex(i int)
func (*ReaderInfo) SetSheetName ¶
func (r *ReaderInfo) SetSheetName(n string)
func (*ReaderInfo) Validate ¶
func (r *ReaderInfo) Validate() error
type StructInfo ¶
func (*StructInfo) GetFieldFromFieldIndex ¶
func (s *StructInfo) GetFieldFromFieldIndex(index int) *FieldInfo
type Unmarshaller ¶
Unmarshaller can be implemented by any value that has an Unmarshall method This converter is used to convert the value to the desired representation
type WriterInfo ¶
func (*WriterInfo) GetSheetIndex ¶
func (w *WriterInfo) GetSheetIndex() (int, error)
func (*WriterInfo) GetSheetName ¶
func (w *WriterInfo) GetSheetName() string
func (*WriterInfo) SetAxis ¶
func (w *WriterInfo) SetAxis(axis string)
func (*WriterInfo) SetAxisCoordinates ¶
func (w *WriterInfo) SetAxisCoordinates(col int, row int)
func (*WriterInfo) SetSheetIndex ¶
func (w *WriterInfo) SetSheetIndex(i int)
func (*WriterInfo) SetSheetName ¶
func (w *WriterInfo) SetSheetName(n string)
func (*WriterInfo) Validate ¶
func (w *WriterInfo) Validate() error
Click to show internal directories.
Click to hide internal directories.