MCPcopy Create free account
hub / github.com/GoSimplicity/LinkMe / newClient

Function newClient

ioc/sms.go:13–28  ·  view source on GitHub ↗

newClient 创建腾讯云短信客户端

()

Source from the content-addressed store, hash-verified

11
12// newClient 创建腾讯云短信客户端
13func newClient() *tencentsms.Client {
14 secretId := viper.GetString("sms.tencent.secretId")
15 secretKey := viper.GetString("sms.tencent.secretKey")
16 endPoint := viper.GetString("sms.tencent.endPoint")
17 credential := common.NewCredential(
18 secretId,
19 secretKey,
20 )
21 // 创建客户端配置
22 cpf := profile.NewClientProfile()
23 // 设置腾讯云短信服务端点
24 cpf.HttpProfile.Endpoint = endPoint
25 // 创建腾讯云短信客户端
26 client, _ := tencentsms.NewClient(credential, regions.Nanjing, cpf)
27 return client
28}
29
30// InitSms 初始化腾讯云短信实例
31func InitSms() *sms.TencentSms {

Callers 1

InitSmsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected