Documentation
¶
Index ¶
- func CompositionUml(source string, rel Rel) string
- func CompositionsUml(source string, compositions []Rel) (result []string)
- func EnumUml(enum Enum) string
- func EnumsUml(enums []Enum) (result []string)
- func FieldUml(field Field) string
- func FieldsUml(fields []Field) (result []string)
- func Gen(source string) string
- func Generate(structs []Struct, enums []Enum) (result string)
- func GetEnumValues(f map[string]*ast.Package, enumName string) (result []string)
- func GetTypeName(t ast.Expr) string
- func InferredRelationUml(source string, rel Rel) string
- func InferredRelationsUml(source string, relations []Rel) (result []string)
- func ListEnum(f map[string]*ast.Package) (result []*ast.TypeSpec)
- func ListStructTypeSpecs(f map[string]*ast.Package) (result []*ast.TypeSpec)
- func StructUml(s Struct) string
- func StructsUml(structs []Struct) (result []string)
- type Cardinality
- type Enum
- type Field
- type Rel
- type Struct
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CompositionUml ¶
func CompositionsUml ¶
func GetEnumValues ¶
func GetTypeName ¶
func InferredRelationUml ¶
func InferredRelationsUml ¶
func ListStructTypeSpecs ¶
func StructsUml ¶
Types ¶
type Cardinality ¶
type Cardinality = string
const AtLeastOne Cardinality = "1..*"
const ExactOne Cardinality = "1"
const Many Cardinality = "0..*"
const MaxOne Cardinality = "0..1"
func GetTypeInfo ¶
func GetTypeInfo(t ast.Expr) (fullName string, elementName string, many Cardinality)
type Field ¶
type Field struct { Name string Type string ElementType string //if type is an array or map Card Cardinality }
func GetStructFields ¶
type Rel ¶
type Rel struct { StructName string SourceCardinality Cardinality TargetCardinality Cardinality }
type Struct ¶
type Struct struct { Name string Fields []Field //relations Compositions []Rel InferredRelations []Rel }
func SetCompositions ¶
func SetInferredRelations ¶
func SetRelations ¶
Click to show internal directories.
Click to hide internal directories.