transformers

package
v1.19.0 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2023 License: MPL-2.0 Imports: 5 Imported by: 56

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 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)

Jump to

Keyboard shortcuts

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