added connection string to config

This commit is contained in:
2021-11-04 20:28:37 +01:00
parent 9be7b6c18f
commit 8725def3a1
5 changed files with 11 additions and 9 deletions

View File

@@ -18,6 +18,7 @@ type args struct {
CacheTTL int64 `arg:"--cache-ttl,env:CACHE_TTL" help:"Time in seconds" default:"30" placeholder:"TTL"`
CacheCleanup int64 `arg:"--cache-cleanup,env:CACHE_CLEANUP" help:"Time in seconds" default:"60" placeholder:"CLEANUP"`
Verbose bool `arg:"-v,--verbose,env:VERBOSE" help:"verbosity level" default:"false"`
DBConnection string `arg:"--db,required,env:DB_CONNECTION" help:"DSN in format: https://github.com/go-sql-driver/mysql#dsn-data-source-name"`
}
func (args) Version() string {
@@ -35,6 +36,7 @@ func main() {
S3AccessKey: args.S3AccessKey,
S3SecretKey: args.S3SecretKey,
S3Bucket: args.S3Bucket,
DSN: args.DBConnection,
CacheTTL: time.Duration(args.CacheTTL) * time.Second,
CacheCleanup: time.Duration(args.CacheCleanup) * time.Second,
Address: args.Address,