diff --git a/README.md b/README.md index 9797847..d898c08 100644 --- a/README.md +++ b/README.md @@ -12,10 +12,19 @@ go get github.com/Azure/AppConfiguration-GoProvider/azureappconfiguration ``` +## Getting Started + +Official documentation on how to use the Azure App Configuration provider is available in the following quickstarts: + +- [Create a Go console app with Azure App Configuration](https://learn.microsoft.com/azure/azure-app-configuration/quickstart-go-console-app?tabs=entra-id) +- [Enable dynamic configuration refresh in a Go console app](https://learn.microsoft.com/azure/azure-app-configuration/enable-dynamic-configuration-go-console-app) +- [Create a Go web app with Azure App Configuration](https://learn.microsoft.com/azure/azure-app-configuration/quickstart-go-web-app?tabs=entra-id) +- [Use dynamic configuration in a Gin web app](https://learn.microsoft.com/azure/azure-app-configuration/enable-dynamic-configuration-gin-web-app) + ## Examples -- [Console Application](./example/console-example/): Load settings from Azure App Configuration and use in a console application. -- [Web Application](./example/gin-example/): Load settings from Azure App Configuration and use in a Gin web application. +- [Console Application](./example/console_app/) +- [Web Application](./example/gin_web_app/) ## Data Collection diff --git a/azureappconfiguration/README.md b/azureappconfiguration/README.md index 41f33e3..ea9ff00 100644 --- a/azureappconfiguration/README.md +++ b/azureappconfiguration/README.md @@ -12,10 +12,19 @@ go get github.com/Azure/AppConfiguration-GoProvider/azureappconfiguration ``` +## Getting Started + +Official documentation on how to use the Azure App Configuration provider is available in the following quickstarts: + +- [Create a Go console app with Azure App Configuration](https://learn.microsoft.com/azure/azure-app-configuration/quickstart-go-console-app?tabs=entra-id) +- [Enable dynamic configuration refresh in a Go console app](https://learn.microsoft.com/azure/azure-app-configuration/enable-dynamic-configuration-go-console-app) +- [Create a Go web app with Azure App Configuration](https://learn.microsoft.com/azure/azure-app-configuration/quickstart-go-web-app?tabs=entra-id) +- [Use dynamic configuration in a Gin web app](https://learn.microsoft.com/azure/azure-app-configuration/enable-dynamic-configuration-gin-web-app) + ## Examples -- [Console Application](../example/console-example/): Load settings from Azure App Configuration and use in a console application. -- [Web Application](../example/gin-example/): Load settings from Azure App Configuration and use in a Gin web application. +- [Console Application](../example/console_app/) +- [Gin Web Application](../example/gin_web_app/) ## Data Collection diff --git a/azureappconfiguration/azureappconfiguration.go b/azureappconfiguration/azureappconfiguration.go index 387366d..98ed36e 100644 --- a/azureappconfiguration/azureappconfiguration.go +++ b/azureappconfiguration/azureappconfiguration.go @@ -258,6 +258,10 @@ func (azappcfg *AzureAppConfiguration) Refresh(ctx context.Context) error { // Parameters: // - callback: A function with no parameters that will be called after a successful refresh func (azappcfg *AzureAppConfiguration) OnRefreshSuccess(callback func()) { + if callback == nil { + return + } + azappcfg.onRefreshSuccess = append(azappcfg.onRefreshSuccess, callback) } diff --git a/azureappconfiguration/version.go b/azureappconfiguration/version.go index 0f6c447..fb3a7de 100644 --- a/azureappconfiguration/version.go +++ b/azureappconfiguration/version.go @@ -5,5 +5,5 @@ package azureappconfiguration const ( moduleName = "azcfg-go" - moduleVersion = "1.0.0-beta.2" + moduleVersion = "1.0.0" ) diff --git a/example/console-example/README.md b/example/console_app/console_example/README.md similarity index 100% rename from example/console-example/README.md rename to example/console_app/console_example/README.md diff --git a/example/console-example/go.mod b/example/console_app/console_example/go.mod similarity index 81% rename from example/console-example/go.mod rename to example/console_app/console_example/go.mod index 0cfeffd..79a086c 100644 --- a/example/console-example/go.mod +++ b/example/console_app/console_example/go.mod @@ -2,7 +2,7 @@ module console-example-app go 1.23.0 -require github.com/Azure/AppConfiguration-GoProvider/azureappconfiguration v0.0.0-00010101000000-000000000000 +require github.com/Azure/AppConfiguration-GoProvider/azureappconfiguration v1.0.0 require ( github.com/Azure/azure-sdk-for-go/sdk/azcore v1.17.0 // indirect @@ -15,5 +15,3 @@ require ( golang.org/x/sync v0.11.0 // indirect golang.org/x/text v0.22.0 // indirect ) - -replace github.com/Azure/AppConfiguration-GoProvider/azureappconfiguration => ..\..\azureappconfiguration diff --git a/example/console-example/go.sum b/example/console_app/console_example/go.sum similarity index 100% rename from example/console-example/go.sum rename to example/console_app/console_example/go.sum diff --git a/example/console-example/main.go b/example/console_app/console_example/main.go similarity index 100% rename from example/console-example/main.go rename to example/console_app/console_example/main.go diff --git a/example/console-example-refresh/README.md b/example/console_app/console_example_refresh/README.md similarity index 100% rename from example/console-example-refresh/README.md rename to example/console_app/console_example_refresh/README.md diff --git a/example/console-example-refresh/go.mod b/example/console_app/console_example_refresh/go.mod similarity index 81% rename from example/console-example-refresh/go.mod rename to example/console_app/console_example_refresh/go.mod index 0548ffa..cfe3e67 100644 --- a/example/console-example-refresh/go.mod +++ b/example/console_app/console_example_refresh/go.mod @@ -2,7 +2,7 @@ module console-example-refresh go 1.23.2 -require github.com/Azure/AppConfiguration-GoProvider/azureappconfiguration v0.0.0-00010101000000-000000000000 +require github.com/Azure/AppConfiguration-GoProvider/azureappconfiguration v1.0.0 require ( github.com/Azure/azure-sdk-for-go/sdk/azcore v1.18.0 // indirect @@ -15,5 +15,3 @@ require ( golang.org/x/sync v0.13.0 // indirect golang.org/x/text v0.24.0 // indirect ) - -replace github.com/Azure/AppConfiguration-GoProvider/azureappconfiguration => ..\..\azureappconfiguration diff --git a/example/console-example-refresh/go.sum b/example/console_app/console_example_refresh/go.sum similarity index 100% rename from example/console-example-refresh/go.sum rename to example/console_app/console_example_refresh/go.sum diff --git a/example/console-example-refresh/main.go b/example/console_app/console_example_refresh/main.go similarity index 100% rename from example/console-example-refresh/main.go rename to example/console_app/console_example_refresh/main.go diff --git a/example/gin-example-refresh/README.md b/example/gin_web_app/gin-example-refresh/README.md similarity index 100% rename from example/gin-example-refresh/README.md rename to example/gin_web_app/gin-example-refresh/README.md diff --git a/example/gin-example-refresh/go.mod b/example/gin_web_app/gin-example-refresh/go.mod similarity index 92% rename from example/gin-example-refresh/go.mod rename to example/gin_web_app/gin-example-refresh/go.mod index 54dd10b..06ab26c 100644 --- a/example/gin-example-refresh/go.mod +++ b/example/gin_web_app/gin-example-refresh/go.mod @@ -3,7 +3,7 @@ module web-app-refresh go 1.23.2 require ( - github.com/Azure/AppConfiguration-GoProvider/azureappconfiguration v0.0.0-00010101000000-000000000000 + github.com/Azure/AppConfiguration-GoProvider/azureappconfiguration v1.0.0 github.com/gin-gonic/gin v1.10.0 ) @@ -42,5 +42,3 @@ require ( google.golang.org/protobuf v1.34.1 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) - -replace github.com/Azure/AppConfiguration-GoProvider/azureappconfiguration => ..\..\azureappconfiguration diff --git a/example/gin-example-refresh/go.sum b/example/gin_web_app/gin-example-refresh/go.sum similarity index 100% rename from example/gin-example-refresh/go.sum rename to example/gin_web_app/gin-example-refresh/go.sum diff --git a/example/gin-example-refresh/main.go b/example/gin_web_app/gin-example-refresh/main.go similarity index 100% rename from example/gin-example-refresh/main.go rename to example/gin_web_app/gin-example-refresh/main.go diff --git a/example/gin-example-refresh/templates/about.html b/example/gin_web_app/gin-example-refresh/templates/about.html similarity index 100% rename from example/gin-example-refresh/templates/about.html rename to example/gin_web_app/gin-example-refresh/templates/about.html diff --git a/example/gin-example-refresh/templates/index.html b/example/gin_web_app/gin-example-refresh/templates/index.html similarity index 100% rename from example/gin-example-refresh/templates/index.html rename to example/gin_web_app/gin-example-refresh/templates/index.html diff --git a/example/gin-example/README.md b/example/gin_web_app/gin-example/README.md similarity index 100% rename from example/gin-example/README.md rename to example/gin_web_app/gin-example/README.md diff --git a/example/gin-example/go.mod b/example/gin_web_app/gin-example/go.mod similarity index 93% rename from example/gin-example/go.mod rename to example/gin_web_app/gin-example/go.mod index a67d002..3d9fab6 100644 --- a/example/gin-example/go.mod +++ b/example/gin_web_app/gin-example/go.mod @@ -3,12 +3,10 @@ module simple-web-app go 1.23.0 require ( - github.com/Azure/AppConfiguration-GoProvider/azureappconfiguration v0.0.0-00010101000000-000000000000 + github.com/Azure/AppConfiguration-GoProvider/azureappconfiguration v1.0.0 github.com/gin-gonic/gin v1.10.0 ) -replace github.com/Azure/AppConfiguration-GoProvider/azureappconfiguration => ..\..\azureappconfiguration - require ( github.com/Azure/azure-sdk-for-go/sdk/azcore v1.17.0 // indirect github.com/Azure/azure-sdk-for-go/sdk/data/azappconfig v1.2.0-beta.1 // indirect diff --git a/example/gin-example/go.sum b/example/gin_web_app/gin-example/go.sum similarity index 100% rename from example/gin-example/go.sum rename to example/gin_web_app/gin-example/go.sum diff --git a/example/gin-example/main.go b/example/gin_web_app/gin-example/main.go similarity index 100% rename from example/gin-example/main.go rename to example/gin_web_app/gin-example/main.go diff --git a/example/gin-example/templates/about.html b/example/gin_web_app/gin-example/templates/about.html similarity index 100% rename from example/gin-example/templates/about.html rename to example/gin_web_app/gin-example/templates/about.html diff --git a/example/gin-example/templates/index.html b/example/gin_web_app/gin-example/templates/index.html similarity index 100% rename from example/gin-example/templates/index.html rename to example/gin_web_app/gin-example/templates/index.html