GOPackageHeaderServer/conf/listen.go
Captain ALM b56c440ab7
All checks were successful
continuous-integration/drone Build is passing
Implement program.
2022-07-11 21:47:22 +01:00

27 lines
553 B
Go

package conf
import "time"
type ListenYaml struct {
Web string `yaml:"web"`
ReadTimeout time.Duration `yaml:"readTimeout"`
WriteTimeout time.Duration `yaml:"writeTimeout"`
Identify bool `yaml:"identify"`
}
func (ly ListenYaml) GetReadTimeout() time.Duration {
if ly.ReadTimeout.Seconds() < 1 {
return 1 * time.Second
} else {
return ly.ReadTimeout
}
}
func (ly ListenYaml) GetWriteTimeout() time.Duration {
if ly.WriteTimeout.Seconds() < 1 {
return 1 * time.Second
} else {
return ly.WriteTimeout
}
}