arn-sdk

module
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2025 License: MIT

README

ARN Client for Go

This package provides a Go client for Azure Resource Notifications.

All basic usage information for the client is available in the client package godoc. To effectively use this client, you will need to contact the ARN team to obtain the necessary information for configuring your service to utilize the client.

Notes:

This package is based on a previous package developed (internally at Microsoft) by another developer, which was not in active use for sending data. After utilizing that package for some time, we identified various improvements that could be made. This is a re-write to incorporate those improvements. The original package was crucial in bootstrapping this project and shares some code with this new version.

Key changes and improvements in this package include:

  • Removal of auto-generated code: This reduces unnecessary pointer usage, which improves garbage collection (GC) efficiency. Reducing GC cycles is critical for performance in large Go services.
  • Independence from any specific Model version: The new design allows for the creation of new models that satisfy our Notification type, enabling future updates without breaking the client. While we use interfaces for Notifications and Event types to allow for future model abstraction, the actual model consists of concrete types defined for the user.
  • Support for synchronous and asynchronous methods: This provides flexibility in how the client can be used.
  • Enhanced documentation: More comprehensive documentation makes it easier to understand and use the client.
  • Improved testing: Tests have been revamped to be faster and cleaner, replacing ginkgo tests with standard Go tests and eliminating the use of mock libraries.
  • Fixes constant value address issuess: The original package defined some constants for enumermated values, but the SDK required the address of these constants. This required redefining the constants as variables to get their address. This fixes that issue.
  • Moved logging to slog.Logger: Originally this used a third party package for logging. Prefer an slog.Logger to allow logging packages to be swapped out.

Removed features:

  • Deletion of storage containers: The original package had a feature to delete storage containers. However this feature would have several clients that share the same storage calling deletes. This seemed inefficient and potentially dangerous, so it was removed. Instead we opt for the user to set storage containers to be deleted in the storage account. One reason this was probably done is that Azure Blob Storage can only delete on a daily period, where we should have at least hourly granularity.

This re-write significantly benefited from the groundwork laid by the original package, making the process of deciphering the ARN API much easier.

Third Party Libraries

This package uses the following third-party libraries:

  • github.com/go-json-experiment/json
  • github.com/google/uuid
  • github.com/kylelemons/godebug

These package have sub-dependencies as follows:

  • github.com/jedib0t/go-pretty/v6
  • github.com/mattn/go-runewidth
  • github.com/rivo/uniseg
  • github.com/sanity-io/litter
  • golang.org/x/net
  • golang.org/x/sys
  • golang.org/x/text

Trademarks

This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft trademarks or logos is subject to and must follow Microsoft’s Trademark & Brand Guidelines. Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. Any use of third-party trademarks or logos are subject to those third-party’s policies.

Directories

Path Synopsis
Package client provides a client for interacting with the ARN service.
Package client provides a client for interacting with the ARN service.
internal
conn
Package conn provides the top level package for all connection types to the ARN service.
Package conn provides the top level package for all connection types to the ARN service.
conn/http
Package http provides a client for interacting with the ARN receiver API using an azcore.Client.
Package http provides a client for interacting with the ARN receiver API using an azcore.Client.
conn/maxvals
Package maxvals holds maximum values for message attributes send via the conn package.
Package maxvals holds maximum values for message attributes send via the conn package.
conn/storage
Package storage provides a client around Azure Blob Storage for sending data that will be used by the ARN service.
Package storage provides a client around Azure Blob Storage for sending data that will be used by the ARN service.
Package models provides the interfaces and types that various model packages will need to implement or use.
Package models provides the interfaces and types that various model packages will need to implement or use.
internal/private
Private provides private interfaces that are not meant to be used outside of the models package.
Private provides private interfaces that are not meant to be used outside of the models package.
v3/schema/envelope
Package envelope provides the types and functions for sending events to the ARN service.
Package envelope provides the types and functions for sending events to the ARN service.
v3/schema/types
Package types provides the types used in the ARN service on the wire.
Package types provides the types used in the ARN service on the wire.
version
Package version provides the schema version of the SDK.
Package version provides the schema version of the SDK.

Jump to

Keyboard shortcuts

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