Documentation ¶
Index ¶
- func CreateHeader(columns []string, fieldColumnMap map[string]string) (map[string]int, error)
- func ProvideField(fieldColumnMap map[string]int, row []string) (map[string]interface{}, error)
- func StringToNullBool(s string) (sql.NullBool, error)
- func StringToNullFloat64(s string) (sql.NullFloat64, error)
- func StringToNullInt32(s string) (sql.NullInt32, error)
- func StringToNullInt64(s string) (sql.NullInt64, error)
- func StringToNullString(s string) (sql.NullString, error)
- func StringToNullTime(layout, s string) (sql.NullTime, error)
- func StringToTime(layout, s string) (time.Time, error)
- type FieldError
- type RecordError
- type SourceFieldError
- type SourceGenericError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateHeader ¶
CreateHeader creates header from columns. Using fieldColumnMap to filter only requested field and also rename it.
func ProvideField ¶
ProvideField provides row to be accessed by field names using map. The returned map will only provide the specified fields.
func StringToNullBool ¶
StringToNullBool converts string to sql.NullBool
func StringToNullFloat64 ¶
func StringToNullFloat64(s string) (sql.NullFloat64, error)
StringToNullFloat64 converts string to sql.NullFloat64
func StringToNullInt32 ¶
StringToNullInt32 converts string to sql.NullInt32
func StringToNullInt64 ¶
StringToNullInt64 converts string to sql.NullInt64
func StringToNullString ¶
func StringToNullString(s string) (sql.NullString, error)
StringToNullString converts string to sql.NullString
func StringToNullTime ¶
StringToNullTime converts string to sql.NullTime
Types ¶
type FieldError ¶
FieldError records an error that happens in a field.
func ErrEmptyValue ¶
func ErrEmptyValue(field string) FieldError
ErrEmptyValue indicates an empty value error
func (FieldError) Error ¶
func (e FieldError) Error() string
type RecordError ¶
RecordError records an error that happens in a record.
func (RecordError) Error ¶
func (e RecordError) Error() string
type SourceFieldError ¶ added in v0.1.11
type SourceFieldError struct { Source string RecordNum int64 FieldError }
SourceFieldError records an error that happen when converting field value.
func (SourceFieldError) Error ¶ added in v0.1.11
func (e SourceFieldError) Error() string
type SourceGenericError ¶ added in v0.1.11
SourceGenericError records a generic error that happen when processing csv file.
func (SourceGenericError) Error ¶ added in v0.1.11
func (e SourceGenericError) Error() string