admin

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2022 License: MIT Imports: 15 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 AccessRight added in v0.4.1

type AccessRight string

AccessRight is an access right (Manage, Send, Listen) for an AuthorizationRule.

const (
	// AccessRightManage allows changes to an entity.
	AccessRightManage AccessRight = "Manage"
	// AccessRightSend allows you to send messages to this entity.
	AccessRightSend AccessRight = "Send"
	// AccessRightListen allows you to receive messages from this entity.
	AccessRightListen AccessRight = "Listen"
)

type AuthorizationRule added in v0.4.1

type AuthorizationRule struct {
	// AccessRights for this rule.
	AccessRights []AccessRight

	// KeyName for this rule.
	KeyName *string

	// CreatedTime for this rule.
	CreatedTime *time.Time

	// ModifiedTime for this rule.
	ModifiedTime *time.Time

	// PrimaryKey for this rule.
	PrimaryKey *string

	// SecondaryKey for this rule.
	SecondaryKey *string
}

AuthorizationRule is a rule with keys and rights associated with an entity.

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. connectionString can be a Service Bus connection string for the namespace or for an entity, which contains a SharedAccessKeyName and SharedAccessKey properties (for instance, from the Azure Portal):

Endpoint=sb://<sb>.servicebus.windows.net/;SharedAccessKeyName=<key name>;SharedAccessKey=<key value>

Or it can be a connection string with a SharedAccessSignature:

Endpoint=sb://<sb>.servicebus.windows.net;SharedAccessSignature=SharedAccessSignature sr=<sb>.servicebus.windows.net&sig=<base64-sig>&se=<expiry>&skn=<keyname>
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, 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)
	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"

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

func main() {
	maxDeliveryCount := int32(10)

	resp, err := adminClient.CreateQueue(context.TODO(), "queue-name", &admin.CreateQueueOptions{
		Properties: &admin.QueueProperties{
			// some example properties
			LockDuration:     to.Ptr("PT1M"),
			MaxDeliveryCount: &maxDeliveryCount,
		},
	})
	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) CreateRule added in v0.4.1

func (ac *Client) CreateRule(ctx context.Context, topicName string, subscriptionName string, options *CreateRuleOptions) (CreateRuleResponse, error)

CreateRule creates a rule that can filter and update message for a subscription.

func (*Client) CreateSubscription

func (ac *Client) CreateSubscription(ctx context.Context, topicName string, subscriptionName string, 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, 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) DeleteRule added in v0.4.1

func (ac *Client) DeleteRule(ctx context.Context, topicName string, subscriptionName string, ruleName string, options *DeleteRuleOptions) (DeleteRuleResponse, error)

DeleteRule deletes a rule for a subscription.

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. If the entity does not exist this function will return a nil GetQueueResponse and a nil error.

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. If the entity does not exist this function will return a nil GetQueueRuntimePropertiesResponse and a nil error.

func (*Client) GetRule added in v0.4.1

func (ac *Client) GetRule(ctx context.Context, topicName string, subscriptionName string, ruleName string, options *GetRuleOptions) (*GetRuleResponse, error)

GetRule gets a rule for a subscription.

func (*Client) GetSubscription

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

GetSubscription gets a subscription by name. If the entity does not exist this function will return a nil GetSubscriptionResponse and a nil error.

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. If the entity does not exist this function will return a nil GetSubscriptionRuntimePropertiesResponse and a nil error.

func (*Client) GetTopic

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

GetTopic gets a topic by name. If the entity does not exist this function will return a nil GetTopicResponse and a nil error.

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. If the entity does not exist this function will return a nil GetTopicRuntimePropertiesResponse and a nil error.

func (*Client) NewListQueuesPager added in v0.4.1

func (ac *Client) NewListQueuesPager(options *ListQueuesOptions) *runtime.Pager[ListQueuesResponse]

NewListQueuesPager creates a pager that can be used to list queues.

Example
package main

import (
	"context"
	"fmt"

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

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

	for queuePager.More() {
		page, err := queuePager.NextPage(context.TODO())

		if err != nil {
			panic(err)
		}

		for _, queue := range page.Queues {
			fmt.Printf("Queue name: %s, max size in MB: %d\n", queue.QueueName, *queue.MaxSizeInMegabytes)
		}
	}
}

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

func (*Client) NewListQueuesRuntimePropertiesPager added in v0.4.1

func (ac *Client) NewListQueuesRuntimePropertiesPager(options *ListQueuesRuntimePropertiesOptions) *runtime.Pager[ListQueuesRuntimePropertiesResponse]

NewListQueuesRuntimePropertiesPager creates a pager that lists the 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.NewListQueuesRuntimePropertiesPager(nil)

	for queuePager.More() {
		page, err := queuePager.NextPage(context.TODO())

		if err != nil {
			panic(err)
		}

		for _, queue := range page.QueueRuntimeProperties {
			fmt.Printf("Queue name: %s, active messages: %d\n", queue.QueueName, queue.ActiveMessageCount)
		}
	}
}

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

func (*Client) NewListRulesPager added in v0.4.1

func (ac *Client) NewListRulesPager(topicName string, subscriptionName string, options *ListRulesOptions) *runtime.Pager[ListRulesResponse]

NewListRulesPager creates a pager that can list rules for a subscription.

func (*Client) NewListSubscriptionsPager added in v0.4.1

func (ac *Client) NewListSubscriptionsPager(topicName string, options *ListSubscriptionsOptions) *runtime.Pager[ListSubscriptionsResponse]

NewListSubscriptionsPager creates a pager than can list subscriptions for a topic.

func (*Client) NewListSubscriptionsRuntimePropertiesPager added in v0.4.1

func (ac *Client) NewListSubscriptionsRuntimePropertiesPager(topicName string, options *ListSubscriptionsRuntimePropertiesOptions) *runtime.Pager[ListSubscriptionsRuntimePropertiesResponse]

NewListSubscriptionsRuntimePropertiesPager creates a pager than can list runtime properties for subscriptions for a topic.

func (*Client) NewListTopicsPager added in v0.4.1

func (ac *Client) NewListTopicsPager(options *ListTopicsOptions) *runtime.Pager[ListTopicsResponse]

NewListTopicsPager creates a pager that can list topics.

func (*Client) NewListTopicsRuntimePropertiesPager added in v0.4.1

func (ac *Client) NewListTopicsRuntimePropertiesPager(options *ListTopicsRuntimePropertiesOptions) *runtime.Pager[ListTopicsRuntimePropertiesResponse]

NewListTopicsRuntimePropertiesPager creates a pager than can list 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) UpdateRule added in v0.4.1

func (ac *Client) UpdateRule(ctx context.Context, topicName string, subscriptionName string, properties RuleProperties) (UpdateRuleResponse, error)

UpdateRule updates a rule for a subscription.

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 {
	azcore.ClientOptions
}

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

type CorrelationFilter added in v0.4.1

type CorrelationFilter struct {
	// ApplicationProperties will be matched against the application properties for the message.
	ApplicationProperties map[string]interface{}

	// ContentType will be matched against the ContentType property for the message.
	ContentType *string

	// CorrelationID will be matched against the CorrelationID property for the message.
	CorrelationID *string

	// MessageID will be matched against the MessageID property for the message.
	MessageID *string

	// ReplyTo will be matched against the ReplyTo property for the message.
	ReplyTo *string

	// ReplyToSessionID will be matched against the ReplyToSessionID property for the message.
	ReplyToSessionID *string

	// SessionID will be matched against the SessionID property for the message.
	SessionID *string

	// Subject will be matched against the Subject property for the message.
	Subject *string

	// To will be matched against the To property for the message.
	To *string
}

CorrelationFilter represents a set of conditions that are matched against user and system properties of messages for a subscription.

type CreateQueueOptions

type CreateQueueOptions struct {
	// Properties for the queue.
	Properties *QueueProperties
}

CreateQueueOptions contains the optional parameters for Client.CreateQueue

type CreateQueueResponse

type CreateQueueResponse struct {
	QueueProperties
}

CreateQueueResponse contains the response fields for Client.CreateQueue

type CreateRuleOptions added in v0.4.1

type CreateRuleOptions struct {
	// Name is the name of the rule or nil, which will default to $Default
	Name *string

	// Filter is the filter that will be used for Rule.
	// Valid types: *SQLFilter, *CorrelationFilter, *FalseFilter, *TrueFilter
	Filter RuleFilter

	// Action is the action that will be used for Rule.
	// Valid types: *SQLAction
	Action RuleAction
}

CreateRuleOptions contains the optional parameters for Client.CreateRule

type CreateRuleResponse added in v0.4.1

type CreateRuleResponse struct {
	RuleProperties
}

CreateRuleResponse contains the response fields for Client.CreateRule

type CreateSubscriptionOptions

type CreateSubscriptionOptions struct {
	// Properties for the subscription.
	Properties *SubscriptionProperties
}

CreateSubscriptionOptions contains optional parameters for Client.CreateSubscription

type CreateSubscriptionResponse

type CreateSubscriptionResponse struct {
	SubscriptionProperties
}

CreateSubscriptionResponse contains response fields for Client.CreateSubscription

type CreateTopicOptions

type CreateTopicOptions struct {
	// Properties for the topic.
	Properties *TopicProperties
}

CreateTopicOptions contains optional parameters for Client.CreateTopic

type CreateTopicResponse

type CreateTopicResponse struct {
	TopicProperties
}

CreateTopicResponse contains response fields for Client.CreateTopic

type DeleteQueueOptions

type DeleteQueueOptions struct {
}

DeleteQueueOptions contains optional parameters for Client.DeleteQueue

type DeleteQueueResponse

type DeleteQueueResponse struct {
}

DeleteQueueResponse contains response fields for Client.DeleteQueue

type DeleteRuleOptions added in v0.4.1

type DeleteRuleOptions struct {
}

DeleteRuleOptions can be used to configure the Client.DeleteRule method.

type DeleteRuleResponse added in v0.4.1

type DeleteRuleResponse struct {
}

DeleteRuleResponse contains the response fields for Client.DeleteRule

type DeleteSubscriptionOptions

type DeleteSubscriptionOptions struct {
}

DeleteSubscriptionOptions contains optional parameters for Client.DeleteSubscription

type DeleteSubscriptionResponse

type DeleteSubscriptionResponse struct {
}

DeleteSubscriptionResponse contains response fields for Client.DeleteSubscription

type DeleteTopicOptions

type DeleteTopicOptions struct {
}

DeleteTopicOptions contains optional parameters for Client.DeleteTopic

type DeleteTopicResponse

type DeleteTopicResponse struct {
	// Value is the result of the request.
	Value *TopicProperties
}

DeleteTopicResponse contains the response fields for Client.DeleteTopic

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 FalseFilter added in v0.4.1

type FalseFilter struct{}

FalseFilter is a filter that always evaluates to false for any message.

type GetNamespacePropertiesOptions

type GetNamespacePropertiesOptions struct {
}

GetNamespacePropertiesOptions contains the optional parameters of Client.GetNamespaceProperties

type GetNamespacePropertiesResponse

type GetNamespacePropertiesResponse struct {
	NamespaceProperties
}

GetNamespacePropertiesResponse contains the response fields of Client.GetNamespaceProperties method

type GetQueueOptions

type GetQueueOptions struct {
}

GetQueueOptions contains the optional parameters for Client.GetQueue

type GetQueueResponse

type GetQueueResponse struct {
	QueueProperties
}

GetQueueResponse contains the response fields for Client.GetQueue

type GetQueueRuntimePropertiesOptions

type GetQueueRuntimePropertiesOptions struct {
}

GetQueueRuntimePropertiesOptions contains optional parameters for client.GetQueueRuntimeProperties

type GetQueueRuntimePropertiesResponse

type GetQueueRuntimePropertiesResponse struct {
	QueueRuntimeProperties
}

GetQueueRuntimePropertiesResponse contains response fields for Client.GetQueueRuntimeProperties

type GetRuleOptions added in v0.4.1

type GetRuleOptions struct {
}

GetRuleOptions contains the optional parameters for Client.GetRule

type GetRuleResponse added in v0.4.1

type GetRuleResponse struct {
	// RuleProperties for the rule.
	RuleProperties
}

GetRuleResponse contains the response fields for Client.GetRule

type GetSubscriptionOptions

type GetSubscriptionOptions struct {
}

GetSubscriptionOptions contains optional parameters for Client.GetSubscription

type GetSubscriptionResponse

type GetSubscriptionResponse struct {
	SubscriptionProperties
}

GetSubscriptionResponse contains response fields for Client.GetSubscription

type GetSubscriptionRuntimePropertiesOptions

type GetSubscriptionRuntimePropertiesOptions struct {
}

GetSubscriptionRuntimePropertiesOptions contains optional parameters for Client.GetSubscriptionRuntimeProperties

type GetSubscriptionRuntimePropertiesResponse

type GetSubscriptionRuntimePropertiesResponse struct {
	SubscriptionRuntimeProperties
}

GetSubscriptionRuntimePropertiesResponse contains response fields for Client.GetSubscriptionRuntimeProperties

type GetTopicOptions

type GetTopicOptions struct {
}

GetTopicOptions contains optional parameters for Client.GetTopic

type GetTopicResponse

type GetTopicResponse struct {
	TopicProperties
}

GetTopicResponse contains response fields for Client.GetTopic

type GetTopicRuntimePropertiesOptions

type GetTopicRuntimePropertiesOptions struct {
}

GetTopicRuntimePropertiesOptions contains optional parameters for Client.GetTopicRuntimeProperties

type GetTopicRuntimePropertiesResponse

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

GetTopicRuntimePropertiesResponse contains the result for Client.GetTopicRuntimeProperties

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 {
	Queues []QueueItem
}

ListQueuesResponse contains the response fields for QueuePager.PageResponse

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 {
	QueueRuntimeProperties []QueueRuntimePropertiesItem
}

ListQueuesRuntimePropertiesResponse contains the page response for QueueRuntimePropertiesPager.PageResponse

type ListRulesOptions added in v0.4.1

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

ListRulesOptions contains the optional parameters for Client.ListRules

type ListRulesResponse added in v0.4.1

type ListRulesResponse struct {
	// Rules are all the rules for the page.
	Rules []RuleProperties
}

ListRulesResponse contains the response fields for the pager returned from Client.ListRules.

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.
	Subscriptions []SubscriptionPropertiesItem
}

ListSubscriptionsResponse contains the response fields for SubscriptionPager.PageResponse

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.
	SubscriptionRuntimeProperties []SubscriptionRuntimePropertiesItem
}

ListSubscriptionsRuntimePropertiesResponse contains the response fields for SubscriptionRuntimePropertiesPager.PageResponse

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 {
	// Topics is the result of the request.
	Topics []TopicItem
}

ListTopicsResponse contains response fields for the Client.PageResponse method

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 {
	// TopicRuntimeProperties is the result of the request.
	TopicRuntimeProperties []TopicRuntimePropertiesItem
}

ListTopicsRuntimePropertiesResponse contains response fields for TopicRuntimePropertiesPager.PageResponse

type NamespaceProperties

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

	SKU            string
	MessagingUnits *int64
	Name           string
}

NamespaceProperties are the properties associated with a given namespace

type QueueItem

type QueueItem struct {
	QueueName string
	QueueProperties
}

QueueItem contains the data from the Client.ListQueues pager

type QueueProperties

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

	// 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 *string

	// 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 *string

	// 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 *string

	// 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

	// AuthorizationRules are the authorization rules for this entity.
	AuthorizationRules []AuthorizationRule

	// Maximum size (in KB) of the message payload that can be accepted by the queue. This feature is only available when
	// using Service Bus Premium.
	MaxMessageSizeInKilobytes *int64
}

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
}

QueueRuntimePropertiesItem contains a single item in the page response for QueueRuntimePropertiesPager.PageResponse

type RetryOptions added in v0.3.4

type RetryOptions = exported.RetryOptions

RetryOptions represent the options for retries.

type Rule added in v0.4.1

type Rule struct {
	// Filter is the filter that will be used for Rule.
	// Valid types: *SQLFilter, *CorrelationFilter, *FalseFilter, *TrueFilter
	Filter RuleFilter

	// Action is the action that will be used for Rule.
	// Valid types: *SQLAction
	Action RuleAction
}

Rule specifies a message filter and action for a subscription.

type RuleAction added in v0.4.1

type RuleAction interface {
	// contains filtered or unexported methods
}

RuleAction is an action for a subscription rule. Implemented by: *SQLAction

type RuleFilter added in v0.4.1

type RuleFilter interface {
	// contains filtered or unexported methods
}

RuleFilter is a filter for a subscription rule. Implemented by: *SQLFilter, *CorrelationFilter, *FalseFilter, *TrueFilter

type RuleProperties added in v0.4.1

type RuleProperties struct {
	// Name is the name of this rule.
	Name string

	// Filter is the filter that will be used for Rule.
	// Valid types: *SQLFilter, *CorrelationFilter, *FalseFilter, *TrueFilter
	Filter RuleFilter

	// Action is the action that will be used for Rule.
	// Valid types: *SQLAction
	Action RuleAction
}

RuleProperties are the properties for a rule.

type SQLAction added in v0.4.1

type SQLAction struct {
	// Expression is a SQL Expression
	Expression string

	// Parameters is a map of string to values of type string, number, or boolean.
	Parameters map[string]interface{}
}

SQLAction is an action that updates a message according to its expression.

type SQLFilter added in v0.4.1

type SQLFilter struct {
	// Expression is a SQL Expression
	Expression string

	// Parameters is a map of string to values of type string, number, or boolean.
	Parameters map[string]interface{}
}

SQLFilter is a filter that evaluates to true for any message that matches its expression.

type SubscriptionProperties

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

	// 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 *string

	// 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 *string

	// 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
}

SubscriptionPropertiesItem contains a single item for SubscriptionPager.PageResponse

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
}

SubscriptionRuntimePropertiesItem contains the data from a SubscriptionRuntimePropertiesPager.PageResponse method

type TopicItem

type TopicItem struct {
	TopicProperties

	TopicName string
}

TopicItem is the data returned by the Client.ListTopics pager

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 *string

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

	// 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 *string

	// 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

	// AuthorizationRules are the authorization rules for this entity.
	AuthorizationRules []AuthorizationRule

	// Maximum size (in KB) of the message payload that can be accepted by the topic. This feature is only available when
	// using Service Bus Premium.
	MaxMessageSizeInKilobytes *int64
}

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
}

TopicRuntimePropertiesItem contains fields for the Client.ListTopicsRuntimeProperties method

type TrueFilter added in v0.4.1

type TrueFilter struct{}

TrueFilter is a filter that always evaluates to true for any message.

type UnknownRuleAction added in v0.4.1

type UnknownRuleAction struct {
	// Type is the Service Bus type for this action.
	Type string

	// RawXML is the raw XML for this action that could not be parsed.
	RawXML []byte
}

UnknownRuleAction is an action type not yet handled by this SDK. If you get this type back you should update to a newer version of the SDK which properly represents this type.

type UnknownRuleFilter added in v0.4.1

type UnknownRuleFilter struct {
	// Type is the Service Bus type for this filter.
	Type string

	// RawXML is the raw XML for this rule that could not be parsed.
	RawXML []byte
}

UnknownRuleFilter is a filter type not yet handled by this SDK. If you get this type back you should update to a newer version of the SDK which properly represents this type.

type UpdateQueueOptions

type UpdateQueueOptions struct {
}

UpdateQueueOptions contains optional parameters for Client.UpdateQueue

type UpdateQueueResponse

type UpdateQueueResponse struct {
	QueueProperties
}

UpdateQueueResponse contains the response fields for Client.UpdateQueue

type UpdateRuleOptions added in v0.4.1

type UpdateRuleOptions struct {
}

UpdateRuleOptions can be used to configure the UpdateRule method.

type UpdateRuleResponse added in v0.4.1

type UpdateRuleResponse struct {
	// RuleProperties for the updated rule.
	RuleProperties
}

UpdateRuleResponse contains the response fields for Client.UpdateRule

type UpdateSubscriptionOptions

type UpdateSubscriptionOptions struct {
}

UpdateSubscriptionOptions contains the optional parameters for Client.UpdateSubscription

type UpdateSubscriptionResponse

type UpdateSubscriptionResponse struct {
	SubscriptionProperties
}

UpdateSubscriptionResponse contains the response fields for Client.UpdateSubscription

type UpdateTopicOptions

type UpdateTopicOptions struct {
}

UpdateTopicOptions contains optional parameters for Client.UpdateTopic

type UpdateTopicResponse

type UpdateTopicResponse struct {
	TopicProperties
}

UpdateTopicResponse contains response fields for Client.UpdateTopic

Jump to

Keyboard shortcuts

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