You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Not available until the next release of testcontainers-go <ahref="https://github.com/testcontainers/testcontainers-go"><spanclass="tc-version">:material-tag: main</span></a>
4
+
5
+
## Introduction
6
+
7
+
The Testcontainers module for Memcached.
8
+
9
+
## Adding this module to your project dependencies
10
+
11
+
Please run the following command to add the Memcached module to your Go dependencies:
12
+
13
+
```
14
+
go get github.com/testcontainers/testcontainers-go/modules/memcached
15
+
```
16
+
17
+
## Usage example
18
+
19
+
<!--codeinclude-->
20
+
[Creating a Memcached container](../../modules/memcached/examples_test.go) inside_block:runMemcachedContainer
21
+
<!--/codeinclude-->
22
+
23
+
## Module Reference
24
+
25
+
### Run function
26
+
27
+
- Not available until the next release of testcontainers-go <ahref="https://github.com/testcontainers/testcontainers-go"><spanclass="tc-version">:material-tag: main</span></a>
28
+
29
+
The Memcached module exposes one entrypoint function to create the Memcached container, and this function receives three parameters:
- `testcontainers.ContainerCustomizer`, a variadic argument for passing options.
38
+
39
+
### Container Options
40
+
41
+
When starting the Memcached container, you can pass options in a variadic way to configure it.
42
+
43
+
#### Image
44
+
45
+
Use the second argument in the `Run` function to set a valid Docker image.
46
+
In example: `Run(context.Background(), "memcached:1.6-alpine")`.
47
+
48
+
{% include "../features/common_functional_options.md" %}
49
+
50
+
### ContainerMethods
51
+
52
+
The Memcached container exposes the following methods:
53
+
54
+
#### HostPort
55
+
56
+
- Not available until the next release of testcontainers-go <a href="https://github.com/testcontainers/testcontainers-go"><span class="tc-version">:material-tag: main</span></a>
57
+
58
+
The `HostPort` method returns the host and port of the Memcached container, in the format `host:port`. Use this method to connect to the Memcached container from your application.
0 commit comments