Documentation ¶
Index ¶
Constants ¶
View Source
const ( SMSSchema = "sms_notifications" SMSDefaultTopic = "/sms" )
Variables ¶
View Source
var ( URL = "https://rest.nexmo.com/sms/json?" MaxIdleConnections = 100 RequestTimeout = 500 * time.Millisecond )
View Source
var ( ErrNoSMSSent = errors.New("No sms was sent to Nexmo") ErrIncompleteSMSSent = errors.New("Nexmo sms was only partial delivered.One or more part returned an error") ErrSMSResponseDecodingFailed = errors.New("Nexmo response decoding failed.") ErrNoRetry = errors.New("SMS failed. No retrying.") )
Functions ¶
Types ¶
type Config ¶
type NexmoMessageReport ¶
type NexmoMessageReport struct { Status ResponseCode `json:"status,string"` MessageID string `json:"message-id"` To string `json:"to"` ClientReference string `json:"client-ref"` RemainingBalance string `json:"remaining-balance"` MessagePrice string `json:"message-price"` Network string `json:"network"` ErrorText string `json:"error-text"` }
NexmoMessageReport is the "status report" for a single SMS sent via the Nexmo API
type NexmoMessageResponse ¶
type NexmoMessageResponse struct { MessageCount int `json:"message-count,string"` Messages []NexmoMessageReport `json:"messages"` }
func (NexmoMessageResponse) Check ¶
func (nm NexmoMessageResponse) Check() error
type NexmoSender ¶
type NexmoSender struct { ApiKey string ApiSecret string // contains filtered or unexported fields }
func NewNexmoSender ¶
func NewNexmoSender(apiKey, apiSecret string) (*NexmoSender, error)
func (*NexmoSender) Send ¶
func (ns *NexmoSender) Send(msg *protocol.Message) error
type NexmoSms ¶
type ResponseCode ¶
type ResponseCode int
const ( ResponseSuccess ResponseCode = iota ResponseThrottled ResponseMissingParams ResponseInvalidParams ResponseInvalidCredentials ResponseInternalError ResponseInvalidMessage ResponseNumberBarred ResponsePartnerAcctBarred ResponsePartnerQuotaExceeded ResponseUnused ResponseRESTNotEnabled ResponseMessageTooLong ResponseCommunicationFailed ResponseInvalidSignature ResponseInvalidSenderAddress ResponseInvalidTTL ResponseFacilityNotAllowed ResponseInvalidMessageClass )
func (ResponseCode) String ¶
func (c ResponseCode) String() string
Click to show internal directories.
Click to hide internal directories.