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 ErrHTTPClientError = errors.New("Http client sending to Nexmo Failed. No sms was sent") ErrNexmoResponseStatusNotOk = errors.New("Nexmo response status not ResponseSuccess") ErrSMSResponseDecodingFailed = errors.New("Nexmo response decoding failed") ErrInvalidSender = errors.New("Sms destination phoneNumber is invalid") ErrMultipleSmsSent = errors.New("Multiple or no sms were sent. SMS message may be too long") ErrRetryFailed = errors.New("Failed retrying to send message") ErrEncodeFailed = errors.New("Encoding of message to be sent to Nexmo failed") ErrLastIDCouldNotBeSet = errors.New("Setting last id failed") ErrSmsTooLong = errors.New("Sms maximum length exceeded") )
Functions ¶
Types ¶
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 ¶
type NexmoSms ¶
type ReportEvent ¶
type ReportEvent struct { Id string `json:"id"` Time string `json:"time"` Type string `json:"type"` Payload ReportPayload `json:"payload"` }
type ReportPayload ¶
type ReportPayload struct { OrderID string `json:"order_id,omitempty"` MessageID string `json:"message_id"` SmsText string `json:"text"` SmsRequestTime string `json:"request_time"` SmsResponseTime string `json:"response_time"` MobileNumber string `json:"mobile_number"` DeliveryStatus string `json:"delivery_status"` }
type ResponseCode ¶
type ResponseCode int
const ( ResponseSuccess ResponseCode = iota ResponseThrottled ResponseMissingParams ResponseInvalidParams ResponseInvalidCredentials ResponseInternalError ResponseInvalidMessage ResponseNumberBarred ResponsePartnerAcctBarred ResponsePartnerQuotaExceeded ResponseUnused //Defined in Nexmo Api 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.