feat: Add SSL mode
Signed-off-by: Julien Riou <julien@riou.xyz>
This commit is contained in:
parent
8709ee542b
commit
572a87a736
2 changed files with 5 additions and 0 deletions
|
@ -24,6 +24,7 @@ type Config struct {
|
|||
User string `yaml:"user"`
|
||||
Password string `yaml:"password"`
|
||||
Database string `yaml:"database"`
|
||||
SSLMode string `yaml:"sslmode"`
|
||||
Interval float64 `yaml:"interval"`
|
||||
ConnectTimeout int `yaml:"connect-timeout"`
|
||||
IdleTimeout float64 `yaml:"idle-timeout"`
|
||||
|
@ -117,6 +118,9 @@ func (c *Config) Dsn() string {
|
|||
if c.ConnectTimeout != 0 {
|
||||
parameters = append(parameters, fmt.Sprintf("connect_timeout=%d", c.ConnectTimeout))
|
||||
}
|
||||
if c.SSLMode != "" {
|
||||
parameters = append(parameters, fmt.Sprintf("sslmode=%s", c.SSLMode))
|
||||
}
|
||||
if AppName != "" {
|
||||
parameters = append(parameters, fmt.Sprintf("application_name=%s", AppName))
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue