Documentation
¶
Index ¶
- Constants
- func ServerHostPort(ctx context.Context, c testcontainers.Container) (string, error)
- func WithArguments(args ...string) testcontainers.CustomizeRequestOption
- func WithCommand(cmd []string) testcontainers.CustomizeRequestOption
- func WithConfigFile(cfgPath string) testcontainers.CustomizeRequestOption
- func WithConfigFileMapping(cfgPath, containerCfgPath string) testcontainers.CustomizeRequestOption
- func WithCopyFile(hostFilePath, containerFilePath string, fileMode int64) testcontainers.CustomizeRequestOption
- func WithEnv(prefix string) testcontainers.CustomizeRequestOption
- func WithHookOnStartTarantool(hook func(ctx context.Context, connection string) error) testcontainers.CustomizeRequestOption
- func WithHookOnStopTarantool(hook func(ctx context.Context, connection string) error) testcontainers.CustomizeRequestOption
- func WithLogger(logger testcontainers.Logging) testcontainers.CustomizeRequestOption
- func WithName(name string, reuse bool) testcontainers.CustomizeRequestOption
- func WithScripts(scriptPath string, containerScriptPath string) testcontainers.CustomizeRequestOption
- func WithScriptsMapping(scriptPath string, containerScriptPath string) testcontainers.CustomizeRequestOption
- func WithTarantool15(image string, waitTimeout time.Duration) testcontainers.CustomizeRequestOption
- func WithTarantool2(image string, waitTimeout time.Duration) testcontainers.CustomizeRequestOption
- type Container
- func (c *Container) CopyDirToContainer(ctx context.Context, hostDirPath string, containerParentPath string, ...) error
- func (c *Container) Init(ctx context.Context) error
- func (c *Container) ProduceLog(ctx context.Context) error
- func (c *Container) ServerHostPort(ctx context.Context) (string, error)
- func (c *Container) Start(ctx context.Context) error
- func (c *Container) StartContainer(ctx context.Context) error
- func (c *Container) Stop(ctx context.Context) error
- func (c *Container) Terminate(ctx context.Context) error
- type LogConsumer
Constants ¶
const ( DefaultTarantoolImage = "tarantool/tarantool:1.5" DefaultMasterPort = "3301" )
Variables ¶
This section is empty.
Functions ¶
func ServerHostPort ¶
func WithArguments ¶
func WithArguments(args ...string) testcontainers.CustomizeRequestOption
WithArguments запуск контейнера tarantool с аргументами для entrypoint
func WithCommand ¶
func WithCommand(cmd []string) testcontainers.CustomizeRequestOption
WithCommand запуск контейнера tarantool с пользовательской командой
func WithConfigFile ¶
func WithConfigFile(cfgPath string) testcontainers.CustomizeRequestOption
WithConfigFile устанавливает конфиг тарантула из файла расположенного в cfgPath
func WithConfigFileMapping ¶
func WithConfigFileMapping(cfgPath, containerCfgPath string) testcontainers.CustomizeRequestOption
WithConfigFileMapping устанавливает конфиг тарантула из файла расположенного в cfgPath в контейнер по пути containerCfgPath
func WithCopyFile ¶
func WithEnv ¶
func WithEnv(prefix string) testcontainers.CustomizeRequestOption
WithEnv копирует переменные окружения начинающиеся с prefix в контейнер
func WithHookOnStartTarantool ¶
func WithHookOnStartTarantool(hook func(ctx context.Context, connection string) error) testcontainers.CustomizeRequestOption
WithHookOnStartTarantool регистрирует функции выполняющиеся после старта контейнера и получения соединения к БД
func WithHookOnStopTarantool ¶
func WithHookOnStopTarantool(hook func(ctx context.Context, connection string) error) testcontainers.CustomizeRequestOption
WithHookOnStopTarantool регистрирует функции выполняющиеся перед остановкой контейнера
func WithLogger ¶
func WithLogger(logger testcontainers.Logging) testcontainers.CustomizeRequestOption
WithLogger устанавливает вывод в logger
func WithScripts ¶
func WithScripts(scriptPath string, containerScriptPath string) testcontainers.CustomizeRequestOption
WithScripts копирует папку со LUA скриптами из папки расположенной в scriptPath в папку контейнера containerScriptPath
func WithScriptsMapping ¶
func WithScriptsMapping(scriptPath string, containerScriptPath string) testcontainers.CustomizeRequestOption
WithScriptsMapping устанавливает папку со LUA скриптами из папки расположенной в scriptPath в папку контейнера containerScriptPath
func WithTarantool15 ¶
WithTarantool15 конфигурирует запуск контейнера тарантула версии 1.5
func WithTarantool2 ¶
WithTarantool2 конфигурирует запуск контейнера тарантула версии 2
Types ¶
type Container ¶
type Container struct { testcontainers.Container // contains filtered or unexported fields }
func NewContainer ¶
func NewContainer(ctx context.Context, opts ...testcontainers.ContainerCustomizer) (*Container, error)
NewContainer создает экземпляр контейнера тарантула
func RunContainer ¶
func RunContainer(ctx context.Context, opts ...testcontainers.ContainerCustomizer) (*Container, error)
RunContainer создает экземпляр контейнера тарантула
func (*Container) CopyDirToContainer ¶
func (c *Container) CopyDirToContainer(ctx context.Context, hostDirPath string, containerParentPath string, fileMode int64) error
CopyDirToContainer копирует файлы (включая содержимое символических ссылок) расположенные в hostDirPath в контейнер в containerParentPath с правами fileMode
func (*Container) ProduceLog ¶
ProduceLog запускает процесс чтения логов контейнера с их выводом в testcontainers.Logging
func (*Container) ServerHostPort ¶
ServerHostPort хост и порт сервера тарантула запущенного в контейнере
type LogConsumer ¶
type LogConsumer struct {
testcontainers.Logging
}
LogConsumer реализует обработку полученных логов контейнера
func (*LogConsumer) Accept ¶
func (lc *LogConsumer) Accept(l testcontainers.Log)