testutil

package
v1.2.4 Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package testutil provides test utilities for Elasticsearch client testing.

This package simplifies testing by providing helper functions to create Elasticsearch test containers and initialize clients across different versions.

Features:

  • Multi-version client creation (v7, v8, v9)
  • Testcontainers integration
  • Simplified client initialization for tests

Example:

client := testutil.GetTestClient(t, "v8", []string{"http://localhost:9200"})
client.Index("testindex", "1", `{"test":"data"}`)

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetTestClient

func GetTestClient(t *testing.T, version string, addresses []string) elasticsearch.ClientInterface

func RunWithElasticsearch

func RunWithElasticsearch(m *testing.M, image string, elasticsearchURL *string)
Example
package main

import (
	"fmt"
)

func main() {
	var elasticsearchURL string

	fmt.Println("Example elasticsearch URL format:", elasticsearchURL)
}

Types

This section is empty.

Jump to

Keyboard shortcuts

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