client

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2022 License: Apache-2.0 Imports: 12 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrSdkCantBeEmpty       = errors.New("SDK key cannot be empty")
	ErrConnectorCannotBeNil = errors.New("connector cannot be nil")
)

Functions

func New

func New(apiKey string, options ...ConfigOption) (*client, error)

New creates a new client instance that connects to CF with the default configuration. For advanced configuration options use ConfigOptions functions

func NewWithConnector

func NewWithConnector(connector connector.Connector, options ...ConfigOption) (*client, error)

Types

type Client

type Client interface {
	WaitForInitialization()
	Evaluate(feature string, target evaluation.Target) evaluation.Evaluation
	Close() error
}

type ConfigOption

type ConfigOption func(config *config)

ConfigOption is used as return value for advanced client configuration using options pattern

func WithCache

func WithCache(cache repository.Cache) ConfigOption

WithCache set custom cache or predefined one from cache package

func WithPrefetchFlags

func WithPrefetchFlags(identifiers ...string) ConfigOption

WithPrefetchFlags set of flags to be prefetched

func WithPullInterval

func WithPullInterval(interval uint) ConfigOption

WithPullInterval set pulling interval in minutes

func WithPullerEnabled

func WithPullerEnabled(val bool) ConfigOption

WithPullerEnabled set puller on or off

func WithStorage

func WithStorage(storage repository.Storage) ConfigOption

WithStorage set custom storage

func WithStreamEnabled

func WithStreamEnabled(val bool) ConfigOption

WithStreamEnabled set stream on or off

Jump to

Keyboard shortcuts

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