CallistoLabsNYC / samsa

Rust-native Kafka/Redpanda protocol and client implementation.
Apache License 2.0
106 stars 5 forks source link

Implement TLS Connection #69

Closed hgm-king closed 4 months ago

hgm-king commented 6 months ago

Major Changes to notice

Network Code

We have moved the network module around to contain the TCP and TLS code. They each impl BrokerConnection which is a trait that abstracts out the reading, writing, and connecting over the network for their respective protocols.

Connection Config

We have a BrokerAddress struct that we use to hold a host and port. This is used by both the TCP and the TLS connection. The TLS connection also has a set of cert file paths that it needs.

Logic Changes

Each higher level struct like Producer and Consumer has a generic parameter which allows it to accept a TLS or TCP. This makes it know what type of config it requires.

The low level methods accept an impl BrokerConnection which you will see all over.