Crate cargo_registry [] [src]

This crate implements the backend server for https://crates.io/

All implemented routes are defined in the middleware function and implemented in the category, keyword, krate, user and version modules.

Reexports

extern crate std as std;
extern crate diesel;
extern crate diesel_codegen;
extern crate log;
extern crate serde_json;
extern crate serde_derive;
extern crate ammonia;
extern crate chrono;
extern crate comrak;
extern crate curl;
extern crate diesel_full_text_search;
extern crate dotenv;
extern crate git2;
extern crate hex;
extern crate license_exprs;
extern crate oauth2;
extern crate openssl;
extern crate r2d2;
extern crate r2d2_diesel;
extern crate rand;
extern crate s3;
extern crate semver;
extern crate serde;
extern crate time;
extern crate toml;
extern crate url;
extern crate conduit;
extern crate conduit_conditional_get;
extern crate conduit_cookie;
extern crate cookie;
extern crate conduit_git_http_backend;
extern crate conduit_log_requests;
extern crate conduit_middleware;
extern crate conduit_router;
extern crate conduit_static;
use std::prelude::v1::*;
pub use app::App;
pub use self::badge::Badge;
pub use self::category::Category;
pub use config::Config;
pub use self::dependency::Dependency;
pub use self::download::VersionDownload;
pub use self::keyword::Keyword;
pub use self::krate::Crate;
pub use self::user::User;
pub use self::version::Version;
pub use self::uploaders::Uploader;
pub use self::uploaders::Bomb;
use std::sync::Arc;
use std::error::Error;
use conduit_router::RouteBuilder;
use conduit_middleware::MiddlewareBuilder;
use util::C;
use util::R;
use util::R404;

Modules

app

Application-wide components in a struct accessible from each request

badge
categories
category
config
crate_owner_invitation
db
dependency
dist

This module implements middleware to serve the compiled emberjs frontend

download
git
http
keyword
krate
local_upload

This module implements middleware to serve crates and readmes from the local_uploads/ directory. This is only used in development environments.

owner
pagination
render
schema
token
upload

This module handles the expected information a crate should have and manages the serialising and deserialising of this information to and from structs. The serlializing is only utilised in integration tests.

uploaders
user
util
version

Structs

lower_t

Enums

Env

Used for setting different values depending on whether the app is being run in production, in development, or for testing.

Replica

Used for setting different values depending on the type of registry this instance is.

Functions

encode_time

Convenience function for getting a time in RFC 3339 format.

env

Convenience function requiring that an environment variable is set.

lower
middleware

Configures routes, sessions, logging, and other middleware.

now

Convenience function for getting the current server time in UTC.

Type Definitions

lower