xmsg

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AliyunMsgInstance

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

func NewAliyunMsg

func NewAliyunMsg(regionId, accessKeyId, accessSecret string) *AliyunMsgInstance

func (*AliyunMsgInstance) SendSingleMsg

func (m *AliyunMsgInstance) SendSingleMsg(param *SendSingleMsgParams) error

type IMsg

type IMsg interface {
	SendSingleMsg(param *SendSingleMsgParams) error
}

func NewMsgInstance

func NewMsgInstance(c MsgConf) IMsg

如果切换其他服务商只需要改这里

type MsgConf

type MsgConf struct {
	Aliyun struct {
		AccessId     string `json:",optional"`
		AccessSecret string `json:",optional"`
		RegionId     string `json:",default=cn-hangzhou"`
	}
}

type SendSingleMsgParams

type SendSingleMsgParams struct {
	//必填
	PhoneNumbers string            //手机号码
	Content      map[string]string //发送内容
	SignName     string            //短信签名
	TemplateCode string            //模版code
	//选填
	OutId string //业务id
}

Jump to

Keyboard shortcuts

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