Documentation
¶
Index ¶
- func ConvertToTSType(s string) string
- func ExtractJson(s interface{}) (string, map[string]string)
- func GenerateTS(s interface{}) string
- func GenerateTSFromStructs(structs *[]interface{}) string
- func GenerateType(filename string, s interface{})
- func GenerateTypes(filename string, structs *[]interface{})
- func GetStructName(s interface{}) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConvertToTSType ¶
ConvertToTSType converts a Go type to a TypeScript type
This is a very basic implementation and does not support all of TypeScript's types TODO: Add support for more types
func ExtractJson ¶
ExtractJson extracts the JSON attributes from a struct
func GenerateTS ¶
func GenerateTS(s interface{}) string
GenerateTS generates a TypeScript interface from a Go struct
func GenerateTSFromStructs ¶
func GenerateTSFromStructs(structs *[]interface{}) string
GenerateTSFromStructs generates TypeScript interfaces from Go structs
func GenerateType ¶
func GenerateType(filename string, s interface{})
func GenerateTypes ¶
func GenerateTypes(filename string, structs *[]interface{})
GenerateTypes generates TypeScript interfaces from Go structs
func GetStructName ¶
func GetStructName(s interface{}) string
GetStructName gets the name of a struct
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.