Documentation
¶
Index ¶
- type ArgumentMapping
- type ArrayArgMapping
- type BuilderArgMapping
- type BuilderChoiceMapping
- type Config
- type Context
- func (context *Context) BuildersForType(typeDef ast.Type) ast.Builders
- func (context *Context) IsArrayOfKinds(def ast.Type, kinds ...ast.Kind) bool
- func (context *Context) IsDisjunctionOfBuilders(def ast.Type) bool
- func (context *Context) IsMapOfKinds(def ast.Type, kinds ...ast.Kind) bool
- func (context *Context) LocateObject(pkg string, name string) (ast.Object, bool)
- func (context *Context) LocateObjectByRef(ref ast.RefType) (ast.Object, bool)
- func (context Context) PackagesForVariant(variant string) []string
- func (context *Context) ResolveRefs(def ast.Type) ast.Type
- func (context *Context) ResolveToBuilder(def ast.Type) bool
- func (context *Context) ResolveToComposableSlot(def ast.Type) (ast.Type, bool)
- func (context *Context) ResolveToStruct(def ast.Type) bool
- func (context Context) SchemasForVariant(variant string) []*ast.Schema
- type ConversionMapping
- type Converter
- type ConverterGenerator
- type ConverterInput
- type DirectArgMapping
- type DisjunctionArgMapping
- type DisjunctionBranchArgMapping
- type Language
- type Languages
- type MapArgMapping
- type MappingGuard
- type NullableConfig
- type NullableKindsProvider
- type OptionMapping
- type RuntimeArgMapping
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ArgumentMapping ¶
type ArgumentMapping struct { Direct *DirectArgMapping Runtime *RuntimeArgMapping Builder *BuilderArgMapping BuilderDisjunction []BuilderChoiceMapping Array *ArrayArgMapping Map *MapArgMapping Disjunction *DisjunctionArgMapping // TODO: used? necessary? Guards []MappingGuard }
type ArrayArgMapping ¶
type BuilderArgMapping ¶
type BuilderArgMapping struct { ValuePath ast.Path ValueType ast.Type BuilderPkg string BuilderName string }
mapping between a JSON value and an argument delegated to a builder
type BuilderChoiceMapping ¶
type BuilderChoiceMapping struct { Guards []MappingGuard Builder BuilderArgMapping }
type Config ¶
type Config struct { // Debug turns on or off the debugging mode. Debug bool // Types indicates whether types should be generated or not. Types bool // Builders indicates whether builders should be generated or not. Builders bool // Converters indicates whether converters should be generated or not. Converters bool // APIReference indicates whether an API reference should be generated or not. APIReference bool }
Config represents global configuration options, to be used by all jennies.
type Context ¶
func (*Context) BuildersForType ¶ added in v0.0.8
func (*Context) IsArrayOfKinds ¶
func (*Context) IsDisjunctionOfBuilders ¶
func (*Context) IsMapOfKinds ¶
func (*Context) LocateObject ¶
func (*Context) LocateObjectByRef ¶
func (Context) PackagesForVariant ¶ added in v0.0.9
func (*Context) ResolveToComposableSlot ¶
type ConversionMapping ¶
type ConversionMapping struct { // for i, panel := range input.Panels { WithPanel(panel) } RepeatFor ast.Path // `input.Panels` RepeatAs string // `panel` RepeatIndex string // `i` Options []OptionMapping }
type Converter ¶
type Converter struct { Package string BuilderName string Input ConverterInput // FIXME: assuming we only have direct mappings here is... *optimistic*. ConstructorArgs []DirectArgMapping Mappings []ConversionMapping }
type ConverterGenerator ¶
type ConverterGenerator struct {
// contains filtered or unexported fields
}
func NewConverterGenerator ¶
func NewConverterGenerator(nullableTypes NullableConfig) *ConverterGenerator
func (*ConverterGenerator) FromBuilder ¶
func (generator *ConverterGenerator) FromBuilder(context Context, builder ast.Builder) Converter
type ConverterInput ¶
type DirectArgMapping ¶
type DisjunctionArgMapping ¶
type DisjunctionArgMapping struct {
Branches []DisjunctionBranchArgMapping
}
type DisjunctionBranchArgMapping ¶
type DisjunctionBranchArgMapping struct { Type ast.Type Of *DirectArgMapping Arg *ArgumentMapping }
type Languages ¶
func (Languages) AsLanguageRefs ¶
type MapArgMapping ¶
type MappingGuard ¶
func (MappingGuard) String ¶
func (guard MappingGuard) String() string
type NullableConfig ¶
func (NullableConfig) TypeIsNullable ¶
func (nullableConfig NullableConfig) TypeIsNullable(typeDef ast.Type) bool
type NullableKindsProvider ¶
type NullableKindsProvider interface {
NullableKinds() NullableConfig
}
type OptionMapping ¶
type OptionMapping struct { Option ast.Option // option in the builder Guards []MappingGuard Args []ArgumentMapping }
func (OptionMapping) ArgumentGuards ¶
func (optMapping OptionMapping) ArgumentGuards() []MappingGuard
type RuntimeArgMapping ¶
type RuntimeArgMapping struct { FuncName string Args []*DirectArgMapping }
Click to show internal directories.
Click to hide internal directories.