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:
parent
ac50679071
commit
609c327a95
|
@ -53,7 +53,7 @@ You can create a mut variable of type `EppClient` with the domain registry confi
|
|||
```rust
|
||||
use std::collections::HashMap;
|
||||
|
||||
use epp_client::config::{EppClientConfig, EppClientConnection};
|
||||
use epp_client::config::{EppClientConfig, RegistryConfig};
|
||||
use epp_client::EppClient;
|
||||
use epp_client::epp::{EppDomainCheck, EppDomainCheckResponse};
|
||||
use epp_client::generate_client_tr_id;
|
||||
|
@ -61,10 +61,10 @@ use epp_client::generate_client_tr_id;
|
|||
#[tokio::main]
|
||||
async fn main() {
|
||||
// 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_name".to_owned(),
|
||||
EppClientConnection {
|
||||
RegistryConfig {
|
||||
host: "example.com".to_owned(),
|
||||
port: 700,
|
||||
username: "username".to_owned(),
|
||||
|
@ -126,7 +126,6 @@ cert_chain = '/path/to/certificate/chain/pemfile'
|
|||
key = '/path/to/private/key/pemfile'
|
||||
```
|
||||
|
||||
|
||||
```rust
|
||||
use epp_client::config::{EppClientConfig};
|
||||
|
||||
|
|
|
@ -53,7 +53,7 @@ You can create a mut variable of type `EppClient` with the domain registry confi
|
|||
```rust
|
||||
use std::collections::HashMap;
|
||||
|
||||
use epp_client::config::{EppClientConfig, EppClientConnection};
|
||||
use epp_client::config::{EppClientConfig, RegistryConfig};
|
||||
use epp_client::EppClient;
|
||||
use epp_client::epp::{EppDomainCheck, EppDomainCheckResponse};
|
||||
use epp_client::generate_client_tr_id;
|
||||
|
@ -61,10 +61,10 @@ use epp_client::generate_client_tr_id;
|
|||
#[tokio::main]
|
||||
async fn main() {
|
||||
// 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_name".to_owned(),
|
||||
EppClientConnection {
|
||||
RegistryConfig {
|
||||
host: "example.com".to_owned(),
|
||||
port: 700,
|
||||
username: "username".to_owned(),
|
||||
|
@ -126,7 +126,6 @@ cert_chain = '/path/to/certificate/chain/pemfile'
|
|||
key = '/path/to/private/key/pemfile'
|
||||
```
|
||||
|
||||
|
||||
```rust
|
||||
use epp_client::config::{EppClientConfig};
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
//! ```no_run
|
||||
//! use std::collections::HashMap;
|
||||
//!
|
||||
//! use epp_client::config::{EppClientConfig, EppClientConnection};
|
||||
//! use epp_client::config::{EppClientConfig, RegistryConfig};
|
||||
//! use epp_client::EppClient;
|
||||
//! use epp_client::domain::check::DomainCheck;
|
||||
//! use epp_client::generate_client_tr_id;
|
||||
|
@ -15,10 +15,10 @@
|
|||
//! async fn main() {
|
||||
//!
|
||||
//! // Create a config
|
||||
//! let mut registry: HashMap<String, EppClientConnection> = HashMap::new();
|
||||
//! let mut registry: HashMap<String, RegistryConfig> = HashMap::new();
|
||||
//! registry.insert(
|
||||
//! "registry_name".to_owned(),
|
||||
//! EppClientConnection {
|
||||
//! RegistryConfig {
|
||||
//! host: "example.com".to_owned(),
|
||||
//! port: 700,
|
||||
//! username: "username".to_owned(),
|
||||
|
|
|
@ -7,13 +7,13 @@
|
|||
//! ```no_run
|
||||
//! use std::collections::HashMap;
|
||||
//!
|
||||
//! use epp_client::config::{EppClientConfig, EppClientConnection};
|
||||
//! use epp_client::config::{EppClientConfig, RegistryConfig};
|
||||
//!
|
||||
//! // Create a config
|
||||
//! let mut registry: HashMap<String, EppClientConnection> = HashMap::new();
|
||||
//! let mut registry: HashMap<String, RegistryConfig> = HashMap::new();
|
||||
//! registry.insert(
|
||||
//! "registry_name".to_owned(),
|
||||
//! EppClientConnection {
|
||||
//! RegistryConfig {
|
||||
//! host: "example.com".to_owned(),
|
||||
//! port: 700,
|
||||
//! username: "username".to_owned(),
|
||||
|
@ -48,19 +48,19 @@ pub struct EppClientTlsFiles {
|
|||
/// Config that stores settings for multiple registries
|
||||
#[derive(Serialize, Deserialize, Debug)]
|
||||
pub struct EppClientConfig {
|
||||
pub registry: HashMap<String, EppClientConnection>,
|
||||
pub registry: HashMap<String, RegistryConfig>,
|
||||
}
|
||||
|
||||
impl EppClientConfig {
|
||||
/// 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)
|
||||
}
|
||||
}
|
||||
|
||||
/// Connection details to connect to and authenticate with a registry
|
||||
#[derive(Serialize, Deserialize, Debug)]
|
||||
pub struct EppClientConnection {
|
||||
pub struct RegistryConfig {
|
||||
pub host: String,
|
||||
pub port: u16,
|
||||
pub username: String,
|
||||
|
@ -69,7 +69,7 @@ pub struct EppClientConnection {
|
|||
pub tls_files: Option<EppClientTlsFiles>,
|
||||
}
|
||||
|
||||
impl EppClientConnection {
|
||||
impl RegistryConfig {
|
||||
/// Returns the EPP username and password as a tuple
|
||||
pub fn credentials(&self) -> (String, String) {
|
||||
(self.username.to_string(), self.password.to_string())
|
||||
|
|
|
@ -30,7 +30,7 @@ impl<E: EppExtension> EppRequest<E> for ContactCheck<E> {
|
|||
/// ```no_run
|
||||
/// use std::collections::HashMap;
|
||||
///
|
||||
/// use epp_client::config::{EppClientConfig, EppClientConnection};
|
||||
/// use epp_client::config::{EppClientConfig, RegistryConfig};
|
||||
/// use epp_client::EppClient;
|
||||
/// use epp_client::contact::check::ContactCheck;
|
||||
/// use epp_client::generate_client_tr_id;
|
||||
|
@ -39,10 +39,10 @@ impl<E: EppExtension> EppRequest<E> for ContactCheck<E> {
|
|||
/// #[tokio::main]
|
||||
/// async fn main() {
|
||||
/// // Create a config
|
||||
/// let mut registry: HashMap<String, EppClientConnection> = HashMap::new();
|
||||
/// let mut registry: HashMap<String, RegistryConfig> = HashMap::new();
|
||||
/// registry.insert(
|
||||
/// "registry_name".to_owned(),
|
||||
/// EppClientConnection {
|
||||
/// RegistryConfig {
|
||||
/// host: "example.com".to_owned(),
|
||||
/// port: 700,
|
||||
/// username: "username".to_owned(),
|
||||
|
|
|
@ -29,7 +29,7 @@ impl<E: EppExtension> EppRequest<E> for ContactCreate<E> {
|
|||
/// ```no_run
|
||||
/// use std::collections::HashMap;
|
||||
///
|
||||
/// use epp_client::config::{EppClientConfig, EppClientConnection};
|
||||
/// use epp_client::config::{EppClientConfig, RegistryConfig};
|
||||
/// use epp_client::EppClient;
|
||||
/// use epp_client::common::{Address, Phone, PostalInfo};
|
||||
/// use epp_client::contact::create::ContactCreate;
|
||||
|
@ -39,10 +39,10 @@ impl<E: EppExtension> EppRequest<E> for ContactCreate<E> {
|
|||
/// #[tokio::main]
|
||||
/// async fn main() {
|
||||
/// // Create a config
|
||||
/// let mut registry: HashMap<String, EppClientConnection> = HashMap::new();
|
||||
/// let mut registry: HashMap<String, RegistryConfig> = HashMap::new();
|
||||
/// registry.insert(
|
||||
/// "registry_name".to_owned(),
|
||||
/// EppClientConnection {
|
||||
/// RegistryConfig {
|
||||
/// host: "example.com".to_owned(),
|
||||
/// port: 700,
|
||||
/// username: "username".to_owned(),
|
||||
|
|
|
@ -30,7 +30,7 @@ impl<E: EppExtension> EppRequest<E> for ContactDelete<E> {
|
|||
/// ```no_run
|
||||
/// use std::collections::HashMap;
|
||||
///
|
||||
/// use epp_client::config::{EppClientConfig, EppClientConnection};
|
||||
/// use epp_client::config::{EppClientConfig, RegistryConfig};
|
||||
/// use epp_client::EppClient;
|
||||
/// use epp_client::contact::delete::ContactDelete;
|
||||
/// use epp_client::generate_client_tr_id;
|
||||
|
@ -39,10 +39,10 @@ impl<E: EppExtension> EppRequest<E> for ContactDelete<E> {
|
|||
/// #[tokio::main]
|
||||
/// async fn main() {
|
||||
/// // Create a config
|
||||
/// let mut registry: HashMap<String, EppClientConnection> = HashMap::new();
|
||||
/// let mut registry: HashMap<String, RegistryConfig> = HashMap::new();
|
||||
/// registry.insert(
|
||||
/// "registry_name".to_owned(),
|
||||
/// EppClientConnection {
|
||||
/// RegistryConfig {
|
||||
/// host: "example.com".to_owned(),
|
||||
/// port: 700,
|
||||
/// username: "username".to_owned(),
|
||||
|
|
|
@ -31,7 +31,7 @@ impl<E: EppExtension> EppRequest<E> for ContactInfo<E> {
|
|||
/// ```no_run
|
||||
/// use std::collections::HashMap;
|
||||
///
|
||||
/// use epp_client::config::{EppClientConfig, EppClientConnection};
|
||||
/// use epp_client::config::{EppClientConfig, RegistryConfig};
|
||||
/// use epp_client::EppClient;
|
||||
/// use epp_client::contact::info::ContactInfo;
|
||||
/// use epp_client::generate_client_tr_id;
|
||||
|
@ -40,10 +40,10 @@ impl<E: EppExtension> EppRequest<E> for ContactInfo<E> {
|
|||
/// #[tokio::main]
|
||||
/// async fn main() {
|
||||
/// // Create a config
|
||||
/// let mut registry: HashMap<String, EppClientConnection> = HashMap::new();
|
||||
/// let mut registry: HashMap<String, RegistryConfig> = HashMap::new();
|
||||
/// registry.insert(
|
||||
/// "registry_name".to_owned(),
|
||||
/// EppClientConnection {
|
||||
/// RegistryConfig {
|
||||
/// host: "example.com".to_owned(),
|
||||
/// port: 700,
|
||||
/// username: "username".to_owned(),
|
||||
|
|
|
@ -32,7 +32,7 @@ impl<E: EppExtension> EppRequest<E> for ContactUpdate<E> {
|
|||
/// ```no_run
|
||||
/// use std::collections::HashMap;
|
||||
///
|
||||
/// use epp_client::config::{EppClientConfig, EppClientConnection};
|
||||
/// use epp_client::config::{EppClientConfig, RegistryConfig};
|
||||
/// use epp_client::EppClient;
|
||||
/// use epp_client::contact::update::ContactUpdate;
|
||||
/// use epp_client::generate_client_tr_id;
|
||||
|
@ -42,10 +42,10 @@ impl<E: EppExtension> EppRequest<E> for ContactUpdate<E> {
|
|||
/// #[tokio::main]
|
||||
/// async fn main() {
|
||||
/// // Create a config
|
||||
/// let mut registry: HashMap<String, EppClientConnection> = HashMap::new();
|
||||
/// let mut registry: HashMap<String, RegistryConfig> = HashMap::new();
|
||||
/// registry.insert(
|
||||
/// "registry_name".to_owned(),
|
||||
/// EppClientConnection {
|
||||
/// RegistryConfig {
|
||||
/// host: "example.com".to_owned(),
|
||||
/// port: 700,
|
||||
/// username: "username".to_owned(),
|
||||
|
|
|
@ -29,7 +29,7 @@ impl<E: EppExtension> EppRequest<E> for DomainCheck<E> {
|
|||
/// ```no_run
|
||||
/// use std::collections::HashMap;
|
||||
///
|
||||
/// use epp_client::config::{EppClientConfig, EppClientConnection};
|
||||
/// use epp_client::config::{EppClientConfig, RegistryConfig};
|
||||
/// use epp_client::EppClient;
|
||||
/// use epp_client::domain::check::DomainCheck;
|
||||
/// use epp_client::generate_client_tr_id;
|
||||
|
@ -38,10 +38,10 @@ impl<E: EppExtension> EppRequest<E> for DomainCheck<E> {
|
|||
/// #[tokio::main]
|
||||
/// async fn main() {
|
||||
/// // Create a config
|
||||
/// let mut registry: HashMap<String, EppClientConnection> = HashMap::new();
|
||||
/// let mut registry: HashMap<String, RegistryConfig> = HashMap::new();
|
||||
/// registry.insert(
|
||||
/// "registry_name".to_owned(),
|
||||
/// EppClientConnection {
|
||||
/// RegistryConfig {
|
||||
/// host: "example.com".to_owned(),
|
||||
/// port: 700,
|
||||
/// username: "username".to_owned(),
|
||||
|
|
|
@ -32,7 +32,7 @@ impl<E: EppExtension> EppRequest<E> for DomainCreate<E> {
|
|||
/// ```no_run
|
||||
/// use std::collections::HashMap;
|
||||
///
|
||||
/// use epp_client::config::{EppClientConfig, EppClientConnection};
|
||||
/// use epp_client::config::{EppClientConfig, RegistryConfig};
|
||||
/// use epp_client::EppClient;
|
||||
/// use epp_client::common::DomainContact;
|
||||
/// use epp_client::domain::create::DomainCreate;
|
||||
|
@ -45,10 +45,10 @@ impl<E: EppExtension> EppRequest<E> for DomainCreate<E> {
|
|||
/// #[tokio::main]
|
||||
/// async fn main() {
|
||||
/// // Create a config
|
||||
/// let mut registry: HashMap<String, EppClientConnection> = HashMap::new();
|
||||
/// let mut registry: HashMap<String, RegistryConfig> = HashMap::new();
|
||||
/// registry.insert(
|
||||
/// "registry_name".to_owned(),
|
||||
/// EppClientConnection {
|
||||
/// RegistryConfig {
|
||||
/// host: "example.com".to_owned(),
|
||||
/// port: 700,
|
||||
/// username: "username".to_owned(),
|
||||
|
|
|
@ -30,7 +30,7 @@ impl<E: EppExtension> EppRequest<E> for DomainDelete<E> {
|
|||
/// ```no_run
|
||||
/// use std::collections::HashMap;
|
||||
///
|
||||
/// use epp_client::config::{EppClientConfig, EppClientConnection};
|
||||
/// use epp_client::config::{EppClientConfig, RegistryConfig};
|
||||
/// use epp_client::EppClient;
|
||||
/// use epp_client::domain::delete::DomainDelete;
|
||||
/// use epp_client::generate_client_tr_id;
|
||||
|
@ -39,10 +39,10 @@ impl<E: EppExtension> EppRequest<E> for DomainDelete<E> {
|
|||
/// #[tokio::main]
|
||||
/// async fn main() {
|
||||
/// // Create a config
|
||||
/// let mut registry: HashMap<String, EppClientConnection> = HashMap::new();
|
||||
/// let mut registry: HashMap<String, RegistryConfig> = HashMap::new();
|
||||
/// registry.insert(
|
||||
/// "registry_name".to_owned(),
|
||||
/// EppClientConnection {
|
||||
/// RegistryConfig {
|
||||
/// host: "example.com".to_owned(),
|
||||
/// port: 700,
|
||||
/// username: "username".to_owned(),
|
||||
|
|
|
@ -31,7 +31,7 @@ impl<E: EppExtension> EppRequest<E> for DomainInfo<E> {
|
|||
/// ```no_run
|
||||
/// use std::collections::HashMap;
|
||||
///
|
||||
/// use epp_client::config::{EppClientConfig, EppClientConnection};
|
||||
/// use epp_client::config::{EppClientConfig, RegistryConfig};
|
||||
/// use epp_client::EppClient;
|
||||
/// use epp_client::domain::info::DomainInfo;
|
||||
/// use epp_client::generate_client_tr_id;
|
||||
|
@ -40,10 +40,10 @@ impl<E: EppExtension> EppRequest<E> for DomainInfo<E> {
|
|||
/// #[tokio::main]
|
||||
/// async fn main() {
|
||||
/// // Create a config
|
||||
/// let mut registry: HashMap<String, EppClientConnection> = HashMap::new();
|
||||
/// let mut registry: HashMap<String, RegistryConfig> = HashMap::new();
|
||||
/// registry.insert(
|
||||
/// "registry_name".to_owned(),
|
||||
/// EppClientConnection {
|
||||
/// RegistryConfig {
|
||||
/// host: "example.com".to_owned(),
|
||||
/// port: 700,
|
||||
/// username: "username".to_owned(),
|
||||
|
|
|
@ -32,7 +32,7 @@ impl<E: EppExtension> EppRequest<E> for DomainRenew<E> {
|
|||
///
|
||||
/// use chrono::NaiveDate;
|
||||
///
|
||||
/// use epp_client::config::{EppClientConfig, EppClientConnection};
|
||||
/// use epp_client::config::{EppClientConfig, RegistryConfig};
|
||||
/// use epp_client::EppClient;
|
||||
/// use epp_client::domain::renew::DomainRenew;
|
||||
/// use epp_client::generate_client_tr_id;
|
||||
|
@ -41,10 +41,10 @@ impl<E: EppExtension> EppRequest<E> for DomainRenew<E> {
|
|||
/// #[tokio::main]
|
||||
/// async fn main() {
|
||||
/// // Create a config
|
||||
/// let mut registry: HashMap<String, EppClientConnection> = HashMap::new();
|
||||
/// let mut registry: HashMap<String, RegistryConfig> = HashMap::new();
|
||||
/// registry.insert(
|
||||
/// "registry_name".to_owned(),
|
||||
/// EppClientConnection {
|
||||
/// RegistryConfig {
|
||||
/// host: "example.com".to_owned(),
|
||||
/// port: 700,
|
||||
/// username: "username".to_owned(),
|
||||
|
|
|
@ -15,7 +15,7 @@ use serde::{Deserialize, Serialize};
|
|||
/// ```no_run
|
||||
/// use std::collections::HashMap;
|
||||
///
|
||||
/// use epp_client::config::{EppClientConfig, EppClientConnection};
|
||||
/// use epp_client::config::{EppClientConfig, RegistryConfig};
|
||||
/// use epp_client::EppClient;
|
||||
/// use epp_client::common::{DomainStatus, DomainContact};
|
||||
/// use epp_client::domain::rgp::report::RgpRestoreReport;
|
||||
|
@ -28,10 +28,10 @@ use serde::{Deserialize, Serialize};
|
|||
/// #[tokio::main]
|
||||
/// async fn main() {
|
||||
/// // Create a config
|
||||
/// let mut registry: HashMap<String, EppClientConnection> = HashMap::new();
|
||||
/// let mut registry: HashMap<String, RegistryConfig> = HashMap::new();
|
||||
/// registry.insert(
|
||||
/// "registry_name".to_owned(),
|
||||
/// EppClientConnection {
|
||||
/// RegistryConfig {
|
||||
/// host: "example.com".to_owned(),
|
||||
/// port: 700,
|
||||
/// username: "username".to_owned(),
|
||||
|
|
|
@ -16,7 +16,7 @@ use serde::{Deserialize, Serialize};
|
|||
/// ```no_run
|
||||
/// use std::collections::HashMap;
|
||||
///
|
||||
/// use epp_client::config::{EppClientConfig, EppClientConnection};
|
||||
/// use epp_client::config::{EppClientConfig, RegistryConfig};
|
||||
/// use epp_client::EppClient;
|
||||
/// use epp_client::domain::rgp::request::RgpRestoreRequest;
|
||||
/// use epp_client::domain::update::DomainUpdate;
|
||||
|
@ -25,10 +25,10 @@ use serde::{Deserialize, Serialize};
|
|||
/// #[tokio::main]
|
||||
/// async fn main() {
|
||||
/// // Create a config
|
||||
/// let mut registry: HashMap<String, EppClientConnection> = HashMap::new();
|
||||
/// let mut registry: HashMap<String, RegistryConfig> = HashMap::new();
|
||||
/// registry.insert(
|
||||
/// "registry_name".to_owned(),
|
||||
/// EppClientConnection {
|
||||
/// RegistryConfig {
|
||||
/// host: "example.com".to_owned(),
|
||||
/// port: 700,
|
||||
/// username: "username".to_owned(),
|
||||
|
|
|
@ -90,7 +90,7 @@ impl<E: EppExtension> EppRequest<E> for DomainTransferQuery<E> {
|
|||
/// ```no_run
|
||||
/// use std::collections::HashMap;
|
||||
///
|
||||
/// use epp_client::config::{EppClientConfig, EppClientConnection};
|
||||
/// use epp_client::config::{EppClientConfig, RegistryConfig};
|
||||
/// use epp_client::EppClient;
|
||||
/// use epp_client::domain::transfer::DomainTransferRequest;
|
||||
/// use epp_client::generate_client_tr_id;
|
||||
|
@ -99,10 +99,10 @@ impl<E: EppExtension> EppRequest<E> for DomainTransferQuery<E> {
|
|||
/// #[tokio::main]
|
||||
/// async fn main() {
|
||||
/// // Create a config
|
||||
/// let mut registry: HashMap<String, EppClientConnection> = HashMap::new();
|
||||
/// let mut registry: HashMap<String, RegistryConfig> = HashMap::new();
|
||||
/// registry.insert(
|
||||
/// "registry_name".to_owned(),
|
||||
/// EppClientConnection {
|
||||
/// RegistryConfig {
|
||||
/// host: "example.com".to_owned(),
|
||||
/// port: 700,
|
||||
/// username: "username".to_owned(),
|
||||
|
@ -163,7 +163,7 @@ impl<E: EppExtension> DomainTransferRequest<E> {
|
|||
/// ```no_run
|
||||
/// use std::collections::HashMap;
|
||||
///
|
||||
/// use epp_client::config::{EppClientConfig, EppClientConnection};
|
||||
/// use epp_client::config::{EppClientConfig, RegistryConfig};
|
||||
/// use epp_client::EppClient;
|
||||
/// use epp_client::domain::transfer::DomainTransferApprove;
|
||||
/// use epp_client::generate_client_tr_id;
|
||||
|
@ -172,10 +172,10 @@ impl<E: EppExtension> DomainTransferRequest<E> {
|
|||
/// #[tokio::main]
|
||||
/// async fn main() {
|
||||
/// // Create a config
|
||||
/// let mut registry: HashMap<String, EppClientConnection> = HashMap::new();
|
||||
/// let mut registry: HashMap<String, RegistryConfig> = HashMap::new();
|
||||
/// registry.insert(
|
||||
/// "registry_name".to_owned(),
|
||||
/// EppClientConnection {
|
||||
/// RegistryConfig {
|
||||
/// host: "example.com".to_owned(),
|
||||
/// port: 700,
|
||||
/// username: "username".to_owned(),
|
||||
|
@ -236,7 +236,7 @@ impl<E: EppExtension> DomainTransferApprove<E> {
|
|||
/// ```no_run
|
||||
/// use std::collections::HashMap;
|
||||
///
|
||||
/// use epp_client::config::{EppClientConfig, EppClientConnection};
|
||||
/// use epp_client::config::{EppClientConfig, RegistryConfig};
|
||||
/// use epp_client::EppClient;
|
||||
/// use epp_client::domain::transfer::DomainTransferReject;
|
||||
/// use epp_client::generate_client_tr_id;
|
||||
|
@ -245,10 +245,10 @@ impl<E: EppExtension> DomainTransferApprove<E> {
|
|||
/// #[tokio::main]
|
||||
/// async fn main() {
|
||||
/// // Create a config
|
||||
/// let mut registry: HashMap<String, EppClientConnection> = HashMap::new();
|
||||
/// let mut registry: HashMap<String, RegistryConfig> = HashMap::new();
|
||||
/// registry.insert(
|
||||
/// "registry_name".to_owned(),
|
||||
/// EppClientConnection {
|
||||
/// RegistryConfig {
|
||||
/// host: "example.com".to_owned(),
|
||||
/// port: 700,
|
||||
/// username: "username".to_owned(),
|
||||
|
@ -309,7 +309,7 @@ impl<E: EppExtension> DomainTransferReject<E> {
|
|||
/// ```no_run
|
||||
/// use std::collections::HashMap;
|
||||
///
|
||||
/// use epp_client::config::{EppClientConfig, EppClientConnection};
|
||||
/// use epp_client::config::{EppClientConfig, RegistryConfig};
|
||||
/// use epp_client::EppClient;
|
||||
/// use epp_client::domain::transfer::DomainTransferCancel;
|
||||
/// use epp_client::generate_client_tr_id;
|
||||
|
@ -318,10 +318,10 @@ impl<E: EppExtension> DomainTransferReject<E> {
|
|||
/// #[tokio::main]
|
||||
/// async fn main() {
|
||||
/// // Create a config
|
||||
/// let mut registry: HashMap<String, EppClientConnection> = HashMap::new();
|
||||
/// let mut registry: HashMap<String, RegistryConfig> = HashMap::new();
|
||||
/// registry.insert(
|
||||
/// "registry_name".to_owned(),
|
||||
/// EppClientConnection {
|
||||
/// RegistryConfig {
|
||||
/// host: "example.com".to_owned(),
|
||||
/// port: 700,
|
||||
/// username: "username".to_owned(),
|
||||
|
@ -382,7 +382,7 @@ impl<E: EppExtension> DomainTransferCancel<E> {
|
|||
/// ```no_run
|
||||
/// use std::collections::HashMap;
|
||||
///
|
||||
/// use epp_client::config::{EppClientConfig, EppClientConnection};
|
||||
/// use epp_client::config::{EppClientConfig, RegistryConfig};
|
||||
/// use epp_client::EppClient;
|
||||
/// use epp_client::domain::transfer::DomainTransferQuery;
|
||||
/// use epp_client::generate_client_tr_id;
|
||||
|
@ -391,10 +391,10 @@ impl<E: EppExtension> DomainTransferCancel<E> {
|
|||
/// #[tokio::main]
|
||||
/// async fn main() {
|
||||
/// // Create a config
|
||||
/// let mut registry: HashMap<String, EppClientConnection> = HashMap::new();
|
||||
/// let mut registry: HashMap<String, RegistryConfig> = HashMap::new();
|
||||
/// registry.insert(
|
||||
/// "registry_name".to_owned(),
|
||||
/// EppClientConnection {
|
||||
/// RegistryConfig {
|
||||
/// host: "example.com".to_owned(),
|
||||
/// port: 700,
|
||||
/// username: "username".to_owned(),
|
||||
|
|
|
@ -38,7 +38,7 @@ impl<E: EppExtension> EppRequest<E> for DomainUpdate<E> {
|
|||
/// ```no_run
|
||||
/// use std::collections::HashMap;
|
||||
///
|
||||
/// use epp_client::config::{EppClientConfig, EppClientConnection};
|
||||
/// use epp_client::config::{EppClientConfig, RegistryConfig};
|
||||
/// use epp_client::EppClient;
|
||||
/// use epp_client::common::{DomainStatus, DomainContact};
|
||||
/// use epp_client::domain::update::{DomainUpdate, DomainAddRemove};
|
||||
|
@ -48,10 +48,10 @@ impl<E: EppExtension> EppRequest<E> for DomainUpdate<E> {
|
|||
/// #[tokio::main]
|
||||
/// async fn main() {
|
||||
/// // Create a config
|
||||
/// let mut registry: HashMap<String, EppClientConnection> = HashMap::new();
|
||||
/// let mut registry: HashMap<String, RegistryConfig> = HashMap::new();
|
||||
/// registry.insert(
|
||||
/// "registry_name".to_owned(),
|
||||
/// EppClientConnection {
|
||||
/// RegistryConfig {
|
||||
/// host: "example.com".to_owned(),
|
||||
/// port: 700,
|
||||
/// username: "username".to_owned(),
|
||||
|
|
|
@ -31,7 +31,7 @@ impl<E: EppExtension> EppRequest<E> for HostCheck<E> {
|
|||
/// ```no_run
|
||||
/// use std::collections::HashMap;
|
||||
///
|
||||
/// use epp_client::config::{EppClientConfig, EppClientConnection};
|
||||
/// use epp_client::config::{EppClientConfig, RegistryConfig};
|
||||
/// use epp_client::EppClient;
|
||||
/// use epp_client::host::check::HostCheck;
|
||||
/// use epp_client::generate_client_tr_id;
|
||||
|
@ -40,10 +40,10 @@ impl<E: EppExtension> EppRequest<E> for HostCheck<E> {
|
|||
/// #[tokio::main]
|
||||
/// async fn main() {
|
||||
/// // Create a config
|
||||
/// let mut registry: HashMap<String, EppClientConnection> = HashMap::new();
|
||||
/// let mut registry: HashMap<String, RegistryConfig> = HashMap::new();
|
||||
/// registry.insert(
|
||||
/// "registry_name".to_owned(),
|
||||
/// EppClientConnection {
|
||||
/// RegistryConfig {
|
||||
/// host: "example.com".to_owned(),
|
||||
/// port: 700,
|
||||
/// username: "username".to_owned(),
|
||||
|
|
|
@ -29,7 +29,7 @@ impl<E: EppExtension> EppRequest<E> for HostCreate<E> {
|
|||
/// ```no_run
|
||||
/// use std::collections::HashMap;
|
||||
///
|
||||
/// use epp_client::config::{EppClientConfig, EppClientConnection};
|
||||
/// use epp_client::config::{EppClientConfig, RegistryConfig};
|
||||
/// use epp_client::EppClient;
|
||||
/// use epp_client::common::HostAddr;
|
||||
/// use epp_client::host::create::HostCreate;
|
||||
|
@ -39,10 +39,10 @@ impl<E: EppExtension> EppRequest<E> for HostCreate<E> {
|
|||
/// #[tokio::main]
|
||||
/// async fn main() {
|
||||
/// // Create a config
|
||||
/// let mut registry: HashMap<String, EppClientConnection> = HashMap::new();
|
||||
/// let mut registry: HashMap<String, RegistryConfig> = HashMap::new();
|
||||
/// registry.insert(
|
||||
/// "registry_name".to_owned(),
|
||||
/// EppClientConnection {
|
||||
/// RegistryConfig {
|
||||
/// host: "example.com".to_owned(),
|
||||
/// port: 700,
|
||||
/// username: "username".to_owned(),
|
||||
|
|
|
@ -30,7 +30,7 @@ impl<E: EppExtension> EppRequest<E> for HostDelete<E> {
|
|||
/// ```no_run
|
||||
/// use std::collections::HashMap;
|
||||
///
|
||||
/// use epp_client::config::{EppClientConfig, EppClientConnection};
|
||||
/// use epp_client::config::{EppClientConfig, RegistryConfig};
|
||||
/// use epp_client::EppClient;
|
||||
/// use epp_client::host::delete::HostDelete;
|
||||
/// use epp_client::generate_client_tr_id;
|
||||
|
@ -39,10 +39,10 @@ impl<E: EppExtension> EppRequest<E> for HostDelete<E> {
|
|||
/// #[tokio::main]
|
||||
/// async fn main() {
|
||||
/// // Create a config
|
||||
/// let mut registry: HashMap<String, EppClientConnection> = HashMap::new();
|
||||
/// let mut registry: HashMap<String, RegistryConfig> = HashMap::new();
|
||||
/// registry.insert(
|
||||
/// "registry_name".to_owned(),
|
||||
/// EppClientConnection {
|
||||
/// RegistryConfig {
|
||||
/// host: "example.com".to_owned(),
|
||||
/// port: 700,
|
||||
/// username: "username".to_owned(),
|
||||
|
|
|
@ -29,7 +29,7 @@ impl<E: EppExtension> EppRequest<E> for HostInfo<E> {
|
|||
/// ```no_run
|
||||
/// use std::collections::HashMap;
|
||||
///
|
||||
/// use epp_client::config::{EppClientConfig, EppClientConnection};
|
||||
/// use epp_client::config::{EppClientConfig, RegistryConfig};
|
||||
/// use epp_client::EppClient;
|
||||
/// use epp_client::host::info::HostInfo;
|
||||
/// use epp_client::generate_client_tr_id;
|
||||
|
@ -38,10 +38,10 @@ impl<E: EppExtension> EppRequest<E> for HostInfo<E> {
|
|||
/// #[tokio::main]
|
||||
/// async fn main() {
|
||||
/// // Create a config
|
||||
/// let mut registry: HashMap<String, EppClientConnection> = HashMap::new();
|
||||
/// let mut registry: HashMap<String, RegistryConfig> = HashMap::new();
|
||||
/// registry.insert(
|
||||
/// "registry_name".to_owned(),
|
||||
/// EppClientConnection {
|
||||
/// RegistryConfig {
|
||||
/// host: "example.com".to_owned(),
|
||||
/// port: 700,
|
||||
/// username: "username".to_owned(),
|
||||
|
|
|
@ -30,7 +30,7 @@ impl<E: EppExtension> EppRequest<E> for HostUpdate<E> {
|
|||
/// ```no_run
|
||||
/// use std::collections::HashMap;
|
||||
///
|
||||
/// use epp_client::config::{EppClientConfig, EppClientConnection};
|
||||
/// use epp_client::config::{EppClientConfig, RegistryConfig};
|
||||
/// use epp_client::EppClient;
|
||||
/// use epp_client::common::{HostAddr, HostStatus};
|
||||
/// use epp_client::host::update::{HostUpdate, HostAddRemove, HostChangeInfo};
|
||||
|
@ -40,10 +40,10 @@ impl<E: EppExtension> EppRequest<E> for HostUpdate<E> {
|
|||
/// #[tokio::main]
|
||||
/// async fn main() {
|
||||
/// // Create a config
|
||||
/// let mut registry: HashMap<String, EppClientConnection> = HashMap::new();
|
||||
/// let mut registry: HashMap<String, RegistryConfig> = HashMap::new();
|
||||
/// registry.insert(
|
||||
/// "registry_name".to_owned(),
|
||||
/// EppClientConnection {
|
||||
/// RegistryConfig {
|
||||
/// host: "example.com".to_owned(),
|
||||
/// port: 700,
|
||||
/// username: "username".to_owned(),
|
||||
|
|
|
@ -41,7 +41,7 @@
|
|||
//! ```no_run
|
||||
//! use std::collections::HashMap;
|
||||
//!
|
||||
//! use epp_client::config::{EppClientConfig, EppClientConnection};
|
||||
//! use epp_client::config::{EppClientConfig, RegistryConfig};
|
||||
//! use epp_client::EppClient;
|
||||
//! use epp_client::domain::check::DomainCheck;
|
||||
//! use epp_client::generate_client_tr_id;
|
||||
|
@ -51,10 +51,10 @@
|
|||
//! async fn main() {
|
||||
//!
|
||||
//! // Create a config
|
||||
//! let mut registry: HashMap<String, EppClientConnection> = HashMap::new();
|
||||
//! let mut registry: HashMap<String, RegistryConfig> = HashMap::new();
|
||||
//! registry.insert(
|
||||
//! "registry_name".to_owned(),
|
||||
//! EppClientConnection {
|
||||
//! RegistryConfig {
|
||||
//! host: "example.com".to_owned(),
|
||||
//! port: 700,
|
||||
//! username: "username".to_owned(),
|
||||
|
|
|
@ -27,7 +27,7 @@ impl<E: EppExtension> EppRequest<E> for MessageAck<E> {
|
|||
/// ```no_run
|
||||
/// use std::collections::HashMap;
|
||||
///
|
||||
/// use epp_client::config::{EppClientConfig, EppClientConnection};
|
||||
/// use epp_client::config::{EppClientConfig, RegistryConfig};
|
||||
/// use epp_client::EppClient;
|
||||
/// use epp_client::message::ack::MessageAck;
|
||||
/// use epp_client::generate_client_tr_id;
|
||||
|
@ -36,10 +36,10 @@ impl<E: EppExtension> EppRequest<E> for MessageAck<E> {
|
|||
/// #[tokio::main]
|
||||
/// async fn main() {
|
||||
/// // Create a config
|
||||
/// let mut registry: HashMap<String, EppClientConnection> = HashMap::new();
|
||||
/// let mut registry: HashMap<String, RegistryConfig> = HashMap::new();
|
||||
/// registry.insert(
|
||||
/// "registry_name".to_owned(),
|
||||
/// EppClientConnection {
|
||||
/// RegistryConfig {
|
||||
/// host: "example.com".to_owned(),
|
||||
/// port: 700,
|
||||
/// username: "username".to_owned(),
|
||||
|
|
|
@ -28,7 +28,7 @@ impl<E: EppExtension> EppRequest<E> for MessagePoll<E> {
|
|||
/// ```no_run
|
||||
/// use std::collections::HashMap;
|
||||
///
|
||||
/// use epp_client::config::{EppClientConfig, EppClientConnection};
|
||||
/// use epp_client::config::{EppClientConfig, RegistryConfig};
|
||||
/// use epp_client::EppClient;
|
||||
/// use epp_client::message::poll::MessagePoll;
|
||||
/// use epp_client::generate_client_tr_id;
|
||||
|
@ -37,10 +37,10 @@ impl<E: EppExtension> EppRequest<E> for MessagePoll<E> {
|
|||
/// #[tokio::main]
|
||||
/// async fn main() {
|
||||
/// // Create a config
|
||||
/// let mut registry: HashMap<String, EppClientConnection> = HashMap::new();
|
||||
/// let mut registry: HashMap<String, RegistryConfig> = HashMap::new();
|
||||
/// registry.insert(
|
||||
/// "registry_name".to_owned(),
|
||||
/// EppClientConnection {
|
||||
/// RegistryConfig {
|
||||
/// host: "example.com".to_owned(),
|
||||
/// port: 700,
|
||||
/// username: "username".to_owned(),
|
||||
|
|
|
@ -13,7 +13,7 @@ use rustls_pemfile;
|
|||
use tokio::{io::AsyncReadExt, io::AsyncWriteExt, net::TcpStream};
|
||||
use tokio_rustls::{client::TlsStream, rustls::ClientConfig, TlsConnector};
|
||||
|
||||
use crate::config::EppClientConnection;
|
||||
use crate::config::RegistryConfig;
|
||||
use crate::error;
|
||||
|
||||
/// 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
|
||||
/// socket stream to read/write to the connection
|
||||
pub async fn epp_connect(
|
||||
registry_creds: &EppClientConnection,
|
||||
registry_creds: &RegistryConfig,
|
||||
) -> Result<TlsStream<TcpStream>, error::Error> {
|
||||
info!(
|
||||
"Connecting: EPP Server: {} Port: {}",
|
||||
|
|
Loading…
Reference in New Issue