Documentation ¶
Overview ¶
Example (Client_Clear_Messages) ¶
package main import ( "context" "fmt" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/storage/azqueue" "log" "os" ) func handleError(err error) { if err != nil { log.Fatal(err.Error()) } } func main() { accountName, ok := os.LookupEnv("AZURE_STORAGE_ACCOUNT_NAME") if !ok { panic("AZURE_STORAGE_ACCOUNT_NAME could not be found") } serviceURL := fmt.Sprintf("https://%s.queue.core.windows.net/", accountName) cred, err := azidentity.NewDefaultAzureCredential(nil) handleError(err) client, err := azqueue.NewServiceClient(serviceURL, cred, nil) handleError(err) resp, err := client.CreateQueue(context.TODO(), "testqueue", &azqueue.CreateOptions{ Metadata: map[string]*string{"hello": to.Ptr("world")}, }) handleError(err) fmt.Println(resp) queueClient := client.NewQueueClient("testqueue") resp1, err := queueClient.EnqueueMessage(context.Background(), "test content", nil) handleError(err) fmt.Println(resp1) resp2, err := queueClient.ClearMessages(context.Background(), nil) handleError(err) fmt.Println(resp2) // delete the queue _, err = client.DeleteQueue(context.TODO(), "testqueue", nil) handleError(err) fmt.Println(resp) }
Output:
Example (Client_CreateQueue) ¶
package main import ( "context" "fmt" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/storage/azqueue" "log" "os" ) func handleError(err error) { if err != nil { log.Fatal(err.Error()) } } func main() { accountName, ok := os.LookupEnv("AZURE_STORAGE_ACCOUNT_NAME") if !ok { panic("AZURE_STORAGE_ACCOUNT_NAME could not be found") } serviceURL := fmt.Sprintf("https://%s.queue.core.windows.net/", accountName) cred, err := azidentity.NewDefaultAzureCredential(nil) handleError(err) client, err := azqueue.NewServiceClient(serviceURL, cred, nil) handleError(err) resp, err := client.CreateQueue(context.TODO(), "testqueue", &azqueue.CreateOptions{ Metadata: map[string]*string{"hello": to.Ptr("world")}, }) handleError(err) fmt.Println(resp) // delete the queue _, err = client.DeleteQueue(context.TODO(), "testqueue", nil) handleError(err) fmt.Println(resp) }
Output:
Example (Client_DeleteQueue) ¶
package main import ( "context" "fmt" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/storage/azqueue" "log" "os" ) func handleError(err error) { if err != nil { log.Fatal(err.Error()) } } func main() { accountName, ok := os.LookupEnv("AZURE_STORAGE_ACCOUNT_NAME") if !ok { panic("AZURE_STORAGE_ACCOUNT_NAME could not be found") } serviceURL := fmt.Sprintf("https://%s.queue.core.windows.net/", accountName) cred, err := azidentity.NewDefaultAzureCredential(nil) handleError(err) client, err := azqueue.NewServiceClient(serviceURL, cred, nil) handleError(err) opts := &azqueue.DeleteOptions{} // or just pass nil to the method below resp, err := client.DeleteQueue(context.TODO(), "testqueue", opts) handleError(err) fmt.Println(resp) }
Output:
Example (Client_Enqueue_DequeueMessage) ¶
package main import ( "context" "fmt" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/storage/azqueue" "log" "os" ) func handleError(err error) { if err != nil { log.Fatal(err.Error()) } } func main() { accountName, ok := os.LookupEnv("AZURE_STORAGE_ACCOUNT_NAME") if !ok { panic("AZURE_STORAGE_ACCOUNT_NAME could not be found") } serviceURL := fmt.Sprintf("https://%s.queue.core.windows.net/", accountName) cred, err := azidentity.NewDefaultAzureCredential(nil) handleError(err) client, err := azqueue.NewServiceClient(serviceURL, cred, nil) handleError(err) resp, err := client.CreateQueue(context.TODO(), "testqueue", &azqueue.CreateOptions{ Metadata: map[string]*string{"hello": to.Ptr("world")}, }) handleError(err) fmt.Println(resp) opts := &azqueue.EnqueueMessageOptions{TimeToLive: to.Ptr(int32(10))} queueClient := client.NewQueueClient("testqueue") resp1, err := queueClient.EnqueueMessage(context.Background(), "test content", opts) handleError(err) fmt.Println(resp1) resp2, err := queueClient.DequeueMessage(context.Background(), nil) handleError(err) // check message content fmt.Println(resp2.Messages[0].MessageText) // delete the queue _, err = client.DeleteQueue(context.TODO(), "testqueue", nil) handleError(err) fmt.Println(resp) }
Output:
Example (Client_NewClient) ¶
package main import ( "fmt" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/storage/azqueue" "log" "os" ) func handleError(err error) { if err != nil { log.Fatal(err.Error()) } } func main() { // this example uses Azure Active Directory (AAD) to authenticate with Azure Queue Storage accountName, ok := os.LookupEnv("AZURE_STORAGE_ACCOUNT_NAME") if !ok { panic("AZURE_STORAGE_ACCOUNT_NAME could not be found") } serviceURL := fmt.Sprintf("https://%s.queue.core.windows.net/", accountName) // https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azidentity#DefaultAzureCredential cred, err := azidentity.NewDefaultAzureCredential(nil) handleError(err) client, err := azqueue.NewServiceClient(serviceURL, cred, nil) handleError(err) fmt.Println(client.URL()) }
Output:
Example (Client_NewClientFromConnectionString) ¶
package main import ( "fmt" "github.com/Azure/azure-sdk-for-go/sdk/storage/azqueue" "log" "os" ) func handleError(err error) { if err != nil { log.Fatal(err.Error()) } } func main() { // this example uses a connection string to authenticate with Azure queue Storage connectionString, ok := os.LookupEnv("AZURE_STORAGE_CONNECTION_STRING") if !ok { log.Fatal("the environment variable 'AZURE_STORAGE_CONNECTION_STRING' could not be found") } serviceClient, err := azqueue.NewServiceClientFromConnectionString(connectionString, nil) handleError(err) fmt.Println(serviceClient.URL()) }
Output:
Example (Client_NewListQueuesPager) ¶
package main import ( "context" "fmt" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/storage/azqueue" "log" "os" ) func handleError(err error) { if err != nil { log.Fatal(err.Error()) } } func main() { accountName, ok := os.LookupEnv("AZURE_STORAGE_ACCOUNT_NAME") if !ok { panic("AZURE_STORAGE_ACCOUNT_NAME could not be found") } serviceURL := fmt.Sprintf("https://%s.queue.core.windows.net/", accountName) cred, err := azidentity.NewDefaultAzureCredential(nil) handleError(err) client, err := azqueue.NewServiceClient(serviceURL, cred, nil) handleError(err) pager := client.NewListQueuesPager(&azqueue.ListQueuesOptions{ Include: azqueue.ListQueuesInclude{Metadata: true}, }) // list pre-existing queues for pager.More() { resp, err := pager.NextPage(context.Background()) handleError(err) // if err is not nil, break the loop. for _, _queue := range resp.Queues { fmt.Printf("%v", _queue) } } }
Output:
Example (Client_PeekMessages) ¶
package main import ( "context" "fmt" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/storage/azqueue" "log" "os" ) func handleError(err error) { if err != nil { log.Fatal(err.Error()) } } func main() { accountName, ok := os.LookupEnv("AZURE_STORAGE_ACCOUNT_NAME") if !ok { panic("AZURE_STORAGE_ACCOUNT_NAME could not be found") } serviceURL := fmt.Sprintf("https://%s.queue.core.windows.net/", accountName) cred, err := azidentity.NewDefaultAzureCredential(nil) handleError(err) client, err := azqueue.NewServiceClient(serviceURL, cred, nil) handleError(err) resp, err := client.CreateQueue(context.TODO(), "testqueue", &azqueue.CreateOptions{ Metadata: map[string]*string{"hello": to.Ptr("world")}, }) handleError(err) fmt.Println(resp) queueClient := client.NewQueueClient("testqueue") // enqueue 4 messages for i := 0; i < 4; i++ { resp1, err := queueClient.EnqueueMessage(context.Background(), "test content", nil) handleError(err) fmt.Println(resp1) } // only check 3 messages opts := &azqueue.PeekMessagesOptions{NumberOfMessages: to.Ptr(int32(3))} resp2, err := queueClient.PeekMessages(context.Background(), opts) handleError(err) // check 3 messages retrieved fmt.Println(len(resp2.Messages)) // delete the queue _, err = client.DeleteQueue(context.TODO(), "testqueue", nil) handleError(err) fmt.Println(resp) }
Output:
Example (Client_Update_Message) ¶
package main import ( "context" "fmt" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/storage/azqueue" "log" "os" ) func handleError(err error) { if err != nil { log.Fatal(err.Error()) } } func main() { accountName, ok := os.LookupEnv("AZURE_STORAGE_ACCOUNT_NAME") if !ok { panic("AZURE_STORAGE_ACCOUNT_NAME could not be found") } serviceURL := fmt.Sprintf("https://%s.queue.core.windows.net/", accountName) cred, err := azidentity.NewDefaultAzureCredential(nil) handleError(err) client, err := azqueue.NewServiceClient(serviceURL, cred, nil) handleError(err) resp, err := client.CreateQueue(context.TODO(), "testqueue", &azqueue.CreateOptions{ Metadata: map[string]*string{"hello": to.Ptr("world")}, }) handleError(err) fmt.Println(resp) queueClient := client.NewQueueClient("testqueue") resp1, err := queueClient.EnqueueMessage(context.Background(), "test content", nil) handleError(err) fmt.Println(resp1) popReceipt := *resp1.Messages[0].PopReceipt messageID := *resp1.Messages[0].MessageID opts := &azqueue.UpdateMessageOptions{} _, err = queueClient.UpdateMessage(context.Background(), messageID, popReceipt, "new content", opts) handleError(err) resp3, err := queueClient.DequeueMessage(context.Background(), nil) handleError(err) // check message content has updated fmt.Println(resp3.Messages[0].MessageText) // delete the queue _, err = client.DeleteQueue(context.TODO(), "testqueue", nil) handleError(err) fmt.Println(resp) }
Output:
Index ¶
- type AccessPolicy
- type AccessPolicyPermission
- type CORSRule
- type ClearMessagesOptions
- type ClearMessagesResponse
- type ClientOptions
- type CreateOptions
- type CreateQueueResponse
- type CreateResponse
- type DeleteMessageOptions
- type DeleteMessageResponse
- type DeleteOptions
- type DeleteQueueResponse
- type DeleteResponse
- type DequeueMessageOptions
- type DequeueMessagesOptions
- type DequeueMessagesResponse
- type DequeuedMessage
- type EnqueueMessageOptions
- type EnqueueMessagesResponse
- type EnqueuedMessage
- type GeoReplication
- type GeoReplicationStatus
- type GetAccessPolicyOptions
- type GetAccessPolicyResponse
- type GetQueuePropertiesOptions
- type GetQueuePropertiesResponse
- type GetSASURLOptions
- type GetServicePropertiesOptions
- type GetServicePropertiesResponse
- type GetStatisticsOptions
- type GetStatisticsResponse
- type ListQueuesInclude
- type ListQueuesOptions
- type ListQueuesResponse
- type ListQueuesSegmentResponse
- type Logging
- type Metrics
- type PeekMessageOptions
- type PeekMessagesOptions
- type PeekMessagesResponse
- type PeekedMessage
- type Queue
- type QueueClient
- func NewQueueClient(queueURL string, cred azcore.TokenCredential, options *ClientOptions) (*QueueClient, error)
- func NewQueueClientFromConnectionString(connectionString string, queueName string, options *ClientOptions) (*QueueClient, error)
- func NewQueueClientWithNoCredential(queueURL string, options *ClientOptions) (*QueueClient, error)
- func NewQueueClientWithSharedKeyCredential(queueURL string, cred *SharedKeyCredential, options *ClientOptions) (*QueueClient, error)
- func (q *QueueClient) ClearMessages(ctx context.Context, o *ClearMessagesOptions) (ClearMessagesResponse, error)
- func (q *QueueClient) Create(ctx context.Context, options *CreateOptions) (CreateResponse, error)
- func (q *QueueClient) Delete(ctx context.Context, options *DeleteOptions) (DeleteResponse, error)
- func (q *QueueClient) DeleteMessage(ctx context.Context, messageID string, popReceipt string, ...) (DeleteMessageResponse, error)
- func (q *QueueClient) DequeueMessage(ctx context.Context, o *DequeueMessageOptions) (DequeueMessagesResponse, error)
- func (q *QueueClient) DequeueMessages(ctx context.Context, o *DequeueMessagesOptions) (DequeueMessagesResponse, error)
- func (q *QueueClient) EnqueueMessage(ctx context.Context, content string, o *EnqueueMessageOptions) (EnqueueMessagesResponse, error)
- func (q *QueueClient) GetAccessPolicy(ctx context.Context, o *GetAccessPolicyOptions) (GetAccessPolicyResponse, error)
- func (q *QueueClient) GetProperties(ctx context.Context, options *GetQueuePropertiesOptions) (GetQueuePropertiesResponse, error)
- func (q *QueueClient) GetSASURL(permissions sas.QueuePermissions, expiry time.Time, o *GetSASURLOptions) (string, error)
- func (q *QueueClient) PeekMessage(ctx context.Context, o *PeekMessageOptions) (PeekMessagesResponse, error)
- func (q *QueueClient) PeekMessages(ctx context.Context, o *PeekMessagesOptions) (PeekMessagesResponse, error)
- func (q *QueueClient) SetAccessPolicy(ctx context.Context, o *SetAccessPolicyOptions) (SetAccessPolicyResponse, error)
- func (q *QueueClient) SetMetadata(ctx context.Context, options *SetMetadataOptions) (SetMetadataResponse, error)
- func (q *QueueClient) URL() string
- func (q *QueueClient) UpdateMessage(ctx context.Context, messageID string, popReceipt string, content string, ...) (UpdateMessageResponse, error)
- type RetentionPolicy
- type ServiceClient
- func NewServiceClient(serviceURL string, cred azcore.TokenCredential, options *ClientOptions) (*ServiceClient, error)
- func NewServiceClientFromConnectionString(connectionString string, options *ClientOptions) (*ServiceClient, error)
- func NewServiceClientWithNoCredential(serviceURL string, options *ClientOptions) (*ServiceClient, error)
- func NewServiceClientWithSharedKeyCredential(serviceURL string, cred *SharedKeyCredential, options *ClientOptions) (*ServiceClient, error)
- func (s *ServiceClient) CreateQueue(ctx context.Context, queueName string, options *CreateOptions) (CreateResponse, error)
- func (s *ServiceClient) DeleteQueue(ctx context.Context, queueName string, options *DeleteOptions) (DeleteResponse, error)
- func (s *ServiceClient) GetSASURL(resources sas.AccountResourceTypes, permissions sas.AccountPermissions, ...) (string, error)
- func (s *ServiceClient) GetServiceProperties(ctx context.Context, o *GetServicePropertiesOptions) (GetServicePropertiesResponse, error)
- func (s *ServiceClient) GetStatistics(ctx context.Context, o *GetStatisticsOptions) (GetStatisticsResponse, error)
- func (s *ServiceClient) NewListQueuesPager(o *ListQueuesOptions) *runtime.Pager[ListQueuesResponse]
- func (s *ServiceClient) NewQueueClient(queueName string) *QueueClient
- func (s *ServiceClient) SetProperties(ctx context.Context, o *SetPropertiesOptions) (SetPropertiesResponse, error)
- func (s *ServiceClient) URL() string
- type SetAccessPolicyOptions
- type SetAccessPolicyResponse
- type SetMetadataOptions
- type SetMetadataResponse
- type SetPropertiesOptions
- type SetPropertiesResponse
- type SharedKeyCredential
- type SignedIdentifier
- type StorageServiceProperties
- type StorageServiceStats
- type URLParts
- type UpdateMessageOptions
- type UpdateMessageResponse
Examples ¶
- Package (Client_Clear_Messages)
- Package (Client_CreateQueue)
- Package (Client_DeleteQueue)
- Package (Client_Enqueue_DequeueMessage)
- Package (Client_NewClient)
- Package (Client_NewClientFromConnectionString)
- Package (Client_NewClientWithSharedKeyCredential)
- Package (Client_NewListQueuesPager)
- Package (Client_PeekMessages)
- Package (Client_Update_Message)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccessPolicyPermission ¶
type AccessPolicyPermission = exported.AccessPolicyPermission
AccessPolicyPermission type simplifies creating the permissions string for a queue's access policy. Initialize an instance of this type and then call its String method to set AccessPolicy's Permission field.
type CORSRule ¶
CORSRule - CORS is an HTTP feature that enables a web application running under one domain to access resources in another domain. Web browsers implement a security restriction known as same-origin policy that prevents a web page from calling APIs in a different domain; CORS provides a secure way to allow one domain (the origin domain) to call APIs in another domain
type ClearMessagesOptions ¶
type ClearMessagesOptions struct { }
ClearMessagesOptions contains the optional parameters for the QueueClient.ClearMessages method.
type ClearMessagesResponse ¶
type ClearMessagesResponse = generated.MessagesClientClearResponse
ClearMessagesResponse contains the response from method QueueClient.ClearMessages.
type ClientOptions ¶
type ClientOptions struct {
azcore.ClientOptions
}
ClientOptions contains the optional parameters when creating a ServiceClient or QueueClient.
type CreateOptions ¶
type CreateOptions struct { // Optional. Specifies a user-defined name-value pair associated with the queue. Metadata map[string]*string }
CreateOptions contains the optional parameters for creating a queue.
type CreateQueueResponse ¶
type CreateQueueResponse = generated.QueueClientCreateResponse
CreateQueueResponse contains the response from method queue.ServiceClient.Create.
type CreateResponse ¶
type CreateResponse = generated.QueueClientCreateResponse
CreateResponse contains the response from method QueueClient.Create.
type DeleteMessageOptions ¶
type DeleteMessageOptions struct { }
DeleteMessageOptions contains the optional parameters for the QueueClient.DeleteMessage method.
type DeleteMessageResponse ¶
type DeleteMessageResponse = generated.MessageIDClientDeleteResponse
DeleteMessageResponse contains the response from method QueueClient.DeleteMessage.
type DeleteOptions ¶
type DeleteOptions struct { }
DeleteOptions contains the optional parameters for deleting a queue.
type DeleteQueueResponse ¶
type DeleteQueueResponse = generated.QueueClientDeleteResponse
DeleteQueueResponse contains the response from method queue.ServiceClient.Delete
type DeleteResponse ¶
type DeleteResponse = generated.QueueClientDeleteResponse
DeleteResponse contains the response from method QueueClient.Delete.
type DequeueMessageOptions ¶
type DequeueMessageOptions struct { // If not specified, the default value is 0. Specifies the new visibility timeout value, // in seconds, relative to server time. The value must be larger than or equal to 0, and cannot be // larger than 7 days. The visibility timeout of a message cannot be // set to a value later than the expiry time. VisibilityTimeout // should be set to a value smaller than the time-to-live value. VisibilityTimeout *int32 }
DequeueMessageOptions contains the optional parameters for the QueueClient.DequeueMessage method.
type DequeueMessagesOptions ¶
type DequeueMessagesOptions struct { // Optional. A nonzero integer value that specifies the number of messages to retrieve from the queue, // up to a maximum of 32. If fewer messages are visible, the visible messages are returned. // By default, a single message is retrieved from the queue with this operation. NumberOfMessages *int32 // If not specified, the default value is 30. Specifies the // new visibility timeout value, in seconds, relative to server time. // The value must be larger than or equal to 1, and cannot be // larger than 7 days. The visibility timeout of a message cannot be // set to a value later than the expiry time. VisibilityTimeout // should be set to a value smaller than the time-to-live value. VisibilityTimeout *int32 }
DequeueMessagesOptions contains the optional parameters for the QueueClient.DequeueMessages method.
type DequeueMessagesResponse ¶
type DequeueMessagesResponse = generated.MessagesClientDequeueResponse
DequeueMessagesResponse contains the response from method QueueClient.DequeueMessage or QueueClient.DequeueMessages.
type DequeuedMessage ¶
type DequeuedMessage = generated.DequeuedMessage
DequeuedMessage - dequeued message
type EnqueueMessageOptions ¶
type EnqueueMessageOptions struct { // Specifies the time-to-live interval for the message, in seconds. // The time-to-live may be any positive number or -1 for infinity. // If this parameter is omitted, the default time-to-live is 7 days. TimeToLive *int32 // If not specified, the default value is 0. // Specifies the new visibility timeout value, in seconds, relative to server time. // The value must be larger than or equal to 0, and cannot be larger than 7 days. // The visibility timeout of a message cannot be set to a value later than the expiry time. // VisibilityTimeout should be set to a value smaller than the time-to-live value. VisibilityTimeout *int32 }
EnqueueMessageOptions contains the optional parameters for the QueueClient.EnqueueMessage method.
type EnqueueMessagesResponse ¶
type EnqueueMessagesResponse = generated.MessagesClientEnqueueResponse
EnqueueMessagesResponse contains the response from method QueueClient.EnqueueMessage.
type EnqueuedMessage ¶
type EnqueuedMessage = generated.EnqueuedMessage
EnqueuedMessage - enqueued message
type GeoReplication ¶
type GeoReplication = generated.GeoReplication
GeoReplication - Geo-Replication information for the Secondary Storage Service
type GeoReplicationStatus ¶
type GeoReplicationStatus = generated.GeoReplicationStatus
GeoReplicationStatus - The status of the secondary location
const ( GeoReplicationStatusLive GeoReplicationStatus = generated.GeoReplicationStatusLive GeoReplicationStatusBootstrap GeoReplicationStatus = generated.GeoReplicationStatusBootstrap )
type GetAccessPolicyOptions ¶
type GetAccessPolicyOptions struct { }
GetAccessPolicyOptions contains the optional parameters for the QueueClient.GetAccessPolicy method.
type GetAccessPolicyResponse ¶
type GetAccessPolicyResponse = generated.QueueClientGetAccessPolicyResponse
GetAccessPolicyResponse contains the response from method QueueClient.GetAccessPolicy.
type GetQueuePropertiesOptions ¶
type GetQueuePropertiesOptions struct { }
GetQueuePropertiesOptions contains the optional parameters for the QueueClient.GetProperties method.
type GetQueuePropertiesResponse ¶
type GetQueuePropertiesResponse = generated.QueueClientGetPropertiesResponse
GetQueuePropertiesResponse contains the response from method QueueClient.GetProperties.
type GetSASURLOptions ¶
GetSASURLOptions contains the optional parameters for the Client.GetSASURL method.
type GetServicePropertiesOptions ¶
type GetServicePropertiesOptions struct { }
GetServicePropertiesOptions contains the optional parameters for the ServiceClient.GetServiceProperties method.
type GetServicePropertiesResponse ¶
type GetServicePropertiesResponse = generated.ServiceClientGetPropertiesResponse
GetServicePropertiesResponse contains the response from method ServiceClient.GetServiceProperties.
type GetStatisticsOptions ¶
type GetStatisticsOptions struct { }
GetStatisticsOptions provides set of options for ServiceClient.GetStatistics
type GetStatisticsResponse ¶
type GetStatisticsResponse = generated.ServiceClientGetStatisticsResponse
GetStatisticsResponse contains the response from method ServiceClient.GetStatistics.
type ListQueuesInclude ¶
type ListQueuesInclude struct { // Tells the service whether to return metadata for each queue. Metadata bool }
ListQueuesInclude indicates what additional information the service should return with each queue.
type ListQueuesOptions ¶
type ListQueuesOptions struct { Include ListQueuesInclude // A string value that identifies the portion of the list of queues to be returned with the next listing operation. The // operation returns the NextMarker value within the response body if the listing operation did not return all queues // remaining to be listed with the current page. The NextMarker value can be used as the value for the marker parameter in // a subsequent call to request the next page of list items. The marker value is opaque to the client. Marker *string // Specifies the maximum number of queues to return. If the request does not specify max results, or specifies a value // greater than 5000, the server will return up to 5000 items. Note that if the listing operation crosses a partition boundary, // then the service will return a continuation token for retrieving the remainder of the results. For this reason, it is possible // that the service will return fewer results than specified by max results, or than the default of 5000. MaxResults *int32 // Filters the results to return only queues whose name begins with the specified prefix. Prefix *string }
ListQueuesOptions provides set of configurations for ListQueues operation
type ListQueuesResponse ¶
type ListQueuesResponse = generated.ServiceClientListQueuesSegmentResponse
ListQueuesResponse contains the response from method ServiceClient.ListQueuesSegment.
type ListQueuesSegmentResponse ¶
type ListQueuesSegmentResponse = generated.ListQueuesSegmentResponse
ListQueuesSegmentResponse - response segment
type Metrics ¶
Metrics - a summary of request statistics grouped by API in hour or minute aggregates for queues
type PeekMessageOptions ¶
type PeekMessageOptions struct { }
PeekMessageOptions contains the optional parameters for the QueueClient.PeekMessage method.
type PeekMessagesOptions ¶
type PeekMessagesOptions struct {
NumberOfMessages *int32
}
PeekMessagesOptions contains the optional parameters for the QueueClient.PeekMessages method.
type PeekMessagesResponse ¶
type PeekMessagesResponse = generated.MessagesClientPeekResponse
PeekMessagesResponse contains the response from method QueueClient.PeekMessage or QueueClient.PeekMessages.
type QueueClient ¶
type QueueClient base.CompositeClient[generated.QueueClient, generated.MessagesClient]
QueueClient represents a URL to the Azure Queue Storage service allowing you to manipulate queues.
func NewQueueClient ¶
func NewQueueClient(queueURL string, cred azcore.TokenCredential, options *ClientOptions) (*QueueClient, error)
NewQueueClient creates an instance of ServiceClient with the specified values.
- serviceURL - the URL of the storage account e.g. https://<account>.queue.core.windows.net/
- cred - an Azure AD credential, typically obtained via the azidentity module
- options - client options; pass nil to accept the default values
func NewQueueClientFromConnectionString ¶
func NewQueueClientFromConnectionString(connectionString string, queueName string, options *ClientOptions) (*QueueClient, error)
NewQueueClientFromConnectionString creates an instance of ServiceClient with the specified values.
- connectionString - a connection string for the desired storage account
- options - client options; pass nil to accept the default values
func NewQueueClientWithNoCredential ¶
func NewQueueClientWithNoCredential(queueURL string, options *ClientOptions) (*QueueClient, error)
NewQueueClientWithNoCredential creates an instance of QueueClient with the specified values. This is used to anonymously access a storage account or with a shared access signature (SAS) token.
- serviceURL - the URL of the storage account e.g. https://<account>.queue.core.windows.net/?<sas token>
- options - client options; pass nil to accept the default values
func NewQueueClientWithSharedKeyCredential ¶
func NewQueueClientWithSharedKeyCredential(queueURL string, cred *SharedKeyCredential, options *ClientOptions) (*QueueClient, error)
NewQueueClientWithSharedKeyCredential creates an instance of ServiceClient with the specified values.
- serviceURL - the URL of the storage account e.g. https://<account>.queue.core.windows.net/
- cred - a SharedKeyCredential created with the matching storage account and access key
- options - client options; pass nil to accept the default values
func (*QueueClient) ClearMessages ¶
func (q *QueueClient) ClearMessages(ctx context.Context, o *ClearMessagesOptions) (ClearMessagesResponse, error)
ClearMessages deletes all messages from the queue. For more information, see https://learn.microsoft.com/en-us/rest/api/storageservices/clear-messages.
func (*QueueClient) Create ¶
func (q *QueueClient) Create(ctx context.Context, options *CreateOptions) (CreateResponse, error)
Create creates a new queue within a storage account. If a queue with the same name already exists, the operation fails. For more information, see https://learn.microsoft.com/en-us/rest/api/storageservices/create-queue4.
func (*QueueClient) Delete ¶
func (q *QueueClient) Delete(ctx context.Context, options *DeleteOptions) (DeleteResponse, error)
Delete deletes the specified queue. For more information, see https://learn.microsoft.com/en-us/rest/api/storageservices/delete-queue3.
func (*QueueClient) DeleteMessage ¶
func (q *QueueClient) DeleteMessage(ctx context.Context, messageID string, popReceipt string, o *DeleteMessageOptions) (DeleteMessageResponse, error)
DeleteMessage deletes message from queue with the given popReceipt. For more information, see https://learn.microsoft.com/en-us/rest/api/storageservices/delete-message2.
func (*QueueClient) DequeueMessage ¶
func (q *QueueClient) DequeueMessage(ctx context.Context, o *DequeueMessageOptions) (DequeueMessagesResponse, error)
DequeueMessage removes one message from the queue. For more information, see https://learn.microsoft.com/en-us/rest/api/storageservices/get-messages.
func (*QueueClient) DequeueMessages ¶
func (q *QueueClient) DequeueMessages(ctx context.Context, o *DequeueMessagesOptions) (DequeueMessagesResponse, error)
DequeueMessages removes one or more messages from the queue. For more information, see https://learn.microsoft.com/en-us/rest/api/storageservices/get-messages.
func (*QueueClient) EnqueueMessage ¶
func (q *QueueClient) EnqueueMessage(ctx context.Context, content string, o *EnqueueMessageOptions) (EnqueueMessagesResponse, error)
EnqueueMessage adds a message to the queue. For more information, see https://learn.microsoft.com/en-us/rest/api/storageservices/put-message.
func (*QueueClient) GetAccessPolicy ¶
func (q *QueueClient) GetAccessPolicy(ctx context.Context, o *GetAccessPolicyOptions) (GetAccessPolicyResponse, error)
GetAccessPolicy returns the queue's access policy. For more information, see https://learn.microsoft.com/en-us/rest/api/storageservices/get-queue-acl.
func (*QueueClient) GetProperties ¶
func (q *QueueClient) GetProperties(ctx context.Context, options *GetQueuePropertiesOptions) (GetQueuePropertiesResponse, error)
GetProperties gets properties including metadata of a queue. For more information, see https://learn.microsoft.com/en-us/rest/api/storageservices/get-queue-metadata.
func (*QueueClient) GetSASURL ¶
func (q *QueueClient) GetSASURL(permissions sas.QueuePermissions, expiry time.Time, o *GetSASURLOptions) (string, error)
GetSASURL is a convenience method for generating a SAS token for the currently pointed at account. It can only be used if the credential supplied during creation was a SharedKeyCredential. This validity can be checked with CanGetAccountSASToken().
func (*QueueClient) PeekMessage ¶
func (q *QueueClient) PeekMessage(ctx context.Context, o *PeekMessageOptions) (PeekMessagesResponse, error)
PeekMessage peeks the first message from the queue. For more information, see https://learn.microsoft.com/en-us/rest/api/storageservices/peek-messages.
func (*QueueClient) PeekMessages ¶
func (q *QueueClient) PeekMessages(ctx context.Context, o *PeekMessagesOptions) (PeekMessagesResponse, error)
PeekMessages peeks one or more messages from the queue For more information, see https://learn.microsoft.com/en-us/rest/api/storageservices/peek-messages.
func (*QueueClient) SetAccessPolicy ¶
func (q *QueueClient) SetAccessPolicy(ctx context.Context, o *SetAccessPolicyOptions) (SetAccessPolicyResponse, error)
SetAccessPolicy sets the queue's permissions. For more information, see https://learn.microsoft.com/en-us/rest/api/storageservices/set-queue-acl.
func (*QueueClient) SetMetadata ¶
func (q *QueueClient) SetMetadata(ctx context.Context, options *SetMetadataOptions) (SetMetadataResponse, error)
SetMetadata sets the metadata for the queue. For more information, see https://learn.microsoft.com/en-us/rest/api/storageservices/set-queue-metadata.
func (*QueueClient) URL ¶
func (q *QueueClient) URL() string
URL returns the URL endpoint used by the ServiceClient object.
func (*QueueClient) UpdateMessage ¶
func (q *QueueClient) UpdateMessage(ctx context.Context, messageID string, popReceipt string, content string, o *UpdateMessageOptions) (UpdateMessageResponse, error)
UpdateMessage updates a message from the queue with the given popReceipt. For more information, see https://learn.microsoft.com/en-us/rest/api/storageservices/update-message.
type RetentionPolicy ¶
type RetentionPolicy = generated.RetentionPolicy
RetentionPolicy - the retention policy which determines how long the associated data should persist
type ServiceClient ¶
type ServiceClient base.Client[generated.ServiceClient]
ServiceClient represents a URL to the Azure Queue Storage service allowing you to manipulate queues.
func NewServiceClient ¶
func NewServiceClient(serviceURL string, cred azcore.TokenCredential, options *ClientOptions) (*ServiceClient, error)
NewServiceClient creates an instance of ServiceClient with the specified values.
- serviceURL - the URL of the storage account e.g. https://<account>.queue.core.windows.net/
- cred - an Azure AD credential, typically obtained via the azidentity module
- options - client options; pass nil to accept the default values
func NewServiceClientFromConnectionString ¶
func NewServiceClientFromConnectionString(connectionString string, options *ClientOptions) (*ServiceClient, error)
NewServiceClientFromConnectionString creates an instance of ServiceClient with the specified values.
- connectionString - a connection string for the desired storage account
- options - client options; pass nil to accept the default values
func NewServiceClientWithNoCredential ¶
func NewServiceClientWithNoCredential(serviceURL string, options *ClientOptions) (*ServiceClient, error)
NewServiceClientWithNoCredential creates an instance of ServiceClient with the specified values. This is used to anonymously access a storage account or with a shared access signature (SAS) token.
- serviceURL - the URL of the storage account e.g. https://<account>.queue.core.windows.net/?<sas token>
- options - client options; pass nil to accept the default values
func NewServiceClientWithSharedKeyCredential ¶
func NewServiceClientWithSharedKeyCredential(serviceURL string, cred *SharedKeyCredential, options *ClientOptions) (*ServiceClient, error)
NewServiceClientWithSharedKeyCredential creates an instance of ServiceClient with the specified values.
- serviceURL - the URL of the storage account e.g. https://<account>.queue.core.windows.net/
- cred - a SharedKeyCredential created with the matching storage account and access key
- options - client options; pass nil to accept the default values
func (*ServiceClient) CreateQueue ¶
func (s *ServiceClient) CreateQueue(ctx context.Context, queueName string, options *CreateOptions) (CreateResponse, error)
CreateQueue creates a new queue within a storage account. If a queue with the same name already exists, the operation fails. For more information, see https://learn.microsoft.com/en-us/rest/api/storageservices/create-queue4.
func (*ServiceClient) DeleteQueue ¶
func (s *ServiceClient) DeleteQueue(ctx context.Context, queueName string, options *DeleteOptions) (DeleteResponse, error)
DeleteQueue deletes the specified queue. For more information, see https://learn.microsoft.com/en-us/rest/api/storageservices/delete-queue3.
func (*ServiceClient) GetSASURL ¶
func (s *ServiceClient) GetSASURL(resources sas.AccountResourceTypes, permissions sas.AccountPermissions, expiry time.Time, o *GetSASURLOptions) (string, error)
GetSASURL is a convenience method for generating a SAS token for the currently pointed at account. It can only be used if the credential supplied during creation was a SharedKeyCredential. This validity can be checked with CanGetAccountSASToken().
func (*ServiceClient) GetServiceProperties ¶
func (s *ServiceClient) GetServiceProperties(ctx context.Context, o *GetServicePropertiesOptions) (GetServicePropertiesResponse, error)
GetServiceProperties - gets the properties of a storage account's Queue service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules.
func (*ServiceClient) GetStatistics ¶
func (s *ServiceClient) GetStatistics(ctx context.Context, o *GetStatisticsOptions) (GetStatisticsResponse, error)
GetStatistics Retrieves statistics related to replication for the Queue service.
func (*ServiceClient) NewListQueuesPager ¶
func (s *ServiceClient) NewListQueuesPager(o *ListQueuesOptions) *runtime.Pager[ListQueuesResponse]
NewListQueuesPager operation returns a pager of the queues under the specified account. Use an empty Marker to start enumeration from the beginning. Queue names are returned in lexicographic order. For more information, see https://learn.microsoft.com/en-us/rest/api/storageservices/list-queues1.
func (*ServiceClient) NewQueueClient ¶
func (s *ServiceClient) NewQueueClient(queueName string) *QueueClient
NewQueueClient creates a new QueueClient object by concatenating queueName to the end of this Client's URL. The new QueueClient uses the same request policy pipeline as the Client.
func (*ServiceClient) SetProperties ¶
func (s *ServiceClient) SetProperties(ctx context.Context, o *SetPropertiesOptions) (SetPropertiesResponse, error)
SetProperties Sets the properties of a storage account's Queue service, including Azure Storage Analytics. If an element (e.g. analytics_logging) is left as None, the existing settings on the service for that functionality are preserved.
func (*ServiceClient) URL ¶
func (s *ServiceClient) URL() string
URL returns the URL endpoint used by the ServiceClient object.
type SetAccessPolicyOptions ¶
type SetAccessPolicyOptions struct {
QueueACL []*SignedIdentifier
}
SetAccessPolicyOptions provides set of configurations for QueueClient.SetAccessPolicy operation
type SetAccessPolicyResponse ¶
type SetAccessPolicyResponse = generated.QueueClientSetAccessPolicyResponse
SetAccessPolicyResponse contains the response from method QueueClient.SetAccessPolicy.
type SetMetadataOptions ¶
SetMetadataOptions contains the optional parameters for the QueueClient.SetMetadata method.
type SetMetadataResponse ¶
type SetMetadataResponse = generated.QueueClientSetMetadataResponse
SetMetadataResponse contains the response from method QueueClient.SetMetadata.
type SetPropertiesOptions ¶
type SetPropertiesOptions struct { // The set of CORS rules. CORS []*CORSRule // a summary of request statistics grouped by API in hour or minute aggregates for queues HourMetrics *Metrics // Azure Analytics Logging settings. Logging *Logging // a summary of request statistics grouped by API in hour or minute aggregates for queues MinuteMetrics *Metrics }
SetPropertiesOptions provides set of options for ServiceClient.SetProperties
type SetPropertiesResponse ¶
type SetPropertiesResponse = generated.ServiceClientSetPropertiesResponse
SetPropertiesResponse contains the response from method ServiceClient.SetProperties.
type SharedKeyCredential ¶
type SharedKeyCredential = exported.SharedKeyCredential
SharedKeyCredential contains an account's name and its primary or secondary key.
func NewSharedKeyCredential ¶
func NewSharedKeyCredential(accountName, accountKey string) (*SharedKeyCredential, error)
NewSharedKeyCredential creates an immutable SharedKeyCredential containing the storage account's name and either its primary or secondary key.
type SignedIdentifier ¶
type SignedIdentifier = generated.SignedIdentifier
SignedIdentifier - signed identifier
type StorageServiceProperties ¶
type StorageServiceProperties = generated.StorageServiceProperties
StorageServiceProperties - Storage Service Properties.
type StorageServiceStats ¶
type StorageServiceStats = generated.StorageServiceStats
StorageServiceStats - Stats for the storage service.
type URLParts ¶
URLParts object represents the components that make up an Azure Storage Queue URL. NOTE: Changing any SAS-related field requires computing a new SAS signature.
type UpdateMessageOptions ¶
type UpdateMessageOptions struct {
VisibilityTimeout *int32
}
UpdateMessageOptions contains the optional parameters for the QueueClient.UpdateMessage method.
type UpdateMessageResponse ¶
type UpdateMessageResponse = generated.MessageIDClientUpdateResponse
UpdateMessageResponse contains the response from method QueueClient.UpdateMessage.