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

The database connection pool

The GitHub OAuth2 configuration

A unique key used with conduit_cookie to generate cookies

The crate index git repository

The location on disk of the checkout of the crate index git repository

The server configuration

Methods

impl App
[src]

[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)

[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.