Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DependencySet = wire.NewSet( NewNexmoClient, NewTwilioClient, NewCustomClient, NewLogger, NewSMSHookTimeout, NewHookHTTPClient, NewHookDenoClient, wire.Struct(new(Client), "*"), wire.Struct(new(SMSWebHook), "*"), wire.Struct(new(SMSDenoHook), "*"), )
View Source
var ErrAmbiguousClient = errors.New("ambiguous SMS client")
View Source
var ErrMissingCustomSMSProviderConfiguration = errors.New("sms: custom provider configuration is missing")
View Source
var ErrMissingNexmoConfiguration = errors.New("nexmo: configuration is missing")
View Source
var ErrMissingTwilioConfiguration = errors.New("twilio: configuration is missing")
View Source
var ErrNoAvailableClient = errors.New("no available SMS client")
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { Logger Logger DevMode config.DevMode MessagingConfig *config.MessagingConfig FeatureTestModeSMSSuppressed config.FeatureTestModeSMSSuppressed TestModeSMSConfig *config.TestModeSMSConfig TwilioClient *TwilioClient NexmoClient *NexmoClient CustomClient *CustomClient }
func (*Client) Send ¶
func (c *Client) Send(opts SendOptions) error
type CustomClient ¶
type CustomClient struct { Config *config.CustomSMSProviderConfig SMSDenoHook SMSDenoHook SMSWebHook SMSWebHook }
func NewCustomClient ¶
func NewCustomClient(c *config.CustomSMSProviderConfig, d SMSDenoHook, w SMSWebHook) *CustomClient
type HookDenoClient ¶
type HookDenoClient struct {
hook.DenoClient
}
func NewHookDenoClient ¶
func NewHookDenoClient(endpoint config.DenoEndpoint, logger hook.Logger, timeout SMSHookTimeout) HookDenoClient
type HookHTTPClient ¶
func NewHookHTTPClient ¶
func NewHookHTTPClient(timeout SMSHookTimeout) HookHTTPClient
type NexmoClient ¶
func NewNexmoClient ¶
func NewNexmoClient(c *config.NexmoCredentials) *NexmoClient
type SMSDenoHook ¶
type SMSDenoHook struct { hook.DenoHook Client HookDenoClient }
func (*SMSDenoHook) Call ¶
func (d *SMSDenoHook) Call(u *url.URL, payload SendSMSPayload) error
type SMSHookTimeout ¶
func NewSMSHookTimeout ¶
func NewSMSHookTimeout(smsCfg *config.CustomSMSProviderConfig) SMSHookTimeout
type SMSWebHook ¶
type SMSWebHook struct { hook.WebHook Client HookHTTPClient }
func (*SMSWebHook) Call ¶
func (w *SMSWebHook) Call(u *url.URL, payload SendSMSPayload) error
type SendOptions ¶
type SendSMSPayload ¶
type TwilioClient ¶
type TwilioClient struct { TwilioClient *twilio.RestClient MessagingServiceSID string }
func NewTwilioClient ¶
func NewTwilioClient(c *config.TwilioCredentials) *TwilioClient
Click to show internal directories.
Click to hide internal directories.