admin

package
v0.3.5 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2022 License: MIT Imports: 9 Imported by: 11

Documentation

Overview

Package admin provides `Client`, which can create and manage Queues, Topics and Subscriptions. NOTE: For sending and receiving messages with Azure ServiceBus use the `Client` in the `github.com/Azure/azure-sdk-for-go/sdk/messaging/azservicebus` package.

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client allows you to administer resources in a Service Bus Namespace. For example, you can create queues, enabling capabilities like partitioning, duplicate detection, etc.. NOTE: For sending and receiving messages you'll need to use the `azservicebus.Client` type instead.

func NewClient

func NewClient(fullyQualifiedNamespace string, tokenCredential azcore.TokenCredential, options *ClientOptions) (*Client, error)

NewClient creates a Client authenticating using a TokenCredential.

Example
package main

import (
	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/messaging/azservicebus/admin"
)

func main() {
	// NOTE: If you'd like to authenticate using a Service Bus connection string
	// look at `NewClientWithConnectionString` instead.

	credential, err := azidentity.NewDefaultAzureCredential(nil)
	exitOnError("Failed to create a DefaultAzureCredential", err)

	adminClient, err = admin.NewClient("<ex: myservicebus.servicebus.windows.net>", credential, nil)
	exitOnError("Failed to create ServiceBusClient in example", err)
}

// NOTE: these are just here to keep the examples succinct.
var adminClient *admin.Client

func exitOnError(message string, err error) {}
Output:

func NewClientFromConnectionString

func NewClientFromConnectionString(connectionString string, options *ClientOptions) (*Client, error)

NewClientFromConnectionString creates a Client authenticating using a connection string.

Example
package main

import (
	"github.com/Azure/azure-sdk-for-go/sdk/messaging/azservicebus/admin"
)

func main() {
	// NOTE: If you'd like to authenticate via Azure Active Directory look at
	// the `NewClient` function instead.

	adminClient, err = admin.NewClientFromConnectionString("<connection string>", nil)
	exitOnError("Failed to create ServiceBusClient in example", err)
}

// NOTE: these are just here to keep the examples succinct.
var adminClient *admin.Client
var err error

func exitOnError(message string, err error) {}
Output:

func (*Client) CreateQueue

func (ac *Client) CreateQueue(ctx context.Context, queueName string, properties *QueueProperties, options *CreateQueueOptions) (*CreateQueueResponse, error)

CreateQueue creates a queue with configurable properties.

Example
package main

import (
	"context"
	"fmt"

	"github.com/Azure/azure-sdk-for-go/sdk/messaging/azservicebus/admin"
)

func main() {
	resp, err := adminClient.CreateQueue(context.TODO(), "queue-name", nil, nil)
	exitOnError("Failed to add queue", err)

	// some example properties
	fmt.Printf("Max message delivery count = %d\n", *resp.MaxDeliveryCount)
	fmt.Printf("Lock duration: %s\n", resp.LockDuration)
}

// NOTE: these are just here to keep the examples succinct.
var adminClient *admin.Client

func exitOnError(message string, err error) {}
Output:

Example (Usingproperties)
package main

import (
	"context"
	"fmt"
	"time"

	"github.com/Azure/azure-sdk-for-go/sdk/messaging/azservicebus/admin"
)

func main() {
	lockDuration := time.Minute
	maxDeliveryCount := int32(10)

	resp, err := adminClient.CreateQueue(context.TODO(), "queue-name", &admin.QueueProperties{
		// some example properties
		LockDuration:     &lockDuration,
		MaxDeliveryCount: &maxDeliveryCount,
	}, nil)
	exitOnError("Failed to create queue", err)

	// some example properties
	fmt.Printf("Max message delivery count = %d\n", *resp.MaxDeliveryCount)
	fmt.Printf("Lock duration: %s\n", resp.LockDuration)
}

// NOTE: these are just here to keep the examples succinct.
var adminClient *admin.Client

func exitOnError(message string, err error) {}
Output:

func (*Client) CreateSubscription

func (ac *Client) CreateSubscription(ctx context.Context, topicName string, subscriptionName string, properties *SubscriptionProperties, options *CreateSubscriptionOptions) (*CreateSubscriptionResponse, error)

CreateSubscription creates a subscription to a topic with configurable properties

func (*Client) CreateTopic

func (ac *Client) CreateTopic(ctx context.Context, topicName string, properties *TopicProperties, options *CreateTopicOptions) (*CreateTopicResponse, error)

CreateTopic creates a topic using defaults for all options.

func (*Client) DeleteQueue

func (ac *Client) DeleteQueue(ctx context.Context, queueName string, options *DeleteQueueOptions) (*DeleteQueueResponse, error)

DeleteQueue deletes a queue.

func (*Client) DeleteSubscription

func (ac *Client) DeleteSubscription(ctx context.Context, topicName string, subscriptionName string, options *DeleteSubscriptionOptions) (*DeleteSubscriptionResponse, error)

DeleteSubscription deletes a subscription.

func (*Client) DeleteTopic

func (ac *Client) DeleteTopic(ctx context.Context, topicName string, options *DeleteTopicOptions) (*DeleteTopicResponse, error)

DeleteTopic deletes a topic.

func (*Client) GetNamespaceProperties

func (ac *Client) GetNamespaceProperties(ctx context.Context, options *GetNamespacePropertiesOptions) (*GetNamespacePropertiesResponse, error)

GetNamespaceProperties gets the properties for the namespace, includings properties like SKU and CreatedTime.

func (*Client) GetQueue

func (ac *Client) GetQueue(ctx context.Context, queueName string, options *GetQueueOptions) (*GetQueueResponse, error)

GetQueue gets a queue by name.

func (*Client) GetQueueRuntimeProperties

func (ac *Client) GetQueueRuntimeProperties(ctx context.Context, queueName string, options *GetQueueRuntimePropertiesOptions) (*GetQueueRuntimePropertiesResponse, error)

GetQueueRuntimeProperties gets runtime properties of a queue, like the SizeInBytes, or ActiveMessageCount.

func (*Client) GetSubscription

func (ac *Client) GetSubscription(ctx context.Context, topicName string, subscriptionName string, options *GetSubscriptionOptions) (*GetSubscriptionResponse, error)

GetSubscription gets a subscription by name.

func (*Client) GetSubscriptionRuntimeProperties

func (ac *Client) GetSubscriptionRuntimeProperties(ctx context.Context, topicName string, subscriptionName string, options *GetSubscriptionRuntimePropertiesOptions) (*GetSubscriptionRuntimePropertiesResponse, error)

GetSubscriptionRuntimeProperties gets runtime properties of a subscription, like the SizeInBytes, or SubscriptionCount.

func (*Client) GetTopic

func (ac *Client) GetTopic(ctx context.Context, topicName string, options *GetTopicOptions) (*GetTopicResponse, error)

GetTopic gets a topic by name.

func (*Client) GetTopicRuntimeProperties

func (ac *Client) GetTopicRuntimeProperties(ctx context.Context, topicName string, options *GetTopicRuntimePropertiesOptions) (*GetTopicRuntimePropertiesResponse, error)

GetTopicRuntimeProperties gets runtime properties of a topic, like the SizeInBytes, or SubscriptionCount.

func (*Client) ListQueues

func (ac *Client) ListQueues(options *ListQueuesOptions) *QueuePager

ListQueues lists queues.

Example
package main

import (
	"context"
	"fmt"

	"github.com/Azure/azure-sdk-for-go/sdk/messaging/azservicebus/admin"
)

func main() {
	queuePager := adminClient.ListQueues(nil)

	for queuePager.NextPage(context.TODO()) {
		for _, queue := range queuePager.PageResponse().Items {
			fmt.Printf("Queue name: %s, max size in MB: %d\n", queue.QueueName, *queue.MaxSizeInMegabytes)
		}
	}

	exitOnError("Failed when listing queues", queuePager.Err())
}

// NOTE: these are just here to keep the examples succinct.
var adminClient *admin.Client

func exitOnError(message string, err error) {}
Output:

func (*Client) ListQueuesRuntimeProperties

func (ac *Client) ListQueuesRuntimeProperties(options *ListQueuesRuntimePropertiesOptions) *QueueRuntimePropertiesPager

ListQueuesRuntimeProperties lists runtime properties for queues.

Example
package main

import (
	"context"
	"fmt"

	"github.com/Azure/azure-sdk-for-go/sdk/messaging/azservicebus/admin"
)

func main() {
	queuePager := adminClient.ListQueuesRuntimeProperties(nil)

	for queuePager.NextPage(context.TODO()) {
		for _, queue := range queuePager.PageResponse().Items {
			fmt.Printf("Queue name: %s, active messages: %d\n", queue.QueueName, queue.ActiveMessageCount)
		}
	}

	exitOnError("Failed when listing queues runtime properties", queuePager.Err())
}

// NOTE: these are just here to keep the examples succinct.
var adminClient *admin.Client

func exitOnError(message string, err error) {}
Output:

func (*Client) ListSubscriptions

func (ac *Client) ListSubscriptions(topicName string, options *ListSubscriptionsOptions) *SubscriptionPager

ListSubscriptions lists subscriptions for a topic.

func (*Client) ListSubscriptionsRuntimeProperties

func (ac *Client) ListSubscriptionsRuntimeProperties(topicName string, options *ListSubscriptionsRuntimePropertiesOptions) *SubscriptionRuntimePropertiesPager

ListSubscriptionsRuntimeProperties lists runtime properties for subscriptions for a topic.

func (*Client) ListTopics

func (ac *Client) ListTopics(options *ListTopicsOptions) *TopicsPager

ListTopics lists topics.

func (*Client) ListTopicsRuntimeProperties

func (ac *Client) ListTopicsRuntimeProperties(options *ListTopicsRuntimePropertiesOptions) *TopicRuntimePropertiesPager

ListTopicsRuntimeProperties lists runtime properties for topics.

func (*Client) UpdateQueue

func (ac *Client) UpdateQueue(ctx context.Context, queueName string, properties QueueProperties, options *UpdateQueueOptions) (*UpdateQueueResponse, error)

UpdateQueue updates an existing queue.

func (*Client) UpdateSubscription

func (ac *Client) UpdateSubscription(ctx context.Context, topicName string, subscriptionName string, properties SubscriptionProperties, options *UpdateSubscriptionOptions) (*UpdateSubscriptionResponse, error)

UpdateSubscription updates an existing subscription.

func (*Client) UpdateTopic

func (ac *Client) UpdateTopic(ctx context.Context, topicName string, properties TopicProperties, options *UpdateTopicOptions) (*UpdateTopicResponse, error)

UpdateTopic updates an existing topic.

type ClientOptions

type ClientOptions struct {
	// RetryOptions controls how often operations are retried from this client.
	RetryOptions *RetryOptions
}

ClientOptions allows you to set optional configuration for `Client`.

type CreateQueueOptions

type CreateQueueOptions struct {
}

type CreateQueueResponse

type CreateQueueResponse struct {
	CreateQueueResult

	// RawResponse is the *http.Response for the request.
	RawResponse *http.Response
}

type CreateQueueResult

type CreateQueueResult struct {
	QueueProperties
}

type CreateSubscriptionOptions

type CreateSubscriptionOptions struct {
}

type CreateSubscriptionResponse

type CreateSubscriptionResponse struct {
	// Value is the result of the request.
	CreateSubscriptionResult
	// RawResponse is the *http.Response for the request.
	RawResponse *http.Response
}

type CreateSubscriptionResult

type CreateSubscriptionResult struct {
	SubscriptionProperties
}

type CreateTopicOptions

type CreateTopicOptions struct {
}

type CreateTopicResponse

type CreateTopicResponse struct {
	CreateTopicResult

	// RawResponse is the *http.Response for the request.
	RawResponse *http.Response
}

type CreateTopicResult

type CreateTopicResult struct {
	TopicProperties
}

type DeleteQueueOptions

type DeleteQueueOptions struct {
}

type DeleteQueueResponse

type DeleteQueueResponse struct {
	RawResponse *http.Response
}

type DeleteSubscriptionOptions

type DeleteSubscriptionOptions struct {
}

type DeleteSubscriptionResponse

type DeleteSubscriptionResponse struct {
	// RawResponse is the *http.Response for the request.
	RawResponse *http.Response
}

type DeleteTopicOptions

type DeleteTopicOptions struct {
}

type DeleteTopicResponse

type DeleteTopicResponse struct {
	// Value is the result of the request.
	Value *TopicProperties
	// RawResponse is the *http.Response for the request.
	RawResponse *http.Response
}

type EntityStatus

type EntityStatus string

EntityStatus represents the current status of the entity.

const (
	// EntityStatusActive indicates an entity can be used for sending and receiving.
	EntityStatusActive EntityStatus = "Active"
	// EntityStatusDisabled indicates an entity cannot be used for sending or receiving.
	EntityStatusDisabled EntityStatus = "Disabled"
	// EntityStatusSendDisabled indicates that an entity cannot be used for sending.
	EntityStatusSendDisabled EntityStatus = "SendDisabled"
	// EntityStatusReceiveDisabled indicates that an entity cannot be used for receiving.
	EntityStatusReceiveDisabled EntityStatus = "ReceiveDisabled"
)

type GetNamespacePropertiesOptions

type GetNamespacePropertiesOptions struct {
}

type GetNamespacePropertiesResponse

type GetNamespacePropertiesResponse struct {
	GetNamespacePropertiesResult
	RawResponse *http.Response
}

type GetNamespacePropertiesResult

type GetNamespacePropertiesResult struct {
	NamespaceProperties
}

type GetQueueOptions

type GetQueueOptions struct {
}

type GetQueueResponse

type GetQueueResponse struct {
	GetQueueResult

	// RawResponse is the *http.Response for the request.
	RawResponse *http.Response
}

type GetQueueResult

type GetQueueResult struct {
	QueueProperties
}

type GetQueueRuntimePropertiesOptions

type GetQueueRuntimePropertiesOptions struct {
}

type GetQueueRuntimePropertiesResponse

type GetQueueRuntimePropertiesResponse struct {
	GetQueueRuntimePropertiesResult

	// RawResponse is the *http.Response for the request.
	RawResponse *http.Response
}

type GetQueueRuntimePropertiesResult

type GetQueueRuntimePropertiesResult struct {
	QueueRuntimeProperties
}

type GetSubscriptionOptions

type GetSubscriptionOptions struct {
}

type GetSubscriptionResponse

type GetSubscriptionResponse struct {
	GetSubscriptionResult

	// RawResponse is the *http.Response for the request.
	RawResponse *http.Response
}

type GetSubscriptionResult

type GetSubscriptionResult struct {
	SubscriptionProperties
}

type GetSubscriptionRuntimePropertiesOptions

type GetSubscriptionRuntimePropertiesOptions struct {
}

type GetSubscriptionRuntimePropertiesResponse

type GetSubscriptionRuntimePropertiesResponse struct {
	GetSubscriptionRuntimePropertiesResult
	// RawResponse is the *http.Response for the request.
	RawResponse *http.Response
}

type GetSubscriptionRuntimePropertiesResult

type GetSubscriptionRuntimePropertiesResult struct {
	SubscriptionRuntimeProperties
}

type GetTopicOptions

type GetTopicOptions struct {
}

type GetTopicResponse

type GetTopicResponse struct {
	GetTopicResult

	// RawResponse is the *http.Response for the request.
	RawResponse *http.Response
}

type GetTopicResult

type GetTopicResult struct {
	TopicProperties
}

type GetTopicRuntimePropertiesOptions

type GetTopicRuntimePropertiesOptions struct {
}

type GetTopicRuntimePropertiesResponse

type GetTopicRuntimePropertiesResponse struct {
	GetTopicRuntimePropertiesResult

	// RawResponse is the *http.Response for the request.
	RawResponse *http.Response
}

type GetTopicRuntimePropertiesResult

type GetTopicRuntimePropertiesResult struct {
	// Value is the result of the request.
	TopicRuntimeProperties
}

type ListQueuesOptions

type ListQueuesOptions struct {
	// MaxPageSize is the maximum size of each page of results.
	MaxPageSize int32
}

ListQueuesOptions can be used to configure the ListQueues method.

type ListQueuesResponse

type ListQueuesResponse struct {
	ListQueuesResult
	RawResponse *http.Response
}

type ListQueuesResult

type ListQueuesResult struct {
	Items []*QueueItem
}

type ListQueuesRuntimePropertiesOptions

type ListQueuesRuntimePropertiesOptions struct {
	// MaxPageSize is the maximum size of each page of results.
	MaxPageSize int32
}

ListQueuesRuntimePropertiesOptions can be used to configure the ListQueuesRuntimeProperties method.

type ListQueuesRuntimePropertiesResponse

type ListQueuesRuntimePropertiesResponse struct {
	Items       []*QueueRuntimePropertiesItem
	RawResponse *http.Response
}

type ListSubscriptionsOptions

type ListSubscriptionsOptions struct {
	// MaxPageSize is the maximum size of each page of results.
	MaxPageSize int32
}

ListSubscriptionsOptions can be used to configure the ListSusbscriptions method.

type ListSubscriptionsResponse

type ListSubscriptionsResponse struct {
	// Value is the result of the request.
	Items []*SubscriptionPropertiesItem
	// RawResponse is the *http.Response for the request.
	RawResponse *http.Response
}

type ListSubscriptionsRuntimePropertiesOptions

type ListSubscriptionsRuntimePropertiesOptions struct {
	// MaxPageSize is the maximum size of each page of results.
	MaxPageSize int32
}

ListSubscriptionsRuntimePropertiesOptions can be used to configure the ListSubscriptionsRuntimeProperties method.

type ListSubscriptionsRuntimePropertiesResponse

type ListSubscriptionsRuntimePropertiesResponse struct {
	// Value is the result of the request.
	Items []*SubscriptionRuntimePropertiesItem
	// RawResponse is the *http.Response for the request.
	RawResponse *http.Response
}

type ListTopicsOptions

type ListTopicsOptions struct {
	// MaxPageSize is the maximum size of each page of results.
	MaxPageSize int32
}

ListTopicsOptions can be used to configure the ListTopics method.

type ListTopicsResponse

type ListTopicsResponse struct {
	// Items is the result of the request.
	Items []*TopicItem
	// RawResponse is the *http.Response for the request.
	RawResponse *http.Response
}

type ListTopicsRuntimePropertiesOptions

type ListTopicsRuntimePropertiesOptions struct {
	// MaxPageSize is the maximum size of each page of results.
	MaxPageSize int32
}

ListTopicsRuntimePropertiesOptions can be used to configure the ListTopicsRuntimeProperties method.

type ListTopicsRuntimePropertiesResponse

type ListTopicsRuntimePropertiesResponse struct {
	// Items is the result of the request.
	Items []*TopicRuntimePropertiesItem
	// RawResponse is the *http.Response for the request.
	RawResponse *http.Response
}

type NamespaceProperties

type NamespaceProperties struct {
	CreatedTime  time.Time
	ModifiedTime time.Time

	SKU            string
	MessagingUnits *int64
	Name           string
}

type QueueItem

type QueueItem struct {
	QueueName string
	QueueProperties
}

type QueuePager

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

QueuePager provides iteration over ListQueues pages.

func (*QueuePager) Err

func (p *QueuePager) Err() error

Err returns the last error encountered while paging.

func (*QueuePager) NextPage

func (p *QueuePager) NextPage(ctx context.Context) bool

NextPage returns true if the pager advanced to the next page. Returns false if there are no more pages or an error occurred.

func (*QueuePager) PageResponse

func (p *QueuePager) PageResponse() *ListQueuesResponse

PageResponse returns the current page.

type QueueProperties

type QueueProperties struct {
	// LockDuration is the duration a message is locked when using the PeekLock receive mode.
	// Default is 1 minute.
	LockDuration *time.Duration

	// MaxSizeInMegabytes - The maximum size of the queue in megabytes, which is the size of memory
	// allocated for the queue.
	// Default is 1024.
	MaxSizeInMegabytes *int32

	// RequiresDuplicateDetection indicates if this queue requires duplicate detection.
	RequiresDuplicateDetection *bool

	// RequiresSession indicates whether the queue supports the concept of sessions.
	// Sessionful-messages follow FIFO ordering.
	// Default is false.
	RequiresSession *bool

	// DefaultMessageTimeToLive is the duration after which the message expires, starting from when
	// the message is sent to Service Bus. This is the default value used when TimeToLive is not
	// set on a message itself.
	DefaultMessageTimeToLive *time.Duration

	// DeadLetteringOnMessageExpiration indicates whether this queue has dead letter
	// support when a message expires.
	DeadLetteringOnMessageExpiration *bool

	// DuplicateDetectionHistoryTimeWindow is the duration of duplicate detection history.
	// Default value is 10 minutes.
	DuplicateDetectionHistoryTimeWindow *time.Duration

	// MaxDeliveryCount is the maximum amount of times a message can be delivered before it is automatically
	// sent to the dead letter queue.
	// Default value is 10.
	MaxDeliveryCount *int32

	// EnableBatchedOperations indicates whether server-side batched operations are enabled.
	EnableBatchedOperations *bool

	// Status is the current status of the queue.
	Status *EntityStatus

	// AutoDeleteOnIdle is the idle interval after which the queue is automatically deleted.
	AutoDeleteOnIdle *time.Duration

	// EnablePartitioning indicates whether the queue is to be partitioned across multiple message brokers.
	EnablePartitioning *bool

	// ForwardTo is the name of the recipient entity to which all the messages sent to the queue
	// are forwarded to.
	ForwardTo *string

	// ForwardDeadLetteredMessagesTo is the absolute URI of the entity to forward dead letter messages
	ForwardDeadLetteredMessagesTo *string

	// UserMetadata is custom metadata that user can associate with the queue.
	UserMetadata *string
}

QueueProperties represents the static properties of the queue.

type QueueRuntimeProperties

type QueueRuntimeProperties struct {
	// SizeInBytes - The size of the queue, in bytes.
	SizeInBytes int64

	// CreatedAt is when the entity was created.
	CreatedAt time.Time

	// UpdatedAt is when the entity was last updated.
	UpdatedAt time.Time

	// AccessedAt is when the entity was last updated.
	AccessedAt time.Time

	// TotalMessageCount is the number of messages in the queue.
	TotalMessageCount int64

	// ActiveMessageCount is the number of active messages in the entity.
	ActiveMessageCount int32

	// DeadLetterMessageCount is the number of dead-lettered messages in the entity.
	DeadLetterMessageCount int32

	// ScheduledMessageCount is the number of messages that are scheduled to be enqueued.
	ScheduledMessageCount int32

	// TransferDeadLetterMessageCount is the number of messages transfer-messages which are dead-lettered
	// into transfer-dead-letter subqueue.
	TransferDeadLetterMessageCount int32

	// TransferMessageCount is the number of messages which are yet to be transferred/forwarded to destination entity.
	TransferMessageCount int32
}

QueueRuntimeProperties represent dynamic properties of a queue, such as the ActiveMessageCount.

type QueueRuntimePropertiesItem

type QueueRuntimePropertiesItem struct {
	QueueName string
	QueueRuntimeProperties
}

type QueueRuntimePropertiesPager

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

QueueRuntimePropertiesPager provides iteration over ListQueueRuntimeProperties pages.

func (*QueueRuntimePropertiesPager) Err

Err returns the last error encountered while paging.

func (*QueueRuntimePropertiesPager) NextPage

NextPage returns true if the pager advanced to the next page. Returns false if there are no more pages or an error occurred.

func (*QueueRuntimePropertiesPager) PageResponse

PageResponse returns the current page.

type RetryOptions added in v0.3.4

type RetryOptions = utils.RetryOptions

RetryOptions represent the options for retries.

type SubscriptionPager

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

SubscriptionPager provides iteration over ListSubscriptions pages.

func (*SubscriptionPager) Err

func (p *SubscriptionPager) Err() error

Err returns the last error encountered while paging.

func (*SubscriptionPager) NextPage

func (p *SubscriptionPager) NextPage(ctx context.Context) bool

NextPage returns true if the pager advanced to the next page. Returns false if there are no more pages or an error occurred.

func (*SubscriptionPager) PageResponse

func (p *SubscriptionPager) PageResponse() *ListSubscriptionsResponse

PageResponse returns the current page.

type SubscriptionProperties

type SubscriptionProperties struct {
	// LockDuration is the duration a message is locked when using the PeekLock receive mode.
	// Default is 1 minute.
	LockDuration *time.Duration

	// RequiresSession indicates whether the subscription supports the concept of sessions.
	// Sessionful-messages follow FIFO ordering.
	// Default is false.
	RequiresSession *bool

	// DefaultMessageTimeToLive is the duration after which the message expires, starting from when
	// the message is sent to Service Bus. This is the default value used when TimeToLive is not
	// set on a message itself.
	DefaultMessageTimeToLive *time.Duration

	// DeadLetteringOnMessageExpiration indicates whether this subscription has dead letter
	// support when a message expires.
	DeadLetteringOnMessageExpiration *bool

	// EnableDeadLetteringOnFilterEvaluationExceptions indicates whether messages need to be
	// forwarded to dead-letter sub queue when subscription rule evaluation fails.
	EnableDeadLetteringOnFilterEvaluationExceptions *bool

	// MaxDeliveryCount is the maximum amount of times a message can be delivered before it is automatically
	// sent to the dead letter queue.
	// Default value is 10.
	MaxDeliveryCount *int32

	// Status is the current status of the subscription.
	Status *EntityStatus

	// AutoDeleteOnIdle is the idle interval after which the subscription is automatically deleted.
	AutoDeleteOnIdle *time.Duration

	// ForwardTo is the name of the recipient entity to which all the messages sent to the topic
	// are forwarded to.
	ForwardTo *string

	// ForwardDeadLetteredMessagesTo is the absolute URI of the entity to forward dead letter messages
	ForwardDeadLetteredMessagesTo *string

	// EnableBatchedOperations indicates whether server-side batched operations are enabled.
	EnableBatchedOperations *bool

	// UserMetadata is custom metadata that user can associate with the subscription.
	UserMetadata *string
}

SubscriptionProperties represents the static properties of the subscription.

type SubscriptionPropertiesItem

type SubscriptionPropertiesItem struct {
	SubscriptionProperties

	TopicName        string
	SubscriptionName string
}

type SubscriptionRuntimeProperties

type SubscriptionRuntimeProperties struct {
	// TotalMessageCount is the number of messages in the subscription.
	TotalMessageCount int64

	// ActiveMessageCount is the number of active messages in the entity.
	ActiveMessageCount int32

	// DeadLetterMessageCount is the number of dead-lettered messages in the entity.
	DeadLetterMessageCount int32

	// TransferMessageCount is the number of messages which are yet to be transferred/forwarded to destination entity.
	TransferMessageCount int32

	// TransferDeadLetterMessageCount is the number of messages transfer-messages which are dead-lettered
	// into transfer-dead-letter subqueue.
	TransferDeadLetterMessageCount int32

	// AccessedAt is when the entity was last updated.
	AccessedAt time.Time

	// CreatedAt is when the entity was created.
	CreatedAt time.Time

	// UpdatedAt is when the entity was last updated.
	UpdatedAt time.Time
}

SubscriptionRuntimeProperties represent dynamic properties of a subscription, such as the ActiveMessageCount.

type SubscriptionRuntimePropertiesItem

type SubscriptionRuntimePropertiesItem struct {
	SubscriptionRuntimeProperties

	TopicName        string
	SubscriptionName string
}

type SubscriptionRuntimePropertiesPager

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

SubscriptionRuntimePropertiesPager provides iteration over ListSubscriptionsRuntimeProperties pages.

func (*SubscriptionRuntimePropertiesPager) Err

Err returns the last error encountered while paging.

func (*SubscriptionRuntimePropertiesPager) NextPage

NextPage returns true if the pager advanced to the next page. Returns false if there are no more pages or an error occurred.

func (*SubscriptionRuntimePropertiesPager) PageResponse

PageResponse returns the current page.

type TopicItem

type TopicItem struct {
	TopicProperties

	TopicName string
}

type TopicProperties

type TopicProperties struct {
	// MaxSizeInMegabytes - The maximum size of the topic in megabytes, which is the size of memory
	// allocated for the topic.
	// Default is 1024.
	MaxSizeInMegabytes *int32

	// RequiresDuplicateDetection indicates if this topic requires duplicate detection.
	RequiresDuplicateDetection *bool

	// DefaultMessageTimeToLive is the duration after which the message expires, starting from when
	// the message is sent to Service Bus. This is the default value used when TimeToLive is not
	// set on a message itself.
	DefaultMessageTimeToLive *time.Duration

	// DuplicateDetectionHistoryTimeWindow is the duration of duplicate detection history.
	// Default value is 10 minutes.
	DuplicateDetectionHistoryTimeWindow *time.Duration

	// EnableBatchedOperations indicates whether server-side batched operations are enabled.
	EnableBatchedOperations *bool

	// Status is the current status of the topic.
	Status *EntityStatus

	// AutoDeleteOnIdle is the idle interval after which the topic is automatically deleted.
	AutoDeleteOnIdle *time.Duration

	// EnablePartitioning indicates whether the topic is to be partitioned across multiple message brokers.
	EnablePartitioning *bool

	// SupportOrdering defines whether ordering needs to be maintained. If true, messages
	// sent to topic will be forwarded to the subscription, in order.
	SupportOrdering *bool

	// UserMetadata is custom metadata that user can associate with the topic.
	UserMetadata *string
}

TopicProperties represents the static properties of the topic.

type TopicRuntimeProperties

type TopicRuntimeProperties struct {
	// SizeInBytes - The size of the topic, in bytes.
	SizeInBytes int64

	// CreatedAt is when the entity was created.
	CreatedAt time.Time

	// UpdatedAt is when the entity was last updated.
	UpdatedAt time.Time

	// AccessedAt is when the entity was last updated.
	AccessedAt time.Time

	// SubscriptionCount is the number of subscriptions to the topic.
	SubscriptionCount int32

	// ScheduledMessageCount is the number of messages that are scheduled to be entopicd.
	ScheduledMessageCount int32
}

TopicRuntimeProperties represent dynamic properties of a topic, such as the ActiveMessageCount.

type TopicRuntimePropertiesItem

type TopicRuntimePropertiesItem struct {
	TopicRuntimeProperties

	TopicName string
}

type TopicRuntimePropertiesPager

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

TopicRuntimePropertiesPager provides iteration over TopicRuntimeProperties pages.

func (*TopicRuntimePropertiesPager) Err

Err returns the last error encountered while paging.

func (*TopicRuntimePropertiesPager) NextPage

NextPage returns true if the pager advanced to the next page. Returns false if there are no more pages or an error occurred.

func (*TopicRuntimePropertiesPager) PageResponse

PageResponse returns the current page.

type TopicsPager

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

TopicsPager provides iteration over TopicProperties pages.

func (*TopicsPager) Err

func (p *TopicsPager) Err() error

Err returns the last error encountered while paging.

func (*TopicsPager) NextPage

func (p *TopicsPager) NextPage(ctx context.Context) bool

NextPage returns true if the pager advanced to the next page. Returns false if there are no more pages or an error occurred.

func (*TopicsPager) PageResponse

func (p *TopicsPager) PageResponse() *ListTopicsResponse

PageResponse returns the current page.

type UpdateQueueOptions

type UpdateQueueOptions struct {
}

type UpdateQueueResponse

type UpdateQueueResponse struct {
	UpdateQueueResult

	// RawResponse is the *http.Response for the request.
	RawResponse *http.Response
}

type UpdateQueueResult

type UpdateQueueResult struct {
	QueueProperties
}

type UpdateSubscriptionOptions

type UpdateSubscriptionOptions struct {
}

type UpdateSubscriptionResponse

type UpdateSubscriptionResponse struct {
	UpdateSubscriptionResult

	// RawResponse is the *http.Response for the request.
	RawResponse *http.Response
}

type UpdateSubscriptionResult

type UpdateSubscriptionResult struct {
	SubscriptionProperties
}

type UpdateTopicOptions

type UpdateTopicOptions struct {
}

type UpdateTopicResponse

type UpdateTopicResponse struct {
	UpdateTopicResult

	// RawResponse is the *http.Response for the request.
	RawResponse *http.Response
}

type UpdateTopicResult

type UpdateTopicResult struct {
	TopicProperties
}

Jump to

Keyboard shortcuts

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