Documentation ¶
Overview ¶
Package gen allows generating Go structs from avro schemas.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct { PackageName string Tags map[string]TagStyle FullName bool Encoders bool Initialisms []string }
Config configures the code generation.
type Generator ¶
type Generator struct {
// contains filtered or unexported fields
}
Generator generates Go structs from schemas.
func NewGenerator ¶
NewGenerator returns a generator.
type OptsFunc ¶
type OptsFunc func(*Generator)
OptsFunc is a function that configures a generator.
func WithEncoders ¶
WithEncoders configures the generator to generate schema and encoders on all objects.
func WithFullName ¶
WithFullName configures the generator to use the full name of a record when creating the struct name.
func WithInitialisms ¶
WithInitialisms configures the generator to use additional custom initialisms when styling struct and field names.
type TagStyle ¶
type TagStyle string
TagStyle defines the styling for a tag.
const ( // Original is a style like whAtEVer_IS_InthEInpuT. Original TagStyle = "original" // Snake is a style like im_written_in_snake_case. Snake TagStyle = "snake" // Camel is a style like imWrittenInCamelCase. Camel TagStyle = "camel" // Kebab is a style like im-written-in-kebab-case. Kebab TagStyle = "kebab" // UpperCamel is a style like ImWrittenInUpperCamel. UpperCamel TagStyle = "upper-camel" )
Click to show internal directories.
Click to hide internal directories.