Documentation ¶
Index ¶
- Variables
- func New(apiKey string, options ...ConfigOption) (*client, error)
- func NewWithConnector(connector connector.Connector, options ...ConfigOption) (*client, error)
- type Client
- type ConfigOption
- func WithCache(cache repository.Cache) ConfigOption
- func WithPrefetchFlags(identifiers ...string) ConfigOption
- func WithPullInterval(interval uint) ConfigOption
- func WithPullerEnabled(val bool) ConfigOption
- func WithStorage(storage repository.Storage) ConfigOption
- func WithStreamEnabled(val bool) ConfigOption
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
Click to show internal directories.
Click to hide internal directories.