Documentation
¶
Overview ¶
Package gen contains (mostly) generated Jennifer code, that can be used at multiple places.
Generating code that generates code from existing code is useful, because we just have to write regular code.
The code is generated with "github.com/aloder/tojen", and then modified by hand.
Index ¶
- func Comments(comments ...string) jen.Code
- func MustTemplate(template string, values IntoValues, options ...TemplatingOption) jen.Code
- func PrimitiveFromString(s *spec.Schema, ptr bool, varName, strName jen.Code) (jen.Code, error)
- func Qual(path, name string) *jen.Statement
- func Raw(str string) *jen.Statement
- func Template(template string, values IntoValues, options ...TemplatingOption) (jen.Code, error)
- type IntoValues
- type TemplatingOption
- type Values
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MustTemplate ¶
func MustTemplate(template string, values IntoValues, options ...TemplatingOption) jen.Code
func PrimitiveFromString ¶
func Template ¶
func Template(template string, values IntoValues, options ...TemplatingOption) (jen.Code, error)
Template mixes jen code with a string template.
Types ¶
type IntoValues ¶
type IntoValues interface {
Values() Values
}
type TemplatingOption ¶
type TemplatingOption func(*templatingOptions)
TemplatingOption is used to set templating options
func SkipNotFound ¶
func SkipNotFound() TemplatingOption
SkipNotFound is an option to leave not found values untouched in the template.
Click to show internal directories.
Click to hide internal directories.