Documentation ¶
Index ¶
- Constants
- func GetBaseUrl() string
- func GetDefaultFrom() string
- func GetFullPath(api string) string
- func GetHost() string
- func GetPort() int
- func GetSignature(ts int64, nonce string, method string, uri string, extraData string) string
- func GetTLS() bool
- func NewAuthHeader(ts int64, nonce string, method string, uri string, extraData string) string
- func SetCredential(credential *SmsGlobalCredential)
- func SetDefaultFrom(from string)
- func SetHost(host string)
- func SetPort(port int)
- func SetTLS(tls bool)
- type CreditBalanceResponse
- type SendMultiSMSResponse
- type SmsGlobalCredential
- type SmsGlobalDateTime
- type SmsGlobalError
- type SmsGlobalPayloadDecodeError
- type SmsGlobalSendSMSRequest
- type SmsGlobalSendSMSResponse
- type SmsGlobalSendSMSResponseMessageItem
- type SmsGlobalSettings
Constants ¶
View Source
const ( ErrorOutputTemplate string = "Error: %s\n" WarningOutputTemplate string = "Warning: %s\n" )
View Source
const ( SmsAPI string = "/v2/sms" UserBasePath string = "/v2/user" UserCreditBalanceAPI string = UserBasePath + "/credit-balance" )
View Source
const (
AuthHeaderTemplate string = `MAC id="%s", ts="%d", nonce="%s", mac="%s"`
)
View Source
const (
SignatureTemplate string = "%d\n%s\n%s\n%s\n%s\n%d\n%s\n"
)
Variables ¶
This section is empty.
Functions ¶
func GetBaseUrl ¶
func GetBaseUrl() string
func GetDefaultFrom ¶
func GetDefaultFrom() string
func GetFullPath ¶
func GetSignature ¶
func NewAuthHeader ¶
func SetCredential ¶
func SetCredential(credential *SmsGlobalCredential)
func SetDefaultFrom ¶
func SetDefaultFrom(from string)
Types ¶
type CreditBalanceResponse ¶
type CreditBalanceResponse struct { Balance float64 `json:"balance,omitempty"` Currency string `json:"currency,omitempty"` }
func GetAccountBalance ¶
func GetAccountBalance(timeout int) (*CreditBalanceResponse, error)
type SendMultiSMSResponse ¶ added in v0.1.0
type SendMultiSMSResponse struct { }
type SmsGlobalCredential ¶
type SmsGlobalCredential struct { MasterUser string `json:"masterUser"` MasterPass string `json:"masterPass"` ApiKey string `json:"apiKey"` ApiSecret string `json:"apiSecret"` }
func GetCredential ¶
func GetCredential() *SmsGlobalCredential
type SmsGlobalDateTime ¶ added in v0.1.8
func (*SmsGlobalDateTime) UnmarshalJSON ¶ added in v0.1.8
func (ct *SmsGlobalDateTime) UnmarshalJSON(b []byte) error
type SmsGlobalError ¶
func NewFailedCallError ¶
func NewFailedCallError(resp *http.Response) *SmsGlobalError
func NewSmsGlobalError ¶
func NewSmsGlobalError(code int, message string) *SmsGlobalError
func (*SmsGlobalError) Error ¶
func (m *SmsGlobalError) Error() string
type SmsGlobalPayloadDecodeError ¶
type SmsGlobalPayloadDecodeError struct {
Message string
}
func NewSmsGlobalPayloadDecodeError ¶
func NewSmsGlobalPayloadDecodeError(message string) *SmsGlobalPayloadDecodeError
func (*SmsGlobalPayloadDecodeError) Error ¶
func (m *SmsGlobalPayloadDecodeError) Error() string
type SmsGlobalSendSMSRequest ¶ added in v0.1.5
type SmsGlobalSendSMSRequest struct { Destination string `json:"destination,omitempty"` Message string `json:"message,omitempty"` Origin string `json:"origin,omitempty"` ScheduledDateTime *time.Time `json:"scheduledDateTime,omitempty"` Campaign string `json:"campaign,omitempty"` NotifyUrl string `json:"notifyUrl,omitempty"` IncomingUrl string `json:"incomingUrl,omitempty"` ExpiryDateTime *time.Time `json:"expiryDateTime,omitempty"` }
type SmsGlobalSendSMSResponse ¶ added in v0.1.5
type SmsGlobalSendSMSResponse struct {
Messages []SmsGlobalSendSMSResponseMessageItem `json:"messages"`
}
type SmsGlobalSendSMSResponseMessageItem ¶ added in v0.1.5
type SmsGlobalSendSMSResponseMessageItem struct { Id int64 `json:"id"` OutgoingId int64 `json:"outgoingId"` Origin string `json:"origin"` Destination string `json:"destination"` Message string `json:"message"` Status string `json:"status"` DateTime SmsGlobalDateTime `json:"dateTime"` }
func SendSingle ¶
type SmsGlobalSettings ¶
type SmsGlobalSettings struct { Host string `json:"host"` Port int `json:"port"` TLS bool `json:"tls"` Credential *SmsGlobalCredential `json:"credential"` DefaultFrom string `json:"defaultFrom"` }
var Settings *SmsGlobalSettings
Click to show internal directories.
Click to hide internal directories.