diff --git a/src/consts.rs b/src/consts.rs index 008e435..25fba9b 100644 --- a/src/consts.rs +++ b/src/consts.rs @@ -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"), "/", @@ -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");