subscriptions

package
v0.0.0-...-d823fe1 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2021 License: Apache-2.0 Imports: 1 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

View Source
var RequestOpts golangsdk.RequestOpts = golangsdk.RequestOpts{
	MoreHeaders: map[string]string{"Content-Type": "application/json", "X-Language": "en-us"},
}

Functions

This section is empty.

Types

type CreateOps

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

CreateOps is a struct that contains all the parameters.

func (CreateOps) ToSubscriptionCreateMap

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

type CreateOpsBuilder

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

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

type CreateResult

type CreateResult struct {
	// contains filtered or unexported fields
}

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

func Create

func Create(client *golangsdk.ServiceClient, ops CreateOpsBuilder, 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.

func (CreateResult) ExtractInto

func (r CreateResult) ExtractInto(v interface{}) error

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 GetResult

type GetResult struct {
	// contains filtered or unexported fields
}

func (GetResult) Extract

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

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

func (GetResult) ExtractInto

func (r GetResult) ExtractInto(v interface{}) error

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)

list all the subscriptions

func (ListResult) Extract

func (lr 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