22 lines
635 B
Go
22 lines
635 B
Go
package config
|
|
|
|
import "time"
|
|
|
|
// Dukcapil holds configuration for the Dukcapil Face Recognition (1:N) API.
|
|
type Dukcapil struct {
|
|
BaseURL string `mapstructure:"base_url"`
|
|
CustomerID string `mapstructure:"customer_id"`
|
|
Methode string `mapstructure:"methode"`
|
|
UserID string `mapstructure:"user_id"`
|
|
Password string `mapstructure:"password"`
|
|
DefaultIP string `mapstructure:"default_ip"`
|
|
TimeoutSecond int `mapstructure:"timeout_second"`
|
|
}
|
|
|
|
func (d *Dukcapil) Timeout() time.Duration {
|
|
if d.TimeoutSecond <= 0 {
|
|
return 30 * time.Second
|
|
}
|
|
return time.Duration(d.TimeoutSecond) * time.Second
|
|
}
|