Categorygithub.com/Azure/azure-sdk-for-go/sdk/messaging/eventgrid/aznamespaces
modulepackage
1.0.0
Repository: https://github.com/azure/azure-sdk-for-go.git
Documentation: pkg.go.dev

# README

Azure Event Grid Namespaces Client Module for Go

Azure Event Grid is a highly scalable, fully managed Pub Sub message distribution service that offers flexible message consumption patterns. For more information about Event Grid see: link.

This client module allows you to publish events and receive events using the Pull delivery API.

NOTE: This client does not work with Event Grid Basic. Use the azeventgrid.Client in the azeventgrid package instead.

Key links:

Getting started

Install the package

Install the Azure Event Grid Namespaces client module for Go with go get:

go get github.com/Azure/azure-sdk-for-go/sdk/messaging/eventgrid/aznamespaces

Prerequisites

Authenticate the client

Event Grid Namespaces clients (SenderClient and ReceiverClient) authenticate using a TokenCredential, provided by the azidentity module, or using a shared key credential.

Using a TokenCredential:

Using a shared key:

Key concepts

An Event Grid namespace is a container for multiple types of resources, including namespace topics:

Namespaces also offer access using MQTT, although that is not covered in this package.

Examples

Examples for various scenarios can be found on pkg.go.dev or in the example*_test.go files in our GitHub repo for aznamespaces.

Troubleshooting

Logging

This module uses the classification-based logging implementation in azcore. To enable console logging for all SDK modules, set the environment variable AZURE_SDK_GO_LOGGING to all.

Use the azcore/log package to control log event output.

import (
  "fmt"
  azlog "github.com/Azure/azure-sdk-for-go/sdk/azcore/log"
)

// print log output to stdout
azlog.SetListener(func(event azlog.Event, s string) {
    fmt.Printf("[%s] %s\n", event, s)
})

Next steps

More sample code should go here, along with links out to the appropriate example tests.

Contributing

For details on contributing to this repository, see the contributing guide.

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com.

When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

Additional Helpful Links for Contributors

Many people all over the world have helped make this project better. You'll want to check out:

Reporting security issues and security bugs

Security issues and bugs should be reported privately, via email, to the Microsoft Security Response Center (MSRC) [email protected]. You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Further information, including the MSRC PGP key, can be found in the Security TechCenter.

License

Azure SDK for Go is licensed under the MIT license.

# Functions

NewReceiverClient creates a [ReceiverClient] which uses an azcore.TokenCredential for authentication.
NewReceiverClientWithSharedKeyCredential creates a [ReceiverClient] using a shared key.
NewSenderClient creates a [SenderClient] which uses an azcore.TokenCredential for authentication.
NewSenderClientWithSharedKeyCredential creates a [SenderClient] using a shared key.
PossibleReleaseDelayValues returns the possible values for the ReleaseDelay const type.

# Constants

ReleaseDelayNoDelay - Release the event after 0 seconds.
ReleaseDelayOneHour - Release the event after 3600 seconds.
ReleaseDelayOneMinute - Release the event after 60 seconds.
ReleaseDelayTenMinutes - Release the event after 600 seconds.
ReleaseDelayTenSeconds - Release the event after 10 seconds.

# Structs

AcknowledgeEventsOptions contains the optional parameters for the ReceiverClient.AcknowledgeEvents method.
AcknowledgeEventsResponse contains the response from method ReceiverClient.AcknowledgeEvents.
AcknowledgeEventsResult - The result of the Acknowledge operation.
BrokerProperties - Properties of the Event Broker operation.
Error - The error object.
FailedLockToken - Failed LockToken information.
ReceiveDetails - Receive operation details per Cloud Event.
ReceiveEventsOptions contains the optional parameters for the ReceiverClient.ReceiveEvents method.
ReceiveEventsResponse contains the response from method ReceiverClient.ReceiveEvents.
ReceiveEventsResult - Details of the Receive operation response.
ReceiverClient contains the methods for the Microsoft.EventGrid namespace.
ReceiverClientOptions contains the optional parameters when creating a ReceiverClient.
RejectEventsOptions contains the optional parameters for the ReceiverClient.RejectEvents method.
RejectEventsResponse contains the response from method ReceiverClient.RejectEvents.
RejectEventsResult - The result of the Reject operation.
ReleaseEventsOptions contains the optional parameters for the ReceiverClient.ReleaseEvents method.
ReleaseEventsResponse contains the response from method ReceiverClient.ReleaseEvents.
ReleaseEventsResult - The result of the Release operation.
RenewEventLocksOptions contains the optional parameters for the ReceiverClient.RenewEventLocks method.
RenewEventLocksResponse contains the response from method ReceiverClient.RenewEventLocks.
RenewEventLocksResult - The result of the RenewLock operation.
SenderClient contains the methods for the Microsoft.EventGrid namespace.
SenderClientOptions contains the optional parameters when creating a SenderClient.
SendEventOptions contains the optional parameters for the SenderClient.SendEvent method.
SendEventResponse contains the response from method SenderClient.SendEvent.
SendEventsOptions contains the optional parameters for the SenderClient.SendEvents method.
SendEventsResponse contains the response from method SenderClient.SendEvents.

# Type aliases

ReleaseDelay - Supported delays for release operation.