From 81cd8f32607e4c6e1e6ba635fbd9ad673690a096 Mon Sep 17 00:00:00 2001 From: linglingye001 <143174321+linglingye001@users.noreply.github.com> Date: Mon, 9 Jun 2025 14:51:42 +0800 Subject: [PATCH 1/3] Callback nil check (#28) * callback nil check * update * nil check --- azureappconfiguration/azureappconfiguration.go | 4 ++++ 1 file changed, 4 insertions(+) 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) } From dc9a93f5878cf894347997c4f7c89507fbad938e Mon Sep 17 00:00:00 2001 From: linglingye001 <143174321+linglingye001@users.noreply.github.com> Date: Thu, 19 Jun 2025 15:03:24 +0800 Subject: [PATCH 2/3] Update README (#32) --- README.md | 13 +++++++++++-- azureappconfiguration/README.md | 13 +++++++++++-- .../console_example}/README.md | 0 .../console_example}/go.mod | 4 +--- .../console_example}/go.sum | 0 .../console_example}/main.go | 0 .../console_example_refresh}/README.md | 0 .../console_example_refresh}/go.mod | 4 +--- .../console_example_refresh}/go.sum | 0 .../console_example_refresh}/main.go | 0 .../{ => gin_web_app}/gin-example-refresh/README.md | 0 .../{ => gin_web_app}/gin-example-refresh/go.mod | 4 +--- .../{ => gin_web_app}/gin-example-refresh/go.sum | 0 .../{ => gin_web_app}/gin-example-refresh/main.go | 0 .../gin-example-refresh/templates/about.html | 0 .../gin-example-refresh/templates/index.html | 0 example/{ => gin_web_app}/gin-example/README.md | 0 example/{ => gin_web_app}/gin-example/go.mod | 4 +--- example/{ => gin_web_app}/gin-example/go.sum | 0 example/{ => gin_web_app}/gin-example/main.go | 0 .../gin-example/templates/about.html | 0 .../gin-example/templates/index.html | 0 22 files changed, 26 insertions(+), 16 deletions(-) rename example/{console-example => console_app/console_example}/README.md (100%) rename example/{console-example => console_app/console_example}/go.mod (81%) rename example/{console-example => console_app/console_example}/go.sum (100%) rename example/{console-example => console_app/console_example}/main.go (100%) rename example/{console-example-refresh => console_app/console_example_refresh}/README.md (100%) rename example/{console-example-refresh => console_app/console_example_refresh}/go.mod (81%) rename example/{console-example-refresh => console_app/console_example_refresh}/go.sum (100%) rename example/{console-example-refresh => console_app/console_example_refresh}/main.go (100%) rename example/{ => gin_web_app}/gin-example-refresh/README.md (100%) rename example/{ => gin_web_app}/gin-example-refresh/go.mod (92%) rename example/{ => gin_web_app}/gin-example-refresh/go.sum (100%) rename example/{ => gin_web_app}/gin-example-refresh/main.go (100%) rename example/{ => gin_web_app}/gin-example-refresh/templates/about.html (100%) rename example/{ => gin_web_app}/gin-example-refresh/templates/index.html (100%) rename example/{ => gin_web_app}/gin-example/README.md (100%) rename example/{ => gin_web_app}/gin-example/go.mod (93%) rename example/{ => gin_web_app}/gin-example/go.sum (100%) rename example/{ => gin_web_app}/gin-example/main.go (100%) rename example/{ => gin_web_app}/gin-example/templates/about.html (100%) rename example/{ => gin_web_app}/gin-example/templates/index.html (100%) 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/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 From b267b7fc4a443d7e94623e07b1014ce000ff5b7d Mon Sep 17 00:00:00 2001 From: linglingye001 <143174321+linglingye001@users.noreply.github.com> Date: Thu, 19 Jun 2025 15:22:39 +0800 Subject: [PATCH 3/3] bump up version 1.0.0 (#33) --- azureappconfiguration/version.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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" )