Documentation
¶
Index ¶
- Variables
- func CloseRes(ctx context.Context, res *http.Response)
- func FormatManagementError(body []byte, origErr error) error
- func StringToTime(timeStr string) (time.Time, error)
- type ActionDescription
- type Author
- type AuthorizationRule
- type BaseEntityDescription
- type Content
- type CorrelationFilter
- type CountDetails
- type DefaultRuleDescription
- type Entity
- type EntityManager
- type EntityStatus
- type Entry
- type ExecuteOptions
- type Feed
- type FilterDescription
- type KeyValueList
- type KeyValueOfstringanyType
- type Link
- type ManagementError
- type NamespaceEntry
- type NamespaceInfo
- type QueueContent
- type QueueDescription
- type QueueEntity
- type QueueEnvelope
- type QueueFeed
- type RuleContent
- type RuleDescription
- type RuleEntity
- type RuleEnvelope
- type RuleFeed
- type SubscriptionContent
- type SubscriptionDescription
- type SubscriptionEntity
- type SubscriptionEnvelope
- type SubscriptionFeed
- type TempRuleEnvelope
- type TopicContent
- type TopicDescription
- type TopicEntity
- type TopicEnvelope
- type TopicFeed
- type Value
Constants ¶
This section is empty.
Variables ¶
var ErrFeedEmpty = errors.New("entity does not exist")
Functions ¶
func FormatManagementError ¶
Types ¶
type ActionDescription ¶
type ActionDescription struct { Type string `xml:"http://www.w3.org/2001/XMLSchema-instance type,attr"` SQLExpression string `xml:"SqlExpression,omitempty"` Parameters *KeyValueList `xml:"Parameters,omitempty"` // RawXML is any XML that wasn't covered by our known properties. RawXML []byte `xml:",innerxml"` // RawAttrs are attributes for the raw XML element that wasn't covered by our known properties. RawAttrs []xml.Attr `xml:",any,attr"` }
ActionDescription describes an action upon a message that matches a filter
With SQL filter conditions, you can define an action that can annotate the message by adding, removing, or replacing properties and their values. The action uses a SQL-like expression that loosely leans on the SQL UPDATE statement syntax. The action is performed on the message after it has been matched and before the message is selected into the subscription. The changes to the message properties are private to the message copied into the subscription.
type AuthorizationRule ¶
type AuthorizationRule struct { // Type is the type attribute, which indicates the type of AuthorizationRule // (today this is only `SharedAccessAuthorizationRule`) Type string `xml:"http://www.w3.org/2001/XMLSchema-instance type,attr"` ClaimType string `xml:"ClaimType"` ClaimValue string `xml:"ClaimValue"` // SharedAccessAuthorizationRule properties Rights []string `xml:"Rights>AccessRights"` KeyName *string `xml:"KeyName"` CreatedTime *time.Time `xml:"CreatedTime"` ModifiedTime *time.Time `xml:"ModifiedTime"` PrimaryKey *string `xml:"PrimaryKey"` SecondaryKey *string `xml:"SecondaryKey"` }
All
type BaseEntityDescription ¶
type BaseEntityDescription struct { InstanceMetadataSchema *string `xml:"xmlns:i,attr,omitempty"` ServiceBusSchema *string `xml:"xmlns,attr,omitempty"` }
BaseEntityDescription provides common fields which are part of Queues, Topics and Subscriptions
type Content ¶
type Content struct { XMLName xml.Name `xml:"content"` Type string `xml:"type,attr"` Body string `xml:",innerxml"` }
Content is a generic body for an Atom entry
type CorrelationFilter ¶
type CorrelationFilter struct { CorrelationID *string `xml:"CorrelationId,omitempty"` MessageID *string `xml:"MessageId,omitempty"` To *string `xml:"To,omitempty"` ReplyTo *string `xml:"ReplyTo,omitempty"` Label *string `xml:"Label,omitempty"` SessionID *string `xml:"SessionId,omitempty"` ReplyToSessionID *string `xml:"ReplyToSessionId,omitempty"` ContentType *string `xml:"ContentType,omitempty"` Properties *KeyValueList `xml:"Properties,omitempty"` }
CorrelationFilter holds a set of conditions that are matched against one or more of an arriving message's user and system properties. A common use is to match against the CorrelationId property, but the application can also choose to match against ContentType, Label, MessageId, ReplyTo, ReplyToSessionId, SessionId, To, and any user-defined properties. A match exists when an arriving message's value for a property is equal to the value specified in the correlation filter. For string expressions, the comparison is case-sensitive. When specifying multiple match properties, the filter combines them as a logical AND condition, meaning for the filter to match, all conditions must match.
type CountDetails ¶
type CountDetails struct { XMLName xml.Name `xml:"CountDetails"` ActiveMessageCount *int32 `xml:"ActiveMessageCount,omitempty"` DeadLetterMessageCount *int32 `xml:"DeadLetterMessageCount,omitempty"` ScheduledMessageCount *int32 `xml:"ScheduledMessageCount,omitempty"` TransferDeadLetterMessageCount *int32 `xml:"TransferDeadLetterMessageCount,omitempty"` TransferMessageCount *int32 `xml:"TransferMessageCount,omitempty"` }
CountDetails has current active (and other) messages for queue/topic.
type DefaultRuleDescription ¶
type DefaultRuleDescription struct { XMLName xml.Name `xml:"DefaultRuleDescription"` Filter *FilterDescription `xml:"Filter"` Action *ActionDescription `xml:"Action,omitempty"` Name string `xml:"Name,omitempty"` }
DefaultRuleDescription is the content type for Subscription Rule management requests
type EntityManager ¶
type EntityManager interface { Get(ctx context.Context, entityPath string, respObj any) (*http.Response, error) Put(ctx context.Context, entityPath string, body any, respObj any, options *ExecuteOptions) (*http.Response, error) Delete(ctx context.Context, entityPath string) (*http.Response, error) TokenProvider() auth.TokenProvider }
func NewEntityManager ¶
func NewEntityManager(ns string, tokenCredential azcore.TokenCredential, version string, options *azcore.ClientOptions) (EntityManager, error)
NewEntityManager creates an entity manager using a TokenCredential.
func NewEntityManagerWithConnectionString ¶
func NewEntityManagerWithConnectionString(connectionString string, version string, options *azcore.ClientOptions) (EntityManager, error)
NewEntityManagerWithConnectionString creates an entity manager (a lower level HTTP client for the ATOM endpoint). This is typically wrapped by an entity specific client (like TopicManager, QueueManager or , SubscriptionManager).
type EntityStatus ¶
type EntityStatus string
EntityStatus enumerates the values for entity status.
const ( // Active ... Active EntityStatus = "Active" // Creating ... Creating EntityStatus = "Creating" // Deleting ... Deleting EntityStatus = "Deleting" // Disabled ... Disabled EntityStatus = "Disabled" // ReceiveDisabled ... ReceiveDisabled EntityStatus = "ReceiveDisabled" // Renaming ... Renaming EntityStatus = "Renaming" // Restoring ... Restoring EntityStatus = "Restoring" // SendDisabled ... SendDisabled EntityStatus = "SendDisabled" // Unknown ... Unknown EntityStatus = "Unknown" )
type Entry ¶
type Entry struct { XMLName xml.Name `xml:"entry"` ID string `xml:"id,omitempty"` Title string `xml:"title,omitempty"` Author *Author `xml:"author,omitempty"` Link *Link `xml:"link,omitempty"` Content *Content `xml:"content"` DataServiceSchema string `xml:"xmlns:d,attr,omitempty"` DataServiceMetadataSchema string `xml:"xmlns:m,attr,omitempty"` AtomSchema string `xml:"xmlns,attr"` }
Entry is the Atom wrapper for a management request
type ExecuteOptions ¶
type Feed ¶
type Feed struct { XMLName xml.Name `xml:"feed"` ID string `xml:"id"` Title string `xml:"title"` Entries []Entry `xml:"entry"` }
Feed is an Atom feed which contains entries
type FilterDescription ¶
type FilterDescription struct { XMLName xml.Name `xml:"Filter"` // RawXML is any XML that wasn't covered by our known properties. RawXML []byte `xml:",innerxml"` // RawAttrs are attributes for the raw XML element that wasn't covered by our known properties. RawAttrs []xml.Attr `xml:",any,attr"` CorrelationFilter Type string `xml:"http://www.w3.org/2001/XMLSchema-instance type,attr"` SQLExpression *string `xml:"SqlExpression,omitempty"` CompatibilityLevel int `xml:"CompatibilityLevel,omitempty"` Parameters *KeyValueList `xml:"Parameters,omitempty"` }
FilterDescription describes a filter which can be applied to a subscription to filter messages from the topic.
Subscribers can define which messages they want to receive from a topic. These messages are specified in the form of one or more named subscription rules. Each rule consists of a condition that selects particular messages and an action that annotates the selected message. For each matching rule condition, the subscription produces a copy of the message, which may be differently annotated for each matching rule.
Each newly created topic subscription has an initial default subscription rule. If you don't explicitly specify a filter condition for the rule, the applied filter is the true filter that enables all messages to be selected into the subscription. The default rule has no associated annotation action.
type KeyValueList ¶
type KeyValueList struct {
KeyValues []KeyValueOfstringanyType `xml:"KeyValueOfstringanyType,omitempty"`
}
Filters
type KeyValueOfstringanyType ¶
Subscriptions (and rules)
type Link ¶
type Link struct { XMLName xml.Name `xml:"link"` Rel string `xml:"rel,attr"` HREF string `xml:"href,attr"` }
Link is an Atom link used in an entry
type ManagementError ¶
type ManagementError struct { XMLName xml.Name `xml:"Error"` Code int `xml:"Code"` Detail string `xml:"Detail"` }
example: <Error><Code>401</Code><Detail>Manage,EntityRead claims required for this operation.</Detail></Error>
func (*ManagementError) String ¶
func (m *ManagementError) String() string
type NamespaceEntry ¶
type NamespaceEntry struct {
NamespaceInfo *NamespaceInfo `xml:"content>NamespaceInfo"`
}
type NamespaceInfo ¶
type QueueContent ¶
type QueueContent struct { XMLName xml.Name `xml:"content"` Type string `xml:"type,attr"` QueueDescription QueueDescription `xml:"QueueDescription"` }
QueueContent is a specialized Queue body for an Atom entry
type QueueDescription ¶
type QueueDescription struct { XMLName xml.Name `xml:"QueueDescription"` BaseEntityDescription LockDuration *string `xml:"LockDuration,omitempty"` // LockDuration - ISO 8601 timespan duration of a peek-lock; that is, the amount of time that the message is locked for other receivers. The maximum value for LockDuration is 5 minutes; the default value is 1 minute. MaxSizeInMegabytes *int32 `xml:"MaxSizeInMegabytes,omitempty"` // MaxSizeInMegabytes - The maximum size of the queue in megabytes, which is the size of memory allocated for the queue. Default is 1024. RequiresDuplicateDetection *bool `xml:"RequiresDuplicateDetection,omitempty"` // RequiresDuplicateDetection - A value indicating if this queue requires duplicate detection. RequiresSession *bool `xml:"RequiresSession,omitempty"` DefaultMessageTimeToLive *string `xml:"DefaultMessageTimeToLive,omitempty"` // DefaultMessageTimeToLive - ISO 8601 default message timespan to live value. This 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. DeadLetteringOnMessageExpiration *bool `xml:"DeadLetteringOnMessageExpiration,omitempty"` // DeadLetteringOnMessageExpiration - A value that indicates whether this queue has dead letter support when a message expires. DuplicateDetectionHistoryTimeWindow *string `xml:"DuplicateDetectionHistoryTimeWindow,omitempty"` // DuplicateDetectionHistoryTimeWindow - ISO 8601 timeSpan structure that defines the duration of the duplicate detection history. The default value is 10 minutes. MaxDeliveryCount *int32 `xml:"MaxDeliveryCount,omitempty"` // MaxDeliveryCount - The maximum delivery count. A message is automatically deadlettered after this number of deliveries. default value is 10. EnableBatchedOperations *bool `xml:"EnableBatchedOperations,omitempty"` // EnableBatchedOperations - Value that indicates whether server-side batched operations are enabled. SizeInBytes *int64 `xml:"SizeInBytes,omitempty"` // SizeInBytes - The size of the queue, in bytes. MessageCount *int64 `xml:"MessageCount,omitempty"` // MessageCount - The number of messages in the queue. IsAnonymousAccessible *bool `xml:"IsAnonymousAccessible,omitempty"` AuthorizationRules []AuthorizationRule `xml:"AuthorizationRules>AuthorizationRule,omitempty"` Status *EntityStatus `xml:"Status,omitempty"` AccessedAt string `xml:"AccessedAt,omitempty"` CreatedAt string `xml:"CreatedAt,omitempty"` UpdatedAt string `xml:"UpdatedAt,omitempty"` SupportOrdering *bool `xml:"SupportOrdering,omitempty"` AutoDeleteOnIdle *string `xml:"AutoDeleteOnIdle,omitempty"` EnablePartitioning *bool `xml:"EnablePartitioning,omitempty"` EnableExpress *bool `xml:"EnableExpress,omitempty"` CountDetails *CountDetails `xml:"CountDetails,omitempty"` ForwardTo *string `xml:"ForwardTo,omitempty"` ForwardDeadLetteredMessagesTo *string `xml:"ForwardDeadLetteredMessagesTo,omitempty"` // ForwardDeadLetteredMessagesTo - absolute URI of the entity to forward dead letter messages UserMetadata *string `xml:"UserMetadata,omitempty"` MaxMessageSizeInKilobytes *int64 `xml:"MaxMessageSizeInKilobytes,omitempty"` }
QueueDescription is the content type for Queue management requests
type QueueEntity ¶
type QueueEntity struct { *QueueDescription *Entity }
QueueEntity is the Azure Service Bus description of a Queue for management activities
type QueueEnvelope ¶
type QueueEnvelope struct { *Entry Content *QueueContent `xml:"content"` }
QueueEnvelope is a specialized Queue feed entry
func WrapWithQueueEnvelope ¶
func WrapWithQueueEnvelope(qd *QueueDescription, tokenProvider auth.TokenProvider) *QueueEnvelope
type QueueFeed ¶
type QueueFeed struct { *Feed Entries []QueueEnvelope `xml:"entry"` }
QueueFeed is a specialized feed containing QueueEntries
func (QueueFeed) Items ¶
func (qf QueueFeed) Items() []QueueEnvelope
type RuleContent ¶
type RuleContent struct { XMLName xml.Name `xml:"content"` Type string `xml:"type,attr"` RuleDescription RuleDescription `xml:"RuleDescription"` }
RuleContent is a specialized Subscription body for an Atom entry
type RuleDescription ¶
type RuleDescription struct { XMLName xml.Name `xml:"RuleDescription"` XMLNS string `xml:"xmlns,attr"` XMLNSI string `xml:"xmlns:i,attr"` BaseEntityDescription CreatedAt string `xml:"CreatedAt,omitempty"` Filter *FilterDescription `xml:"Filter,omitempty"` Action *ActionDescription `xml:"Action,omitempty"` Name string `xml:"Name"` }
RuleDescription is the content type for Subscription Rule management requests
type RuleEntity ¶
type RuleEntity struct { *RuleDescription *Entity }
RuleEntity is the Azure Service Bus description of a Subscription Rule for madnagement activities
type RuleEnvelope ¶
type RuleEnvelope struct { *Entry Content *RuleContent `xml:"content"` }
Subscriptions (and rules)
func WrapWithRuleEnvelope ¶
func WrapWithRuleEnvelope(rd *RuleDescription) *RuleEnvelope
type RuleFeed ¶
type RuleFeed struct { *Feed Entries []RuleEnvelope `xml:"entry"` }
RuleFeed is a specialized feed containing RuleEnvelopes
func (RuleFeed) Items ¶
func (rf RuleFeed) Items() []RuleEnvelope
type SubscriptionContent ¶
type SubscriptionContent struct { XMLName xml.Name `xml:"content"` Type string `xml:"type,attr"` SubscriptionDescription SubscriptionDescription `xml:"SubscriptionDescription"` }
SubscriptionContent is a specialized Subscription body for an Atom entry
type SubscriptionDescription ¶
type SubscriptionDescription struct { XMLName xml.Name `xml:"SubscriptionDescription"` BaseEntityDescription LockDuration *string `xml:"LockDuration,omitempty"` // LockDuration - ISO 8601 timespan duration of a peek-lock; that is, the amount of time that the message is locked for other receivers. The maximum value for LockDuration is 5 minutes; the default value is 1 minute. RequiresSession *bool `xml:"RequiresSession,omitempty"` DefaultMessageTimeToLive *string `xml:"DefaultMessageTimeToLive,omitempty"` // DefaultMessageTimeToLive - ISO 8601 default message timespan to live value. This 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. DeadLetteringOnMessageExpiration *bool `xml:"DeadLetteringOnMessageExpiration,omitempty"` // DeadLetteringOnMessageExpiration - A value that indicates whether this queue has dead letter support when a message expires. DeadLetteringOnFilterEvaluationExceptions *bool `xml:"DeadLetteringOnFilterEvaluationExceptions,omitempty"` DefaultRuleDescription *DefaultRuleDescription `xml:"DefaultRuleDescription,omitempty"` // DefaultRuleDescription - A default rule that is created right when the new subscription is created. MaxDeliveryCount *int32 `xml:"MaxDeliveryCount,omitempty"` // MaxDeliveryCount - The maximum delivery count. A message is automatically deadlettered after this number of deliveries. default value is 10. MessageCount *int64 `xml:"MessageCount,omitempty"` // MessageCount - The number of messages in the queue. EnableBatchedOperations *bool `xml:"EnableBatchedOperations,omitempty"` // EnableBatchedOperations - Value that indicates whether server-side batched operations are enabled. Status *EntityStatus `xml:"Status,omitempty"` ForwardTo *string `xml:"ForwardTo,omitempty"` // ForwardTo - absolute URI of the entity to forward messages UserMetadata *string `xml:"UserMetadata,omitempty"` ForwardDeadLetteredMessagesTo *string `xml:"ForwardDeadLetteredMessagesTo,omitempty"` // ForwardDeadLetteredMessagesTo - absolute URI of the entity to forward dead letter messages AutoDeleteOnIdle *string `xml:"AutoDeleteOnIdle,omitempty"` CreatedAt string `xml:"CreatedAt,omitempty"` UpdatedAt string `xml:"UpdatedAt,omitempty"` AccessedAt string `xml:"AccessedAt,omitempty"` CountDetails *CountDetails `xml:"CountDetails,omitempty"` }
SubscriptionDescription is the content type for Subscription management requests
type SubscriptionEntity ¶
type SubscriptionEntity struct { *SubscriptionDescription *Entity }
SubscriptionEntity is the Azure Service Bus description of a topic Subscription for management activities
type SubscriptionEnvelope ¶
type SubscriptionEnvelope struct { *Entry Content *SubscriptionContent `xml:"content"` }
subscriptionEntryContent is a specialized Topic feed Subscription
func WrapWithSubscriptionEnvelope ¶
func WrapWithSubscriptionEnvelope(sd *SubscriptionDescription) *SubscriptionEnvelope
type SubscriptionFeed ¶
type SubscriptionFeed struct { *Feed Entries []SubscriptionEnvelope `xml:"entry"` }
SubscriptionFeed is a specialized feed containing Topic Subscriptions
func (SubscriptionFeed) Items ¶
func (sf SubscriptionFeed) Items() []SubscriptionEnvelope
type TopicContent ¶
type TopicContent struct { XMLName xml.Name `xml:"content"` Type string `xml:"type,attr"` TopicDescription TopicDescription `xml:"TopicDescription"` }
TopicContent is a specialized Topic body for an Atom entry
type TopicDescription ¶
type TopicDescription struct { XMLName xml.Name `xml:"TopicDescription"` BaseEntityDescription DefaultMessageTimeToLive *string `xml:"DefaultMessageTimeToLive,omitempty"` // DefaultMessageTimeToLive - ISO 8601 default message time span to live value. This 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. MaxSizeInMegabytes *int32 `xml:"MaxSizeInMegabytes,omitempty"` // MaxSizeInMegabytes - The maximum size of the queue in megabytes, which is the size of memory allocated for the queue. Default is 1024. RequiresDuplicateDetection *bool `xml:"RequiresDuplicateDetection,omitempty"` // RequiresDuplicateDetection - A value indicating if this queue requires duplicate detection. DuplicateDetectionHistoryTimeWindow *string `xml:"DuplicateDetectionHistoryTimeWindow,omitempty"` // DuplicateDetectionHistoryTimeWindow - ISO 8601 timeSpan structure that defines the duration of the duplicate detection history. The default value is 10 minutes. EnableBatchedOperations *bool `xml:"EnableBatchedOperations,omitempty"` // EnableBatchedOperations - Value that indicates whether server-side batched operations are enabled. SizeInBytes *int64 `xml:"SizeInBytes,omitempty"` // SizeInBytes - The size of the queue, in bytes. FilteringMessagesBeforePublishing *bool `xml:"FilteringMessagesBeforePublishing,omitempty"` IsAnonymousAccessible *bool `xml:"IsAnonymousAccessible,omitempty"` AuthorizationRules []AuthorizationRule `xml:"AuthorizationRules>AuthorizationRule,omitempty"` Status *EntityStatus `xml:"Status,omitempty"` UserMetadata *string `xml:"UserMetadata,omitempty"` AccessedAt string `xml:"AccessedAt,omitempty"` CreatedAt string `xml:"CreatedAt,omitempty"` UpdatedAt string `xml:"UpdatedAt,omitempty"` SupportOrdering *bool `xml:"SupportOrdering,omitempty"` AutoDeleteOnIdle *string `xml:"AutoDeleteOnIdle,omitempty"` EnablePartitioning *bool `xml:"EnablePartitioning,omitempty"` EnableSubscriptionPartitioning *bool `xml:"EnableSubscriptionPartitioning,omitempty"` EnableExpress *bool `xml:"EnableExpress,omitempty"` CountDetails *CountDetails `xml:"CountDetails,omitempty"` SubscriptionCount *int32 `xml:"SubscriptionCount,omitempty"` MaxMessageSizeInKilobytes *int64 `xml:"MaxMessageSizeInKilobytes,omitempty"` }
TopicDescription is the content type for Topic management requests Refer here for ordering constraints: https://github.com/Azure/azure-sdk-for-net/blob/ed2e86cb299e11a276dcf652a9db796efe2d2a27/sdk/servicebus/Azure.Messaging.ServiceBus/src/Administration/TopicPropertiesExtensions.cs#L178
type TopicEntity ¶
type TopicEntity struct { *TopicDescription *Entity }
TopicEntity is the Azure Service Bus description of a Topic for management activities
type TopicEnvelope ¶
type TopicEnvelope struct { *Entry Content *TopicContent `xml:"content"` }
TopicEnvelope is a specialized Topic feed entry
func WrapWithTopicEnvelope ¶
func WrapWithTopicEnvelope(td *TopicDescription) *TopicEnvelope
type TopicFeed ¶
type TopicFeed struct { *Feed Entries []TopicEnvelope `xml:"entry"` }
TopicFeed is a specialized feed containing Topic Entries
func (TopicFeed) Items ¶
func (tf TopicFeed) Items() []TopicEnvelope