testing

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2024 License: MPL-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MinioServer

type MinioServer struct {
	// RootUsername is the root account username on the MinIO instance.
	RootUsername string
	// RootPassword is the root account password on the MinIO instance.
	RootPassword string
	// ServiceAccountAccessKeyId is the access key id for the default service
	// account created in NewMinioServer.
	ServiceAccountAccessKeyId string
	// ServiceAccountSecretAccessKey is the secret access key for the default
	// service account created in NewMinioServer.
	ServiceAccountSecretAccessKey string
	// ApiAddr is the MinIO S3 API address.
	ApiAddr string
	// Client is a MinIO SDK client, created with the default service account
	// credentials.
	Client *minio.Client
	// AdminClient is a Madmin client created with the root account credentials.
	AdminClient *madmin.AdminClient
}

func NewMinioServer

func NewMinioServer(t testing.TB, inOpts ...Option) *MinioServer

NewMinioServer uses docker to create a MinIO instance, ensures the instance is healthy, then creates a service account before returning a MinIOServer object, which contains the SDK client for API operations and the Madmin client for MinIO Admin operations.

type Option

type Option func(testing.TB, *options)

func WithRepository

func WithRepository(r string) Option

WithRepository controls the MinIO docker image used.

func WithSkipCleanup

func WithSkipCleanup(s bool) Option

WithSkipCleanup controls whether the MinIO instance gets destroyed after the test is run. If this option is passed, the instance will not be destroyed.

func WithVersion

func WithVersion(v string) Option

WithVersion controls the MinIO docker image version used.

Jump to

Keyboard shortcuts

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