Skip to content

tractoai/testcontainers-ytsaurus

Repository files navigation

YTsaurus

Introduction

The Testcontainers module for YTsaurus.

Adding this module to your project dependencies

Please run the following command to add the YTsaurus module to your Go dependencies:

go get github.com/tractoai/testcontainers-ytsaurus

Usage example

ctx := context.Background()

// Start a YTsaurus container
container, err := ytsaurus.RunContainer(ctx, testcontainers.WithImage("ytsaurus/local:stable"))
if err != nil {
    fmt.Printf("Error starting container: %s\n", err)
    return
}

// Clean up the container after the example is complete
defer func() {
    if err := container.Terminate(ctx); err != nil {
        fmt.Printf("Error terminating container: %s\n", err)
    }
}()

Module reference

The YTsaurus module exposes one entrypoint function to create the YTsaurus container, and this function receives two parameters:

func RunContainer(ctx context.Context, opts ...testcontainers.ContainerCustomizer) (*YTsaurusContainer, error)
  • context.Context, the Go context.
  • testcontainers.ContainerCustomizer, a variadic argument for passing options.

Container Options

When starting the YTsaurus container, you can pass options in a variadic way to configure it.

Image

If you need to set a different YTsaurus Docker image, you can use testcontainers.WithImage with a valid Docker image for YTsaurus. E.g. testcontainers.WithImage("ytsaurus/local:stable").

About

testcontainers-based local ytsaurus

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •