dukcapil/config/dukcapil.go
Aditya Siregar bc64eb20ea add dukcapil
2026-05-07 04:01:32 +07:00

23 lines
690 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"`
PublicKeyPath string `mapstructure:"public_key_path"`
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
}