Versions in this module Expand all Collapse all v1 v1.20.76 Nov 28, 2023 Changes in this version + const ALI_MNS_ERR_NS + const AUTHORIZATION + const BACKOFF_RETRY + const CONTENT_MD5 + const CONTENT_TYPE + const DATE + const DELETE + const DefaultDNSTTL + const DefaultQueueQPSLimit + const DefaultTimeout + const DefaultTopicQPSLimit + const EXPONENTIAL_DECAY_RETRY + const GET + const GLOBAL_PROXY + const HOST + const KEEP_ALIVE + const MQ_VERSION + const POST + const PUT + const SIMPLIFIED + const XML + var DefaultNumOfMessages int32 = 16 + var ERR_CREATE_NEW_REQUEST_FAILED = errors.TN(ALI_MNS_ERR_NS, 4, "create new request failed, {{.err}}") + var ERR_DECODE_BODY_FAILED = errors.TN(ALI_MNS_ERR_NS, 9, "decode body failed, {{.err}}, body: \"{{.body}}\"") + var ERR_GENERAL_AUTH_HEADER_FAILED = errors.TN(ALI_MNS_ERR_NS, 3, "general auth header failed, {{.err}}") + var ERR_GET_BODY_DECODE_ELEMENT_ERROR = errors.TN(ALI_MNS_ERR_NS, 10, ...) + var ERR_MARSHAL_MESSAGE_FAILED = errors.TN(ALI_MNS_ERR_NS, 2, "marshal message filed, {{.err}}") + var ERR_MNS_ACCESS_DENIED = errors.TN(ALI_MNS_ERR_NS, 100, ali_MNS_ERR_TEMPSTR) + var ERR_MNS_BATCH_OP_FAIL = errors.TN(ALI_MNS_ERR_NS, 136, "mns queue batch operation fail") + var ERR_MNS_DELAY_SECONDS_RANGE_ERROR = errors.TN(ALI_MNS_ERR_NS, 127, "queue delay seconds is not in range of (0~60480)") + var ERR_MNS_INTERNAL_ERROR = errors.TN(ALI_MNS_ERR_NS, 102, ali_MNS_ERR_TEMPSTR) + var ERR_MNS_INVALID_ACCESS_KEY_ID = errors.TN(ALI_MNS_ERR_NS, 101, ali_MNS_ERR_TEMPSTR) + var ERR_MNS_INVALID_ARGUMENT = errors.TN(ALI_MNS_ERR_NS, 105, ali_MNS_ERR_TEMPSTR) + var ERR_MNS_INVALID_AUTHORIZATION_HEADER = errors.TN(ALI_MNS_ERR_NS, 103, ali_MNS_ERR_TEMPSTR) + var ERR_MNS_INVALID_CONTENT_TYPE = errors.TN(ALI_MNS_ERR_NS, 120, ali_MNS_ERR_TEMPSTR) + var ERR_MNS_INVALID_DATE_HEADER = errors.TN(ALI_MNS_ERR_NS, 104, ali_MNS_ERR_TEMPSTR) + var ERR_MNS_INVALID_DEGIST = errors.TN(ALI_MNS_ERR_NS, 106, ali_MNS_ERR_TEMPSTR) + var ERR_MNS_INVALID_ENDPOINT = errors.TN(ALI_MNS_ERR_NS, 207, ali_MNS_ERR_TEMPSTR) + var ERR_MNS_INVALID_QUERY_STRING = errors.TN(ALI_MNS_ERR_NS, 108, ali_MNS_ERR_TEMPSTR) + var ERR_MNS_INVALID_QUEUE_NAME = errors.TN(ALI_MNS_ERR_NS, 118, ali_MNS_ERR_TEMPSTR) + var ERR_MNS_INVALID_REQUEST_URL = errors.TN(ALI_MNS_ERR_NS, 107, ali_MNS_ERR_TEMPSTR) + var ERR_MNS_INVALID_SUBSCRIPTION_NAME = errors.TN(ALI_MNS_ERR_NS, 205, ali_MNS_ERR_TEMPSTR) + var ERR_MNS_INVALID_TOPIC_NAME = errors.TN(ALI_MNS_ERR_NS, 204, ali_MNS_ERR_TEMPSTR) + var ERR_MNS_INVALID_VERSION_HEADER = errors.TN(ALI_MNS_ERR_NS, 119, ali_MNS_ERR_TEMPSTR) + var ERR_MNS_MALFORMED_XML = errors.TN(ALI_MNS_ERR_NS, 109, ali_MNS_ERR_TEMPSTR) + var ERR_MNS_MAX_MESSAGE_SIZE_RANGE_ERROR = errors.TN(ALI_MNS_ERR_NS, 128, "max message size is not in range of (1024~65536)") + var ERR_MNS_MESSAGE_NOT_EXIST = errors.TN(ALI_MNS_ERR_NS, 115, ali_MNS_ERR_TEMPSTR) + var ERR_MNS_MISSING_AUTHORIZATION_HEADER = errors.TN(ALI_MNS_ERR_NS, 110, ali_MNS_ERR_TEMPSTR) + var ERR_MNS_MISSING_DATE_HEADER = errors.TN(ALI_MNS_ERR_NS, 111, ali_MNS_ERR_TEMPSTR) + var ERR_MNS_MISSING_RECEIPT_HANDLE = errors.TN(ALI_MNS_ERR_NS, 113, ali_MNS_ERR_TEMPSTR) + var ERR_MNS_MISSING_VERSION_HEADER = errors.TN(ALI_MNS_ERR_NS, 112, ali_MNS_ERR_TEMPSTR) + var ERR_MNS_MISSING_VISIBILITY_TIMEOUT = errors.TN(ALI_MNS_ERR_NS, 114, ali_MNS_ERR_TEMPSTR) + var ERR_MNS_MSG_POOLLING_WAIT_SECONDS_RANGE_ERROR = errors.TN(ALI_MNS_ERR_NS, 131, "message poolling wait seconds is not in range of (0~30)") + var ERR_MNS_MSG_RETENTION_PERIOD_RANGE_ERROR = errors.TN(ALI_MNS_ERR_NS, 129, "message retention period is not in range of (60~129600)") + var ERR_MNS_MSG_VISIBILITY_TIMEOUT_RANGE_ERROR = errors.TN(ALI_MNS_ERR_NS, 130, "message visibility timeout is not in range of (1~43200)") + var ERR_MNS_QPS_LIMIT_EXCEEDED = errors.TN(ALI_MNS_ERR_NS, 134, ali_MNS_ERR_TEMPSTR) + var ERR_MNS_QUEUE_ALREADY_EXIST = errors.TN(ALI_MNS_ERR_NS, 116, ali_MNS_ERR_TEMPSTR) + var ERR_MNS_QUEUE_ALREADY_EXIST_AND_HAVE_SAME_ATTR = errors.TN(ALI_MNS_ERR_NS, 133, ...) + var ERR_MNS_QUEUE_DELETED_RECENTLY = errors.TN(ALI_MNS_ERR_NS, 117, ali_MNS_ERR_TEMPSTR) + var ERR_MNS_QUEUE_NAME_IS_TOO_LONG = errors.TN(ALI_MNS_ERR_NS, 126, "queue name is too long, the max length is 256") + var ERR_MNS_QUEUE_NAME_LENGTH_ERROR = errors.TN(ALI_MNS_ERR_NS, 121, ali_MNS_ERR_TEMPSTR) + var ERR_MNS_QUEUE_NOT_EXIST = errors.TN(ALI_MNS_ERR_NS, 122, ali_MNS_ERR_TEMPSTR) + var ERR_MNS_RECEIPT_HANDLE_ERROR = errors.TN(ALI_MNS_ERR_NS, 123, ali_MNS_ERR_TEMPSTR) + var ERR_MNS_RET_NUMBER_RANGE_ERROR = errors.TN(ALI_MNS_ERR_NS, 132, "list param of ret number is not in range of (1~1000)") + var ERR_MNS_SIGNATURE_DOES_NOT_MATCH = errors.TN(ALI_MNS_ERR_NS, 124, ali_MNS_ERR_TEMPSTR) + var ERR_MNS_SUBSCRIBER_NOT_EXIST = errors.TN(ALI_MNS_ERR_NS, 211, ali_MNS_ERR_TEMPSTR) + var ERR_MNS_SUBSCRIPTION_ALREADY_EXIST = errors.TN(ALI_MNS_ERR_NS, 206, ali_MNS_ERR_TEMPSTR) + var ERR_MNS_SUBSCRIPTION_ALREADY_EXIST_AND_HAVE_SAME_ATTR = errors.TN(ALI_MNS_ERR_NS, 210, ...) + var ERR_MNS_SUBSRIPTION_NAME_LENGTH_ERROR = errors.TN(ALI_MNS_ERR_NS, 201, ali_MNS_ERR_TEMPSTR) + var ERR_MNS_TIME_EXPIRED = errors.TN(ALI_MNS_ERR_NS, 125, ali_MNS_ERR_TEMPSTR) + var ERR_MNS_TOPIC_ALREADY_EXIST = errors.TN(ALI_MNS_ERR_NS, 203, ali_MNS_ERR_TEMPSTR) + var ERR_MNS_TOPIC_ALREADY_EXIST_AND_HAVE_SAME_ATTR = errors.TN(ALI_MNS_ERR_NS, 209, ...) + var ERR_MNS_TOPIC_NAME_IS_TOO_LONG = errors.TN(ALI_MNS_ERR_NS, 208, "topic name is too long, the max length is 256") + var ERR_MNS_TOPIC_NAME_LENGTH_ERROR = errors.TN(ALI_MNS_ERR_NS, 200, ali_MNS_ERR_TEMPSTR) + var ERR_MNS_TOPIC_NOT_EXIST = errors.TN(ALI_MNS_ERR_NS, 202, ali_MNS_ERR_TEMPSTR) + var ERR_MNS_UNKNOWN_CODE = errors.TN(ALI_MNS_ERR_NS, 135, ali_MNS_ERR_TEMPSTR) + var ERR_READ_RESPONSE_BODY_FAILED = errors.TN(ALI_MNS_ERR_NS, 6, "read response body failed, {{.err}}") + var ERR_SEND_REQUEST_FAILED = errors.TN(ALI_MNS_ERR_NS, 5, "send request failed, {{.err}}") + var ERR_SIGN_MESSAGE_FAILED = errors.TN(ALI_MNS_ERR_NS, 1, "sign message failed, {{.err}}") + var ERR_UNMARSHAL_ERROR_RESPONSE_FAILED = errors.TN(ALI_MNS_ERR_NS, 7, ...) + var ERR_UNMARSHAL_RESPONSE_FAILED = errors.TN(ALI_MNS_ERR_NS, 8, "unmarshal response failed, {{.err}}") + func ParseError(resp ErrorResponse, resource string) (err error) + type AliMNSCredential struct + func NewAliMNSCredential(accessKeySecret string) *AliMNSCredential + func (p *AliMNSCredential) SetSecretKey(accessKeySecret string) + func (p *AliMNSCredential) Signature(method Method, headers map[string]string, resource string) (signature string, err error) + type AliMNSQueue interface + BatchDeleteMessage func(receiptHandles ...string) (resp BatchMessageDeleteErrorResponse, err error) + BatchPeekMessage func(respChan chan BatchMessageReceiveResponse, errChan chan error, ...) + BatchReceiveMessage func(respChan chan BatchMessageReceiveResponse, errChan chan error, ...) + BatchSendMessage func(messages ...MessageSendRequest) (resp BatchMessageSendResponse, err error) + ChangeMessageVisibility func(receiptHandle string, visibilityTimeout int64) (resp MessageVisibilityChangeResponse, err error) + DeleteMessage func(receiptHandle string) (err error) + Name func() string + PeekMessage func(respChan chan MessageReceiveResponse, errChan chan error) + QPSMonitor func() *QPSMonitor + ReceiveMessage func(respChan chan MessageReceiveResponse, errChan chan error, waitseconds ...int64) + SendMessage func(message MessageSendRequest) (resp MessageSendResponse, err error) + func NewMNSQueue(name string, client MNSClient, qps ...int32) AliMNSQueue + type AliMNSTopic interface + GenerateMailEndpoint func(mailAddress string) string + GenerateQueueEndpoint func(queueName string) string + GetSubscriptionAttributes func(subscriptionName string) (attr SubscriptionAttribute, err error) + ListSubscriptionByTopic func(nextMarker string, retNumber int32, prefix string) (subscriptions Subscriptions, err error) + Name func() string + PublishMessage func(message MessagePublishRequest) (resp MessageSendResponse, err error) + SetSubscriptionAttributes func(subscriptionName string, notifyStrategy notifyStrategyType) (err error) + Subscribe func(subscriptionName string, message MessageSubsribeRequest) (err error) + Unsubscribe func(subscriptionName string) (err error) + func NewMNSTopic(name string, client MNSClient, qps ...int32) AliMNSTopic + type AliQueueManager interface + CreateQueue func(queueName string, delaySeconds int32, maxMessageSize int32, ...) (err error) + CreateSimpleQueue func(queueName string) (err error) + DeleteQueue func(queueName string) (err error) + GetQueueAttributes func(queueName string) (attr QueueAttribute, err error) + ListQueue func(nextMarker string, retNumber int32, prefix string) (queues Queues, err error) + SetQueueAttributes func(queueName string, delaySeconds int32, maxMessageSize int32, ...) (err error) + func NewMNSQueueManager(client MNSClient) AliQueueManager + type AliTopicManager interface + CreateSimpleTopic func(topicName string) (err error) + CreateTopic func(topicName string, maxMessageSize int32, loggingEnabled bool) (err error) + DeleteTopic func(topicName string) (err error) + GetTopicAttributes func(topicName string) (attr TopicAttribute, err error) + ListTopic func(nextMarker string, retNumber int32, prefix string) (topics Topics, err error) + SetTopicAttributes func(topicName string, maxMessageSize int32, loggingEnabled bool) (err error) + func NewMNSTopicManager(client MNSClient) AliTopicManager + type BatchMessageDeleteErrorResponse struct + FailedMessages []MessageDeleteFailEntry + XMLName xml.Name + type BatchMessageReceiveResponse struct + Messages []MessageReceiveResponse + XMLName xml.Name + type BatchMessageSendEntry struct + ErrorCode string + ErrorMessage string + MessageBodyMD5 string + MessageId string + XMLName xml.Name + type BatchMessageSendRequest struct + Messages []MessageSendRequest + XMLName xml.Name + type BatchMessageSendResponse struct + Messages []BatchMessageSendEntry + XMLName xml.Name + type CreateQueueRequest struct + DelaySeconds int32 + MaxMessageSize int32 + MessageRetentionPeriod int32 + PollingWaitSeconds int32 + VisibilityTimeout int32 + XMLName xml.Name + type CreateTopicRequest struct + LoggingEnabled bool + MaxMessageSize int32 + XMLName xml.Name + type Credential interface + SetSecretKey func(accessKeySecret string) + Signature func(method Method, headers map[string]string, resource string) (signature string, err error) + type ErrorResponse struct + Code string + HostId string + Message string + RequestId string + XMLName xml.Name + type MNSClient interface + Send func(method Method, headers map[string]string, message interface{}, resource string) (*http.Response, error) + SetProxy func(url string) + func NewAliMNSClient(inputUrl, accessKeyId, accessKeySecret string) MNSClient + type MNSDecoder interface + Decode func(reader io.Reader, v interface{}) (err error) + DecodeError func(bodyBytes []byte, resource string) (decodedError error, err error) + Test func() bool + func NewAliMNSDecoder() MNSDecoder + func NewBatchOpDecoder(v interface{}) MNSDecoder + type MNSQueue struct + func (p *MNSQueue) BatchDeleteMessage(receiptHandles ...string) (resp BatchMessageDeleteErrorResponse, err error) + func (p *MNSQueue) BatchPeekMessage(respChan chan BatchMessageReceiveResponse, errChan chan error, ...) + func (p *MNSQueue) BatchReceiveMessage(respChan chan BatchMessageReceiveResponse, errChan chan error, ...) + func (p *MNSQueue) BatchSendMessage(messages ...MessageSendRequest) (resp BatchMessageSendResponse, err error) + func (p *MNSQueue) ChangeMessageVisibility(receiptHandle string, visibilityTimeout int64) (resp MessageVisibilityChangeResponse, err error) + func (p *MNSQueue) DeleteMessage(receiptHandle string) (err error) + func (p *MNSQueue) Name() string + func (p *MNSQueue) PeekMessage(respChan chan MessageReceiveResponse, errChan chan error) + func (p *MNSQueue) QPSMonitor() *QPSMonitor + func (p *MNSQueue) ReceiveMessage(respChan chan MessageReceiveResponse, errChan chan error, waitseconds ...int64) + func (p *MNSQueue) SendMessage(message MessageSendRequest) (resp MessageSendResponse, err error) + type MNSQueueManager struct + func (p *MNSQueueManager) CreateQueue(queueName string, delaySeconds int32, maxMessageSize int32, ...) (err error) + func (p *MNSQueueManager) CreateSimpleQueue(queueName string) (err error) + func (p *MNSQueueManager) DeleteQueue(queueName string) (err error) + func (p *MNSQueueManager) GetQueueAttributes(queueName string) (attr QueueAttribute, err error) + func (p *MNSQueueManager) ListQueue(nextMarker string, retNumber int32, prefix string) (queues Queues, err error) + func (p *MNSQueueManager) SetQueueAttributes(queueName string, delaySeconds int32, maxMessageSize int32, ...) (err error) + type MNSTopic struct + func (p *MNSTopic) GenerateMailEndpoint(mailAddress string) string + func (p *MNSTopic) GenerateQueueEndpoint(queueName string) string + func (p *MNSTopic) GetSubscriptionAttributes(subscriptionName string) (attr SubscriptionAttribute, err error) + func (p *MNSTopic) ListSubscriptionByTopic(nextMarker string, retNumber int32, prefix string) (subscriptions Subscriptions, err error) + func (p *MNSTopic) Name() string + func (p *MNSTopic) PublishMessage(message MessagePublishRequest) (resp MessageSendResponse, err error) + func (p *MNSTopic) SetSubscriptionAttributes(subscriptionName string, notifyStrategy notifyStrategyType) (err error) + func (p *MNSTopic) Subscribe(subscriptionName string, message MessageSubsribeRequest) (err error) + func (p *MNSTopic) Unsubscribe(subscriptionName string) (err error) + type MNSTopicManager struct + func (p *MNSTopicManager) CreateSimpleTopic(topicName string) (err error) + func (p *MNSTopicManager) CreateTopic(topicName string, maxMessageSize int32, loggingEnabled bool) (err error) + func (p *MNSTopicManager) DeleteTopic(topicName string) (err error) + func (p *MNSTopicManager) GetTopicAttributes(topicName string) (attr TopicAttribute, err error) + func (p *MNSTopicManager) ListTopic(nextMarker string, retNumber int32, prefix string) (topics Topics, err error) + func (p *MNSTopicManager) SetTopicAttributes(topicName string, maxMessageSize int32, loggingEnabled bool) (err error) + type MailAttributes struct + AccountName string + AddressType int32 + IsHtml bool + ReplyToAddress int32 + Subject string + func (m *MailAttributes) MarshalJSON() ([]byte, error) + type MessageAttributes struct + MailAttributes *MailAttributes + XMLName xml.Name + func (m *MessageAttributes) MarshalXML(e *xml.Encoder, start xml.StartElement) error + type MessageDeleteFailEntry struct + ErrorCode string + ErrorMessage string + ReceiptHandle string + XMLName xml.Name + type MessagePublishRequest struct + MessageAttributes *MessageAttributes + MessageBody string + MessageTag string + XMLName xml.Name + type MessageReceiveResponse struct + DequeueCount int64 + EnqueueTime int64 + FirstDequeueTime int64 + MessageBody string + MessageBodyMD5 string + MessageId string + NextVisibleTime int64 + Priority int64 + ReceiptHandle string + type MessageResponse struct + Code string + HostId string + Message string + RequestId string + XMLName xml.Name + type MessageSendRequest struct + DelaySeconds int64 + MessageBody string + Priority int64 + XMLName xml.Name + type MessageSendResponse struct + MessageBodyMD5 string + MessageId string + ReceiptHandle string + type MessageSubsribeRequest struct + Endpoint string + FilterTag string + NotifyContentFormat notifyContentFormatType + NotifyStrategy notifyStrategyType + XMLName xml.Name + type MessageVisibilityChangeResponse struct + NextVisibleTime int64 + ReceiptHandle string + XMLName xml.Name + type Method string + type QPSMonitor struct + func NewQPSMonitor(delaySecond int32, qpsLimit int32) *QPSMonitor + func (p *QPSMonitor) Pulse() + func (p *QPSMonitor) QPS() int32 + func (p *QPSMonitor) Update() int32 + type Queue struct + QueueURL string + type QueueAttribute struct + ActiveMessages int64 + CreateTime int64 + DelayMessages int64 + DelaySeconds int32 + InactiveMessages int64 + LastModifyTime int64 + MaxMessageSize int32 + MessageRetentionPeriod int32 + PollingWaitSeconds int32 + QueueName string + VisibilityTimeout int32 + XMLName xml.Name + type Queues struct + NextMarker string + Queues []Queue + XMLName xml.Name + type ReceiptHandles struct + ReceiptHandles []string + XMLName xml.Name + type SetSubscriptionAttributesRequest struct + NotifyStrategy notifyStrategyType + XMLName xml.Name + type Subscription struct + SubscriptionURL string + type SubscriptionAttribute struct + CreateTime int64 + Endpoint string + FilterTag string + LastModifyTime int64 + NotifyContentFormat notifyContentFormatType + NotifyStrategy notifyStrategyType + Subscriber string + SubscriptionName string + TopicName string + TopicOwner string + XMLName xml.Name + type Subscriptions struct + NextMarker string + Subscriptions []Subscription + XMLName xml.Name + type Topic struct + TopicURL string + type TopicAttribute struct + CreateTime int64 + LastModifyTime int64 + LoggingEnabled bool + MaxMessageSize int32 + MessageCount int64 + MessageRetentionPeriod int32 + TopicName string + XMLName xml.Name + type Topics struct + NextMarker string + Topics []Topic + XMLName xml.Name