File tree 1 file changed +9
-0
lines changed
1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -12,17 +12,25 @@ use curl::http;
12
12
13
13
use { db, Config } ;
14
14
15
+ /// The `App` struct holds the main components of the application like
16
+ /// the database connection pool and configurations
15
17
pub struct App {
18
+ /// The database connection pool
16
19
pub database : db:: Pool ,
20
+
21
+ /// The GitHub OAuth2 configuration
17
22
pub github : oauth2:: Config ,
18
23
pub bucket : s3:: Bucket ,
19
24
pub s3_proxy : Option < String > ,
20
25
pub session_key : String ,
21
26
pub git_repo : Mutex < git2:: Repository > ,
22
27
pub git_repo_checkout : PathBuf ,
28
+
29
+ /// The server configuration
23
30
pub config : Config ,
24
31
}
25
32
33
+ /// The `AppMiddleware` injects an `App` instance into the `Request` extensions
26
34
pub struct AppMiddleware {
27
35
app : Arc < App >
28
36
}
@@ -82,6 +90,7 @@ impl Middleware for AppMiddleware {
82
90
}
83
91
}
84
92
93
+ /// Adds an `app()` method to the `Request` type returning the global `App` instance
85
94
pub trait RequestApp {
86
95
fn app ( & self ) -> & Arc < App > ;
87
96
}
You can’t perform that action at this time.
0 commit comments