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

# README

Azure Event Grid Client Module for Go

Please note this package has been moved to: aznamespaces.

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 topics. Use the publisher.Client in the publisher sub-package instead.

Key links:

Getting started

Install the package

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

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

Prerequisites

Authenticate the client

Event Grid namespace clients authenticate using a shared key credential. An example of that can be viewed here: ExampleNewClientWithSharedKeyCredential.

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 azeventgrid.

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.

# Packages

Copyright (c) Microsoft Corporation.

# Functions

NewClientWithSharedKeyCredential creates a [Client] using a shared key.
PossibleReleaseDelayValues returns the possible values for the ReleaseDelay const type.

# Constants

ReleaseDelayBy0Seconds - Release the event after 0 seconds.
ReleaseDelayBy10Seconds - Release the event after 10 seconds.
ReleaseDelayBy3600Seconds - Release the event after 3600 seconds.
ReleaseDelayBy600Seconds - Release the event after 600 seconds.
ReleaseDelayBy60Seconds - Release the event after 60 seconds.

# Structs

AcknowledgeCloudEventsOptions contains the optional parameters for the Client.AcknowledgeCloudEvents method.
AcknowledgeCloudEventsResponse contains the response from method Client.AcknowledgeCloudEvents.
AcknowledgeResult - The result of the Acknowledge operation.
BrokerProperties - Properties of the Event Broker operation.
Client contains the methods for the Client group.
ClientOptions contains optional settings for [Client].
Error - The error object.
FailedLockToken - Failed LockToken information.
PublishCloudEventOptions contains the optional parameters for the Client.PublishCloudEvent method.
PublishCloudEventResponse contains the response from method Client.PublishCloudEvent.
PublishCloudEventsOptions contains the optional parameters for the Client.PublishCloudEvents method.
PublishCloudEventsResponse contains the response from method Client.PublishCloudEvents.
ReceiveCloudEventsOptions contains the optional parameters for the Client.ReceiveCloudEvents method.
ReceiveCloudEventsResponse contains the response from method Client.ReceiveCloudEvents.
ReceiveDetails - Receive operation details per Cloud Event.
ReceiveResult - Details of the Receive operation response.
RejectCloudEventsOptions contains the optional parameters for the Client.RejectCloudEvents method.
RejectCloudEventsResponse contains the response from method Client.RejectCloudEvents.
RejectResult - The result of the Reject operation.
ReleaseCloudEventsOptions contains the optional parameters for the Client.ReleaseCloudEvents method.
ReleaseCloudEventsResponse contains the response from method Client.ReleaseCloudEvents.
ReleaseResult - The result of the Release operation.
RenewCloudEventLocksOptions contains the optional parameters for the Client.RenewCloudEventLocks method.
RenewCloudEventLocksResponse contains the response from method Client.RenewCloudEventLocks.
RenewCloudEventLocksResult - The result of the RenewLock operation.

# Type aliases

ReleaseDelay indicates how long the service should delay before releasing an event.