mirror of
https://github.com/gomods/athens
synced 2026-02-12 07:28:09 +00:00
* switch proxy to config file pull in single flight changes * changes for single-flight * intermediate stage. All tests passing. pkg still has env refs * remove all env references * delete config/env entirely * fix failing tests * create the config.toml file as part of dev setup * create config file only if it doesn't exist * update Dockerfiles to use config file * move composing elements to the top * verbose parameter naming * newline * add flag for config file path * update docs with config file flag * remove unnecessary nil check * use filepath.join * rename redis port to address * fix path.join * fix issues after merge * add vendor dir
14 lines
318 B
Go
14 lines
318 B
Go
package config
|
|
|
|
import "time"
|
|
|
|
// TimeoutConf is a common struct for anything with a timeout
|
|
type TimeoutConf struct {
|
|
Timeout int `validate:"required"`
|
|
}
|
|
|
|
// TimeoutDuration returns the timeout as time.duration
|
|
func (t *TimeoutConf) TimeoutDuration() time.Duration {
|
|
return time.Second * time.Duration(t.Timeout)
|
|
}
|