Documentation
¶
Overview ¶
Package ir is the version-agnostic intermediate representation used by codegen.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildStruct ¶
BuildStruct converts a JSON Schema object into an IR Struct plus any enums it declares inline. Enum names are derived from the field's Go name.
Types ¶
type Field ¶
type Field struct {
GoName string // exported Go field name
JSONName string // wire name
Type Kind
ElemType Kind // for TypeSlice
EnumName string // for TypeEnumRef
StructRef string // for TypeStructRef
Required bool
MaxLength int // 0 = none
}
Field is one property of a message or nested struct.
type File ¶
type File struct {
Version string // "v16"
Package string // "messages"
Structs []Struct
Enums []Enum
Messages []Message
}
File is the full IR for one version, ready to render.
type Message ¶
type Message struct {
Action string
Direction string // "SentByCP" or "SentByCSMS"
Request string // request struct GoName
Response string // response struct GoName ("" for SEND)
RequestSchema string // request schema filename
ResponseSchema string // response schema filename ("" for SEND)
IsSend bool // OCPP 2.1 SEND: unconfirmed, no response
}
Message binds a request/response struct pair to an action and direction.
Click to show internal directories.
Click to hide internal directories.