Documentation ¶
Index ¶
- func APIKey(apiKey string) func(r *APIClient)
- func APIOptions(apiOptions ...func(*APIClient)) func(r *Engine)
- func APIUrl(url string) func(r *APIClient)
- func PollingInterval(interval time.Duration) func(r *Engine)
- func Retries(retries int) func(r *APIClient)
- func Timeout(timeout time.Duration) func(r *APIClient)
- type APIClient
- type APIClientMock
- type ConfigAPIInterface
- type Engine
- type EngineOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func APIOptions ¶
APIOptions sets the func option for the engine client API
func PollingInterval ¶
PollingInterval sets the polling interval for the bucketing engine
Types ¶
type APIClient ¶
type APIClient struct {
// contains filtered or unexported fields
}
APIClient represents the API client informations
func NewAPIClient ¶
NewAPIClient creates a bucketing API Client to poll bucketing infos
func (*APIClient) GetConfiguration ¶
func (r *APIClient) GetConfiguration() (*bucketingProto.Bucketing_BucketingResponse, error)
GetConfiguration gets an environment configuration from bucketing file
type APIClientMock ¶
type APIClientMock struct {
// contains filtered or unexported fields
}
APIClientMock represents the API client mock informations
func NewAPIClientMock ¶
func NewAPIClientMock(envID string, responseMock *bucketing.Bucketing_BucketingResponse, statusCode int) *APIClientMock
NewAPIClientMock creates a fake api client that returns a specific response
func (*APIClientMock) GetConfiguration ¶
func (r *APIClientMock) GetConfiguration() (*bucketing.Bucketing_BucketingResponse, error)
GetConfiguration mocks a configuration
type ConfigAPIInterface ¶
type ConfigAPIInterface interface {
GetConfiguration() (*bucketing.Bucketing_BucketingResponse, error)
}
ConfigAPIInterface manage the bucketing configuration
type Engine ¶
type Engine struct {
// contains filtered or unexported fields
}
Engine represents a bucketing engine
func GetBucketingEngineMock ¶
GetBucketingEngineMock returns a bucketing engine with mock config
func (*Engine) GetModifications ¶
func (b *Engine) GetModifications(visitorID string, anonymousID *string, context model.Context) (*model.APIClientResponse, error)
GetModifications gets modifications from Decision API
type EngineOptions ¶
type EngineOptions struct { // PollingInterval is the number of milliseconds between each poll. If -1, then no polling will be done PollingInterval time.Duration }
EngineOptions represents the options for the Bucketing decision mode