Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AddSubscriptions ¶ added in v0.9.6
type AddSubscriptions struct {
// Message endpoint
Endpoint string `json:"endpoint" required:"true"`
// Protocol of the message endpoint
// The following protocols are supported:
// email: The endpoints are email address.
// sms: The endpoints are phone numbers.
// http and https: The endpoints are URLs.
Protocol string `json:"protocol" required:"true"`
// Description of the subscription
Remark string `json:"remark,omitempty"`
// Extended information
Extension *SubscriptionExtension `json:"extension,omitempty"`
}
type CreateOpts ¶ added in v0.5.2
type CreateOpts struct {
// Message endpoint
Endpoint string `json:"endpoint" required:"true"`
// Protocol of the message endpoint
// The following protocols are supported:
// email: The endpoints are email address.
// sms: The endpoints are phone numbers.
// http and https: The endpoints are URLs.
Protocol string `json:"protocol" required:"true"`
// Description of the subscription
Remark string `json:"remark,omitempty"`
// Extended information
Extension *SubscriptionExtension `json:"extension,omitempty"`
// This parameter is mandatory when subscriptions need to be created in batches.
// SMN allows you to create a maximum of 50 subscriptions at a time.
Subscriptions []AddSubscriptions `json:"subscriptions,omitempty"`
}
type CreateResponse ¶ added in v0.9.4
type CreateResponse struct {
RequestID string `json:"request_id"`
SubscriptionUrn string `json:"subscription_urn"`
}
func Create ¶
func Create(client *golangsdk.ServiceClient, opts CreateOpts, topicUrn string) (*CreateResponse, error)
type ListTopicOpts ¶ added in v0.9.4
type Subscription ¶
type Subscription struct {
TopicUrn string `json:"topic_urn"`
Protocol string `json:"protocol"`
SubscriptionUrn string `json:"subscription_urn"`
Owner string `json:"owner"`
Endpoint string `json:"endpoint"`
Remark string `json:"remark"`
Status int `json:"status"`
}
func List ¶
func List(client *golangsdk.ServiceClient, opts ListOpts) ([]Subscription, error)
List all the subscriptions
func ListTopic ¶ added in v0.9.4
func ListTopic(client *golangsdk.ServiceClient, opts ListTopicOpts) ([]Subscription, error)
ListTopic subscriptions of specified topic
type SubscriptionExtension ¶ added in v0.9.6
type SubscriptionExtension struct {
// This is an HTTP header field, which can be customized within the field range.
// The field content exists in the form of key/value pairs.
// When a topic is used to send messages, confirmed subscription messages carry the user-defined HTTP header.
Header map[string]string `json:"header,omitempty"`
}
Click to show internal directories.
Click to hide internal directories.