3
0
mirror of https://github.com/ergochat/ergo.git synced 2024-12-27 13:12:43 +01:00
ergo/irc/mysql/config.go
Shivaram Lingamneni 5eed48c077 fix #1622
Allow users to set max MySQL connections and connection lifetime;
set a sane default for max connections if it's not present.
2021-04-23 13:54:44 -04:00

27 lines
671 B
Go

// Copyright (c) 2020 Shivaram Lingamneni
// released under the MIT license
package mysql
import (
"time"
)
type Config struct {
// these are intended to be written directly into the config file:
Enabled bool
Host string
Port int
SocketPath string `yaml:"socket-path"`
User string
Password string
HistoryDatabase string `yaml:"history-database"`
Timeout time.Duration
MaxConns int `yaml:"max-conns"`
ConnMaxLifetime time.Duration `yaml:"conn-max-lifetime"`
// XXX these are copied from elsewhere in the config:
ExpireTime time.Duration
TrackAccountMessages bool
}