sms

package
v1.4.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 29, 2025 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Host 为 Qiniu SMS Server API 服务域名
	Host = "https://sms.qiniuapi.com"
)

Functions

This section is empty.

Types

type AliSmsClient

type AliSmsClient struct {
	AccessKeyID     string
	AccessKeySecret string
	HTTPDebugEnable bool
}

AliSmsClient aliyun sms client

func NewAliSmsClient

func NewAliSmsClient(accessKeyID, accessKeySecret string) *AliSmsClient

NewAliSmsClient return AliSmsClient

func (*AliSmsClient) SendMarket

func (m *AliSmsClient) SendMarket(sign, templateId, phone string) (bizId string, err error)

SendMarket 营销短信

func (*AliSmsClient) SendNotice

func (m *AliSmsClient) SendNotice(sign, templateId, phone string, templateParam string) (bizId string, err error)

SendNotice 发送通知短信

func (*AliSmsClient) SendVerifyCode

func (m *AliSmsClient) SendVerifyCode(sign, templateID, phone, code string) (bizId string, err error)

SendVerifyCode 验证码短信

func (*AliSmsClient) SetDebug

func (m *AliSmsClient) SetDebug(enabled bool)

SetDebug SetDebug

type Manager added in v1.4.3

type Manager struct {
	// contains filtered or unexported fields
}

Manager 提供了 Qiniu SMS Server API 相关功能

func NewManager added in v1.4.3

func NewManager(mac *auth.Credentials) (manager *Manager)

NewManager 用来构建一个新的 Manager

func (*Manager) SendMessage added in v1.4.3

func (m *Manager) SendMessage(args MessagesRequest) (ret MessagesResponse, err error)

SendMessage 发送短信 可单条 可多条

func (*Manager) SendSingleMessage added in v1.4.3

func (m *Manager) SendSingleMessage(args SingleMessageRequest) (ret MessagesResponse, err error)

SendSingleMessage 单条发送短信

type MessagesRequest added in v1.4.3

type MessagesRequest struct {
	SignatureID string                 `json:"signature_id"`
	TemplateID  string                 `json:"template_id"`
	Mobiles     []string               `json:"mobiles"`
	Parameters  map[string]interface{} `json:"parameters"`
}

MessagesRequest 短信消息

type MessagesResponse added in v1.4.3

type MessagesResponse struct {
	JobID     string `json:"job_id,omitempty"`
	MessageId string `json:"message_id,omitempty"`
}

MessagesResponse 发送短信响应

type QiNiuSmsClient added in v1.4.2

type QiNiuSmsClient struct {
	AccessKey string
	SecretKey string
}

func NewQiNiuSmsClient added in v1.4.2

func NewQiNiuSmsClient(accessKey, secretKey string) *QiNiuSmsClient

func (*QiNiuSmsClient) SendVerifyCode added in v1.4.2

func (s *QiNiuSmsClient) SendVerifyCode(signId, templateId, mobile, code string) (messageId string, err error)

type SingleMessageRequest added in v1.4.3

type SingleMessageRequest struct {
	SignatureID string                 `json:"signature_id"`
	TemplateID  string                 `json:"template_id"`
	Mobile      string                 `json:"mobile"`
	Parameters  map[string]interface{} `json:"parameters"`
	Seq         string                 `json:"seq,omitempty"` //业务方提供的消息序列号,状态回调时携带回来
}

type TencentSmsClient added in v1.4.2

type TencentSmsClient struct {
	SDKAppID  string
	SecretId  string
	SecretKey string
}

TencentSmsClient tencent sms client

func NewTencentSmsClient added in v1.4.2

func NewTencentSmsClient(sdkAppId, secretId, secretKey string) *TencentSmsClient

NewTencentSmsClient return TencentSmsClient

func (*TencentSmsClient) SendMarket added in v1.4.2

func (m *TencentSmsClient) SendMarket(sign, templateID string, phone, templateParam []string) (serialNo map[string]string, err error)

SendMarket 营销类短信 批量号码 发送相同的内容

func (*TencentSmsClient) SendVerifyCode added in v1.4.2

func (m *TencentSmsClient) SendVerifyCode(sign, templateID, phone, code string) (serialNo string, err error)

SendVerifyCode 验证码短信

type UpYunMessage

type UpYunMessage struct {
	MessageID int64  `json:"message_id"`
	Mobile    string `json:"mobile"`
}

UpYunMessage UpYunMessage

type UpYunResult

type UpYunResult struct {
	MessageIDS []*UpYunMessage `json:"message_ids"`
}

UpYunResult 返回信息

type UpYunSmsBody

type UpYunSmsBody struct {
	Mobile     string `json:"mobile"`
	TemplateID int64  `json:"template_id"`
	Vars       string `json:"vars"`
}

UpYunSmsBody 发送模型

type UpYunSmsClient

type UpYunSmsClient struct {
	Token string
}

UpYunSmsClient UpYunSmsClient

func NewUpYunSmsClient

func NewUpYunSmsClient(token string) *UpYunSmsClient

NewUpYunSmsClient 返回一个新的client

func (*UpYunSmsClient) SendVerifyCode

func (m *UpYunSmsClient) SendVerifyCode(mobile string, templateId int64, code string) (messageId string, err error)

SendVerifyCode 发送验证码短信

templateId = 模板ID

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL