tarantool

package
v1.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 11, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultTarantoolImage = "tarantool/tarantool:1.5"
	DefaultMasterPort     = "3301"
)

Variables

This section is empty.

Functions

func ServerHostPort

func ServerHostPort(ctx context.Context, c testcontainers.Container) (string, error)

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 WithCopyFile(hostFilePath, containerFilePath string, fileMode int64) testcontainers.CustomizeRequestOption

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 WithName

func WithName(name string, reuse bool) testcontainers.CustomizeRequestOption

WithName устанавливает возможность переиспользовать контейнер

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

func WithTarantool15(image string, waitTimeout time.Duration) testcontainers.CustomizeRequestOption

WithTarantool15 конфигурирует запуск контейнера тарантула версии 1.5

func WithTarantool2

func WithTarantool2(image string, waitTimeout time.Duration) testcontainers.CustomizeRequestOption

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) Init

func (c *Container) Init(ctx context.Context) error

func (*Container) ProduceLog

func (c *Container) ProduceLog(ctx context.Context) error

ProduceLog запускает процесс чтения логов контейнера с их выводом в testcontainers.Logging

func (*Container) ServerHostPort

func (c *Container) ServerHostPort(ctx context.Context) (string, error)

ServerHostPort хост и порт сервера тарантула запущенного в контейнере

func (*Container) Start

func (c *Container) Start(ctx context.Context) error

func (*Container) StartContainer

func (c *Container) StartContainer(ctx context.Context) error

func (*Container) Stop

func (c *Container) Stop(ctx context.Context) error

func (*Container) Terminate

func (c *Container) Terminate(ctx context.Context) error

type LogConsumer

type LogConsumer struct {
	testcontainers.Logging
}

LogConsumer реализует обработку полученных логов контейнера

func (*LogConsumer) Accept

func (lc *LogConsumer) Accept(l testcontainers.Log)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL