eppoclient

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: May 15, 2023 License: MIT Imports: 15 Imported by: 0

Documentation

Overview

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

Index

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

This section is empty.

Types

type Allocation added in v1.1.0

type Allocation struct {
	PercentExposure float32     `json:"percentExposure"`
	Variations      []Variation `json:"variations"`
}

type AssignmentEvent added in v1.0.2

type AssignmentEvent struct {
	Experiment        string
	Variation         string
	Subject           string
	Timestamp         string
	SubjectAttributes dictionary
}

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

func (ec *EppoClient) GetAssignment(subjectKey string, flagKey string, subjectAttributes dictionary) (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 Value added in v1.1.0

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

func Bool added in v1.1.0

func Bool(value bool) Value

func Null added in v1.1.0

func Null() Value

func String added in v1.1.0

func String(value string) Value

func (Value) BoolValue added in v1.1.0

func (v Value) BoolValue() bool

func (Value) StringValue added in v1.1.0

func (v Value) StringValue() string

func (*Value) UnmarshalJSON added in v1.1.0

func (receiver *Value) UnmarshalJSON(data []byte) error

type ValueType added in v1.1.0

type ValueType int
const (
	NullType   ValueType = iota
	BoolType   ValueType = iota
	StringType ValueType = iota
)

type Variation

type Variation struct {
	Name       string     `json:"name"`
	Value      Value      `json:"value"`
	ShardRange shardRange `json:"shardRange"`
}

Jump to

Keyboard shortcuts

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