pub struct Neo4j { /* private fields */ }
neo4j
only.Expand description
Neo4j image for testcontainers.
This image is based on the official Neo4j image.
The default user is neo4j
and the default password is neo
.
The default version is 5
.
§Example
use testcontainers_modules::{neo4j::Neo4j, testcontainers::runners::SyncRunner};
let container = Neo4j::default().start().unwrap();
let uri = format!(
"bolt://{}:{}",
container.get_host().unwrap(),
container.image().bolt_port_ipv4().unwrap()
);
let auth_user = container.image().user();
let auth_pass = container.image().password();
// connect to Neo4j with the uri, user and pass
§Neo4j Version
The version of the image can be set with the NEO4J_VERSION_TAG
environment variable.
The default version is 5
.
The available versions can be found on Docker Hub.
The used version can be retrieved with the version
method.
§Auth
The default user is neo4j
and the default password is neo
.
The used user can be retrieved with the user
method.
The used password can be retrieved with the pass
method.
§Environment variables
The following environment variables are supported:
NEO4J_VERSION_TAG
: The default version of the image to use.NEO4J_TEST_USER
: The default user to use for authentication.NEO4J_TEST_PASS
: The default password to use for authentication.
§Neo4j Labs Plugins
Neo4j offers built-in support for Neo4j Labs plugins.
The method with_neo4j_labs_plugin
can be used to define them.
Supported plugins are APOC, APOC Core, Bloom, Streams, Graph Data Science, and Neo Semantics.
Implementations§
Source§impl Neo4j
impl Neo4j
Sourcepub fn with_version(self, version: impl Into<Cow<'static, str>>) -> Self
pub fn with_version(self, version: impl Into<Cow<'static, str>>) -> Self
Set the Neo4j version to use. The value must be an existing Neo4j version tag.
Sourcepub fn with_password(self, pass: impl Into<Cow<'static, str>>) -> Self
pub fn with_password(self, pass: impl Into<Cow<'static, str>>) -> Self
Set the password to use.
Sourcepub fn without_authentication(self) -> Self
pub fn without_authentication(self) -> Self
Do not use any authentication on the testcontainer.
Setting this will override any prior usages of Self::with_user
and
Self::with_password
.
Sourcepub fn with_neo4j_labs_plugin(self, plugins: &[Neo4jLabsPlugin]) -> Self
pub fn with_neo4j_labs_plugin(self, plugins: &[Neo4jLabsPlugin]) -> Self
Add Neo4j lab plugins to get started with the database.
Trait Implementations§
Source§impl From<Neo4j> for ContainerRequest<Neo4jImage>
impl From<Neo4j> for ContainerRequest<Neo4jImage>
Source§impl From<Neo4j> for Neo4jImage
impl From<Neo4j> for Neo4jImage
impl Eq for Neo4j
impl StructuralPartialEq for Neo4j
Auto Trait Implementations§
impl Freeze for Neo4j
impl RefUnwindSafe for Neo4j
impl Send for Neo4j
impl Sync for Neo4j
impl Unpin for Neo4j
impl UnwindSafe for Neo4j
Blanket Implementations§
Source§impl<T, I> AsyncRunner<I> for T
impl<T, I> AsyncRunner<I> for T
Source§fn start<'async_trait>(
self,
) -> Pin<Box<dyn Future<Output = Result<ContainerAsync<I>, TestcontainersError>> + Send + 'async_trait>>where
T: 'async_trait,
fn start<'async_trait>(
self,
) -> Pin<Box<dyn Future<Output = Result<ContainerAsync<I>, TestcontainersError>> + Send + 'async_trait>>where
T: 'async_trait,
ContainerAsync
.Source§fn pull_image<'async_trait>(
self,
) -> Pin<Box<dyn Future<Output = Result<ContainerRequest<I>, TestcontainersError>> + Send + 'async_trait>>where
T: 'async_trait,
fn pull_image<'async_trait>(
self,
) -> Pin<Box<dyn Future<Output = Result<ContainerRequest<I>, TestcontainersError>> + Send + 'async_trait>>where
T: 'async_trait,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.Source§impl<RI, I> ImageExt<I> for RI
impl<RI, I> ImageExt<I> for RI
Source§fn with_cmd(
self,
cmd: impl IntoIterator<Item = impl Into<String>>,
) -> ContainerRequest<I>
fn with_cmd( self, cmd: impl IntoIterator<Item = impl Into<String>>, ) -> ContainerRequest<I>
Source§fn with_name(self, name: impl Into<String>) -> ContainerRequest<I>
fn with_name(self, name: impl Into<String>) -> ContainerRequest<I>
{domain}/{owner}/{image}
).
Can be used to specify a custom registry or owner.Source§fn with_tag(self, tag: impl Into<String>) -> ContainerRequest<I>
fn with_tag(self, tag: impl Into<String>) -> ContainerRequest<I>
Source§fn with_container_name(self, name: impl Into<String>) -> ContainerRequest<I>
fn with_container_name(self, name: impl Into<String>) -> ContainerRequest<I>
Source§fn with_network(self, network: impl Into<String>) -> ContainerRequest<I>
fn with_network(self, network: impl Into<String>) -> ContainerRequest<I>
Source§fn with_label(
self,
key: impl Into<String>,
value: impl Into<String>,
) -> ContainerRequest<I>
fn with_label( self, key: impl Into<String>, value: impl Into<String>, ) -> ContainerRequest<I>
Source§fn with_labels(
self,
labels: impl IntoIterator<Item = (impl Into<String>, impl Into<String>)>,
) -> ContainerRequest<I>
fn with_labels( self, labels: impl IntoIterator<Item = (impl Into<String>, impl Into<String>)>, ) -> ContainerRequest<I>
Source§fn with_env_var(
self,
name: impl Into<String>,
value: impl Into<String>,
) -> ContainerRequest<I>
fn with_env_var( self, name: impl Into<String>, value: impl Into<String>, ) -> ContainerRequest<I>
Source§fn with_host(
self,
key: impl Into<String>,
value: impl Into<Host>,
) -> ContainerRequest<I>
fn with_host( self, key: impl Into<String>, value: impl Into<Host>, ) -> ContainerRequest<I>
Source§fn with_mount(self, mount: impl Into<Mount>) -> ContainerRequest<I>
fn with_mount(self, mount: impl Into<Mount>) -> ContainerRequest<I>
Source§fn with_copy_to(
self,
target: impl Into<String>,
source: impl Into<CopyDataSource>,
) -> ContainerRequest<I>
fn with_copy_to( self, target: impl Into<String>, source: impl Into<CopyDataSource>, ) -> ContainerRequest<I>
Source§fn with_mapped_port(
self,
host_port: u16,
container_port: ContainerPort,
) -> ContainerRequest<I>
fn with_mapped_port( self, host_port: u16, container_port: ContainerPort, ) -> ContainerRequest<I>
Source§fn with_ulimit(
self,
name: &str,
soft: i64,
hard: Option<i64>,
) -> ContainerRequest<I>
fn with_ulimit( self, name: &str, soft: i64, hard: Option<i64>, ) -> ContainerRequest<I>
Source§fn with_privileged(self, privileged: bool) -> ContainerRequest<I>
fn with_privileged(self, privileged: bool) -> ContainerRequest<I>
Source§fn with_cap_add(self, capability: impl Into<String>) -> ContainerRequest<I>
fn with_cap_add(self, capability: impl Into<String>) -> ContainerRequest<I>
Source§fn with_cap_drop(self, capability: impl Into<String>) -> ContainerRequest<I>
fn with_cap_drop(self, capability: impl Into<String>) -> ContainerRequest<I>
Source§fn with_cgroupns_mode(self, cgroupns_mode: CgroupnsMode) -> ContainerRequest<I>
fn with_cgroupns_mode(self, cgroupns_mode: CgroupnsMode) -> ContainerRequest<I>
Source§fn with_userns_mode(self, userns_mode: &str) -> ContainerRequest<I>
fn with_userns_mode(self, userns_mode: &str) -> ContainerRequest<I>
Source§fn with_shm_size(self, bytes: u64) -> ContainerRequest<I>
fn with_shm_size(self, bytes: u64) -> ContainerRequest<I>
Source§fn with_startup_timeout(self, timeout: Duration) -> ContainerRequest<I>
fn with_startup_timeout(self, timeout: Duration) -> ContainerRequest<I>
Source§fn with_working_dir(self, working_dir: impl Into<String>) -> ContainerRequest<I>
fn with_working_dir(self, working_dir: impl Into<String>) -> ContainerRequest<I>
/
.Source§fn with_log_consumer(
self,
log_consumer: impl LogConsumer + 'static,
) -> ContainerRequest<I>
fn with_log_consumer( self, log_consumer: impl LogConsumer + 'static, ) -> ContainerRequest<I>
Source§fn with_user(self, user: impl Into<String>) -> ContainerRequest<I>
fn with_user(self, user: impl Into<String>) -> ContainerRequest<I>
Source§fn with_readonly_rootfs(self, readonly_rootfs: bool) -> ContainerRequest<I>
fn with_readonly_rootfs(self, readonly_rootfs: bool) -> ContainerRequest<I>
Source§fn with_security_opt(
self,
security_opt: impl Into<String>,
) -> ContainerRequest<I>
fn with_security_opt( self, security_opt: impl Into<String>, ) -> ContainerRequest<I>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoResult<T> for T
impl<T> IntoResult<T> for T
type Err = Infallible
fn into_result(self) -> Result<T, <T as IntoResult<T>>::Err>
Source§impl<T> IntoResult<T> for T
impl<T> IntoResult<T> for T
type Err = Infallible
fn into_result(self) -> Result<T, <T as IntoResult<T>>::Err>
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T, I> SyncRunner<I> for T
impl<T, I> SyncRunner<I> for T
Source§fn start(self) -> Result<Container<I>, TestcontainersError>
fn start(self) -> Result<Container<I>, TestcontainersError>
Container
.