Skip to content

Commit 088ba95

Browse files
authored
Merge pull request #5 from aliyun/export_NotifyStrategyType
export NotifyStrategyType and NotifyContentFormatType
2 parents df722c6 + 9b31db6 commit 088ba95

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

message.go

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,18 @@ import (
55
"encoding/xml"
66
)
77

8-
type notifyStrategyType string
8+
type NotifyStrategyType string
99

1010
const (
11-
BACKOFF_RETRY notifyStrategyType = "BACKOFF_RETRY"
12-
EXPONENTIAL_DECAY_RETRY notifyStrategyType = "EXPONENTIAL_DECAY_RETRY"
11+
BACKOFF_RETRY NotifyStrategyType = "BACKOFF_RETRY"
12+
EXPONENTIAL_DECAY_RETRY NotifyStrategyType = "EXPONENTIAL_DECAY_RETRY"
1313
)
1414

15-
type notifyContentFormatType string
15+
type NotifyContentFormatType string
1616

1717
const (
18-
XML notifyContentFormatType = "XML"
19-
SIMPLIFIED notifyContentFormatType = "SIMPLIFIED"
18+
XML NotifyContentFormatType = "XML"
19+
SIMPLIFIED NotifyContentFormatType = "SIMPLIFIED"
2020
)
2121

2222
type MessageResponse struct {
@@ -111,8 +111,8 @@ type MessageSubsribeRequest struct {
111111
XMLName xml.Name `xml:"Subscription"`
112112
Endpoint string `xml:"Endpoint"`
113113
FilterTag string `xml:"FilterTag,omitempty"`
114-
NotifyStrategy notifyStrategyType `xml:"NotifyStrategy,omitempty"`
115-
NotifyContentFormat notifyContentFormatType `xml:"NotifyContentFormat,omitempty"`
114+
NotifyStrategy NotifyStrategyType `xml:"NotifyStrategy,omitempty"`
115+
NotifyContentFormat NotifyContentFormatType `xml:"NotifyContentFormat,omitempty"`
116116
}
117117

118118
type MessageSendResponse struct {
@@ -220,16 +220,16 @@ type SubscriptionAttribute struct {
220220
TopicOwner string `xml:"TopicOwner,omitempty" json:"topic_owner,omitempty"`
221221
TopicName string `xml:"TopicName,omitempty" json:"topic_name,omitempty"`
222222
Endpoint string `xml:"Endpoint,omitempty" json:"endpoint,omitempty"`
223-
NotifyStrategy notifyStrategyType `xml:"NotifyStrategy,omitempty" json:"notify_strategy,omitempty"`
224-
NotifyContentFormat notifyContentFormatType `xml:"NotifyContentFormat,omitempty" json:"notify_content_format,omitempty"`
223+
NotifyStrategy NotifyStrategyType `xml:"NotifyStrategy,omitempty" json:"notify_strategy,omitempty"`
224+
NotifyContentFormat NotifyContentFormatType `xml:"NotifyContentFormat,omitempty" json:"notify_content_format,omitempty"`
225225
FilterTag string `xml:"FilterTag,omitempty" json:"filter_tag,omitempty"`
226226
CreateTime int64 `xml:"CreateTime,omitempty" json:"create_time,omitempty"`
227227
LastModifyTime int64 `xml:"LastModifyTime,omitempty" json:"last_modify_time,omitempty"`
228228
}
229229

230230
type SetSubscriptionAttributesRequest struct {
231231
XMLName xml.Name `xml:"Subscription" json:"-"`
232-
NotifyStrategy notifyStrategyType `xml:"NotifyStrategy,omitempty" json:"notify_strategy,omitempty"`
232+
NotifyStrategy NotifyStrategyType `xml:"NotifyStrategy,omitempty" json:"notify_strategy,omitempty"`
233233
}
234234

235235
type Queue struct {

topic.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ type AliMNSTopic interface {
1717
PublishMessage(message MessagePublishRequest) (resp MessageSendResponse, err error)
1818

1919
Subscribe(subscriptionName string, message MessageSubsribeRequest) (err error)
20-
SetSubscriptionAttributes(subscriptionName string, notifyStrategy notifyStrategyType) (err error)
20+
SetSubscriptionAttributes(subscriptionName string, notifyStrategy NotifyStrategyType) (err error)
2121
GetSubscriptionAttributes(subscriptionName string) (attr SubscriptionAttribute, err error)
2222
Unsubscribe(subscriptionName string) (err error)
2323
ListSubscriptionByTopic(nextMarker string, retNumber int32, prefix string) (subscriptions Subscriptions, err error)
@@ -87,7 +87,7 @@ func (p *MNSTopic) Subscribe(subscriptionName string, message MessageSubsribeReq
8787
return
8888
}
8989

90-
func (p *MNSTopic) SetSubscriptionAttributes(subscriptionName string, notifyStrategy notifyStrategyType) (err error) {
90+
func (p *MNSTopic) SetSubscriptionAttributes(subscriptionName string, notifyStrategy NotifyStrategyType) (err error) {
9191
subscriptionName = strings.TrimSpace(subscriptionName)
9292

9393
if err = checkTopicName(subscriptionName); err != nil {

0 commit comments

Comments
 (0)