Skip to content

Commit

Permalink
Merge pull request #84 from dandi/doc-consts
Browse files Browse the repository at this point in the history
Document all items in `consts.rs`
  • Loading branch information
jwodder authored Feb 17, 2024
2 parents 85ed1e6 + c998568 commit 43599f3
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions src/consts.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use time::{format_description::FormatItem, macros::format_description};

/// The value of the "User-Agent" header sent in requests to the Dandi Archive
/// and S3
/// The "User-Agent" value sent in outgoing HTTP requests
pub(crate) static USER_AGENT: &str = concat!(
env!("CARGO_PKG_NAME"),
"/",
Expand All @@ -11,29 +10,42 @@ pub(crate) static USER_AGENT: &str = concat!(
")",
);

/// The value of the "Server" header returned in all responses from dandidav
/// The "Server" value returned in all responses from dandidav
pub(crate) static SERVER_VALUE: &str =
concat!(env!("CARGO_PKG_NAME"), "/", env!("CARGO_PKG_VERSION"));

/// The default value of the `--api-url` command-line option
pub(crate) static DEFAULT_API_URL: &str = "https://api.dandiarchive.org/api";

// Case sensitive:
/// File extensions (case sensitive) for Zarrs, including the leading periods
pub(crate) static ZARR_EXTENSIONS: [&str; 2] = [".zarr", ".ngff"];

/// The maximum number of S3 clients cached at once by `DandiClient`
pub(crate) const S3CLIENT_CACHE_SIZE: u64 = 8;

/// The "Content-Type" value for HTML responses to `GET` requests for
/// collections
pub(crate) static HTML_CONTENT_TYPE: &str = "text/html; charset=utf-8";

/// The "Content-Type" value for the stylesheet
pub(crate) static CSS_CONTENT_TYPE: &str = "text/css; charset=utf-8";

/// The "Content-Type" value (reported in both `GET` and `PROPFIND` responses)
/// for virtual `dandiset.yaml` files
pub(crate) static YAML_CONTENT_TYPE: &str = "text/yaml; charset=utf-8";

/// The "Content-Type" value given in `PROPFIND` responses for blob assets with
/// no `encodingFormat` set and also for Zarr entries
pub(crate) static DEFAULT_CONTENT_TYPE: &str = "application/octet-stream";

/// The "Content-Type" value for `PROPFIND` XML responses
pub(crate) static DAV_XML_CONTENT_TYPE: &str = "text/xml; charset=utf-8";

/// The XML namespace for standard WebDAV elements
pub(crate) static DAV_XMLNS: &str = "DAV:";

/// The display format for timestamps shown in collections' HTML views (after
/// converting to UTC)
pub(crate) static HTML_TIMESTAMP_FORMAT: &[FormatItem<'_>] =
format_description!("[year]-[month]-[day] [hour]:[minute]:[second]Z");

Expand Down

0 comments on commit 43599f3

Please sign in to comment.