diff options
author | Runxi Yu <me@runxiyu.org> | 2025-01-12 17:18:51 +0800 |
---|---|---|
committer | Runxi Yu <me@runxiyu.org> | 2025-01-12 17:18:51 +0800 |
commit | f0d6639ed3223d9f4fe97eebf860dd5e77132967 (patch) | |
tree | d9cce024667c03508c0305ed9407ce7675ec2795 /config.go | |
parent | Add missing flag.Parse() (diff) | |
download | maild-f0d6639ed3223d9f4fe97eebf860dd5e77132967.tar.gz maild-f0d6639ed3223d9f4fe97eebf860dd5e77132967.tar.zst maild-f0d6639ed3223d9f4fe97eebf860dd5e77132967.zip |
Reformat code
Diffstat (limited to 'config.go')
-rw-r--r-- | config.go | 12 |
1 files changed, 7 insertions, 5 deletions
@@ -7,8 +7,8 @@ import ( "os" "sync" - "go.lindenii.runxiyu.org/lindenii-common/scfg" "github.com/jackc/pgx/v5/pgxpool" + "go.lindenii.runxiyu.org/lindenii-common/scfg" ) var config struct { @@ -18,14 +18,16 @@ var config struct { Cert string `scfg:"cert"` Key string `scfg:"key"` } `scfg:"tls"` - DB struct { + DB struct { Type string `scfg:"type"` Conn string `scfg:"conn"` } `scfg:"db"` _tls_config *tls.Config } -var config_mutex sync.RWMutex // covers things like the database too -var db *pgxpool.Pool +var ( + config_mutex sync.RWMutex // covers things like the database too + db *pgxpool.Pool +) // load_config loads the configuration file and sets up global things according // to the configuration directives. @@ -50,7 +52,7 @@ func load_config(path string) error { } config._tls_config = &tls.Config{ Certificates: []tls.Certificate{cer}, - MinVersion: tls.VersionTLS13, + MinVersion: tls.VersionTLS13, } // Database setup |