mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-06-16 11:58:52 -04:00
Bumps [github.com/testcontainers/testcontainers-go/modules/opensearch](https://github.com/testcontainers/testcontainers-go) from 0.39.0 to 0.40.0. - [Release notes](https://github.com/testcontainers/testcontainers-go/releases) - [Commits](https://github.com/testcontainers/testcontainers-go/compare/v0.39.0...v0.40.0) --- updated-dependencies: - dependency-name: github.com/testcontainers/testcontainers-go/modules/opensearch dependency-version: 0.40.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com>
45 lines
1.1 KiB
Go
45 lines
1.1 KiB
Go
package opensearch
|
|
|
|
import "github.com/testcontainers/testcontainers-go"
|
|
|
|
// Options is a struct for specifying options for the OpenSearch container.
|
|
type Options struct {
|
|
Password string
|
|
Username string
|
|
}
|
|
|
|
func defaultOptions() *Options {
|
|
return &Options{
|
|
Username: defaultUsername,
|
|
Password: defaultPassword,
|
|
}
|
|
}
|
|
|
|
// Compiler check to ensure that Option implements the testcontainers.ContainerCustomizer interface.
|
|
var _ testcontainers.ContainerCustomizer = (*Option)(nil)
|
|
|
|
// Option is an option for the OpenSearch container.
|
|
type Option func(*Options) error
|
|
|
|
// Customize is a NOOP. It's defined to satisfy the testcontainers.ContainerCustomizer interface.
|
|
func (o Option) Customize(*testcontainers.GenericContainerRequest) error {
|
|
// NOOP to satisfy interface.
|
|
return nil
|
|
}
|
|
|
|
// WithPassword sets the password for the OpenSearch container.
|
|
func WithPassword(password string) Option {
|
|
return func(o *Options) error {
|
|
o.Password = password
|
|
return nil
|
|
}
|
|
}
|
|
|
|
// WithUsername sets the username for the OpenSearch container.
|
|
func WithUsername(username string) Option {
|
|
return func(o *Options) error {
|
|
o.Username = username
|
|
return nil
|
|
}
|
|
}
|