Add function to build header content
This commit is contained in:
parent
9f29f0e1b7
commit
cd72295c1a
1 changed files with 17 additions and 0 deletions
|
@ -1,4 +1,5 @@
|
|||
use storage::file::FileHeaderSpec as FHS;
|
||||
use storage::file::FileHeaderData as FHD;
|
||||
|
||||
pub fn get_spec() -> FHS {
|
||||
FHS::Map { keys: vec![ url_key(), tags_key() ] }
|
||||
|
@ -16,3 +17,19 @@ fn text_array() -> FHS {
|
|||
FHS::Array { allowed_types: vec![FHS::Text] }
|
||||
}
|
||||
|
||||
|
||||
pub fn build_header(url: &String, tags: &Vec<String>) -> FHD {
|
||||
FHD::Map {
|
||||
keys: vec![
|
||||
FHD::Key {
|
||||
name: "URL",
|
||||
value: Box::new(FHD::Text(url.clone()))
|
||||
},
|
||||
FHD::Key {
|
||||
name: "TAGS",
|
||||
value: Box::new(FHD::Text(tags.connect(",")))
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue