pleshevskiy / sonic-channel

Rust client for sonic search backend
Mozilla Public License 2.0
41 stars 8 forks source link

Open channel using env variables #17

Closed pleshevskiy closed 2 years ago

pleshevskiy commented 2 years ago

I'll introduce new commands for channels that will use environment variables to connect.

The first, will use the default environment variables SONIC_HOST and SONIC_PASSWORD to connect.

SearchChannel::from_env();

In the second one you can specify your own variable names.

SearchChannel::from_custom_env("SEARCH_SONIC_HOST", "SEARCH_SONIC_PASSWORD");
pleshevskiy commented 2 years ago

Although, despite its simplicity, this will not be an optimized solution, and lazy_static will have to be brought back. So let it be managed externally, as before.