Skip to content

This repository contains Go SDKs for interacting with and managing Azure App Configuration Key Values.

License

Notifications You must be signed in to change notification settings

stone-payments/appconfig-go-sdk

Repository files navigation

Documentation

appconfig-go-sdk

appconfig-go-sdk is a Go client library for accessing the Azure App Configuration REST API.

Installation

First, you need to get the library:

go get github.com/stone-payments/appconfig-go-sdk

Then you can import the library into your code:

import "github.com/stone-payments/appconfig-go-sdk"

Usage

import "github.com/stone-payments/appconfig-go-sdk/appconfig/keyvalues"

Construct a new client for the desired resource. In this example, we will use the KeyValue Client.

args := keyvalues.NewClientAzureADArgs{
		ClientID:         clientID,
		ClientSecret:     clientSecret,
		TenantID:         tenantID,
		ResourceEndpoint: endpoint,
	}
client, err := keyvalues.NewClientAzureAD(args)

Then you can use the various methods on the client to access the App Configuration API. For Example:

list, err := client.ListKeyValues(keyvalues.ListKeyValuesArgs{})
kv, err := client.GetKeyValue("mykey", "mylabel")

For more sample code snippets, head over to the example directory.

Testing code that uses appconfig-go-sdk

All clients provide interfaces to SDK calls to improve testability, so you can create a mock struct that implements the methods that you need to test.

Head over to the KeyValues client to see an interface example.

Contributing

Contributions are always welcome. Please, submit pull requests and open new issues!

License

This library is distributed under the MIT license found in the LICENSE file.

About

This repository contains Go SDKs for interacting with and managing Azure App Configuration Key Values.

Topics

Resources

License

Stars

Watchers

Forks

Packages