envtest

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2026 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Test

func Test[T any](t *testing.T, loadFunc func(path ...string) (*T, error), envs Inputs)

Types

type FileEnvManager

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

func (*FileEnvManager) Cleanup

func (fem *FileEnvManager) Cleanup()

func (*FileEnvManager) New

func (fem *FileEnvManager) New(t *testing.T)

func (*FileEnvManager) PathIfExists

func (fem *FileEnvManager) PathIfExists() []string

func (*FileEnvManager) SetEnv

func (fem *FileEnvManager) SetEnv(key, value string)

type Input

type Input interface {
	NotRequire() Input
	// contains filtered or unexported methods
}

func CaCert

func CaCert(value string) Input

CaCert: (cert)

func Cert

func Cert(cert string, key string) Input

Cert: (cert, key)

func CertKey

func CertKey(key string, cert string) Input

CertKey: (key, cert)

func Duration

func Duration(value string) Input

func Durations

func Durations(value string) Input

func Enum added in v1.4.0

func Enum(value string, allowed ...string) Input

Enum: (value, allowed...)

func Int

func Int(value string) Input

func NatsCreds

func NatsCreds(path string) Input

func String

func String(value string) Input

func Url

func Url(value string) Input

func Urls

func Urls(value string) Input

type Inputs

type Inputs map[string]Input

func (Inputs) Join

func (i Inputs) Join(new Inputs)

type Manager

type Manager interface {
	SetEnv(key, value string)
	PathIfExists() []string
	Cleanup()
	New(t *testing.T)
}

type SystemEnvManager

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

func (*SystemEnvManager) Cleanup

func (sem *SystemEnvManager) Cleanup()

func (*SystemEnvManager) New

func (sem *SystemEnvManager) New(t *testing.T)

func (*SystemEnvManager) PathIfExists

func (sem *SystemEnvManager) PathIfExists() []string

func (*SystemEnvManager) SetEnv

func (sem *SystemEnvManager) SetEnv(key, value string)

Jump to

Keyboard shortcuts

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