data

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SliceToSliceInterface

func SliceToSliceInterface[T any](value []T) []interface{}

Types

type FileOptions

type FileOptions struct {
	FileName  string
	SheetNum  *int
	Delimiter *rune
	Mapper    *Mapper
}

type FileParser

type FileParser interface {
	Read() (<-chan []string, <-chan error)
	Init(options FileOptions) error
}

type Mapper

type Mapper struct {
	Fields        map[string]interface{}
	MappedFields  map[string]int
	SpecialFields map[string]string
	Values        []interface{}
	DynamicValues map[int]string
	DynamicFields []string
}

func NewMapper

func NewMapper(fields map[string]interface{}, dynamicFields []string) *Mapper

func (*Mapper) GetValue

func (m *Mapper) GetValue(key string) (string, error)

func (*Mapper) ReturnDate

func (m *Mapper) ReturnDate(value interface{}, field string, dateFormat string) (time.Time, error)

func (*Mapper) ReturnFloat

func (m *Mapper) ReturnFloat(value interface{}, field string) (float64, error)

func (*Mapper) ReturnInteger

func (m *Mapper) ReturnInteger(value interface{}, field string) (int, error)

func (*Mapper) SetColumns

func (m *Mapper) SetColumns(values []string) bool

Jump to

Keyboard shortcuts

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