Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func TransformWithStruct ¶
func TransformWithStruct(st any, opts ...StructTransformerOption) schema.Transform
Types ¶
type NameTransformer ¶
type NameTransformer func(reflect.StructField) (string, error)
type StructTransformerOption ¶
type StructTransformerOption func(*structTransformer)
func WithNameTransformer ¶
func WithNameTransformer(transformer NameTransformer) StructTransformerOption
WithNameTransformer overrides how column name will be determined. DefaultNameTransformer is used as the default.
func WithSkipFields ¶
func WithSkipFields(fields ...string) StructTransformerOption
WithSkipFields allows to specify what struct fields should be skipped.
func WithTypeTransformer ¶
func WithTypeTransformer(transformer TypeTransformer) StructTransformerOption
WithTypeTransformer sets a function that can override the schema type for specific fields. Return `schema.TypeInvalid` to fall back to default behavior. DefaultTypeTransformer is used as the default.
type TypeTransformer ¶
type TypeTransformer func(reflect.StructField) (schema.ValueType, error)
Click to show internal directories.
Click to hide internal directories.