-
-
Notifications
You must be signed in to change notification settings - Fork 11
Config
龙方淞 edited this page Aug 31, 2020
·
4 revisions
Configuration is used to tell the program how to generate the Web API.
The supported configuration items are:
-
docker
: Information for generating Dockerfile and related CI files. Dockerfile will not be generated if not provided-
username
: Docker Usernam -
tag
: tag of the image
-
-
cicd
: Information for generating CICD-related configuration files-
GitHubAction
: Whether to generate a GitHub Action configuation file -
k8s
: Whether to generate k8s configuation file
-
-
database
: database related information, required-
dbengine
: The database engine to use,pgsql
by default -
url
: database url, cannot create k8s configuation file if not provided, will panic if so -
tablename
: tablename in the database -
fields
: fields in the database, will try to fetch from the meta table in the database implied byurl
-
name
: field name -
type
: field type (use the typename in the database)
-
-
complex
: complex query-
name
: API endpoint of the complex query -
sql
: sql used during the query -
params
: params used in the qurty-
onThis
: The foreign key name on the original table, givename
or this field -
name
: field name, give this field oronThis
-
type
: field type
-
-
result
: return value of this API-
array
: whether return multiple results -
fields
: colums in the database-
name
: field name -
type
: field type (use the typename in the database)
-
-
-
-
The system supports the following ways to accept configuration:
- Command line parameters
- environment variable
- yaml/toml/json file
- .sql file
- Database meta information
- default value
The priority decreases from top to bottom, for example:
- If you provide
-databaseurl=xxx
in the command line, the correspondingdatabase.url
in yaml will be ignored - If you do not provide
database.fields
in the input yaml file, the program will try to connect to the databasedatabase.url
to read the metadata in the database to generate fields information.
You can export the final configuration to a file.