Struct cargo_registry::app::App
[−]
[src]
pub struct App { pub diesel_database: DieselPool, pub github: Config, pub session_key: String, pub git_repo: Mutex<Repository>, pub git_repo_checkout: PathBuf, pub config: Config, }
The App
struct holds the main components of the application like
the database connection pool and configurations
Fields
diesel_database: DieselPool
The database connection pool
github: Config
The GitHub OAuth2 configuration
session_key: String
A unique key used with conduit_cookie to generate cookies
git_repo: Mutex<Repository>
The crate index git repository
git_repo_checkout: PathBuf
The location on disk of the checkout of the crate index git repository
config: Config
The server configuration
Methods
impl App
[src]
fn new(config: &Config) -> App
[src]
Creates a new App
with a given Config
Configures and sets up:
- GitHub OAuth
- Database connection pools
- A
git2::Repository
instance from the index repo checkout (that server.rs ensures exists)
fn handle(&self) -> Easy
[src]
Returns a handle for making HTTP requests to upload crate files.
The handle will go through a proxy if the uploader being used has specified one, which is only done in test mode in order to be able to record and inspect the HTTP requests that tests make.