1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
pub use fluvio_controlplane_metadata::topic::*;

pub mod validate {
    use crate::shared::validate_resource_name;

    /// Ensure a topic can be created with a given name.
    /// Topics name can only be formed by lowercase alphanumeric elements and hyphens.
    /// They should start and finish with an alphanumeric character.
    pub fn valid_topic_name(name: &str) -> bool {
        validate_resource_name(name).is_ok()
    }
}

mod convert {

    use crate::CreatableAdminSpec;
    use crate::DeletableAdminSpec;
    use crate::AdminSpec;

    use super::TopicSpec;

    impl AdminSpec for TopicSpec {}

    impl CreatableAdminSpec for TopicSpec {}

    impl DeletableAdminSpec for TopicSpec {
        type DeleteKey = String;
    }
}