client

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2021 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type UnlaunchClient

type UnlaunchClient struct {
	FeatureStore service.FeatureStore
	// contains filtered or unexported fields
}

UnlaunchClient is the main interface for interacting with Unlaunch

func (*UnlaunchClient) AwaitUntilReady added in v0.0.2

func (c *UnlaunchClient) AwaitUntilReady(timeout time.Duration) error

AwaitUntilReady blocks until the client initialization is done or timeout occurs, whichever comes first

func (*UnlaunchClient) Feature

func (c *UnlaunchClient) Feature(
	featureKey string,
	identity string,
	attributes map[string]interface{},
) *dtos.UnlaunchFeature

Feature ...

func (*UnlaunchClient) IsShutdown

func (c *UnlaunchClient) IsShutdown() bool

func (*UnlaunchClient) Shutdown

func (c *UnlaunchClient) Shutdown()

Shutdown shuts down the client, and all associated go routines

func (*UnlaunchClient) Variation

func (c *UnlaunchClient) Variation(
	featureKey string,
	identity string,
	attributes map[string]interface{},
) string

Variation evaluates and returns the variation (variation key) for this feature. Variations are defined using the Unlaunch console at https://app.unlaunch.io

type UnlaunchClientConfig

type UnlaunchClientConfig struct {
	PollingInterval      time.Duration
	MetricsFlushInterval time.Duration
	MetricsQueueSize     int
	HTTPTimeout          time.Duration
	Host                 string
	OfflineMode          bool
	LoggerConfig         *logger.LogOptions
}

UnlaunchClientConfig contains configuration parameters to fine-tune the client

func DefaultConfig

func DefaultConfig() *UnlaunchClientConfig

DefaultConfig for our users. Not used anywhere internally

type UnlaunchFactory

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

UnlaunchFactory ...

func NewUnlaunchClientFactory

func NewUnlaunchClientFactory(SDKKey string, cfg *UnlaunchClientConfig) (*UnlaunchFactory, error)

NewUnlaunchClientFactory is a factory

func (*UnlaunchFactory) Client

func (f *UnlaunchFactory) Client() *UnlaunchClient

Client ...

Jump to

Keyboard shortcuts

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