Documentation
¶
Index ¶
- Variables
- func Compare(a, b any) int
- func ExtractAndMapColumnType(columnType string, typeMapping map[string]types.DataType) types.DataType
- func ExtractAvroRecord(record map[string]interface{}) map[string]interface{}
- func ExtractAvroValue(v interface{}) interface{}
- func MaximumOnDataType[T any](typ types.DataType, a, b T) (T, error)
- func NormalizeAvroSchema(schema string) (string, error)
- func ReformatBool(v interface{}) (bool, error)
- func ReformatByteArraysToString(data map[string]any) map[string]any
- func ReformatDate(v interface{}, isTimestampInDB bool) (time.Time, error)
- func ReformatFloat32(v interface{}) (float32, error)
- func ReformatFloat64(v interface{}) (float64, error)
- func ReformatGeoType(v any) (any, error)
- func ReformatInt32(v any) (int32, error)
- func ReformatInt64(v any) (int64, error)
- func ReformatRecord(fields Fields, record types.Record) error
- func ReformatTimeValue(value any) (string, error)
- func ReformatValue(dataType types.DataType, v any) (any, error)
- func ReformatValueOnDataTypes(datatypes []types.DataType, v any) (any, error)
- func Resolve(stream *types.Stream, objects ...map[string]interface{}) error
- func TypeFromValue(v interface{}) types.DataType
- type Field
- type Fields
- func (f Fields) Add(other Fields)
- func (f Fields) Clone() Fields
- func (f Fields) FromSchema(schema *types.TypeSchema)
- func (f Fields) Header() (header []string)
- func (f Fields) Merge(other Fields)
- func (f Fields) OverrideTypes(other Fields)
- func (f Fields) Process(record types.Record) (bool, bool, Fields)
- func (f Fields) ToProperties() map[string]*types.Property
- func (f Fields) ToTypeSchema() *types.TypeSchema
- type Flattener
- type FlattenerImpl
- type StringInterface
- type Time
Constants ¶
This section is empty.
Variables ¶
var DateTimeFormats = []string{
"2006-01-02",
"2006-01-02 15:04:05",
"2006-01-02 15:04:05 -07:00",
"2006-01-02 15:04:05-07:00",
"2006-01-02 15:04:05 -0700 MST",
"2006-01-02-15.04.05.000000",
"2006-01-02T15:04:05",
"2006-01-02T15:04:05.000000",
"2006-01-02T15:04:05.999999999Z07:00",
"2006-01-02T15:04:05+0000",
"2020-08-17T05:50:22.895Z",
"2006-01-02 15:04:05.999999-07",
"2006-01-02 15:04:05.999999+00",
"2006-01-02T15:04:05.000000000Z",
}
var (
ErrNullValue = fmt.Errorf("null value")
)
var GeospatialTypes = []string{"geometry", "point", "polygon", "linestring", "multi"}
Functions ¶
func ExtractAndMapColumnType ¶
func ExtractAvroRecord ¶ added in v0.3.16
ExtractAvroRecord recursively extracts Avro record to JSON-compatible map
func ExtractAvroValue ¶ added in v0.3.16
func ExtractAvroValue(v interface{}) interface{}
ExtractAvroValue extracts Avro-decoded values to JSON-compatible types
func NormalizeAvroSchema ¶ added in v0.3.17
NormalizeAvroSchema parses Avro schema and normalizes all "name" and "namespace" fields
func ReformatBool ¶ added in v0.2.0
func ReformatDate ¶
reformat date expects value and isTimestampInDB boolean which is used in parseStringTimestamp function
func ReformatFloat32 ¶
func ReformatFloat64 ¶
func ReformatGeoType ¶ added in v0.2.9
func ReformatInt32 ¶
func ReformatInt64 ¶
TODO: Add bytes array handling of int64 and other datatypes. Also add unit test cases for it.
func ReformatTimeValue ¶ added in v0.3.14
ReformatTimeValue is used to make time format consistent as per db
func TypeFromValue ¶
Types ¶
type Field ¶
type Field struct {
// contains filtered or unexported fields
}
Field is a data type holder with occurrences
type Fields ¶
func (Fields) FromSchema ¶
func (f Fields) FromSchema(schema *types.TypeSchema)
func (Fields) OverrideTypes ¶
OverrideTypes check if field exists in other then put its type
func (Fields) ToTypeSchema ¶
func (f Fields) ToTypeSchema() *types.TypeSchema
type Flattener ¶
func NewFlattener ¶
func NewFlattener() Flattener
type FlattenerImpl ¶
type FlattenerImpl struct {
// contains filtered or unexported fields
}
type StringInterface ¶
type StringInterface interface {
String() string
}
type Time ¶
func (Time) Compare ¶ added in v0.1.3
Compare compares the time instant ct with u. If ct is before u, it returns -1; if ct is after u, it returns +1; if they're the same, it returns 0.
func (*Time) UnmarshalJSON ¶
UnmarshalJSON overrides the default unmarshalling for CustomTime