eppoclient

package
v3.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package eppoclient provides client for eppo.cloud. Check InitClient to get started.

Index

Constants

View Source
const REQUEST_TIMEOUT_SECONDS = time.Duration(10 * time.Second)
View Source
const UFC_ENDPOINT = "/flag-config/v1/config"

Variables

This section is empty.

Functions

This section is empty.

Types

type AssignmentEvent

type AssignmentEvent struct {
	Experiment        string            `json:"experiment"`
	FeatureFlag       string            `json:"featureFlag"`
	Allocation        string            `json:"allocation"`
	Variation         string            `json:"variation"`
	Subject           string            `json:"subject"`
	SubjectAttributes SubjectAttributes `json:"subjectAttributes,omitempty"`
	Timestamp         string            `json:"timestamp"`
	MetaData          map[string]string `json:"metaData"`
	ExtraLogging      map[string]string `json:"extraLogging,omitempty"`
}

type AssignmentLogger

type AssignmentLogger struct {
}

func (*AssignmentLogger) LogAssignment

func (al *AssignmentLogger) LogAssignment(event AssignmentEvent)

type Config

type Config struct {
	BaseUrl          string
	SdkKey           string
	AssignmentLogger IAssignmentLogger
	PollerInterval   time.Duration
}

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) GetBoolAssignment

func (ec *EppoClient) GetBoolAssignment(subjectKey string, flagKey string, subjectAttributes SubjectAttributes, defaultValue bool) (bool, error)

func (*EppoClient) GetIntegerAssignment

func (ec *EppoClient) GetIntegerAssignment(subjectKey string, flagKey string, subjectAttributes SubjectAttributes, defaultValue int64) (int64, error)

func (*EppoClient) GetJSONAssignment

func (ec *EppoClient) GetJSONAssignment(subjectKey string, flagKey string, subjectAttributes SubjectAttributes, defaultValue interface{}) (interface{}, error)

func (*EppoClient) GetNumericAssignment

func (ec *EppoClient) GetNumericAssignment(subjectKey string, flagKey string, subjectAttributes SubjectAttributes, defaultValue float64) (float64, error)

func (*EppoClient) GetStringAssignment

func (ec *EppoClient) GetStringAssignment(subjectKey string, flagKey string, subjectAttributes SubjectAttributes, defaultValue string) (string, error)

type IAssignmentLogger

type IAssignmentLogger interface {
	LogAssignment(event AssignmentEvent)
}

func NewAssignmentLogger

func NewAssignmentLogger() IAssignmentLogger

type SDKParams

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

type SubjectAttributes

type SubjectAttributes map[string]interface{}

Jump to

Keyboard shortcuts

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