Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update ENG docs #51

Open
wants to merge 17 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ENG-03-Quick-Start.md
Original file line number Diff line number Diff line change
Expand Up @@ -189,4 +189,4 @@ We see that adding a controller to an application is very simple. You only need

**Note: Drogon has no restrictions on the location of the controller source files. You could also save them in "./" (the project root directory), or you could even define a new directory in `CMakeLists.txt`. It is recommended to use the controllers directory for the convenience of management.**

# 04.0 [Controller Introduction](ENG-04-0-Controller-Introduction)
# 04.0 [Controller Introduction](ENG-04-0-Controller-Introduction.md)
2 changes: 1 addition & 1 deletion ENG-04-0-Controller-Introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ public:

A controller registered to a drogon framework will have at most only one instance and will not be destroyed during the entire application run, so users can declare and use member variables in the controller class. Note that when the handler of the controller is called, it is in a multi-threaded environment (when the number of IO threads of the framework is configured to be greater than 1), if you need to access non-temporary variables, please do the concurrent protection work.

# 04.1 [HttpSimpleController](ENG-04-1-Controller-HttpSimpleController)
# 04.1 [HttpSimpleController](ENG-04-1-Controller-HttpSimpleController.md)
2 changes: 1 addition & 1 deletion ENG-04-1-Controller-HttpSimpleController.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,4 @@ You could define an HttpResponse class variable, and then use the callback() to

**The mapping from the above path to the handler is done at compile time. In fact, the drogon framework also provides an interface for runtime completion mapping. The runtime mapping allows the user to map or modify the mapping through configuration files or other user interfaces without recompiling this program (For performance reasons, it is forbidden to add any controller mapping after running the app().run() method).**

# 04.2 [HttpController](ENG-04-2-Controller-HttpController)
# 04.2 [HttpController](ENG-04-2-Controller-HttpController.md)
2 changes: 1 addition & 1 deletion ENG-04-2-Controller-HttpController.md
Original file line number Diff line number Diff line change
Expand Up @@ -275,4 +275,4 @@ As can be seen, parameter mapping can also be done using regular expressions, an

**It should be noted that when using regular expressions, you should pay attention to matching conflicts (multiple different handlers are matched). When conflicts happen in the same controller, drogon will only execute the first handler (the one registered in the framework first). When conflicts happen between different controllers, it is uncertain which handler will be executed. Therefore, users need to avoid these conflicts.**

# 04.3 [WebSocketController](ENG-04-3-Controller-WebSocketController)
# 04.3 [WebSocketController](ENG-04-3-Controller-WebSocketController.md)
2 changes: 1 addition & 1 deletion ENG-04-3-Controller-WebSocketController.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,4 +144,4 @@ const any &getContext() const;
any *getMutableContext();
```

# 05 [Filter](ENG-05-Filter)
# 05 [Filter](ENG-05-Filter.md)
2 changes: 1 addition & 1 deletion ENG-05-Filter.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,4 @@ As you can see, the configuration and registration of filters are very simple. T

**Note: If the filter is defined in the namespace, you must write the namespace completely when you register the filter.**

# 06 [View](ENG-06-View)
# 06 [View](ENG-06-View.md)
2 changes: 1 addition & 1 deletion ENG-06-View.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,4 +148,4 @@ Obviously, this function depends on the development environment. If both drogon

**Note: If a `symbol not found` error occurs while loading a dynamic view, please use the `cmake .. -DCMAKE_ENABLE_EXPORTS=on` to configure your project, or uncomment the last line (`set_property(TARGET ${PROJECT_NAME} PROPERTY ENABLE_EXPORTS ON)`) in your project's CMakeLists.txt, and then rebuild the project**

# 07 [Session](ENG-07-Session)
# 07 [Session](ENG-07-Session.md)
2 changes: 1 addition & 1 deletion ENG-07-Session.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,4 +95,4 @@ drogon::HttpAppFramework::instance().enableSession(1200);

Recompile the entire project with CMake, run the target program webapp, and you can see the effect through the browser.

# 08.0 [Database](ENG-08-0-Database-General)
# 08.0 [Database](ENG-08-0-Database-General.md)
4 changes: 2 additions & 2 deletions ENG-08-0-Database-General.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ The transaction object can be generated by `DbClient` to support transaction ope

### ORM

Drogon also provides support for **ORM**. Users can use the drogon_ctl command to read the tables in the database and generate the corresponding model source code. Then, execute the database operations of these models through the `Mapper<MODEL>` class template. Mapper provides simple and convenient interfaces for standard database operations, allowing users to make the additions, deletions, and changes to the table without writing sql statements. For **ORM**, please refer to [ORM](ENG-08-3-DataBase-ORM)
Drogon also provides support for **ORM**. Users can use the drogon_ctl command to read the tables in the database and generate the corresponding model source code. Then, execute the database operations of these models through the `Mapper<MODEL>` class template. Mapper provides simple and convenient interfaces for standard database operations, allowing users to make the additions, deletions, and changes to the table without writing sql statements. For **ORM**, please refer to [ORM](ENG-08-3-DataBase-ORM.md)

# 08.1 [DbClient](ENG-08-1-DataBase-DbClient)
# 08.1 [DbClient](ENG-08-1-DataBase-DbClient.md)
2 changes: 1 addition & 1 deletion ENG-08-2-DataBase-Transaction.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,4 +81,4 @@ For the simplest example, suppose there is a task table from which the user sele

In this case, select for update is used to avoid concurrent modifications. The update statement is completed in the result callback of the select statement. The outermost braces are used to limit the scope of the transPtr so that it can be destroyed in time after the execution of sql to end the transaction.

# 08.3 [ORM](ENG-08-3-DataBase-ORM)
# 08.3 [ORM](ENG-08-3-DataBase-ORM.md)
2 changes: 1 addition & 1 deletion ENG-08-3-DataBase-ORM.md
Original file line number Diff line number Diff line change
Expand Up @@ -281,4 +281,4 @@ drogon_ctl can also generate restful-style controllers for each model (or table)
It should be noted that the controller of each table is designed to be composed of a base class and a subclass. Among them, the base class and the table are closely related, and the subclass is used to implement special business logic or modify the interface format. The advantage of this design is that when the table structure changes, users can update only the base class without overwriting the subclass(by setting the `generate_base_only` option to `true`).


# 08.4 [FastDbClient](ENG-08-4-DataBase-FastDbClient)
# 08.4 [FastDbClient](ENG-08-4-DataBase-FastDbClient.md)
2 changes: 1 addition & 1 deletion ENG-08-4-DataBase-FastDbClient.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ The use of FastDbClient is almost identical to that of the normal DbClient, exce
* Synchronous transaction creation interfaces are likely to block (when all connections are busy), so FastDbClient's synchronous transaction creation interface returns null pointers directly. If you want to use transactions on FastDbClient, please use the asynchronous transaction creation interface.
* After using the FastDbClient to create an Orm Mapper object, you should also use only asynchronous non-blocking interfaces of the mapper object.

# 08.5 [Automatic batch mode](ENG-08-5-DataBase-auto_batch)
# 08.5 [Automatic batch mode](ENG-08-5-DataBase-auto_batch.md)
2 changes: 1 addition & 1 deletion ENG-08-5-DataBase-auto_batch.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@ Therefore, automatic batch mode is helpful to improve performance, but it is not
When using the newPgClient interface to create a client, set the third parameter to true to enable automatic batch mode;
When using a configuration file to create a client, set the auto_batch option to true to enable automatic batch mode for the client;

# 09 [Plugins](ENG-09-Plugins)
# 09 [Plugins](ENG-09-Plugins.md)
2 changes: 1 addition & 1 deletion ENG-09-Plugins.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,4 @@ Note that it is best to get the plugin after calling the framework's run() inter

All plugins are initialized in the run() interface of the framework and are destroyed when the application exits. Therefore, the plugin's lifecycle is almost identical to the application, which is why the getPlugin() interface does not need to return a smart pointer.

# 10 [Configuration File](ENG-10-Configuration-File)
# 10 [Configuration File](ENG-10-Configuration-File.md)
4 changes: 2 additions & 2 deletions ENG-10-Configuration-File.md
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ Among them:
* `dynamic_views_path`:Boolean value, the default value is false. When it is true, the framework searches view files in the view path and dynamically compiles them into .so files, then loads them into the application. When any view file changes, it will also cause automatic compilation and re-loading;
* `dynamic_views_path`:An array of strings, each of which represents the search path of the dynamic view. If the path value is not starting with `/`, `./` or `../`, and the value is not `.` or `..`, then This path is the relative path of the previous document_root entry, otherwise it is an absolute path or a relative path to the current directory.

See [View](ENG-06-View)
See [View](ENG-06-View.md)

### Server header field

Expand All @@ -332,4 +332,4 @@ The `pipelining_requests` sets the maximum number of unhandled requests that can
"pipelining_requests": 0
```

# 11 [drogon_ctl Command](ENG-11-drogon_ctl-Command)
# 11 [drogon_ctl Command](ENG-11-drogon_ctl-Command.md)
2 changes: 1 addition & 1 deletion ENG-11-drogon_ctl-Command.md
Original file line number Diff line number Diff line change
Expand Up @@ -166,4 +166,4 @@ dg_ctl press -n1000000 -t4 -c1000 -q http://localhost:8080/
dg_ctl press -n 1000000 -t 4 -c 1000 https://www.domain.com/path/to/be/tested
```

# 12 [AOP](ENG-12-AOP-Aspect-Oriented-Programming)
# 12 [AOP](ENG-12-AOP-Aspect-Oriented-Programming.md)
2 changes: 1 addition & 1 deletion ENG-12-AOP-Aspect-Oriented-Programming.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ The following figure shows the location of the above four joinpoints in the HTTP

![](images/AOP.png)

# 13 [Benchmarks](ENG-13-Benchmarks)
# 13 [Benchmarks](ENG-13-Benchmarks.md)