Documentation
¶
Index ¶
Constants ¶
View Source
const LanguageRef = "go"
Variables ¶
This section is empty.
Functions ¶
func NewImportMap ¶
func NewImportMap(packageRoot string) *common.DirectImportMap
Types ¶
type Builder ¶
type Builder struct {
Config Config
Tmpl *template.Template
// contains filtered or unexported fields
}
type Config ¶
type Config struct {
GenerateConverters bool `yaml:"-"`
// GenerateJSONMarshaller controls the generation of `MarshalJSON()` and
// `UnmarshalJSON()` methods on types.
GenerateJSONMarshaller bool `yaml:"generate_json_marshaller"`
// GenerateStrictUnmarshaller controls the generation of
// `UnmarshalJSONStrict()` methods on types.
GenerateStrictUnmarshaller bool `yaml:"generate_strict_unmarshaller"`
// GenerateEqual controls the generation of `Equal()` methods on types.
GenerateEqual bool `yaml:"generate_equal"`
// GenerateValidate controls the generation of `Validate()` methods on types.
GenerateValidate bool `yaml:"generate_validate"`
// SkipRuntime disables runtime-related code generation when enabled.
// Note: builders can NOT be generated with this flag turned on, as they
// rely on the runtime to function.
SkipRuntime bool `yaml:"skip_runtime"`
// SkipPostFormatting disables formatting of Go files done with go imports
// after code generation.
SkipPostFormatting bool `yaml:"skip_post_formatting"`
// OverridesTemplatesDirectories holds a list of directories containing templates
// defining blocks used to override parts of builders/types/....
OverridesTemplatesDirectories []string `yaml:"overrides_templates"`
// ExtraFilesTemplatesDirectories holds a list of directories containing
// templates describing files to be added to the generated output.
ExtraFilesTemplatesDirectories []string `yaml:"extra_files_templates"`
// ExtraFilesTemplatesData holds additional data to be injected into the
// templates described in ExtraFilesTemplatesDirectories.
ExtraFilesTemplatesData map[string]string `yaml:"-"`
// Root path for imports.
// Ex: github.com/grafana/cog/generated
PackageRoot string `yaml:"package_root"`
// AnyAsInterface instructs this jenny to emit `interface{}` instead of `any`.
AnyAsInterface bool `yaml:"any_as_interface"`
// contains filtered or unexported fields
}
func (*Config) InterpolateParameters ¶
type Converter ¶
type Converter struct {
Config Config
NullableConfig languages.NullableConfig
Tmpl *template.Template
// contains filtered or unexported fields
}
type JSONMarshalling ¶
type JSONMarshalling struct {
// contains filtered or unexported fields
}
type Language ¶
type Language struct {
// contains filtered or unexported fields
}
func (*Language) CompilerPasses ¶
func (*Language) NullableKinds ¶
func (language *Language) NullableKinds() languages.NullableConfig
Click to show internal directories.
Click to hide internal directories.