Skip to content

Commit

Permalink
Update example for path remapping
Browse files Browse the repository at this point in the history
  • Loading branch information
DmitryDodzin committed Jul 23, 2024
1 parent 35246e7 commit 80691c7
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
2 changes: 1 addition & 1 deletion mirrord-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@
},
"mapping": {
"title": "feature.fs.mapping {#feature-fs-mapping}",
"description": "Specify map of patterns that if matched will replace the path according to specification",
"description": "Specify map of patterns that if matched will replace the path according to specification.\n\n*Capture groups are allowed.*\n\nExample: ```json { \"^/home/(?<user>\\S+)/dev/tomcat\": \"/etc/tomcat\" \"^/home/(?<user>\\S+)/dev/config/(?<app>\\S+)\": \"/mnt/configs/${user}-$app\" } ``` Will do the next replacements for any io operaton\n\n`/home/johndoe/dev/tomcat/context.xml` => `/etc/tomcat/context.xml` `/home/johndoe/dev/config/api/app.conf` => `/mnt/configs/johndoe-api/app.conf`",
"type": [
"object",
"null"
Expand Down
16 changes: 15 additions & 1 deletion mirrord/config/src/feature/fs/advanced.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,21 @@ pub struct FsConfig {

/// ### feature.fs.mapping {#feature-fs-mapping}
///
/// Specify map of patterns that if matched will replace the path according to specification
/// Specify map of patterns that if matched will replace the path according to specification.
///
/// *Capture groups are allowed.*
///
/// Example:
/// ```json
/// {
/// "^/home/(?<user>\S+)/dev/tomcat": "/etc/tomcat"
/// "^/home/(?<user>\S+)/dev/config/(?<app>\S+)": "/mnt/configs/${user}-$app"
/// }
/// ```
/// Will do the next replacements for any io operaton
///
/// `/home/johndoe/dev/tomcat/context.xml` => `/etc/tomcat/context.xml`
/// `/home/johndoe/dev/config/api/app.conf` => `/mnt/configs/johndoe-api/app.conf`
pub mapping: Option<HashMap<String, String>>,
}

Expand Down

0 comments on commit 80691c7

Please sign in to comment.