Documentation ¶
Index ¶
- func TransformWithStruct(st any, opts ...StructTransformerOption) schema.Transform
- type NameTransformer
- type StructTransformerOption
- func WithNameTransformer(transformer NameTransformer) StructTransformerOption
- func WithSkipFields(fields ...string) StructTransformerOption
- func WithTypeTransformer(transformer TypeTransformer) StructTransformerOption
- func WithUnwrapAllEmbeddedStructs() StructTransformerOption
- func WithUnwrapStructFields(fields ...string) StructTransformerOption
- type TypeTransformer
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
func WithUnwrapAllEmbeddedStructs ¶ added in v1.19.0
func WithUnwrapAllEmbeddedStructs() StructTransformerOption
WithUnwrapAllEmbeddedStructs instructs codegen to unwrap all embedded fields (1 level deep only)
func WithUnwrapStructFields ¶ added in v1.19.0
func WithUnwrapStructFields(fields ...string) StructTransformerOption
WithUnwrapStructFields allows to unwrap specific struct fields (1 level deep only)
type TypeTransformer ¶
type TypeTransformer func(reflect.StructField) (schema.ValueType, error)
Click to show internal directories.
Click to hide internal directories.