Skip to content

Commit

Permalink
Add admin API client
Browse files Browse the repository at this point in the history
Fix #92.
  • Loading branch information
benesch committed Aug 6, 2019
1 parent 70f6125 commit 16facfa
Show file tree
Hide file tree
Showing 11 changed files with 1,779 additions and 2 deletions.
2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,12 @@ serde_derive = "1.0.0"
serde_json = "1.0.0"

[dev-dependencies]
backoff = "0.1.5"
chrono = "0.4.0"
clap = "2.18.0"
env_logger = "0.3.0"
rand = "0.3.15"
regex = "1.1.6"
tokio = "0.1.7"

[features]
Expand Down
2 changes: 2 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ services:
volumes:
- .:/mount
command: ./run_tests.sh
environment:
- KAFKA_VERSION=1.0.2

kafka:
image: confluentinc/cp-kafka:5.2.1
Expand Down
3 changes: 3 additions & 0 deletions rdkafka-sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@ fn main() {
.rustified_enum("rd_kafka_conf_res_t")
.rustified_enum("rd_kafka_resp_err_t")
.rustified_enum("rd_kafka_timestamp_type_t")
.rustified_enum("rd_kafka_admin_op_t")
.rustified_enum("rd_kafka_ResourceType_t")
.rustified_enum("rd_kafka_ConfigSource_t")
.generate()
.expect("failed to generate bindings");

Expand Down
33 changes: 33 additions & 0 deletions rdkafka-sys/src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,30 @@ pub type RDKafkaGroupMemberInfo = bindings::rd_kafka_group_member_info;
/// Native rdkafka group member information
pub type RDKafkaHeaders = bindings::rd_kafka_headers_t;

/// Native rdkafka queue
pub type RDKafkaQueue = bindings::rd_kafka_queue_t;

// Native rdkafka new topic object
pub type RDKafkaNewTopic = bindings::rd_kafka_NewTopic_t;

// Native rdkafka delete topic object
pub type RDKafkaDeleteTopic = bindings::rd_kafka_DeleteTopic_t;

// Native rdkafka new partitions object
pub type RDKafkaNewPartitions = bindings::rd_kafka_NewPartitions_t;

// Native rdkafka config resource
pub type RDKafkaConfigResource = bindings::rd_kafka_ConfigResource_t;

// Native rdkafka event
pub type RDKafkaEvent = bindings::rd_kafka_event_t;

// Native rdkafka admin options
pub type RDKafkaAdminOptions = bindings::rd_kafka_AdminOptions_t;

// Native rdkafka topic result
pub type RDKafkaTopicResult = bindings::rd_kafka_topic_result_t;

// ENUMS

/// Client types
Expand All @@ -66,6 +90,15 @@ pub use bindings::rd_kafka_conf_res_t as RDKafkaConfRes;
/// Response error
pub use bindings::rd_kafka_resp_err_t as RDKafkaRespErr;

/// Admin operation
pub use bindings::rd_kafka_admin_op_t as RDKafkaAdminOp;

/// Config resource type
pub use bindings::rd_kafka_ResourceType_t as RDKafkaResourceType;

/// Config source
pub use bindings::rd_kafka_ConfigSource_t as RDKafkaConfigSource;

/// Errors enum
/// Error from the underlying rdkafka library.
Expand Down
Loading

0 comments on commit 16facfa

Please sign in to comment.