Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct { User string `envconfig:"USER" required:"true" default:"root"` Password string `envconfig:"PASSWD"` Host string `envconfig:"HOST" required:"true" default:"localhost"` Port int `envconfig:"PORT" required:"true" default:"3306"` DB string `envconfig:"DB" required:"true"` TLS string `envconfig:"TLS"` IAMAuth bool `envconfig:"IAM_AUTH"` CACertPath string `envconfig:"CA_CERT_PATH"` }
type DBMux ¶
type DBMux struct {
// contains filtered or unexported fields
}
func (*DBMux) Refresh ¶
Refresh periodically refreshes the passed DB connection, if the connection is using IAM authentication. Credentials generated this way last for 15 minutes, per AWS's documentation:
https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/UsingWithRDS.IAMDBAuth.html
This function should be run as a goroutine, i.e.:
db, _ := mysql.Open(cfg) go mysql.Refresh(log, cfg, 10 * time.Minute, db)
Click to show internal directories.
Click to hide internal directories.