Documentation ¶
Index ¶
- func GetJSONProperty(name string, t *pb.Type, sep string) string
- func GetMethodName(ep *pb.Endpoint) string
- func GetPackage(outDir string) string
- func GetPrimitiveType(tp *pb.Type_Primitive) (string, error)
- func GetSimpleType(t *pb.Type) (string, error)
- func GetType(t *pb.Type) (string, *pb.Type, error)
- func GetTypeLine(t *pb.Type) (int32, error)
- func NamesSortedBySourceContext(types map[string]*pb.Type) ([]string, error)
- func SortLineNames(lineNames []LineName) []string
- func SplitUppercase(str string) []string
- func WriteInterface(w io.Writer, app *pb.Application, epNames []string) error
- func WriteMiddleware(w io.Writer, app *pb.Application, epNames []string)
- func WriteRest(w io.Writer, app *pb.Application, epNames []string) error
- func WriteStruct(w io.Writer, name string, t *pb.Type, jsonSep string) error
- func WriteStructField(w io.Writer, fName string, fType *pb.Type, sep string) error
- func WriteTypes(w io.Writer, app *pb.Application) error
- type CodeResult
- type LineName
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetJSONProperty ¶
GetJSONProperty extracts JSON property name from attribute and defaults to type name
func GetMethodName ¶
GetMethodName creates the interface method name from pattern path
func GetPackage ¶
GetPackage extracts package name from output directory
func GetPrimitiveType ¶
func GetPrimitiveType(tp *pb.Type_Primitive) (string, error)
GetPrimitiveType return Golang type string for Sysl primitive data type
func GetSimpleType ¶
GetSimpleType returns Golang type string for non-composite types (no lists and sets)
func GetTypeLine ¶
GetTypeLine returns the line for a given Sysl type from its SourceContext
func NamesSortedBySourceContext ¶
NamesSortedBySourceContext sorts the keys of the input types according to occurrence in Sysl definition file, derived from SourceContext
func SortLineNames ¶
SortLineNames sorts a slice of LineName in place and returns a slice of sorted names
func SplitUppercase ¶
SplitUppercase splits into fields at all upper case letters and converts fields to lower case
func WriteInterface ¶
WriteInterface creates for methods called in REST endpoints.
func WriteMiddleware ¶
func WriteMiddleware(w io.Writer, app *pb.Application, epNames []string)
WriteMiddleware writes interface returning required middleware functions for REST endpoints
func WriteStruct ¶
WriteStruct creates a Golang `struct` type definition from a Sysl Tuple type definition
func WriteStructField ¶
WriteStructField creates a single line inside a struct definition
func WriteTypes ¶
func WriteTypes(w io.Writer, app *pb.Application) error
WriteTypes creates all types definition in SourceContext order for given Sysl type definition
Types ¶
type CodeResult ¶
CodeResult contains source files' contents as []byte