minioenv

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2025 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init(
	ctx context.Context,
	env Environment,
	buckets ...Bucket,
) (minioClient *minio.Client, term func(), err error)

func Reuse

func Reuse(
	ctx context.Context,
	reusable *Reusable,
	buckets ...Bucket,
) (minioClinet *minio.Client, term func(), err error)

func ReuseForTesting

func ReuseForTesting(
	t *testing.T,
	reusable *Reusable,
	buckets ...Bucket,
) *minio.Client

func UseExternal

func UseExternal(
	ctx context.Context,
	buckets ...Bucket,
) (minioClient *minio.Client, term func(), err error)

func UseExternalConfig

func UseExternalConfig(
	ctx context.Context,
	cfg *ExternalEnvironmentConfig,
	buckets ...Bucket,
) (minioClient *minio.Client, term func(), err error)

func UseExternalForTesting

func UseExternalForTesting(t *testing.T, buckets ...Bucket) *minio.Client

func UseExternalForTestingConfig

func UseExternalForTestingConfig(
	t *testing.T,
	cfg *ExternalEnvironmentConfig,
	buckets ...Bucket,
) *minio.Client

Types

type Bucket

type Bucket struct {
	Name  string
	Files []File
}

type Environment

type Environment interface {
	Connect(ctx context.Context) (*minio.Client, error)
	Terminate(ctx context.Context) error
}

type ExternalEnvironmentConfig

type ExternalEnvironmentConfig struct {
	Endpoint string
	User     string
	Password string
}

type File

type File struct {
	Name    string
	Content []byte
}

func Files

func Files(fsys fs.FS) ([]File, error)

func MustFiles

func MustFiles(fsys fs.FS) []File

type ProvideEnvironmentFunc

type ProvideEnvironmentFunc func(ctx context.Context) (Environment, error)

type Reusable

type Reusable struct {
	// contains filtered or unexported fields
}

func ExternalReusable

func ExternalReusable() *Reusable

func NewReusable

func NewReusable(ccf ProvideEnvironmentFunc, opts ...ReusableOption) *Reusable

func (*Reusable) Terminate

func (r *Reusable) Terminate(ctx context.Context) error

type ReusableOption

type ReusableOption func(*Reusable)

func WithWaitDuration

func WithWaitDuration(waitDuration time.Duration) ReusableOption

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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