-
-
Notifications
You must be signed in to change notification settings - Fork 505
/
config.go
29 lines (26 loc) · 1.25 KB
/
config.go
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,
}
}