Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CustomClient ¶
type CustomClient struct { Config *config.CustomSMSProviderConfig SMSDenoHook SMSDenoHook SMSWebHook SMSWebHook }
func NewCustomClient ¶
func NewCustomClient(c *config.CustomSMSProviderConfig, d SMSDenoHook, w SMSWebHook) *CustomClient
func (*CustomClient) Send ¶
func (c *CustomClient) Send(ctx context.Context, opts smsapi.SendOptions) error
type HookDenoClient ¶
type HookDenoClient interface {
Run(ctx context.Context, script string, input interface{}) (out interface{}, err error)
}
func NewHookDenoClient ¶
func NewHookDenoClient(endpoint config.DenoEndpoint, logger hook.Logger, timeout SMSHookTimeout) HookDenoClient
type HookDenoClientImpl ¶
type HookDenoClientImpl struct {
hook.DenoClient
}
type HookHTTPClient ¶
func NewHookHTTPClient ¶
func NewHookHTTPClient(timeout SMSHookTimeout) HookHTTPClient
type HookHTTPClientImpl ¶
type ResponseBody ¶
type ResponseBody struct { Code string `json:"code"` ProviderName string `json:"provider_name,omitempty"` ProviderErrorCode string `json:"provider_error_code,omitempty"` GoError string `json:"go_error,omitempty"` DumpedResponse []byte `json:"dumped_response,omitempty"` }
See https://github.com/authgear/authgear-sms-gateway/blob/main/pkg/handler/api.go
func ParseResponseBody ¶
func ParseResponseBody(jsonData []byte) (*ResponseBody, error)
type SMSDenoHook ¶
type SMSDenoHook struct { DenoHook Client HookDenoClient }
func NewSMSDenoHookForTest ¶
func NewSMSDenoHookForTest(lf *log.Factory, denoEndpoint config.DenoEndpoint, smsCfg *config.CustomSMSProviderConfig) *SMSDenoHook
func (*SMSDenoHook) Call ¶
func (d *SMSDenoHook) Call(ctx context.Context, u *url.URL, payload SendOptions) error
func (*SMSDenoHook) Test ¶
func (d *SMSDenoHook) Test(ctx context.Context, script string, payload SendOptions) error
type SMSHookTimeout ¶
func NewSMSHookTimeout ¶
func NewSMSHookTimeout(smsCfg *config.CustomSMSProviderConfig) SMSHookTimeout
type SMSWebHook ¶
type SMSWebHook struct { hook.WebHook Client HookHTTPClient }
func NewSMSWebHook ¶
func NewSMSWebHook(hook hook.WebHook, smsCfg *config.CustomSMSProviderConfig) *SMSWebHook
func (*SMSWebHook) Call ¶
func (w *SMSWebHook) Call(ctx context.Context, u *url.URL, payload SendOptions) error
type SendOptions ¶
Click to show internal directories.
Click to hide internal directories.