File tree 14 files changed +60
-27
lines changed
14 files changed +60
-27
lines changed Original file line number Diff line number Diff line change @@ -3,3 +3,4 @@ reorder_imports = true
3
3
merge_derives = true
4
4
imports_granularity = " Crate"
5
5
group_imports = " StdExternalCrate"
6
+ format_code_in_doc_comments = true # tracking issue https://github.com/rust-lang/rustfmt/issues/3348
Original file line number Diff line number Diff line change @@ -14,7 +14,11 @@ const TAG: &str = "2";
14
14
/// let registry = cncf_distribution::CncfDistribution.start().unwrap();
15
15
///
16
16
/// let image_name = "test";
17
- /// let image_tag = format!("{}:{}/{image_name}", registry.get_host().unwrap(), registry.get_host_port_ipv4(5000).unwrap());
17
+ /// let image_tag = format!(
18
+ /// "{}:{}/{image_name}",
19
+ /// registry.get_host().unwrap(),
20
+ /// registry.get_host_port_ipv4(5000).unwrap()
21
+ /// );
18
22
///
19
23
/// // now you can push an image tagged with `image_tag` and pull it afterward
20
24
/// ```
Original file line number Diff line number Diff line change @@ -39,19 +39,24 @@ pub const RANCHER_WEBHOOK_PORT: ContainerPort = ContainerPort::Tcp(8443);
39
39
/// # Example
40
40
/// ```
41
41
/// use std::env::temp_dir;
42
+ ///
42
43
/// use testcontainers_modules::{
43
- /// testcontainers ::{ImageExt, runners::SyncRunner },
44
- /// k3s ::{K3s, KUBE_SECURE_PORT}
44
+ /// k3s ::{K3s, KUBE_SECURE_PORT },
45
+ /// testcontainers ::{runners::SyncRunner, ImageExt},
45
46
/// };
46
47
///
47
- /// let k3s_instance = K3s::default().with_conf_mount(&temp_dir())
48
- /// .with_privileged(true)
49
- /// .with_userns_mode("host")
50
- /// .start()
51
- /// .unwrap();
48
+ /// let k3s_instance = K3s::default()
49
+ /// .with_conf_mount(&temp_dir())
50
+ /// .with_privileged(true)
51
+ /// .with_userns_mode("host")
52
+ /// .start()
53
+ /// .unwrap();
52
54
///
53
55
/// let kube_port = k3s_instance.get_host_port_ipv4(KUBE_SECURE_PORT);
54
- /// let kube_conf = k3s_instance.image().read_kube_config().expect("Cannot read kube conf");
56
+ /// let kube_conf = k3s_instance
57
+ /// .image()
58
+ /// .read_kube_config()
59
+ /// .expect("Cannot read kube conf");
55
60
/// // use kube_port and kube_conf to connect and control k3s cluster
56
61
/// ```
57
62
///
Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ pub const KWOK_CLUSTER_PORT: ContainerPort = ContainerPort::Tcp(8080);
24
24
/// Testcontainers support setting environment variables with the method [`testcontainers::ImageExt::with_env_var`].
25
25
///
26
26
/// ```
27
- /// use testcontainers_modules::{testcontainers::ImageExt, kwok::KwokCluster };
27
+ /// use testcontainers_modules::{kwok::KwokCluster, testcontainers::ImageExt };
28
28
///
29
29
/// let container_request = KwokCluster::default().with_env_var("KWOK_PROMETHEUS_PORT", "9090");
30
30
/// ```
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ const TAG: &str = "11.3";
13
13
///
14
14
/// # Example
15
15
/// ```
16
- /// use testcontainers_modules::{testcontainers::runners::SyncRunner, mariadb };
16
+ /// use testcontainers_modules::{mariadb, testcontainers::runners::SyncRunner};
17
17
///
18
18
/// let mariadb_instance = mariadb::Mariadb::default().start().unwrap();
19
19
/// let mariadb_url = format!(
Original file line number Diff line number Diff line change @@ -13,7 +13,11 @@ use testcontainers::{core::WaitFor, Image};
13
13
///
14
14
/// let mosquitto_instance = mosquitto::Mosquitto::default().start().unwrap();
15
15
///
16
- /// let broker_url = format!("{}:{}", mosquitto_instance.get_host().unwrap(), mosquitto_instance.get_host_port_ipv4(1883).unwrap());
16
+ /// let broker_url = format!(
17
+ /// "{}:{}",
18
+ /// mosquitto_instance.get_host().unwrap(),
19
+ /// mosquitto_instance.get_host_port_ipv4(1883).unwrap()
20
+ /// );
17
21
/// ```
18
22
///
19
23
/// [`Mosquitto`]: https://mosquitto.org/
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ const TAG: &str = "8.1";
13
13
///
14
14
/// # Example
15
15
/// ```
16
- /// use testcontainers_modules::{testcontainers::runners::SyncRunner, mysql };
16
+ /// use testcontainers_modules::{mysql, testcontainers::runners::SyncRunner};
17
17
///
18
18
/// let mysql_instance = mysql::Mysql::default().start().unwrap();
19
19
/// let mysql_url = format!(
Original file line number Diff line number Diff line change @@ -46,10 +46,14 @@ impl std::fmt::Display for Neo4jLabsPlugin {
46
46
/// # Example
47
47
///
48
48
/// ```rust,no_run
49
- /// use testcontainers_modules::{testcontainers::runners::SyncRunner, neo4j::Neo4j };
49
+ /// use testcontainers_modules::{neo4j::Neo4j, testcontainers::runners::SyncRunner};
50
50
///
51
51
/// let container = Neo4j::default().start().unwrap();
52
- /// let uri = format!("bolt://{}:{}", container.get_host().unwrap(), container.image().bolt_port_ipv4().unwrap());
52
+ /// let uri = format!(
53
+ /// "bolt://{}:{}",
54
+ /// container.get_host().unwrap(),
55
+ /// container.image().bolt_port_ipv4().unwrap()
56
+ /// );
53
57
/// let auth_user = container.image().user();
54
58
/// let auth_pass = container.image().password();
55
59
/// // connect to Neo4j with the uri, user and pass
Original file line number Diff line number Diff line change @@ -16,7 +16,11 @@ const TAG: &str = "3.8.22-management";
16
16
///
17
17
/// let rabbitmq_instance = rabbitmq::RabbitMq.start().unwrap();
18
18
///
19
- /// let amqp_url = format!("amqp://{}:{}", rabbitmq_instance.get_host().unwrap(), rabbitmq_instance.get_host_port_ipv4(5672).unwrap());
19
+ /// let amqp_url = format!(
20
+ /// "amqp://{}:{}",
21
+ /// rabbitmq_instance.get_host().unwrap(),
22
+ /// rabbitmq_instance.get_host_port_ipv4(5672).unwrap()
23
+ /// );
20
24
///
21
25
/// // do something with the started rabbitmq instance..
22
26
/// ```
Original file line number Diff line number Diff line change @@ -12,7 +12,10 @@ const TAG: &str = "5.0";
12
12
/// # Example
13
13
/// ```
14
14
/// use redis::Commands;
15
- /// use testcontainers_modules::{testcontainers::runners::SyncRunner, redis::{Redis, REDIS_PORT}};
15
+ /// use testcontainers_modules::{
16
+ /// redis::{Redis, REDIS_PORT},
17
+ /// testcontainers::runners::SyncRunner,
18
+ /// };
16
19
///
17
20
/// let redis_instance = Redis::default().start().unwrap();
18
21
/// let host_ip = redis_instance.get_host().unwrap();
Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ const TAG: &str = "9.5.0-slim";
22
22
///
23
23
/// // use HTTP client to interact with the solr API
24
24
/// ```
25
- ///
25
+ ///
26
26
/// [`Solr`]: https://solr.apache.org/
27
27
/// [`Solr docker image`]: https://hub.docker.com/_/solr
28
28
/// [`Solr reference guide`]: https://solr.apache.org/guide/solr/latest/
Original file line number Diff line number Diff line change @@ -29,20 +29,22 @@ pub const SURREALDB_PORT: ContainerPort = ContainerPort::Tcp(8000);
29
29
/// let surrealdb_instance = surrealdb::SurrealDb::default().start().unwrap();
30
30
///
31
31
/// let connection_string = format!(
32
- /// "127.0.0.1:{}",
33
- /// surrealdb_instance.get_host_port_ipv4(surrealdb::SURREALDB_PORT).unwrap(),
32
+ /// "127.0.0.1:{}",
33
+ /// surrealdb_instance
34
+ /// .get_host_port_ipv4(surrealdb::SURREALDB_PORT)
35
+ /// .unwrap(),
34
36
/// );
35
37
///
36
38
/// # let runtime = tokio::runtime::Runtime::new().unwrap();
37
39
/// # runtime.block_on(async {
38
40
/// let db: Surreal<Client> = Surreal::init();
39
- /// db.connect::<Ws>(connection_string).await.expect("Failed to connect to SurrealDB");
41
+ /// db.connect::<Ws>(connection_string)
42
+ /// .await
43
+ /// .expect("Failed to connect to SurrealDB");
40
44
/// # });
41
- ///
42
45
/// ```
43
46
/// [`SurrealDB`]: https://surrealdb.com/
44
47
/// [`SurrealDB docker image`]: https://hub.docker.com/r/surrealdb/surrealdb
45
- ///
46
48
#[ derive( Debug , Clone ) ]
47
49
pub struct SurrealDb {
48
50
env_vars : HashMap < String , String > ,
Original file line number Diff line number Diff line change @@ -11,12 +11,18 @@ const TAG: &str = "v1.96.0";
11
11
///
12
12
/// # Example
13
13
/// ```
14
- /// use testcontainers_modules::{victoria_metrics, testcontainers::runners::SyncRunner};
14
+ /// use testcontainers_modules::{testcontainers::runners::SyncRunner, victoria_metrics };
15
15
///
16
16
/// let victoria_metrics_instance = victoria_metrics::VictoriaMetrics.start().unwrap();
17
17
///
18
- /// let import_url = format!("http://127.0.0.1:{}/api/v1/import", victoria_metrics_instance.get_host_port_ipv4(8428).unwrap());
19
- /// let export_url = format!("http://127.0.0.1:{}/api/v1/export", victoria_metrics_instance.get_host_port_ipv4(8428).unwrap());
18
+ /// let import_url = format!(
19
+ /// "http://127.0.0.1:{}/api/v1/import",
20
+ /// victoria_metrics_instance.get_host_port_ipv4(8428).unwrap()
21
+ /// );
22
+ /// let export_url = format!(
23
+ /// "http://127.0.0.1:{}/api/v1/export",
24
+ /// victoria_metrics_instance.get_host_port_ipv4(8428).unwrap()
25
+ /// );
20
26
///
21
27
/// // operate on the import and export URLs..
22
28
/// ```
Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ const TAG: &str = "3.9.0";
20
20
/// let zk_url = format!(
21
21
/// "{}:{}",
22
22
/// node.get_host().await.unwrap(),
23
- /// node.get_host_port_ipv4(2181).await.unwrap()
23
+ /// node.get_host_port_ipv4(2181).await.unwrap(),
24
24
/// );
25
25
/// let client = zookeeper_client::Client::connect(&zk_url)
26
26
/// .await
You can’t perform that action at this time.
0 commit comments