appconfigagentv2

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package appconfigagent implements the client for AWS AppConfig agent v2.

If you want to know abont AppConfig Agent, please refer to the following documents:

https://docs.aws.amazon.com/appconfig/latest/userguide/appconfig-agent.html

https://docs.aws.amazon.com/appconfig/latest/userguide/appconfig-agent-how-to-use.html

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BulkEvaluateFeatureFlagResult

type BulkEvaluateFeatureFlagResult struct {
	// The map whose key is the flag key and value is evaluation result
	Evaluations map[string]*FeatureFlagEvaluation
}

Result of BulkEvaluateFeatureFlag

type Client

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

Client for AWS AppConfig Agent

func NewClient

func NewClient(application, environment string, opts ...ClientOption) (*Client, error)

NewClient initialize new Client of AppConfig Agent.

application argument is the name or ID of AWS AppConfig Application. environment argument is the name or ID of AWS AppConfig Environment.

func (*Client) BulkEvaluateFeatureFlag

func (c *Client) BulkEvaluateFeatureFlag(ctx context.Context, configuration string, flagKeys []string, evalCtx map[string]any) (*BulkEvaluateFeatureFlagResult, error)

BulkEvaluateFeatureFlag evaluates multiple flags in feature flag configuration.

configuration argument is the name or ID of AWS AppConfig Configuration. flagKeys argument is the set of flag keys to be evaluated, and if empty, all flags will be evaluated. evalCtx argument is the context value for evaluating multi-variant flags.

func (*Client) EvaluateFeatureFlag

func (c *Client) EvaluateFeatureFlag(ctx context.Context, configuration string, flagKey string, evalCtx map[string]any) (*EvaluateFeatureFlagResult, error)

EvaluateFeatureFlag evaluates a single flag in feature flag configuration.

configuration argument is a name or ID of AWS AppConfig Configuration. evalCtx argument is a context value for evaluating multi-variant flags.

func (*Client) GetConfiguration

func (c *Client) GetConfiguration(ctx context.Context, configuration string) (*GetConfigurationResult, error)

GetConfiguration gets a configuration value.

configuration argument is a name or ID of AWS AppConfig Configuration.

type ClientOption

type ClientOption interface {
	// contains filtered or unexported methods
}

Option for NewClient

func WithBaseURL

func WithBaseURL(baseURL string) ClientOption

WithBaseURL sets a base URL of AppConfig Agent Server. Default value is http://localhost:2772.

func WithHTTPClient

func WithHTTPClient(httpClient *http.Client) ClientOption

WithHTTPClient sets a HTTP client. Default value is http.DefaultClient.

func WithMeterProvider

func WithMeterProvider(meterProvider metric.MeterProvider) ClientOption

WithMeterProvider sets a meter provider of OpenTelemetry.

func WithTracerProvider

func WithTracerProvider(tracerProvider trace.TracerProvider) ClientOption

WithTracerProvider sets a tracer provider of OpenTelemetry.

type EvaluateFeatureFlagResult

type EvaluateFeatureFlagResult struct {
	// Feature flag evaluation result
	Evaluation *FeatureFlagEvaluation
}

Result of EvaluateFeatureFlagResult

type FeatureFlagEvaluation

type FeatureFlagEvaluation struct {
	// Feature flag status
	Enabled bool
	// Feature flag attributes
	Attributes map[string]any
	// Feature flag variant in multi-variant feature flags
	Variant string
}

Evaluated feature flag value

type GetConfigurationResult

type GetConfigurationResult struct {
	ConfigurationBody io.Reader
}

Result of GetConfiguration

Jump to

Keyboard shortcuts

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