(name: &str)
| 15 | } |
| 16 | |
| 17 | pub fn topic(name: &str) -> RepoTopic { |
| 18 | let added = chrono::Utc::now(); |
| 19 | // Some unique path |
| 20 | let id: ExternalId = sha256_base64(name).try_into().unwrap(); |
| 21 | RepoTopic { |
| 22 | api_version: API_VERSION.to_owned(), |
| 23 | metadata: RepoTopicMetadata { |
| 24 | added, |
| 25 | id: id.to_owned(), |
| 26 | details: Some(RepoTopicDetails { |
| 27 | root: false, |
| 28 | timerange: None, |
| 29 | synonyms: Vec::from([Synonym { |
| 30 | name: name.to_owned(), |
| 31 | locale: Locale::EN, |
| 32 | added, |
| 33 | }]), |
| 34 | }), |
| 35 | }, |
| 36 | parent_topics: BTreeSet::from([ParentTopic { id }]), |
| 37 | children: BTreeSet::new(), |
| 38 | } |
| 39 | } |
| 40 | |
| 41 | pub fn link(title: &str, url: &str) -> RepoLink { |
| 42 | let added = chrono::Utc::now(); |
no test coverage detected