Help us shape the future of Go! Take the 2026 Go Developer Survey

subscriptions

package
v0.9.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 16, 2026 License: Apache-2.0 Imports: 3 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Delete

func Delete(client *golangsdk.ServiceClient, subscriptionUrn string) (err error)

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 ListOpts added in v0.9.4

type ListOpts struct {
	Offset string `q:"offset,omitempty"`
	Limit  int    `q:"limit,omitempty"`
}

type ListTopicOpts added in v0.9.4

type ListTopicOpts struct {
	TopicUrn string `json:"-"`
	Offset   string `q:"offset,omitempty"`
	Limit    int    `q:"limit,omitempty"`
}

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"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL