Documentation
¶
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WithRootPassword ¶
func WithRootPassword(password string) testcontainers.CustomizeRequestOption
WithRootPassword sets the root password for the OrientDB container via the ORIENTDB_ROOT_PASSWORD environment variable.
Types ¶
type Container ¶
type Container struct {
testcontainers.Container
}
Container represents the OrientDB container type used in the module.
func Run ¶
func Run(ctx context.Context, img string, opts ...testcontainers.ContainerCustomizer) (*Container, error)
Run creates an instance of the OrientDB container type.
Example ¶
package main
import (
"context"
"fmt"
"log"
"github.com/testcontainers/testcontainers-go"
"github.com/testcontainers/testcontainers-go/modules/orientdb"
)
func main() {
// runOrientDB {
ctx := context.Background()
orientdbContainer, err := orientdb.Run(ctx, "orientdb:3.2",
orientdb.WithRootPassword("rootpwd"),
)
defer func() {
if err := testcontainers.TerminateContainer(orientdbContainer); err != nil {
log.Printf("failed to terminate container: %s", err)
}
}()
if err != nil {
log.Printf("failed to start container: %s", err)
return
}
// }
state, err := orientdbContainer.State(ctx)
if err != nil {
log.Printf("failed to get container state: %s", err)
return
}
fmt.Println(state.Running)
}
Output: true
Click to show internal directories.
Click to hide internal directories.