Documentation ¶
Overview ¶
Package eppoclient provides client for eppo.cloud. Check InitClient to get started.
Index ¶
- Constants
- func ToFloat64(val interface{}) (float64, error)
- type Allocation
- type AssignmentEvent
- type AssignmentLogger
- type Config
- type EppoClient
- func (ec *EppoClient) GetAssignment(subjectKey string, flagKey string, subjectAttributes dictionary) (string, error)
- func (ec *EppoClient) GetBoolAssignment(subjectKey string, flagKey string, subjectAttributes dictionary) (bool, error)
- func (ec *EppoClient) GetJSONStringAssignment(subjectKey string, flagKey string, subjectAttributes dictionary) (string, error)
- func (ec *EppoClient) GetNumericAssignment(subjectKey string, flagKey string, subjectAttributes dictionary) (float64, error)
- func (ec *EppoClient) GetStringAssignment(subjectKey string, flagKey string, subjectAttributes dictionary) (string, error)
- type IAssignmentLogger
- type SDKParams
- type Value
- type ValueType
- type Variation
Constants ¶
View Source
const MAX_CACHE_ENTRIES = 1000 // arbitrary; the caching library requires a max limit
View Source
const RAC_ENDPOINT = "/randomized_assignment/v3/config"
View Source
const REQUEST_TIMEOUT_SECONDS = time.Duration(10 * time.Second)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Allocation ¶
type AssignmentEvent ¶
type AssignmentEvent struct { Experiment string `json:"experiment"` FeatureFlag string `json:"featureFlag"` Allocation string `json:"allocation"` Variation Value `json:"variation"` Subject string `json:"subject"` Timestamp string `json:"timestamp"` SubjectAttributes dictionary `json:"subjectAttributes,omitempty"` }
type AssignmentLogger ¶
type AssignmentLogger struct { }
func (*AssignmentLogger) LogAssignment ¶
func (al *AssignmentLogger) LogAssignment(event AssignmentEvent)
type Config ¶
type Config struct { BaseUrl string ApiKey string AssignmentLogger IAssignmentLogger }
type EppoClient ¶
type EppoClient struct {
// contains filtered or unexported fields
}
Client for eppo.cloud. Instance of this struct will be created on calling InitClient. EppoClient will then immediately start polling experiments data from Eppo.
func InitClient ¶
func InitClient(config Config) *EppoClient
InitClient is required to start polling of experiments configurations and create an instance of EppoClient, which could be used to get assignments information.
func (*EppoClient) GetAssignment ¶ added in v2.0.1
func (ec *EppoClient) GetAssignment(subjectKey string, flagKey string, subjectAttributes dictionary) (string, error)
GetAssignment is maintained for backwards capability. It will return a string value for the assignment.
func (*EppoClient) GetBoolAssignment ¶
func (ec *EppoClient) GetBoolAssignment(subjectKey string, flagKey string, subjectAttributes dictionary) (bool, error)
func (*EppoClient) GetJSONStringAssignment ¶ added in v2.0.1
func (ec *EppoClient) GetJSONStringAssignment(subjectKey string, flagKey string, subjectAttributes dictionary) (string, error)
func (*EppoClient) GetNumericAssignment ¶
func (ec *EppoClient) GetNumericAssignment(subjectKey string, flagKey string, subjectAttributes dictionary) (float64, error)
func (*EppoClient) GetStringAssignment ¶
func (ec *EppoClient) GetStringAssignment(subjectKey string, flagKey string, subjectAttributes dictionary) (string, error)
type IAssignmentLogger ¶
type IAssignmentLogger interface {
LogAssignment(event AssignmentEvent)
}
func NewAssignmentLogger ¶
func NewAssignmentLogger() IAssignmentLogger
type Value ¶
type Value struct { ValueType ValueType `json:"valueType"` BoolValue bool `json:"boolValue,omitempty"` NumericValue float64 `json:"numericValue,omitempty"` StringValue string `json:"stringValue,omitempty"` }
func (Value) GetBoolValue ¶ added in v2.0.1
func (Value) GetNumericValue ¶ added in v2.0.1
func (Value) GetStringValue ¶ added in v2.0.1
func (Value) MarshalJSON ¶ added in v2.0.1
func (*Value) UnmarshalJSON ¶
Click to show internal directories.
Click to hide internal directories.