You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Aliyun MNS Go SDK is the official SDK for MNS in the Go programming language
6
+
7
+
## [Readme in Simplified Chinese](README-CN.md)
8
+
9
+
## [Change Log](CHANGELOG.md)
10
+
11
+
## About
12
+
13
+
- This Go SDK is built on the official API
14
+
of [Alibaba Cloud Message Service (MNS)](https://www.aliyun.com/product/mns/)
15
+
- Alibaba Cloud Message Service (MNS) is an efficient, reliable, secure, convenient, and elastically scalable
16
+
distributed messaging service
17
+
- MNS enables application developers to freely transmit data and notification messages across the distributed
18
+
components of their applications, building loosely coupled systems
19
+
- Using this SDK, users can quickly build highly reliable and concurrent one-to-one consumption models as well as
20
+
one-to-many publish-subscribe models
21
+
22
+
## Running Environment
23
+
24
+
- Go 1.18 or above
25
+
26
+
## Installing
27
+
28
+
- Run the`go get github.com/aliyun/aliyun-mns-go-sdk` command to get the remote code package.
29
+
- Use `import "github.com/aliyun/aliyun-mns-go-sdk"` in your code to introduce MNS Go SDK package
30
+
31
+
## Getting Start
32
+
33
+
- Download the latest version of the Go SDK and enter the example directory
34
+
- Modify 'endpoint' to your own access point, which can be viewed by logging into
35
+
the [MNS console](https://mns.console.aliyun.com/). For more detail,
36
+
see [How to get endpoint](https://help.aliyun.com/zh/mns/user-guide/manage-queues-in-the-console?spm=a2c4g.11186623.0.i25#section-yhc-ix5-300)
37
+
- Set your `ALIBABA_CLOUD_ACCESS_KEY_ID` and
38
+
`ALIBABA_CLOUD_ACCESS_KEY_SECRET` in the environment variables, Alibaba Cloud authentication information can be
39
+
created in the [RAM console](https://ram.console.aliyun.com/).
40
+
For more detail,
41
+
see [How to get AccessKey](https://help.aliyun.com/document_detail/53045.html?spm=a2c4g.11186623.0.i29#task-354412)
42
+
- Follow the Alibaba Cloud standards and set the AK (Access Key) and SK (Secret Key) in the environment variables. For
43
+
more details,
44
+
see [How to set environment variables](https://help.aliyun.com/zh/sdk/developer-reference/configure-the-alibaba-cloud-accesskey-environment-variable-on-linux-macos-and-windows-systems)
@@ -81,25 +86,49 @@ type AliMNSClientConfig struct {
81
86
AccessKeySecretstring
82
87
Tokenstring
83
88
TimeoutSecondint64
89
+
MaxConnsPerHostint
90
+
}
91
+
92
+
// NewClient Follow the Alibaba Cloud standards and set the AK (Access Key) and SK (Secret Key) in the environment variables.
93
+
// For more details, see: https://help.aliyun.com/zh/sdk/developer-reference/configure-the-alibaba-cloud-accesskey-environment-variable-on-linux-macos-and-windows-systems
94
+
funcNewClient(endpointstring) MNSClient {
95
+
returnNewClientWithToken(endpoint, "")
96
+
}
97
+
98
+
// NewClientWithToken Follow the Alibaba Cloud standards and set the AK (Access Key) and SK (Secret Key) in the environment variables.
99
+
// For more details, see: https://help.aliyun.com/zh/sdk/developer-reference/configure-the-alibaba-cloud-accesskey-environment-variable-on-linux-macos-and-windows-systems
0 commit comments