dukcapil/config/dukcapil.go
Aditya Siregar c3317dd9ee update api
2026-05-08 10:06:43 +07:00

24 lines
778 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"`
TransactionSource string `mapstructure:"transaction_source"`
Threshold string `mapstructure:"threshold"`
}
func (d *Dukcapil) Timeout() time.Duration {
if d.TimeoutSecond <= 0 {
return 30 * time.Second
}
return time.Duration(d.TimeoutSecond) * time.Second
}