vearch

package module
v0.35.0 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type VearchContainer

type VearchContainer struct {
	testcontainers.Container
}

VearchContainer represents the Vearch container type used in the module

func Run

func Run(ctx context.Context, img string, opts ...testcontainers.ContainerCustomizer) (*VearchContainer, error)

Run creates an instance of the Vearch container type

Example
// runVearchContainer {
ctx := context.Background()

vearchContainer, err := vearch.Run(ctx, "vearch/vearch:3.5.1")
defer func() {
	if err := testcontainers.TerminateContainer(vearchContainer); err != nil {
		log.Printf("failed to terminate container: %s", err)
	}
}()
if err != nil {
	log.Printf("failed to start container: %s", err)
	return
}
// }

state, err := vearchContainer.State(ctx)
if err != nil {
	log.Printf("failed to get container state: %s", err)
	return
}

fmt.Println(state.Running)
Output:

true

func RunContainer deprecated

func RunContainer(ctx context.Context, opts ...testcontainers.ContainerCustomizer) (*VearchContainer, error)

Deprecated: use Run instead RunContainer creates an instance of the Vearch container type

func (*VearchContainer) RESTEndpoint

func (c *VearchContainer) RESTEndpoint(ctx context.Context) (string, error)

RESTEndpoint returns the REST endpoint of the Vearch container

Jump to

Keyboard shortcuts

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