Documentation ¶
Index ¶
- func NameRelativeTo(pkg *types.Package) types.Qualifier
- func Origin(ty analysis.Type) string
- func SQLTableName(name sql.TableName) string
- func ToLowerFirst(str string) string
- func ToSnakeCase(str string) string
- func WriteDeclarations(decls []Declaration) string
- type Cache
- type Declaration
- type Format
- type Formatters
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NameRelativeTo ¶
NameRelativeTo is the same as types.Relative to, but use the (shorter) package name instead of path.
func SQLTableName ¶
SQLTableName uses a familiar SQL convention for table names, shared by generator/sql and generator/go/sqlcrud
func ToLowerFirst ¶
func ToSnakeCase ¶
func WriteDeclarations ¶
func WriteDeclarations(decls []Declaration) string
WriteDeclarations remove duplicates and aggregate the declarations, sorting them by ID
Types ¶
type Declaration ¶
type Declaration struct { ID string // uniquely identifies the item, used to avoid duplicated declarations Content string // actual code to write Priority bool // if true, the declaration is written at the begining of the file }
Declaration is a top level declaration to write to the generated file.
type Formatters ¶
type Formatters struct {
// contains filtered or unexported fields
}
Formatters provides format commands for Go, Dart, TypeScript and SQL. The zero value is a ready to use cache.
func (*Formatters) FormatFile ¶
func (fr *Formatters) FormatFile(format Format, filename string) error
FormatFile format `filename`, if a formatter for `format` is found. It returns an error if the command failed, not if no formatter is found.
Directories ¶
Path | Synopsis |
---|---|
Package implements a code generator outputting Dart code for type definitions and JSON routines.
|
Package implements a code generator outputting Dart code for type definitions and JSON routines. |
go
|
|
gounions
Package gounions generate JSON wrapper code for union types and types using them
|
Package gounions generate JSON wrapper code for union types and types using them |
sqlcrud
Package sqlcrud generate Go functions to read and write from a DB defined using the conventions from generator/sql
|
Package sqlcrud generate Go functions to read and write from a DB defined using the conventions from generator/sql |
Package typescript generates code for TS type definitions and http calls using the Axios library
|
Package typescript generates code for TS type definitions and http calls using the Axios library |
Click to show internal directories.
Click to hide internal directories.