gen

package
v1.8.43 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 5, 2021 License: MIT Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
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 BuildPermissionsGoFile(permissionMap map[string]string)

func BuildTypescriptPermissions added in v1.8.11

func BuildTypescriptPermissions(permissionMap map[string]string) string

BuildTypescriptPermissions returns a formatted typescript file of permission constants

func CleanGoDALs

func CleanGoDALs(dir string, database *schema.Schema) (e error)

CleanGoDALs removes any repo files that aren't in the database.Tables map

func CleanGoModels

func CleanGoModels(dir string, database *schema.Schema) (e error)

CleanGoModels removes model files that are not found in the database.Tables map

func GenDALs

func GenDALs(dalsDir string, config *lib.Config, force, clean bool) error

func GenGoPerms added in v1.8.20

func GenGoPerms(config *lib.Config) (e error)

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 GenInterfaces(srcDir, destDir string) error

func GenModels

func GenModels(config *lib.Config, force bool, clean bool) error

GenModels generates models

func GenServicesBootstrap added in v1.8.34

func GenServicesBootstrap(config *lib.Config) error

services/services.go

func GenTSPerms added in v1.8.20

func GenTSPerms(config *lib.Config) (e error)

func GenerateDALsBootstrapFile

func GenerateDALsBootstrapFile(config *lib.Config, dir string, schemaList *schema.SchemaList) (e error)

GenerateDALsBootstrapFile generates a dal bootstrap file in golang

func GenerateGoDAL

func GenerateGoDAL(config *lib.Config, table *schema.Table, dir string) (e error)

GenerateGoDAL returns a string for a repo in golang

func GenerateGoModel

func GenerateGoModel(packageName, dir string, schemaName string, table *schema.Table) (e error)

GenerateGoModel returns a string for a model in golang

func GenerateTypescriptType added in v1.8.23

func GenerateTypescriptType(table *schema.Table) (string, error)

GenerateTypescriptType returns a string for a type in typescript

func GenerateTypescriptTypes added in v1.8.23

func GenerateTypescriptTypes(database *schema.Schema) (string, error)

GenerateTypescriptTypes returns a string for a typscript types file

func InspectFile

func InspectFile(filePath string) (s *lib.GoStruct, e error)

InspectFile inspects a file

func LoadPermissionsFromJSON added in v1.8.34

func LoadPermissionsFromJSON() map[string]string

LoadPermissionsFromJSON loads a set of permissions from a JSON file

Types

type Gen

type Gen struct {
	Config *lib.Config
}

Gen conntains all of the generator functionality

func (*Gen) GenAPITests

func (g *Gen) GenAPITests() (e error)

GenAPITests generates api tests

func (*Gen) GenMeta

func (g *Gen) GenMeta(dir string, database *schema.Schema) (e error)

GenMeta returns a string for a model in golang

func (*Gen) GenerateAPIRoutes

func (g *Gen) GenerateAPIRoutes(apiDir string) error

func (*Gen) GenerateDALSQL

func (g *Gen) GenerateDALSQL(dir string, database *schema.Schema) (e error)

GenerateDALSQL generates a constants file filled with sql statements

func (*Gen) GenerateGoAPI

func (g *Gen) GenerateGoAPI(dir string) error

func (*Gen) GenerateGoApp

func (g *Gen) GenerateGoApp(dir string) error

GenerateGoApp generates the base app code

func (*Gen) GenerateServiceBootstrapFile

func (g *Gen) GenerateServiceBootstrapFile(servicesDir string) (e error)

@deprecated

func (*Gen) GenerateServiceInterfaces

func (g *Gen) GenerateServiceInterfaces(definitionsDir string, servicesDir string) error

GenerateServiceInterfaces scans the services directory and outputs 2 files

  1. A services bootstrap file in the services directory
  2. A services definition file in the definitions directory

func (*Gen) GetOrphanedDals

func (g *Gen) GetOrphanedDals(dir string, database *schema.Schema) []string

GetOrphanedDals gets repo files that aren't in the database.Tables map

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL