featureflag

package module
v0.0.0-...-ea07bd3 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2021 License: MIT Imports: 12 Imported by: 0

README

featureflag

Package featureflag provides dynamically updating feature flags backed by AWS AppConfig.

Docs: godocs.io pkg.go.dev

Demonstration application: featureflag-demo.

Documentation

Overview

Package featureflag provides dynamically updating feature flags backed by AWS AppConfig.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(app, env, conf string, options Options) (*config, error)

New creates a new configuration set that will be periodically updated.

func NewWithClient

func NewWithClient(client *appconfig.Client, app, env, conf string, options Options) (*config, error)

NewWithClient creates a new configuration set using called provided AppConfig client

Types

type FlagNotifier

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

A FlagNotifier watches for changes to specific configuration keys.

func (FlagNotifier) Chan

func (f FlagNotifier) Chan() <-chan struct{}

Chan returns a channel that will be sent to when any of the watched keys changes.

func (FlagNotifier) Close

func (f FlagNotifier) Close()

Close cancels the watcher and frees associated resources.

type Options

type Options struct {
	// PanicOnUpdateError controls behavior when asynchronous updating of
	// configuration state fails.
	PanicOnUpdateError bool

	// ErrorWriter is a Writer to which error messages occuring during the
	// asynchronous configuration update process will be written.
	ErrorWriter io.Writer

	// UpdateInterval controls how often AppConfig will be polled for changes.
	// If UpdateInterval is 0 polling will happen with a default interval of 1
	// minute.
	UpdateInterval time.Duration
}

Options describes options for new configuration sets.

Jump to

Keyboard shortcuts

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