-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
超过2级告警线2分钟后,将发短信给用户提醒。
- Loading branch information
Showing
8 changed files
with
311 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package config | ||
|
||
type AliSms struct { | ||
AccessKey string `mapstructure:"access-key" json:"access_key" yaml:"access-key"` // 账号Access Key | ||
AccessSecret string `mapstructure:"access-secret" json:"access_secret" yaml:"access-secret"` // 账号Access Secret | ||
SignName string `mapstructure:"sign-name" json:"sign_name" yaml:"sign-name"` // 短信的 SignName | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package initialize | ||
|
||
import ( | ||
openapi "github.com/alibabacloud-go/darabonba-openapi/client" | ||
dysmsapi20170525 "github.com/alibabacloud-go/dysmsapi-20170525/v2/client" | ||
"github.com/alibabacloud-go/tea/tea" | ||
) | ||
|
||
// CreateClient | ||
/** | ||
* 使用AK&SK初始化账号Client | ||
* @param accessKeyId | ||
* @param accessKeySecret | ||
* @return Client | ||
* @throws Exception | ||
*/ | ||
func CreateClient(accessKeyId *string, accessKeySecret *string) (_result *dysmsapi20170525.Client, _err error) { | ||
config := &openapi.Config{ | ||
// 您的AccessKey ID | ||
AccessKeyId: accessKeyId, | ||
// 您的AccessKey Secret | ||
AccessKeySecret: accessKeySecret, | ||
} | ||
// 访问的域名 | ||
config.Endpoint = tea.String("dysmsapi.aliyuncs.com") | ||
_result = &dysmsapi20170525.Client{} | ||
_result, _err = dysmsapi20170525.NewClient(config) | ||
return _result, _err | ||
} |
Oops, something went wrong.