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

subscriptions

package
v0.6.2 Latest Latest
Warning

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

Go to latest
Published: May 30, 2023 License: Apache-2.0 Imports: 2 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateOpts added in v0.5.2

type CreateOpts struct {
	// Message endpoint
	Endpoint string `json:"endpoint" required:"true"`
	// Protocol of the message endpoint
	Protocol string `json:"protocol" required:"true"`
	// Description of the subscription
	Remark string `json:"remark,omitempty"`
}

CreateOpts is a struct that contains all the parameters.

func (CreateOpts) ToSubscriptionCreateMap added in v0.5.2

func (ops CreateOpts) ToSubscriptionCreateMap() (map[string]interface{}, error)

type CreateOptsBuilder added in v0.5.2

type CreateOptsBuilder interface {
	ToSubscriptionCreateMap() (map[string]interface{}, error)
}

CreateOptsBuilder is used for creating subscription parameters. any struct providing the parameters should implement this interface

type CreateResult

type CreateResult struct {
	golangsdk.Result
}

CreateResult contains the response body and error from a Create request.

func Create

func Create(client *golangsdk.ServiceClient, opts CreateOptsBuilder, topicUrn string) (r CreateResult)

Create a subscription with given parameters.

func (CreateResult) Extract

func (r CreateResult) Extract() (*Subscription, error)

Extract will get the subscription object out of the commonResult object.

type DeleteResult

type DeleteResult struct {
	golangsdk.ErrResult
}

func Delete

func Delete(client *golangsdk.ServiceClient, subscriptionUrn string) (r DeleteResult)

Delete a subscription via subscription urn

type ListResult

type ListResult struct {
	golangsdk.Result
}

func List

func List(client *golangsdk.ServiceClient) (r ListResult)

List all the subscriptions

func ListFromTopic

func ListFromTopic(client *golangsdk.ServiceClient, subscriptionUrn string) (r ListResult)

ListFromTopic all the subscriptions from topic

func (ListResult) Extract

func (r ListResult) Extract() ([]SubscriptionGet, error)

type Subscription

type Subscription struct {
	RequestId       string `json:"request_id"`
	SubscriptionUrn string `json:"subscription_urn"`
}

type SubscriptionGet

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

Jump to

Keyboard shortcuts

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