2024-01-17 10:04:50 +00:00
|
|
|
package kavenegar
|
|
|
|
|
|
|
|
import "github.com/kavenegar/kavenegar-go"
|
|
|
|
|
|
|
|
type Config struct {
|
|
|
|
APIKey string `koanf:"api_key"`
|
2024-07-27 14:58:37 +00:00
|
|
|
Sender string `koanf:"sender"`
|
2024-01-17 10:04:50 +00:00
|
|
|
OtpTemplateNewUser string `koanf:"otp_template_new_user"`
|
|
|
|
OtpTemplateRegisteredUser string `koanf:"otp_template_registered_user"`
|
|
|
|
}
|
2024-07-27 14:58:37 +00:00
|
|
|
|
2024-01-17 10:04:50 +00:00
|
|
|
type Adapter struct {
|
|
|
|
config Config
|
|
|
|
api *kavenegar.Kavenegar
|
|
|
|
}
|
|
|
|
|
|
|
|
func New(config Config) *Adapter {
|
|
|
|
return &Adapter{config: config, api: kavenegar.New(config.APIKey)}
|
|
|
|
}
|
|
|
|
|
|
|
|
func (a Adapter) Client() *kavenegar.Kavenegar {
|
|
|
|
return a.api
|
|
|
|
}
|
|
|
|
|
|
|
|
func (a Adapter) Config() Config {
|
|
|
|
return a.config
|
|
|
|
}
|