Documentation ¶
Index ¶
- Constants
- func BuildPermissionsGoFile(permissionMap map[string]string)
- func BuildRoutesCodeFromController(controller *lib.Controller) (out string, e error)
- func BuildTypescriptPermissions(permissionMap map[string]string) string
- func CleanGoDALs(dir string, database *schema.Schema) (e error)
- func CleanGoModels(dir string, database *schema.Schema) (e error)
- func GenDALs(dalsDir 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(modelsDir string, force bool, clean bool) error
- func GenRoutesAndPermissions(config *lib.Config) error
- func GenTSPerms(config *lib.Config) (e error)
- func GenerateDALsBootstrapFile(config *lib.Config, dir string, schemaList *schema.SchemaList) (e error)
- func GenerateGoDAL(config *lib.Config, table *schema.Table, dir string) (e error)
- func GenerateGoModel(dir string, schemaName string, table *schema.Table) (e error)
- func GenerateTypescriptType(table *schema.Table) (string, error)
- func GenerateTypescriptTypes(database *schema.Schema) (string, error)
- func InspectFile(filePath string) (s *lib.GoStruct, e error)
- type ControllerFetcher
- type Gen
- func (g *Gen) GenAPITests() (e error)
- func (g *Gen) GenMeta(dir string, database *schema.Schema) (e error)
- func (g *Gen) GenerateAPIRoutes(apiDir string) error
- func (g *Gen) GenerateDALSQL(dir string, database *schema.Schema) (e error)
- func (g *Gen) GenerateGoAPI(dir string) error
- func (g *Gen) GenerateGoApp(dir string) error
- func (g *Gen) GenerateServiceBootstrapFile(servicesDir string) (e error)
- func (g *Gen) GenerateServiceInterfaces(definitionsDir string, servicesDir string) error
- func (g *Gen) GetOrphanedDals(dir string, database *schema.Schema) []string
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 BuildRoutesCodeFromController ¶
func BuildRoutesCodeFromController(controller *lib.Controller) (out string, e error)
BuildRoutesCodeFromController builds controller code based on a route
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 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
GenRoutes generates a list of routes from a directory of controller files
func GenTSPerms ¶ added in v1.8.20
func GenerateDALsBootstrapFile ¶
func GenerateDALsBootstrapFile(config *lib.Config, dir string, schemaList *schema.SchemaList) (e error)
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 GenerateTypescriptType ¶ added in v1.8.23
GenerateTypescriptType returns a string for a type in typescript
func GenerateTypescriptTypes ¶ added in v1.8.23
GenerateTypescriptTypes returns a string for a typscript types file
Types ¶
type ControllerFetcher ¶ added in v1.8.19
type ControllerFetcher struct {
// contains filtered or unexported fields
}
func NewControllerFetcher ¶ added in v1.8.19
func NewControllerFetcher() *ControllerFetcher
func (*ControllerFetcher) BuildControllerObjFromControllerFile ¶ added in v1.8.19
func (cf *ControllerFetcher) BuildControllerObjFromControllerFile(filePath string) (controller *lib.Controller, e error)
BuildControllerObjFromControllerFile parses a file and extracts all of its @route comments
func (*ControllerFetcher) Fetch ¶ added in v1.8.19
func (cf *ControllerFetcher) Fetch(dir string) (controllers []*lib.Controller, e error)
type Gen ¶
Gen conntains all of the generator functionality
func (*Gen) GenerateAPIRoutes ¶
func (*Gen) GenerateDALSQL ¶
GenerateDALSQL generates a constants file filled with sql statements
func (*Gen) GenerateGoAPI ¶
func (*Gen) GenerateGoApp ¶
GenerateGoApp generates the base app code
func (*Gen) GenerateServiceBootstrapFile ¶
@deprecated
func (*Gen) GenerateServiceInterfaces ¶
GenerateServiceInterfaces scans the services directory and outputs 2 files
- A services bootstrap file in the services directory
- A services definition file in the definitions directory