fluvio_sc_schema/topic/
mod.rs

1pub use fluvio_controlplane_metadata::topic::*;
2
3pub mod validate {
4    use crate::shared::validate_resource_name;
5
6    /// Ensure a topic can be created with a given name.
7    /// Topics name can only be formed by lowercase alphanumeric elements and hyphens.
8    /// They should start and finish with an alphanumeric character.
9    pub fn valid_topic_name(name: &str) -> bool {
10        validate_resource_name(name).is_ok()
11    }
12}
13
14mod convert {
15
16    use fluvio_controlplane_metadata::topic::UpdateTopicAction;
17
18    use crate::CreatableAdminSpec;
19    use crate::DeletableAdminSpec;
20    use crate::AdminSpec;
21    use crate::UpdatableAdminSpec;
22
23    use super::TopicSpec;
24
25    impl AdminSpec for TopicSpec {}
26
27    impl CreatableAdminSpec for TopicSpec {}
28
29    impl DeletableAdminSpec for TopicSpec {
30        type DeleteKey = String;
31    }
32
33    impl UpdatableAdminSpec for TopicSpec {
34        type UpdateKey = String;
35        type UpdateAction = UpdateTopicAction;
36    }
37}