Documentation
¶
Index ¶
- Constants
- func ExecuteTemplateWithGoFmt(tmpl *template.Template, w io.Writer, data interface{}) error
- func GetComments(n *yaml.Node) string
- func GoName(str string) string
- func LowerFirst(s string) string
- type Channel
- type Design
- func (design *Design) ChannelsMap() map[string]*Channel
- func (design *Design) GenerateClient(w io.Writer) error
- func (design *Design) GenerateServer(w io.Writer) error
- func (design *Design) GenerateServerTest(w io.Writer) error
- func (design *Design) Merge(design2 *Design) error
- func (design *Design) ParseField(node *yaml.Node) (*Field, error)
- func (design *Design) ParseStruct(node *yaml.Node) (*Struct, error)
- func (design *Design) ParseYaml(filePath string) error
- func (design *Design) SkeletonClient(w io.Writer) error
- func (design *Design) SkeletonServer(wMain io.Writer, wPackage io.Writer, wPackageTest io.Writer) error
- func (design *Design) StructsMap() map[string]*Struct
- func (design *Design) Validate() error
- func (design *Design) ValidateStruct(s *Struct) error
- func (design *Design) ValidateType(_type Type) error
- type Direction
- type Field
- type FieldWithPath
- type MapItem
- type MapItemType
- type MapSlice
- type MapSliceType
- type MapType
- type NestedType
- type PrimitiveType
- type RefType
- type Struct
- func (s *Struct) FieldsWithStrictDirection(direction Direction) []string
- func (s *Struct) GoDef() string
- func (s *Struct) GoDoc() string
- func (s *Struct) GoName() string
- func (s *Struct) HasDoc() bool
- func (s *Struct) JsDef() string
- func (s *Struct) ProtocolAlias() string
- func (s *Struct) TopFieldsWithStrictDirection(direction Direction) []*Field
- func (s *Struct) UnnestFieldMap() []*FieldWithPath
- type Tags
- type Type
- type TypeWithAttributes
- type YamlChannel
- type YamlChannelEvent
- type YamlChannelEvents
- type YamlDesign
- type YamlFullField
- type YamlStruct
Constants ¶
View Source
const ( Any = "" ServerToClient = "ServerToClient" ClientToServer = "ClientToServer" )
Variables ¶
This section is empty.
Functions ¶
func ExecuteTemplateWithGoFmt ¶ added in v0.6.0
func GetComments ¶ added in v0.2.0
func GetComments(n *yaml.Node) string
func LowerFirst ¶ added in v0.2.0
Types ¶
type Channel ¶
type Channel struct { Name string Alias string Doc string Enabled []*Struct Directions map[Direction]map[string]bool }
func (*Channel) EnabledMap ¶
func (*Channel) GetDirectionEvents ¶
func (*Channel) ProtocolAlias ¶ added in v0.4.7
type Design ¶
type Design struct { Module string Name string Channels []*Channel Structs []*Struct // contains filtered or unexported fields }
func ParseAndValidateYamls ¶ added in v0.2.0
func ParseYamls ¶ added in v0.2.0
func (*Design) ChannelsMap ¶ added in v0.2.0
func (*Design) GenerateServerTest ¶ added in v0.1.4
func (*Design) ParseField ¶ added in v0.6.0
func (*Design) ParseStruct ¶ added in v0.1.0
func (*Design) SkeletonServer ¶
func (*Design) StructsMap ¶
func (*Design) ValidateStruct ¶ added in v0.6.0
func (*Design) ValidateType ¶ added in v0.6.0
type Field ¶
type Field struct { Tags Tags Name string Type *TypeWithAttributes Doc string }
func (*Field) DirectionDoc ¶ added in v0.2.0
func (*Field) GoAnnotation ¶
func (*Field) ProtocolAlias ¶ added in v0.4.0
type FieldWithPath ¶ added in v0.6.0
type MapItemType ¶ added in v0.6.0
type MapItemType[T yaml.Unmarshaler] struct { Key string Value T }
type MapSlice ¶ added in v0.6.0
type MapSlice struct {
Items []MapItem
}
func (*MapSlice) UnmarshalYAML ¶ added in v0.6.0
type MapSliceType ¶ added in v0.6.0
type MapSliceType[T yaml.Unmarshaler] struct {
Items []MapItemType[T]
}
func (*MapSliceType[T]) UnmarshalYAML ¶ added in v0.6.0
func (mss *MapSliceType[T]) UnmarshalYAML(node *yaml.Node) error
type NestedType ¶ added in v0.6.0
type NestedType struct {
Struct *Struct
}
func (*NestedType) GoType ¶ added in v0.6.0
func (t *NestedType) GoType() string
func (*NestedType) JsType ¶ added in v0.6.0
func (t *NestedType) JsType() string
type PrimitiveType ¶ added in v0.6.0
type PrimitiveType string
func (PrimitiveType) GoType ¶ added in v0.6.0
func (t PrimitiveType) GoType() string
func (PrimitiveType) JsType ¶ added in v0.6.0
func (t PrimitiveType) JsType() string
type Struct ¶
func (*Struct) FieldsWithStrictDirection ¶ added in v0.2.1
func (*Struct) ProtocolAlias ¶ added in v0.4.0
func (*Struct) TopFieldsWithStrictDirection ¶ added in v0.6.0
func (*Struct) UnnestFieldMap ¶ added in v0.6.0
func (s *Struct) UnnestFieldMap() []*FieldWithPath
type Tags ¶ added in v0.6.0
func ProcessTags ¶ added in v0.6.0
func ProcessTags(node *yaml.Node) (t Tags)
type TypeWithAttributes ¶ added in v0.6.0
func ParseFieldStringType ¶ added in v0.6.0
func ParseFieldStringType(value string) (*TypeWithAttributes, error)
func (*TypeWithAttributes) GoType ¶ added in v0.6.0
func (twa *TypeWithAttributes) GoType() string
func (*TypeWithAttributes) JsType ¶ added in v0.6.0
func (twa *TypeWithAttributes) JsType() string
type YamlChannel ¶ added in v0.2.0
type YamlChannel struct { Tags Tags Dual YamlChannelEvents `yaml:"dual"` Server YamlChannelEvents `yaml:"server"` Client YamlChannelEvents `yaml:"client"` }
func (*YamlChannel) UnmarshalYAML ¶ added in v0.6.0
func (yc *YamlChannel) UnmarshalYAML(node *yaml.Node) error
type YamlChannelEvent ¶ added in v0.6.0
func (*YamlChannelEvent) UnmarshalYAML ¶ added in v0.6.0
func (yce *YamlChannelEvent) UnmarshalYAML(node *yaml.Node) error
type YamlChannelEvents ¶ added in v0.6.0
type YamlChannelEvents []YamlChannelEvent
type YamlDesign ¶ added in v0.2.0
type YamlDesign struct { Namespace string `yaml:"namespace"` Structs *MapSlice `yaml:"structs"` Channels MapSliceType[*YamlChannel] `yaml:"channels"` }
type YamlFullField ¶ added in v0.4.0
type YamlStruct ¶ added in v0.2.0
Click to show internal directories.
Click to hide internal directories.