Documentation
¶
Index ¶
- Constants
- func BuildPermissionsGoFile(permissionMap map[string]string)
- func BuildTypescriptPermissions(permissionMap map[string]string) string
- func CleanGoDALs(dir, interfacesDir string, schemas []*schema.Schema) (e error)
- func CleanGoModels(dir string, tsDir string, tables map[string]struct{}) (e error)
- func ColumnMapToNames(columns map[string]string) []string
- func FetchAllPermissionsFromControllers(controllersDir string) (map[string]string, error)
- func GenAPIDocs(config *lib.Config, routes *lib.RoutesJSONContainer)
- func GenAppBootstrapFile(basePackage string) error
- func GenControllerBootstrap(basePackageName string, dirs []string) string
- func GenDALs(dalsDir, dalInterfacesDir string, config *lib.Config, force, clean bool) error
- func GenGoPerms(config *lib.Config) (e error)
- func GenInterface(comment, pkgName, ifaceName, ifaceComment string, methods []string, ...) ([]byte, error)
- func GenInterfaces(srcDir, destDir string) error
- func GenModels(config *lib.Config, force bool, clean bool) error
- func GenRoutesAndPermissions(controllers []*lib.Controller, dirs []string, config *lib.Config) error
- func GenTSPerms(config *lib.Config) (e error)
- func GenTSRoutes(controllers []*lib.Controller, config *lib.Config) error
- func GenerateDALsBootstrapFile(config *lib.Config, dir string, schemaList *schema.SchemaList) error
- func GenerateGoDAL(config *lib.Config, table *schema.Table, dir string) (e error)
- func GenerateGoModel(packageName, dir string, schemaName string, table *schema.Table) (e error)
- func GenerateTypescriptDTO(name string, columns map[string]string) (string, error)
- func GenerateTypescriptModel(name string, columns map[string]string) (string, error)
- func GenerateTypescriptModels(config *lib.Config, routes *lib.RoutesJSONContainer) error
- func GenerateTypesriptDTOs(config *lib.Config, routes *lib.RoutesJSONContainer) error
- func ImportString(sb io.Writer, parts []string)
- func ImportStrings(sb io.Writer, columns map[string]string)
- func InheritStrings(sb io.Writer, columns map[string]string) []string
- func LoadPermissionsFromJSON() map[string]string
- func LoadRoutes(config *lib.Config) (*lib.RoutesJSONContainer, error)
- func ParseFileToGoStruct(filePath string) (*lib.GoStruct, error)
- func TSFileHeader(sb io.Writer, name string)
- type Gen
- type TSRouteGenerator
- type TypescriptGenerator
- func (tg *TypescriptGenerator) ExtractColumns(goType string) map[string]string
- func (tg *TypescriptGenerator) GenerateTypescriptAggregate(name string) (string, error)
- func (tg *TypescriptGenerator) GenerateTypescriptDefaults(sb io.Writer, objectName string)
- func (tg *TypescriptGenerator) GenerateTypescriptFields(sb io.Writer, objectName string)
- func (tg *TypescriptGenerator) GenerateTypesriptAggregates(config *lib.Config) error
Constants ¶
const NullPackage = "\"gopkg.in/guregu/null.v3\""
NullPackage is the package name used for handling nulls
Variables ¶
This section is empty.
Functions ¶
func BuildPermissionsGoFile ¶ added in v1.8.20
func BuildTypescriptPermissions ¶ added in v1.8.11
BuildTypescriptPermissions returns a formatted typescript file of permission constants
func CleanGoDALs ¶
CleanGoDALs removes any repo files that aren't in the database.Tables map
func CleanGoModels ¶
CleanGoModels removes model files that are not found in the database.Tables map
func ColumnMapToNames ¶ added in v1.8.89
func FetchAllPermissionsFromControllers ¶ added in v1.8.82
func GenAPIDocs ¶ added in v1.8.89
func GenAPIDocs(config *lib.Config, routes *lib.RoutesJSONContainer)
func GenAppBootstrapFile ¶ added in v1.8.90
GenAppBootstrapFile generates the services bootstrap file
func GenControllerBootstrap ¶ added in v1.8.89
GenControllerBootstrap generates the bootstrap file for the applications controllers
func GenGoPerms ¶ added in v1.8.20
func GenInterface ¶
func GenInterface(comment, pkgName, ifaceName, ifaceComment string, methods []string, imports []string) ([]byte, error)
GenInterface takes makes the interface into a byte array
func GenInterfaces ¶
func GenRoutesAndPermissions ¶ added in v1.8.19
func GenRoutesAndPermissions(controllers []*lib.Controller, dirs []string, config *lib.Config) error
GenRoutes generates a list of routes from a directory of controller files
func GenTSPerms ¶ added in v1.8.20
func GenTSRoutes ¶ added in v1.8.89
func GenTSRoutes(controllers []*lib.Controller, config *lib.Config) error
func GenerateDALsBootstrapFile ¶
GenerateDALsBootstrapFile generates a dal bootstrap file in golang
func GenerateGoDAL ¶
GenerateGoDAL returns a string for a repo in golang
func GenerateGoModel ¶
GenerateGoModel returns a string for a model in golang
func GenerateTypescriptDTO ¶ added in v1.8.89
GenerateTypescriptType returns a string for a type in typescript TODO need a map of all types so that import paths can be used for struct and array types TODO test for struct types (apart from array types)
func GenerateTypescriptModel ¶ added in v1.8.89
GenerateTypescriptType returns a string for a type in typescript
func GenerateTypescriptModels ¶ added in v1.8.89
func GenerateTypescriptModels(config *lib.Config, routes *lib.RoutesJSONContainer) error
GenerateTypescriptModels returns a string for a typscript types file
func GenerateTypesriptDTOs ¶ added in v1.8.89
func GenerateTypesriptDTOs(config *lib.Config, routes *lib.RoutesJSONContainer) error
func ImportString ¶ added in v1.8.89
func InheritStrings ¶ added in v1.8.89
func LoadPermissionsFromJSON ¶ added in v1.8.34
LoadPermissionsFromJSON loads a set of permissions from a JSON file
func LoadRoutes ¶ added in v1.8.89
func LoadRoutes(config *lib.Config) (*lib.RoutesJSONContainer, error)
func ParseFileToGoStruct ¶ added in v1.8.89
InspectFile inspects a file
func TSFileHeader ¶ added in v1.8.89
Types ¶
type Gen ¶
Gen conntains all of the generator functionality
func (*Gen) GenerateDALSQL ¶
GenerateDALSQL generates a constants file filled with sql statements
type TSRouteGenerator ¶ added in v1.8.89
type TSRouteGenerator struct {
// contains filtered or unexported fields
}
func NewTSRouteGenerator ¶ added in v1.8.89
func NewTSRouteGenerator(c *lib.Controller) *TSRouteGenerator
func (*TSRouteGenerator) AddImport ¶ added in v1.8.89
func (t *TSRouteGenerator) AddImport(importType string)
type TypescriptGenerator ¶ added in v1.8.89
type TypescriptGenerator struct {
// contains filtered or unexported fields
}
func NewTypescriptGenerator ¶ added in v1.8.89
func NewTypescriptGenerator(config *lib.Config, routes *lib.RoutesJSONContainer) *TypescriptGenerator
func (*TypescriptGenerator) ExtractColumns ¶ added in v1.8.89
func (tg *TypescriptGenerator) ExtractColumns(goType string) map[string]string
func (*TypescriptGenerator) GenerateTypescriptAggregate ¶ added in v1.8.89
func (tg *TypescriptGenerator) GenerateTypescriptAggregate(name string) (string, error)
GenerateTypescriptAggregate returns a string for a type in typescript
func (*TypescriptGenerator) GenerateTypescriptDefaults ¶ added in v1.8.89
func (tg *TypescriptGenerator) GenerateTypescriptDefaults(sb io.Writer, objectName string)
func (*TypescriptGenerator) GenerateTypescriptFields ¶ added in v1.8.89
func (tg *TypescriptGenerator) GenerateTypescriptFields(sb io.Writer, objectName string)
func (*TypescriptGenerator) GenerateTypesriptAggregates ¶ added in v1.8.89
func (tg *TypescriptGenerator) GenerateTypesriptAggregates(config *lib.Config) error