s3clienttest

package
v0.0.0-...-e308f56 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package s3clienttest provides a reusable MinIO test server via Docker.

Index

Constants

View Source
const (
	Port     = "19000"
	Addr     = "localhost:" + Port
	Username = "minioadmin"
	Password = "minioadmin"
)

Variables

This section is empty.

Functions

func CleanBucket

func CleanBucket(t *testing.T, bucket string)

CleanBucket removes all objects from the given bucket.

func Client

func Client(t *testing.T) *minio.Client

Client returns a minio client connected to the test server.

func Start

func Start(t *testing.T) string

Start ensures a shared MinIO container is running, creates a deterministic bucket for this test, and returns its name. The bucket name is derived from the calling package and t.Name() so that different test packages cannot collide even when run in parallel.

Any stale objects left over from a previous (possibly crashed) run are removed up front, and t.Cleanup removes objects when the test finishes normally.

Types

This section is empty.

Jump to

Keyboard shortcuts

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