Documentation
¶
Overview ¶
Package types maintains the catalog of data generator types known to mockagen. It combines Mockaroo-compatible type names with go-faker struct tags, database SQL affinities, parameter constraints, and naming hints used by schema inference.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type SQLAffinity ¶
type SQLAffinity string
SQLAffinity classifies generator types into coarse database affinities. Used by schema inference to select candidate types for a given SQL column type without hardcoding parallel lookup tables.
const ( AffinityText SQLAffinity = "text" AffinityInt SQLAffinity = "int" AffinityFloat SQLAffinity = "float" AffinityBool SQLAffinity = "bool" AffinityTime SQLAffinity = "time" AffinityBinary SQLAffinity = "binary" )
type Type ¶
type Type struct {
Name string
FakerTag string
Kind string
Affinity SQLAffinity
RequiresValues bool
RequiresMin bool
RequiresMax bool
RequiresFormat bool
NameHints []string
}
Type represents a generator type registered in mockagen's catalog. It bundles the faker struct tag with metadata, affinity, parameter requirements, and inference name hints.
func All ¶
func All() []Type
All returns a slice of all registered generator types in the catalog, sorted alphabetically by Name.
func Candidates ¶
func Candidates(affinity SQLAffinity) []Type
Candidates returns all registered generator types matching the requested SQL affinity, sorted alphabetically by Name for stable output.