appconfig

package
v1.4.4 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2022 License: MIT Imports: 9 Imported by: 1

Documentation

Overview

Package appconfig implements a koanf.Provider for AWS AppConfig and provides it to koanf to be parsed by a koanf.Parser.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AppConfig

type AppConfig struct {
	// contains filtered or unexported fields
}

AppConfig implements an AWS AppConfig provider.

func Provider

func Provider(cfg Config) *AppConfig

Provider returns an AWS AppConfig provider.

func ProviderWithClient added in v1.4.0

func ProviderWithClient(cfg Config, client *appconfig.Client) *AppConfig

ProviderWithClient returns an AWS AppConfig provider using an existing AWS appconfig client.

func (*AppConfig) Read

func (ac *AppConfig) Read() (map[string]interface{}, error)

Read is not supported by the appconfig provider.

func (*AppConfig) ReadBytes

func (ac *AppConfig) ReadBytes() ([]byte, error)

ReadBytes returns the raw bytes for parsing.

func (*AppConfig) Watch

func (ac *AppConfig) Watch(cb func(event interface{}, err error)) error

Watch polls AWS AppConfig for configuration updates.

type Config

type Config struct {
	// The AWS AppConfig Application to get. Specify either the application
	// name or the application ID.
	Application string

	// The Client ID for the AppConfig. Enables AppConfig to deploy the
	// configuration in intervals, as defined in the deployment strategy.
	ClientID string

	// The AppConfig configuration to fetch. Specify either the configuration
	// name or the configuration ID.
	Configuration string

	// The AppConfig environment to get. Specify either the environment
	// name or the environment ID.
	Environment string

	// The AppConfig Configuration Version to fetch. Specifying a ClientConfigurationVersion
	// ensures that the configuration is only fetched if it is updated. If not specified,
	// the latest available configuration is fetched always.
	// Setting this to the latest configuration version will return an empty slice of bytes.
	ClientConfigurationVersion string

	// The AWS Access Key ID to use. This value is fetched from the environment
	// if not specified.
	AWSAccessKeyID string

	// The AWS Secret Access Key to use. This value is fetched from the environment
	// if not specified.
	AWSSecretAccessKey string

	// The AWS IAM Role ARN to use. Useful for access requiring IAM AssumeRole.
	AWSRoleARN string

	// The AWS Region to use. This value is fetched from teh environment if not specified.
	AWSRegion string

	// Time interval at which the watcher will refresh the configuration.
	// Defaults to 60 seconds.
	WatchInterval time.Duration
}

Config holds the AWS AppConfig Configuration.

Directories

Path Synopsis
module

Jump to

Keyboard shortcuts

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