summaryrefslogtreecommitdiff
path: root/vendor/github.com/testcontainers/testcontainers-go/config.go
blob: 91a333107dc06e19a951ea31efe221f1c8d265ae (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
package testcontainers

import (
	"github.com/testcontainers/testcontainers-go/internal/config"
)

// TestcontainersConfig represents the configuration for Testcontainers
type TestcontainersConfig struct {
	Host           string `properties:"docker.host,default="`                    // Deprecated: use Config.Host instead
	TLSVerify      int    `properties:"docker.tls.verify,default=0"`             // Deprecated: use Config.TLSVerify instead
	CertPath       string `properties:"docker.cert.path,default="`               // Deprecated: use Config.CertPath instead
	RyukDisabled   bool   `properties:"ryuk.disabled,default=false"`             // Deprecated: use Config.RyukDisabled instead
	RyukPrivileged bool   `properties:"ryuk.container.privileged,default=false"` // Deprecated: use Config.RyukPrivileged instead
	Config         config.Config
}

// ReadConfig reads from testcontainers properties file, storing the result in a singleton instance
// of the TestcontainersConfig struct
func ReadConfig() TestcontainersConfig {
	cfg := config.Read()
	return TestcontainersConfig{
		Host:           cfg.Host,
		TLSVerify:      cfg.TLSVerify,
		CertPath:       cfg.CertPath,
		RyukDisabled:   cfg.RyukDisabled,
		RyukPrivileged: cfg.RyukPrivileged,
		Config:         cfg,
	}
}