pub struct Meilisearch { /* private fields */ }
meilisearch
only.Expand description
Module to work with Meilisearch
inside of tests.
Starts an instance of Meilisearch.
This module is based on the official Meilisearch docker image
documented in the Meilisearch docker docs
.
§Example
use testcontainers_modules::{meilisearch, testcontainers::runners::SyncRunner};
let meilisearch_instance = meilisearch::Meilisearch::default().start().unwrap();
let dashboard = format!(
"http://{}:{}",
meilisearch_instance.get_host().unwrap(),
meilisearch_instance.get_host_port_ipv4(7700).unwrap()
);
Implementations§
Source§impl Meilisearch
impl Meilisearch
Sourcepub fn with_master_key(self, master_key: &str) -> Self
pub fn with_master_key(self, master_key: &str) -> Self
Sets the MASTER_KEY
for the Meilisearch
instance.
Default MASTER_KEY
is None
if not overridden by this function
See the official docs for this option
Sourcepub fn with_analytics(self, enabled: bool) -> Self
pub fn with_analytics(self, enabled: bool) -> Self
Configures analytics for the Meilisearch
instance.
Default is false
if not overridden by this function
This default differs from the dockerfile as we expect tests not to be good analytics.
See the official docs for this option
Sourcepub fn with_environment(self, environment: Environment) -> Self
pub fn with_environment(self, environment: Environment) -> Self
Sets the environment of the Meilisearch
instance.
Default is Environment::Development if not overridden by this function.
Setting it to Environment::Production requires authentication via Meilisearch::with_master_key
See the official docs for this option
Sourcepub fn with_log_level(self, level: LogLevel) -> Self
pub fn with_log_level(self, level: LogLevel) -> Self
Sets the log level of the Meilisearch
instance.
Default is LogLevel::Info if not overridden by this function.
See the official docs for this option
Trait Implementations§
Source§impl Clone for Meilisearch
impl Clone for Meilisearch
Source§fn clone(&self) -> Meilisearch
fn clone(&self) -> Meilisearch
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for Meilisearch
impl Debug for Meilisearch
Source§impl Default for Meilisearch
impl Default for Meilisearch
Source§fn default() -> Self
fn default() -> Self
Starts an instance
- in
development
mode (see Meilisearch::with_environment to change this) - without
MASTER_KEY
being set (see Meilisearch::with_master_key to change this) - with Analytics disabled (see Meilisearch::with_analytics to change this)
Source§impl Image for Meilisearch
impl Image for Meilisearch
Source§fn tag(&self) -> &str
fn tag(&self) -> &str
Source§fn ready_conditions(&self) -> Vec<WaitFor>
fn ready_conditions(&self) -> Vec<WaitFor>
Source§fn env_vars(
&self,
) -> impl IntoIterator<Item = (impl Into<Cow<'_, str>>, impl Into<Cow<'_, str>>)>
fn env_vars( &self, ) -> impl IntoIterator<Item = (impl Into<Cow<'_, str>>, impl Into<Cow<'_, str>>)>
Source§fn expose_ports(&self) -> &[ContainerPort]
fn expose_ports(&self) -> &[ContainerPort]
Source§fn mounts(&self) -> impl IntoIterator<Item = &Mount>
fn mounts(&self) -> impl IntoIterator<Item = &Mount>
Source§fn copy_to_sources(&self) -> impl IntoIterator<Item = &CopyToContainer>
fn copy_to_sources(&self) -> impl IntoIterator<Item = &CopyToContainer>
Source§fn entrypoint(&self) -> Option<&str>
fn entrypoint(&self) -> Option<&str>
Source§fn cmd(&self) -> impl IntoIterator<Item = impl Into<Cow<'_, str>>>
fn cmd(&self) -> impl IntoIterator<Item = impl Into<Cow<'_, str>>>
CMD
this image needs to be created with.Source§fn exec_after_start(
&self,
cs: ContainerState,
) -> Result<Vec<ExecCommand>, TestcontainersError>
fn exec_after_start( &self, cs: ContainerState, ) -> Result<Vec<ExecCommand>, TestcontainersError>
Source§fn exec_before_ready(
&self,
cs: ContainerState,
) -> Result<Vec<ExecCommand>, TestcontainersError>
fn exec_before_ready( &self, cs: ContainerState, ) -> Result<Vec<ExecCommand>, TestcontainersError>
Auto Trait Implementations§
impl Freeze for Meilisearch
impl RefUnwindSafe for Meilisearch
impl Send for Meilisearch
impl Sync for Meilisearch
impl Unpin for Meilisearch
impl UnwindSafe for Meilisearch
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<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
.