Rename EppClientConnection to RegistryConfig

This type represents configuration to build a connection for a
particular registry, so this seems like a better name.
This commit is contained in:
Dirkjan Ochtman 2021-12-01 14:43:23 +01:00 committed by masalachai
parent ac50679071
commit 609c327a95
27 changed files with 96 additions and 98 deletions

View File

@ -53,7 +53,7 @@ You can create a mut variable of type `EppClient` with the domain registry confi
```rust ```rust
use std::collections::HashMap; use std::collections::HashMap;
use epp_client::config::{EppClientConfig, EppClientConnection}; use epp_client::config::{EppClientConfig, RegistryConfig};
use epp_client::EppClient; use epp_client::EppClient;
use epp_client::epp::{EppDomainCheck, EppDomainCheckResponse}; use epp_client::epp::{EppDomainCheck, EppDomainCheckResponse};
use epp_client::generate_client_tr_id; use epp_client::generate_client_tr_id;
@ -61,10 +61,10 @@ use epp_client::generate_client_tr_id;
#[tokio::main] #[tokio::main]
async fn main() { async fn main() {
// Configure the client to connect to one of more registries // Configure the client to connect to one of more registries
let mut registry: HashMap<String, EppClientConnection> = HashMap::new(); let mut registry: HashMap<String, RegistryConfig> = HashMap::new();
registry.insert( registry.insert(
"registry_name".to_owned(), "registry_name".to_owned(),
EppClientConnection { RegistryConfig {
host: "example.com".to_owned(), host: "example.com".to_owned(),
port: 700, port: 700,
username: "username".to_owned(), username: "username".to_owned(),
@ -126,7 +126,6 @@ cert_chain = '/path/to/certificate/chain/pemfile'
key = '/path/to/private/key/pemfile' key = '/path/to/private/key/pemfile'
``` ```
```rust ```rust
use epp_client::config::{EppClientConfig}; use epp_client::config::{EppClientConfig};

View File

@ -53,7 +53,7 @@ You can create a mut variable of type `EppClient` with the domain registry confi
```rust ```rust
use std::collections::HashMap; use std::collections::HashMap;
use epp_client::config::{EppClientConfig, EppClientConnection}; use epp_client::config::{EppClientConfig, RegistryConfig};
use epp_client::EppClient; use epp_client::EppClient;
use epp_client::epp::{EppDomainCheck, EppDomainCheckResponse}; use epp_client::epp::{EppDomainCheck, EppDomainCheckResponse};
use epp_client::generate_client_tr_id; use epp_client::generate_client_tr_id;
@ -61,10 +61,10 @@ use epp_client::generate_client_tr_id;
#[tokio::main] #[tokio::main]
async fn main() { async fn main() {
// Configure the client to connect to one of more registries // Configure the client to connect to one of more registries
let mut registry: HashMap<String, EppClientConnection> = HashMap::new(); let mut registry: HashMap<String, RegistryConfig> = HashMap::new();
registry.insert( registry.insert(
"registry_name".to_owned(), "registry_name".to_owned(),
EppClientConnection { RegistryConfig {
host: "example.com".to_owned(), host: "example.com".to_owned(),
port: 700, port: 700,
username: "username".to_owned(), username: "username".to_owned(),
@ -126,7 +126,6 @@ cert_chain = '/path/to/certificate/chain/pemfile'
key = '/path/to/private/key/pemfile' key = '/path/to/private/key/pemfile'
``` ```
```rust ```rust
use epp_client::config::{EppClientConfig}; use epp_client::config::{EppClientConfig};

View File

@ -5,7 +5,7 @@
//! ```no_run //! ```no_run
//! use std::collections::HashMap; //! use std::collections::HashMap;
//! //!
//! use epp_client::config::{EppClientConfig, EppClientConnection}; //! use epp_client::config::{EppClientConfig, RegistryConfig};
//! use epp_client::EppClient; //! use epp_client::EppClient;
//! use epp_client::domain::check::DomainCheck; //! use epp_client::domain::check::DomainCheck;
//! use epp_client::generate_client_tr_id; //! use epp_client::generate_client_tr_id;
@ -15,10 +15,10 @@
//! async fn main() { //! async fn main() {
//! //!
//! // Create a config //! // Create a config
//! let mut registry: HashMap<String, EppClientConnection> = HashMap::new(); //! let mut registry: HashMap<String, RegistryConfig> = HashMap::new();
//! registry.insert( //! registry.insert(
//! "registry_name".to_owned(), //! "registry_name".to_owned(),
//! EppClientConnection { //! RegistryConfig {
//! host: "example.com".to_owned(), //! host: "example.com".to_owned(),
//! port: 700, //! port: 700,
//! username: "username".to_owned(), //! username: "username".to_owned(),

View File

@ -7,13 +7,13 @@
//! ```no_run //! ```no_run
//! use std::collections::HashMap; //! use std::collections::HashMap;
//! //!
//! use epp_client::config::{EppClientConfig, EppClientConnection}; //! use epp_client::config::{EppClientConfig, RegistryConfig};
//! //!
//! // Create a config //! // Create a config
//! let mut registry: HashMap<String, EppClientConnection> = HashMap::new(); //! let mut registry: HashMap<String, RegistryConfig> = HashMap::new();
//! registry.insert( //! registry.insert(
//! "registry_name".to_owned(), //! "registry_name".to_owned(),
//! EppClientConnection { //! RegistryConfig {
//! host: "example.com".to_owned(), //! host: "example.com".to_owned(),
//! port: 700, //! port: 700,
//! username: "username".to_owned(), //! username: "username".to_owned(),
@ -48,19 +48,19 @@ pub struct EppClientTlsFiles {
/// Config that stores settings for multiple registries /// Config that stores settings for multiple registries
#[derive(Serialize, Deserialize, Debug)] #[derive(Serialize, Deserialize, Debug)]
pub struct EppClientConfig { pub struct EppClientConfig {
pub registry: HashMap<String, EppClientConnection>, pub registry: HashMap<String, RegistryConfig>,
} }
impl EppClientConfig { impl EppClientConfig {
/// Returns the config for a particular registry /// Returns the config for a particular registry
pub fn registry(&self, registry: &str) -> Option<&EppClientConnection> { pub fn registry(&self, registry: &str) -> Option<&RegistryConfig> {
self.registry.get(registry) self.registry.get(registry)
} }
} }
/// Connection details to connect to and authenticate with a registry /// Connection details to connect to and authenticate with a registry
#[derive(Serialize, Deserialize, Debug)] #[derive(Serialize, Deserialize, Debug)]
pub struct EppClientConnection { pub struct RegistryConfig {
pub host: String, pub host: String,
pub port: u16, pub port: u16,
pub username: String, pub username: String,
@ -69,7 +69,7 @@ pub struct EppClientConnection {
pub tls_files: Option<EppClientTlsFiles>, pub tls_files: Option<EppClientTlsFiles>,
} }
impl EppClientConnection { impl RegistryConfig {
/// Returns the EPP username and password as a tuple /// Returns the EPP username and password as a tuple
pub fn credentials(&self) -> (String, String) { pub fn credentials(&self) -> (String, String) {
(self.username.to_string(), self.password.to_string()) (self.username.to_string(), self.password.to_string())

View File

@ -30,7 +30,7 @@ impl<E: EppExtension> EppRequest<E> for ContactCheck<E> {
/// ```no_run /// ```no_run
/// use std::collections::HashMap; /// use std::collections::HashMap;
/// ///
/// use epp_client::config::{EppClientConfig, EppClientConnection}; /// use epp_client::config::{EppClientConfig, RegistryConfig};
/// use epp_client::EppClient; /// use epp_client::EppClient;
/// use epp_client::contact::check::ContactCheck; /// use epp_client::contact::check::ContactCheck;
/// use epp_client::generate_client_tr_id; /// use epp_client::generate_client_tr_id;
@ -39,10 +39,10 @@ impl<E: EppExtension> EppRequest<E> for ContactCheck<E> {
/// #[tokio::main] /// #[tokio::main]
/// async fn main() { /// async fn main() {
/// // Create a config /// // Create a config
/// let mut registry: HashMap<String, EppClientConnection> = HashMap::new(); /// let mut registry: HashMap<String, RegistryConfig> = HashMap::new();
/// registry.insert( /// registry.insert(
/// "registry_name".to_owned(), /// "registry_name".to_owned(),
/// EppClientConnection { /// RegistryConfig {
/// host: "example.com".to_owned(), /// host: "example.com".to_owned(),
/// port: 700, /// port: 700,
/// username: "username".to_owned(), /// username: "username".to_owned(),

View File

@ -29,7 +29,7 @@ impl<E: EppExtension> EppRequest<E> for ContactCreate<E> {
/// ```no_run /// ```no_run
/// use std::collections::HashMap; /// use std::collections::HashMap;
/// ///
/// use epp_client::config::{EppClientConfig, EppClientConnection}; /// use epp_client::config::{EppClientConfig, RegistryConfig};
/// use epp_client::EppClient; /// use epp_client::EppClient;
/// use epp_client::common::{Address, Phone, PostalInfo}; /// use epp_client::common::{Address, Phone, PostalInfo};
/// use epp_client::contact::create::ContactCreate; /// use epp_client::contact::create::ContactCreate;
@ -39,10 +39,10 @@ impl<E: EppExtension> EppRequest<E> for ContactCreate<E> {
/// #[tokio::main] /// #[tokio::main]
/// async fn main() { /// async fn main() {
/// // Create a config /// // Create a config
/// let mut registry: HashMap<String, EppClientConnection> = HashMap::new(); /// let mut registry: HashMap<String, RegistryConfig> = HashMap::new();
/// registry.insert( /// registry.insert(
/// "registry_name".to_owned(), /// "registry_name".to_owned(),
/// EppClientConnection { /// RegistryConfig {
/// host: "example.com".to_owned(), /// host: "example.com".to_owned(),
/// port: 700, /// port: 700,
/// username: "username".to_owned(), /// username: "username".to_owned(),

View File

@ -30,7 +30,7 @@ impl<E: EppExtension> EppRequest<E> for ContactDelete<E> {
/// ```no_run /// ```no_run
/// use std::collections::HashMap; /// use std::collections::HashMap;
/// ///
/// use epp_client::config::{EppClientConfig, EppClientConnection}; /// use epp_client::config::{EppClientConfig, RegistryConfig};
/// use epp_client::EppClient; /// use epp_client::EppClient;
/// use epp_client::contact::delete::ContactDelete; /// use epp_client::contact::delete::ContactDelete;
/// use epp_client::generate_client_tr_id; /// use epp_client::generate_client_tr_id;
@ -39,10 +39,10 @@ impl<E: EppExtension> EppRequest<E> for ContactDelete<E> {
/// #[tokio::main] /// #[tokio::main]
/// async fn main() { /// async fn main() {
/// // Create a config /// // Create a config
/// let mut registry: HashMap<String, EppClientConnection> = HashMap::new(); /// let mut registry: HashMap<String, RegistryConfig> = HashMap::new();
/// registry.insert( /// registry.insert(
/// "registry_name".to_owned(), /// "registry_name".to_owned(),
/// EppClientConnection { /// RegistryConfig {
/// host: "example.com".to_owned(), /// host: "example.com".to_owned(),
/// port: 700, /// port: 700,
/// username: "username".to_owned(), /// username: "username".to_owned(),

View File

@ -31,7 +31,7 @@ impl<E: EppExtension> EppRequest<E> for ContactInfo<E> {
/// ```no_run /// ```no_run
/// use std::collections::HashMap; /// use std::collections::HashMap;
/// ///
/// use epp_client::config::{EppClientConfig, EppClientConnection}; /// use epp_client::config::{EppClientConfig, RegistryConfig};
/// use epp_client::EppClient; /// use epp_client::EppClient;
/// use epp_client::contact::info::ContactInfo; /// use epp_client::contact::info::ContactInfo;
/// use epp_client::generate_client_tr_id; /// use epp_client::generate_client_tr_id;
@ -40,10 +40,10 @@ impl<E: EppExtension> EppRequest<E> for ContactInfo<E> {
/// #[tokio::main] /// #[tokio::main]
/// async fn main() { /// async fn main() {
/// // Create a config /// // Create a config
/// let mut registry: HashMap<String, EppClientConnection> = HashMap::new(); /// let mut registry: HashMap<String, RegistryConfig> = HashMap::new();
/// registry.insert( /// registry.insert(
/// "registry_name".to_owned(), /// "registry_name".to_owned(),
/// EppClientConnection { /// RegistryConfig {
/// host: "example.com".to_owned(), /// host: "example.com".to_owned(),
/// port: 700, /// port: 700,
/// username: "username".to_owned(), /// username: "username".to_owned(),

View File

@ -32,7 +32,7 @@ impl<E: EppExtension> EppRequest<E> for ContactUpdate<E> {
/// ```no_run /// ```no_run
/// use std::collections::HashMap; /// use std::collections::HashMap;
/// ///
/// use epp_client::config::{EppClientConfig, EppClientConnection}; /// use epp_client::config::{EppClientConfig, RegistryConfig};
/// use epp_client::EppClient; /// use epp_client::EppClient;
/// use epp_client::contact::update::ContactUpdate; /// use epp_client::contact::update::ContactUpdate;
/// use epp_client::generate_client_tr_id; /// use epp_client::generate_client_tr_id;
@ -42,10 +42,10 @@ impl<E: EppExtension> EppRequest<E> for ContactUpdate<E> {
/// #[tokio::main] /// #[tokio::main]
/// async fn main() { /// async fn main() {
/// // Create a config /// // Create a config
/// let mut registry: HashMap<String, EppClientConnection> = HashMap::new(); /// let mut registry: HashMap<String, RegistryConfig> = HashMap::new();
/// registry.insert( /// registry.insert(
/// "registry_name".to_owned(), /// "registry_name".to_owned(),
/// EppClientConnection { /// RegistryConfig {
/// host: "example.com".to_owned(), /// host: "example.com".to_owned(),
/// port: 700, /// port: 700,
/// username: "username".to_owned(), /// username: "username".to_owned(),

View File

@ -29,7 +29,7 @@ impl<E: EppExtension> EppRequest<E> for DomainCheck<E> {
/// ```no_run /// ```no_run
/// use std::collections::HashMap; /// use std::collections::HashMap;
/// ///
/// use epp_client::config::{EppClientConfig, EppClientConnection}; /// use epp_client::config::{EppClientConfig, RegistryConfig};
/// use epp_client::EppClient; /// use epp_client::EppClient;
/// use epp_client::domain::check::DomainCheck; /// use epp_client::domain::check::DomainCheck;
/// use epp_client::generate_client_tr_id; /// use epp_client::generate_client_tr_id;
@ -38,10 +38,10 @@ impl<E: EppExtension> EppRequest<E> for DomainCheck<E> {
/// #[tokio::main] /// #[tokio::main]
/// async fn main() { /// async fn main() {
/// // Create a config /// // Create a config
/// let mut registry: HashMap<String, EppClientConnection> = HashMap::new(); /// let mut registry: HashMap<String, RegistryConfig> = HashMap::new();
/// registry.insert( /// registry.insert(
/// "registry_name".to_owned(), /// "registry_name".to_owned(),
/// EppClientConnection { /// RegistryConfig {
/// host: "example.com".to_owned(), /// host: "example.com".to_owned(),
/// port: 700, /// port: 700,
/// username: "username".to_owned(), /// username: "username".to_owned(),

View File

@ -32,7 +32,7 @@ impl<E: EppExtension> EppRequest<E> for DomainCreate<E> {
/// ```no_run /// ```no_run
/// use std::collections::HashMap; /// use std::collections::HashMap;
/// ///
/// use epp_client::config::{EppClientConfig, EppClientConnection}; /// use epp_client::config::{EppClientConfig, RegistryConfig};
/// use epp_client::EppClient; /// use epp_client::EppClient;
/// use epp_client::common::DomainContact; /// use epp_client::common::DomainContact;
/// use epp_client::domain::create::DomainCreate; /// use epp_client::domain::create::DomainCreate;
@ -45,10 +45,10 @@ impl<E: EppExtension> EppRequest<E> for DomainCreate<E> {
/// #[tokio::main] /// #[tokio::main]
/// async fn main() { /// async fn main() {
/// // Create a config /// // Create a config
/// let mut registry: HashMap<String, EppClientConnection> = HashMap::new(); /// let mut registry: HashMap<String, RegistryConfig> = HashMap::new();
/// registry.insert( /// registry.insert(
/// "registry_name".to_owned(), /// "registry_name".to_owned(),
/// EppClientConnection { /// RegistryConfig {
/// host: "example.com".to_owned(), /// host: "example.com".to_owned(),
/// port: 700, /// port: 700,
/// username: "username".to_owned(), /// username: "username".to_owned(),

View File

@ -30,7 +30,7 @@ impl<E: EppExtension> EppRequest<E> for DomainDelete<E> {
/// ```no_run /// ```no_run
/// use std::collections::HashMap; /// use std::collections::HashMap;
/// ///
/// use epp_client::config::{EppClientConfig, EppClientConnection}; /// use epp_client::config::{EppClientConfig, RegistryConfig};
/// use epp_client::EppClient; /// use epp_client::EppClient;
/// use epp_client::domain::delete::DomainDelete; /// use epp_client::domain::delete::DomainDelete;
/// use epp_client::generate_client_tr_id; /// use epp_client::generate_client_tr_id;
@ -39,10 +39,10 @@ impl<E: EppExtension> EppRequest<E> for DomainDelete<E> {
/// #[tokio::main] /// #[tokio::main]
/// async fn main() { /// async fn main() {
/// // Create a config /// // Create a config
/// let mut registry: HashMap<String, EppClientConnection> = HashMap::new(); /// let mut registry: HashMap<String, RegistryConfig> = HashMap::new();
/// registry.insert( /// registry.insert(
/// "registry_name".to_owned(), /// "registry_name".to_owned(),
/// EppClientConnection { /// RegistryConfig {
/// host: "example.com".to_owned(), /// host: "example.com".to_owned(),
/// port: 700, /// port: 700,
/// username: "username".to_owned(), /// username: "username".to_owned(),

View File

@ -31,7 +31,7 @@ impl<E: EppExtension> EppRequest<E> for DomainInfo<E> {
/// ```no_run /// ```no_run
/// use std::collections::HashMap; /// use std::collections::HashMap;
/// ///
/// use epp_client::config::{EppClientConfig, EppClientConnection}; /// use epp_client::config::{EppClientConfig, RegistryConfig};
/// use epp_client::EppClient; /// use epp_client::EppClient;
/// use epp_client::domain::info::DomainInfo; /// use epp_client::domain::info::DomainInfo;
/// use epp_client::generate_client_tr_id; /// use epp_client::generate_client_tr_id;
@ -40,10 +40,10 @@ impl<E: EppExtension> EppRequest<E> for DomainInfo<E> {
/// #[tokio::main] /// #[tokio::main]
/// async fn main() { /// async fn main() {
/// // Create a config /// // Create a config
/// let mut registry: HashMap<String, EppClientConnection> = HashMap::new(); /// let mut registry: HashMap<String, RegistryConfig> = HashMap::new();
/// registry.insert( /// registry.insert(
/// "registry_name".to_owned(), /// "registry_name".to_owned(),
/// EppClientConnection { /// RegistryConfig {
/// host: "example.com".to_owned(), /// host: "example.com".to_owned(),
/// port: 700, /// port: 700,
/// username: "username".to_owned(), /// username: "username".to_owned(),

View File

@ -32,7 +32,7 @@ impl<E: EppExtension> EppRequest<E> for DomainRenew<E> {
/// ///
/// use chrono::NaiveDate; /// use chrono::NaiveDate;
/// ///
/// use epp_client::config::{EppClientConfig, EppClientConnection}; /// use epp_client::config::{EppClientConfig, RegistryConfig};
/// use epp_client::EppClient; /// use epp_client::EppClient;
/// use epp_client::domain::renew::DomainRenew; /// use epp_client::domain::renew::DomainRenew;
/// use epp_client::generate_client_tr_id; /// use epp_client::generate_client_tr_id;
@ -41,10 +41,10 @@ impl<E: EppExtension> EppRequest<E> for DomainRenew<E> {
/// #[tokio::main] /// #[tokio::main]
/// async fn main() { /// async fn main() {
/// // Create a config /// // Create a config
/// let mut registry: HashMap<String, EppClientConnection> = HashMap::new(); /// let mut registry: HashMap<String, RegistryConfig> = HashMap::new();
/// registry.insert( /// registry.insert(
/// "registry_name".to_owned(), /// "registry_name".to_owned(),
/// EppClientConnection { /// RegistryConfig {
/// host: "example.com".to_owned(), /// host: "example.com".to_owned(),
/// port: 700, /// port: 700,
/// username: "username".to_owned(), /// username: "username".to_owned(),

View File

@ -15,7 +15,7 @@ use serde::{Deserialize, Serialize};
/// ```no_run /// ```no_run
/// use std::collections::HashMap; /// use std::collections::HashMap;
/// ///
/// use epp_client::config::{EppClientConfig, EppClientConnection}; /// use epp_client::config::{EppClientConfig, RegistryConfig};
/// use epp_client::EppClient; /// use epp_client::EppClient;
/// use epp_client::common::{DomainStatus, DomainContact}; /// use epp_client::common::{DomainStatus, DomainContact};
/// use epp_client::domain::rgp::report::RgpRestoreReport; /// use epp_client::domain::rgp::report::RgpRestoreReport;
@ -28,10 +28,10 @@ use serde::{Deserialize, Serialize};
/// #[tokio::main] /// #[tokio::main]
/// async fn main() { /// async fn main() {
/// // Create a config /// // Create a config
/// let mut registry: HashMap<String, EppClientConnection> = HashMap::new(); /// let mut registry: HashMap<String, RegistryConfig> = HashMap::new();
/// registry.insert( /// registry.insert(
/// "registry_name".to_owned(), /// "registry_name".to_owned(),
/// EppClientConnection { /// RegistryConfig {
/// host: "example.com".to_owned(), /// host: "example.com".to_owned(),
/// port: 700, /// port: 700,
/// username: "username".to_owned(), /// username: "username".to_owned(),

View File

@ -16,7 +16,7 @@ use serde::{Deserialize, Serialize};
/// ```no_run /// ```no_run
/// use std::collections::HashMap; /// use std::collections::HashMap;
/// ///
/// use epp_client::config::{EppClientConfig, EppClientConnection}; /// use epp_client::config::{EppClientConfig, RegistryConfig};
/// use epp_client::EppClient; /// use epp_client::EppClient;
/// use epp_client::domain::rgp::request::RgpRestoreRequest; /// use epp_client::domain::rgp::request::RgpRestoreRequest;
/// use epp_client::domain::update::DomainUpdate; /// use epp_client::domain::update::DomainUpdate;
@ -25,10 +25,10 @@ use serde::{Deserialize, Serialize};
/// #[tokio::main] /// #[tokio::main]
/// async fn main() { /// async fn main() {
/// // Create a config /// // Create a config
/// let mut registry: HashMap<String, EppClientConnection> = HashMap::new(); /// let mut registry: HashMap<String, RegistryConfig> = HashMap::new();
/// registry.insert( /// registry.insert(
/// "registry_name".to_owned(), /// "registry_name".to_owned(),
/// EppClientConnection { /// RegistryConfig {
/// host: "example.com".to_owned(), /// host: "example.com".to_owned(),
/// port: 700, /// port: 700,
/// username: "username".to_owned(), /// username: "username".to_owned(),

View File

@ -90,7 +90,7 @@ impl<E: EppExtension> EppRequest<E> for DomainTransferQuery<E> {
/// ```no_run /// ```no_run
/// use std::collections::HashMap; /// use std::collections::HashMap;
/// ///
/// use epp_client::config::{EppClientConfig, EppClientConnection}; /// use epp_client::config::{EppClientConfig, RegistryConfig};
/// use epp_client::EppClient; /// use epp_client::EppClient;
/// use epp_client::domain::transfer::DomainTransferRequest; /// use epp_client::domain::transfer::DomainTransferRequest;
/// use epp_client::generate_client_tr_id; /// use epp_client::generate_client_tr_id;
@ -99,10 +99,10 @@ impl<E: EppExtension> EppRequest<E> for DomainTransferQuery<E> {
/// #[tokio::main] /// #[tokio::main]
/// async fn main() { /// async fn main() {
/// // Create a config /// // Create a config
/// let mut registry: HashMap<String, EppClientConnection> = HashMap::new(); /// let mut registry: HashMap<String, RegistryConfig> = HashMap::new();
/// registry.insert( /// registry.insert(
/// "registry_name".to_owned(), /// "registry_name".to_owned(),
/// EppClientConnection { /// RegistryConfig {
/// host: "example.com".to_owned(), /// host: "example.com".to_owned(),
/// port: 700, /// port: 700,
/// username: "username".to_owned(), /// username: "username".to_owned(),
@ -163,7 +163,7 @@ impl<E: EppExtension> DomainTransferRequest<E> {
/// ```no_run /// ```no_run
/// use std::collections::HashMap; /// use std::collections::HashMap;
/// ///
/// use epp_client::config::{EppClientConfig, EppClientConnection}; /// use epp_client::config::{EppClientConfig, RegistryConfig};
/// use epp_client::EppClient; /// use epp_client::EppClient;
/// use epp_client::domain::transfer::DomainTransferApprove; /// use epp_client::domain::transfer::DomainTransferApprove;
/// use epp_client::generate_client_tr_id; /// use epp_client::generate_client_tr_id;
@ -172,10 +172,10 @@ impl<E: EppExtension> DomainTransferRequest<E> {
/// #[tokio::main] /// #[tokio::main]
/// async fn main() { /// async fn main() {
/// // Create a config /// // Create a config
/// let mut registry: HashMap<String, EppClientConnection> = HashMap::new(); /// let mut registry: HashMap<String, RegistryConfig> = HashMap::new();
/// registry.insert( /// registry.insert(
/// "registry_name".to_owned(), /// "registry_name".to_owned(),
/// EppClientConnection { /// RegistryConfig {
/// host: "example.com".to_owned(), /// host: "example.com".to_owned(),
/// port: 700, /// port: 700,
/// username: "username".to_owned(), /// username: "username".to_owned(),
@ -236,7 +236,7 @@ impl<E: EppExtension> DomainTransferApprove<E> {
/// ```no_run /// ```no_run
/// use std::collections::HashMap; /// use std::collections::HashMap;
/// ///
/// use epp_client::config::{EppClientConfig, EppClientConnection}; /// use epp_client::config::{EppClientConfig, RegistryConfig};
/// use epp_client::EppClient; /// use epp_client::EppClient;
/// use epp_client::domain::transfer::DomainTransferReject; /// use epp_client::domain::transfer::DomainTransferReject;
/// use epp_client::generate_client_tr_id; /// use epp_client::generate_client_tr_id;
@ -245,10 +245,10 @@ impl<E: EppExtension> DomainTransferApprove<E> {
/// #[tokio::main] /// #[tokio::main]
/// async fn main() { /// async fn main() {
/// // Create a config /// // Create a config
/// let mut registry: HashMap<String, EppClientConnection> = HashMap::new(); /// let mut registry: HashMap<String, RegistryConfig> = HashMap::new();
/// registry.insert( /// registry.insert(
/// "registry_name".to_owned(), /// "registry_name".to_owned(),
/// EppClientConnection { /// RegistryConfig {
/// host: "example.com".to_owned(), /// host: "example.com".to_owned(),
/// port: 700, /// port: 700,
/// username: "username".to_owned(), /// username: "username".to_owned(),
@ -309,7 +309,7 @@ impl<E: EppExtension> DomainTransferReject<E> {
/// ```no_run /// ```no_run
/// use std::collections::HashMap; /// use std::collections::HashMap;
/// ///
/// use epp_client::config::{EppClientConfig, EppClientConnection}; /// use epp_client::config::{EppClientConfig, RegistryConfig};
/// use epp_client::EppClient; /// use epp_client::EppClient;
/// use epp_client::domain::transfer::DomainTransferCancel; /// use epp_client::domain::transfer::DomainTransferCancel;
/// use epp_client::generate_client_tr_id; /// use epp_client::generate_client_tr_id;
@ -318,10 +318,10 @@ impl<E: EppExtension> DomainTransferReject<E> {
/// #[tokio::main] /// #[tokio::main]
/// async fn main() { /// async fn main() {
/// // Create a config /// // Create a config
/// let mut registry: HashMap<String, EppClientConnection> = HashMap::new(); /// let mut registry: HashMap<String, RegistryConfig> = HashMap::new();
/// registry.insert( /// registry.insert(
/// "registry_name".to_owned(), /// "registry_name".to_owned(),
/// EppClientConnection { /// RegistryConfig {
/// host: "example.com".to_owned(), /// host: "example.com".to_owned(),
/// port: 700, /// port: 700,
/// username: "username".to_owned(), /// username: "username".to_owned(),
@ -382,7 +382,7 @@ impl<E: EppExtension> DomainTransferCancel<E> {
/// ```no_run /// ```no_run
/// use std::collections::HashMap; /// use std::collections::HashMap;
/// ///
/// use epp_client::config::{EppClientConfig, EppClientConnection}; /// use epp_client::config::{EppClientConfig, RegistryConfig};
/// use epp_client::EppClient; /// use epp_client::EppClient;
/// use epp_client::domain::transfer::DomainTransferQuery; /// use epp_client::domain::transfer::DomainTransferQuery;
/// use epp_client::generate_client_tr_id; /// use epp_client::generate_client_tr_id;
@ -391,10 +391,10 @@ impl<E: EppExtension> DomainTransferCancel<E> {
/// #[tokio::main] /// #[tokio::main]
/// async fn main() { /// async fn main() {
/// // Create a config /// // Create a config
/// let mut registry: HashMap<String, EppClientConnection> = HashMap::new(); /// let mut registry: HashMap<String, RegistryConfig> = HashMap::new();
/// registry.insert( /// registry.insert(
/// "registry_name".to_owned(), /// "registry_name".to_owned(),
/// EppClientConnection { /// RegistryConfig {
/// host: "example.com".to_owned(), /// host: "example.com".to_owned(),
/// port: 700, /// port: 700,
/// username: "username".to_owned(), /// username: "username".to_owned(),

View File

@ -38,7 +38,7 @@ impl<E: EppExtension> EppRequest<E> for DomainUpdate<E> {
/// ```no_run /// ```no_run
/// use std::collections::HashMap; /// use std::collections::HashMap;
/// ///
/// use epp_client::config::{EppClientConfig, EppClientConnection}; /// use epp_client::config::{EppClientConfig, RegistryConfig};
/// use epp_client::EppClient; /// use epp_client::EppClient;
/// use epp_client::common::{DomainStatus, DomainContact}; /// use epp_client::common::{DomainStatus, DomainContact};
/// use epp_client::domain::update::{DomainUpdate, DomainAddRemove}; /// use epp_client::domain::update::{DomainUpdate, DomainAddRemove};
@ -48,10 +48,10 @@ impl<E: EppExtension> EppRequest<E> for DomainUpdate<E> {
/// #[tokio::main] /// #[tokio::main]
/// async fn main() { /// async fn main() {
/// // Create a config /// // Create a config
/// let mut registry: HashMap<String, EppClientConnection> = HashMap::new(); /// let mut registry: HashMap<String, RegistryConfig> = HashMap::new();
/// registry.insert( /// registry.insert(
/// "registry_name".to_owned(), /// "registry_name".to_owned(),
/// EppClientConnection { /// RegistryConfig {
/// host: "example.com".to_owned(), /// host: "example.com".to_owned(),
/// port: 700, /// port: 700,
/// username: "username".to_owned(), /// username: "username".to_owned(),

View File

@ -31,7 +31,7 @@ impl<E: EppExtension> EppRequest<E> for HostCheck<E> {
/// ```no_run /// ```no_run
/// use std::collections::HashMap; /// use std::collections::HashMap;
/// ///
/// use epp_client::config::{EppClientConfig, EppClientConnection}; /// use epp_client::config::{EppClientConfig, RegistryConfig};
/// use epp_client::EppClient; /// use epp_client::EppClient;
/// use epp_client::host::check::HostCheck; /// use epp_client::host::check::HostCheck;
/// use epp_client::generate_client_tr_id; /// use epp_client::generate_client_tr_id;
@ -40,10 +40,10 @@ impl<E: EppExtension> EppRequest<E> for HostCheck<E> {
/// #[tokio::main] /// #[tokio::main]
/// async fn main() { /// async fn main() {
/// // Create a config /// // Create a config
/// let mut registry: HashMap<String, EppClientConnection> = HashMap::new(); /// let mut registry: HashMap<String, RegistryConfig> = HashMap::new();
/// registry.insert( /// registry.insert(
/// "registry_name".to_owned(), /// "registry_name".to_owned(),
/// EppClientConnection { /// RegistryConfig {
/// host: "example.com".to_owned(), /// host: "example.com".to_owned(),
/// port: 700, /// port: 700,
/// username: "username".to_owned(), /// username: "username".to_owned(),

View File

@ -29,7 +29,7 @@ impl<E: EppExtension> EppRequest<E> for HostCreate<E> {
/// ```no_run /// ```no_run
/// use std::collections::HashMap; /// use std::collections::HashMap;
/// ///
/// use epp_client::config::{EppClientConfig, EppClientConnection}; /// use epp_client::config::{EppClientConfig, RegistryConfig};
/// use epp_client::EppClient; /// use epp_client::EppClient;
/// use epp_client::common::HostAddr; /// use epp_client::common::HostAddr;
/// use epp_client::host::create::HostCreate; /// use epp_client::host::create::HostCreate;
@ -39,10 +39,10 @@ impl<E: EppExtension> EppRequest<E> for HostCreate<E> {
/// #[tokio::main] /// #[tokio::main]
/// async fn main() { /// async fn main() {
/// // Create a config /// // Create a config
/// let mut registry: HashMap<String, EppClientConnection> = HashMap::new(); /// let mut registry: HashMap<String, RegistryConfig> = HashMap::new();
/// registry.insert( /// registry.insert(
/// "registry_name".to_owned(), /// "registry_name".to_owned(),
/// EppClientConnection { /// RegistryConfig {
/// host: "example.com".to_owned(), /// host: "example.com".to_owned(),
/// port: 700, /// port: 700,
/// username: "username".to_owned(), /// username: "username".to_owned(),

View File

@ -30,7 +30,7 @@ impl<E: EppExtension> EppRequest<E> for HostDelete<E> {
/// ```no_run /// ```no_run
/// use std::collections::HashMap; /// use std::collections::HashMap;
/// ///
/// use epp_client::config::{EppClientConfig, EppClientConnection}; /// use epp_client::config::{EppClientConfig, RegistryConfig};
/// use epp_client::EppClient; /// use epp_client::EppClient;
/// use epp_client::host::delete::HostDelete; /// use epp_client::host::delete::HostDelete;
/// use epp_client::generate_client_tr_id; /// use epp_client::generate_client_tr_id;
@ -39,10 +39,10 @@ impl<E: EppExtension> EppRequest<E> for HostDelete<E> {
/// #[tokio::main] /// #[tokio::main]
/// async fn main() { /// async fn main() {
/// // Create a config /// // Create a config
/// let mut registry: HashMap<String, EppClientConnection> = HashMap::new(); /// let mut registry: HashMap<String, RegistryConfig> = HashMap::new();
/// registry.insert( /// registry.insert(
/// "registry_name".to_owned(), /// "registry_name".to_owned(),
/// EppClientConnection { /// RegistryConfig {
/// host: "example.com".to_owned(), /// host: "example.com".to_owned(),
/// port: 700, /// port: 700,
/// username: "username".to_owned(), /// username: "username".to_owned(),

View File

@ -29,7 +29,7 @@ impl<E: EppExtension> EppRequest<E> for HostInfo<E> {
/// ```no_run /// ```no_run
/// use std::collections::HashMap; /// use std::collections::HashMap;
/// ///
/// use epp_client::config::{EppClientConfig, EppClientConnection}; /// use epp_client::config::{EppClientConfig, RegistryConfig};
/// use epp_client::EppClient; /// use epp_client::EppClient;
/// use epp_client::host::info::HostInfo; /// use epp_client::host::info::HostInfo;
/// use epp_client::generate_client_tr_id; /// use epp_client::generate_client_tr_id;
@ -38,10 +38,10 @@ impl<E: EppExtension> EppRequest<E> for HostInfo<E> {
/// #[tokio::main] /// #[tokio::main]
/// async fn main() { /// async fn main() {
/// // Create a config /// // Create a config
/// let mut registry: HashMap<String, EppClientConnection> = HashMap::new(); /// let mut registry: HashMap<String, RegistryConfig> = HashMap::new();
/// registry.insert( /// registry.insert(
/// "registry_name".to_owned(), /// "registry_name".to_owned(),
/// EppClientConnection { /// RegistryConfig {
/// host: "example.com".to_owned(), /// host: "example.com".to_owned(),
/// port: 700, /// port: 700,
/// username: "username".to_owned(), /// username: "username".to_owned(),

View File

@ -30,7 +30,7 @@ impl<E: EppExtension> EppRequest<E> for HostUpdate<E> {
/// ```no_run /// ```no_run
/// use std::collections::HashMap; /// use std::collections::HashMap;
/// ///
/// use epp_client::config::{EppClientConfig, EppClientConnection}; /// use epp_client::config::{EppClientConfig, RegistryConfig};
/// use epp_client::EppClient; /// use epp_client::EppClient;
/// use epp_client::common::{HostAddr, HostStatus}; /// use epp_client::common::{HostAddr, HostStatus};
/// use epp_client::host::update::{HostUpdate, HostAddRemove, HostChangeInfo}; /// use epp_client::host::update::{HostUpdate, HostAddRemove, HostChangeInfo};
@ -40,10 +40,10 @@ impl<E: EppExtension> EppRequest<E> for HostUpdate<E> {
/// #[tokio::main] /// #[tokio::main]
/// async fn main() { /// async fn main() {
/// // Create a config /// // Create a config
/// let mut registry: HashMap<String, EppClientConnection> = HashMap::new(); /// let mut registry: HashMap<String, RegistryConfig> = HashMap::new();
/// registry.insert( /// registry.insert(
/// "registry_name".to_owned(), /// "registry_name".to_owned(),
/// EppClientConnection { /// RegistryConfig {
/// host: "example.com".to_owned(), /// host: "example.com".to_owned(),
/// port: 700, /// port: 700,
/// username: "username".to_owned(), /// username: "username".to_owned(),

View File

@ -41,7 +41,7 @@
//! ```no_run //! ```no_run
//! use std::collections::HashMap; //! use std::collections::HashMap;
//! //!
//! use epp_client::config::{EppClientConfig, EppClientConnection}; //! use epp_client::config::{EppClientConfig, RegistryConfig};
//! use epp_client::EppClient; //! use epp_client::EppClient;
//! use epp_client::domain::check::DomainCheck; //! use epp_client::domain::check::DomainCheck;
//! use epp_client::generate_client_tr_id; //! use epp_client::generate_client_tr_id;
@ -51,10 +51,10 @@
//! async fn main() { //! async fn main() {
//! //!
//! // Create a config //! // Create a config
//! let mut registry: HashMap<String, EppClientConnection> = HashMap::new(); //! let mut registry: HashMap<String, RegistryConfig> = HashMap::new();
//! registry.insert( //! registry.insert(
//! "registry_name".to_owned(), //! "registry_name".to_owned(),
//! EppClientConnection { //! RegistryConfig {
//! host: "example.com".to_owned(), //! host: "example.com".to_owned(),
//! port: 700, //! port: 700,
//! username: "username".to_owned(), //! username: "username".to_owned(),

View File

@ -27,7 +27,7 @@ impl<E: EppExtension> EppRequest<E> for MessageAck<E> {
/// ```no_run /// ```no_run
/// use std::collections::HashMap; /// use std::collections::HashMap;
/// ///
/// use epp_client::config::{EppClientConfig, EppClientConnection}; /// use epp_client::config::{EppClientConfig, RegistryConfig};
/// use epp_client::EppClient; /// use epp_client::EppClient;
/// use epp_client::message::ack::MessageAck; /// use epp_client::message::ack::MessageAck;
/// use epp_client::generate_client_tr_id; /// use epp_client::generate_client_tr_id;
@ -36,10 +36,10 @@ impl<E: EppExtension> EppRequest<E> for MessageAck<E> {
/// #[tokio::main] /// #[tokio::main]
/// async fn main() { /// async fn main() {
/// // Create a config /// // Create a config
/// let mut registry: HashMap<String, EppClientConnection> = HashMap::new(); /// let mut registry: HashMap<String, RegistryConfig> = HashMap::new();
/// registry.insert( /// registry.insert(
/// "registry_name".to_owned(), /// "registry_name".to_owned(),
/// EppClientConnection { /// RegistryConfig {
/// host: "example.com".to_owned(), /// host: "example.com".to_owned(),
/// port: 700, /// port: 700,
/// username: "username".to_owned(), /// username: "username".to_owned(),

View File

@ -28,7 +28,7 @@ impl<E: EppExtension> EppRequest<E> for MessagePoll<E> {
/// ```no_run /// ```no_run
/// use std::collections::HashMap; /// use std::collections::HashMap;
/// ///
/// use epp_client::config::{EppClientConfig, EppClientConnection}; /// use epp_client::config::{EppClientConfig, RegistryConfig};
/// use epp_client::EppClient; /// use epp_client::EppClient;
/// use epp_client::message::poll::MessagePoll; /// use epp_client::message::poll::MessagePoll;
/// use epp_client::generate_client_tr_id; /// use epp_client::generate_client_tr_id;
@ -37,10 +37,10 @@ impl<E: EppExtension> EppRequest<E> for MessagePoll<E> {
/// #[tokio::main] /// #[tokio::main]
/// async fn main() { /// async fn main() {
/// // Create a config /// // Create a config
/// let mut registry: HashMap<String, EppClientConnection> = HashMap::new(); /// let mut registry: HashMap<String, RegistryConfig> = HashMap::new();
/// registry.insert( /// registry.insert(
/// "registry_name".to_owned(), /// "registry_name".to_owned(),
/// EppClientConnection { /// RegistryConfig {
/// host: "example.com".to_owned(), /// host: "example.com".to_owned(),
/// port: 700, /// port: 700,
/// username: "username".to_owned(), /// username: "username".to_owned(),

View File

@ -13,7 +13,7 @@ use rustls_pemfile;
use tokio::{io::AsyncReadExt, io::AsyncWriteExt, net::TcpStream}; use tokio::{io::AsyncReadExt, io::AsyncWriteExt, net::TcpStream};
use tokio_rustls::{client::TlsStream, rustls::ClientConfig, TlsConnector}; use tokio_rustls::{client::TlsStream, rustls::ClientConfig, TlsConnector};
use crate::config::EppClientConnection; use crate::config::RegistryConfig;
use crate::error; use crate::error;
/// EPP Connection struct with some metadata for the connection /// EPP Connection struct with some metadata for the connection
@ -118,7 +118,7 @@ impl EppConnection {
/// Establishes a TLS connection to a registry and returns a ConnectionStream instance containing the /// Establishes a TLS connection to a registry and returns a ConnectionStream instance containing the
/// socket stream to read/write to the connection /// socket stream to read/write to the connection
pub async fn epp_connect( pub async fn epp_connect(
registry_creds: &EppClientConnection, registry_creds: &RegistryConfig,
) -> Result<TlsStream<TcpStream>, error::Error> { ) -> Result<TlsStream<TcpStream>, error::Error> {
info!( info!(
"Connecting: EPP Server: {} Port: {}", "Connecting: EPP Server: {} Port: {}",