Module utils

Source
Expand description

Utils module.

§Overview

This module contains utility functions for the DS Event Stream.

§Features

  • Get the topics for the DS Event Stream.

§Example

use ds_event_stream_rs_sdk::utils::{list_topics, get_topic, get_bootstrap_servers, Environment, ClientCredentials};

let bootstrap_servers = get_bootstrap_servers(Environment::Development, false);
let credentials = ClientCredentials { username: "username".to_string(), password: "password".to_string() };

let topic = get_topic(&bootstrap_servers, &credentials, "topic_name");
let topics = list_topics(&bootstrap_servers, &credentials);

Modules§

error
Utils error module.

Structs§

ClientCredentials
Client credentials for Kafka authentication.

Enums§

Environment
The environment of the DS Event Stream.

Constants§

DEV_EXTERNAL_BOOTSTRAP 🔒
DEV_INTERNAL_BOOTSTRAP 🔒
PROD_EXTERNAL_BOOTSTRAP 🔒
PROD_INTERNAL_BOOTSTRAP 🔒

Functions§

create_admin_client 🔒
Create an admin client.
get_bootstrap_servers
Get the bootstrap servers for the DS Event Stream.
get_topic
Get the name of a specific topic.
list_topics
List the topics for the DS Event Stream.