Documentation
¶
Overview ¶
Package sms sends text messages, verification codes above all, through the provider the administrators configure. The providers live in the subpackages; Sender hides which one is in force and renders the message template for the providers that take a finished text.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetSupportedPlatforms ¶
func GetSupportedPlatforms() []integration.Info
GetSupportedPlatforms describes the providers and their configuration fields for the administrators' settings page.
Types ¶
type Message ¶ added in v1.21.0
type Message struct {
// Area is the country calling code, without the plus sign ("86").
Area string
// Mobile is the number within the area.
Mobile string
// Params fill the message template: the text template kept in the
// provider configuration, or for Alibaba Cloud the template approved on
// the provider's side. A verification code travels as "code".
Params map[string]string
}
Message is one text message to a phone number.
func CodeMessage ¶ added in v1.21.0
CodeMessage is the message that delivers a verification code.
type Platform ¶
type Platform int
Platform is an SMS provider, stored in the configuration by its name.
type Sender ¶
type Sender interface {
// Send delivers msg; ctx bounds the provider call.
Send(ctx context.Context, msg Message) error
}
Sender delivers text messages through one provider account. It is safe for concurrent use.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package abosend sends text messages through the Abosend HTTP API.
|
Package abosend sends text messages through the Abosend HTTP API. |
|
Package alibabacloud sends text messages through Alibaba Cloud SMS, which fills a template approved on the provider's side.
|
Package alibabacloud sends text messages through Alibaba Cloud SMS, which fills a template approved on the provider's side. |
|
Package smsbao sends text messages through the SMSBao HTTP API.
|
Package smsbao sends text messages through the SMSBao HTTP API. |
|
Package twilio sends text messages through the Twilio API.
|
Package twilio sends text messages through the Twilio API. |