experiments

package
v2.0.5 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2024 License: MIT Imports: 10 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClientOption

type ClientOption func(c *ExperimentClient)

func WithDomain added in v2.0.1

func WithDomain(domian string) ClientOption

func WithErrorLogger

func WithErrorLogger(l Logger) ClientOption

func WithLogger

func WithLogger(l Logger) ClientOption

type Config

type Config struct {
	// Host A/B Test server host
	Host string
}

type ExperimentClient

type ExperimentClient struct {
	// Environment control the sdk shoud get which environment data .
	// Valid value is daily, prepub,product
	Environment string

	// APIClient invoke api to connect to pairecservice open api
	APIClient *api.APIClient

	// Logger specifies a logger used to report internal changes within the writer
	Logger Logger

	// ErrorLogger is the logger to report errors
	ErrorLogger Logger
	// contains filtered or unexported fields
}

func NewExperimentClient

func NewExperimentClient(instanceId, regionId, accessKeyId, accessKeySecret, environment string, opts ...ClientOption) (*ExperimentClient, error)

func (*ExperimentClient) BackflowFeatureConsistencyCheckJobData added in v2.0.2

func (e *ExperimentClient) BackflowFeatureConsistencyCheckJobData(backflowData *model.FeatureConsistencyBackflowData) (api.FeatureConsistencyBackflowResponse, error)

func (*ExperimentClient) CheckIfFlowCtrlPlanTargetIsEnabled

func (e *ExperimentClient) CheckIfFlowCtrlPlanTargetIsEnabled(env string, targetId int, currentTimestamp int64) bool

func (*ExperimentClient) GetFlowCtrlPlanMetaList

func (e *ExperimentClient) GetFlowCtrlPlanMetaList(env string, currentTimestamp int64) []model.FlowCtrlPlan

func (*ExperimentClient) GetFlowCtrlPlanTargetList

func (e *ExperimentClient) GetFlowCtrlPlanTargetList(env, sceneName string, currentTimestamp int64) map[int]model.FlowCtrlPlanTargets

func (*ExperimentClient) GetFlowCtrlPlanTargetTraffic

func (e *ExperimentClient) GetFlowCtrlPlanTargetTraffic(env, sceneName string, idList ...string) []FlowCtrlPlanTargetTraffic

func (*ExperimentClient) GetSceneParams

func (e *ExperimentClient) GetSceneParams(sceneName string) model.SceneParams

func (*ExperimentClient) LoadExperimentData

func (e *ExperimentClient) LoadExperimentData()

LoadExperimentData specifies a function to load data from A/B Test Server

func (*ExperimentClient) LoadSceneParamsData

func (e *ExperimentClient) LoadSceneParamsData()

LoadSceneParamsData specifies a function to load param data from A/B Test Server

func (*ExperimentClient) MatchExperiment

func (e *ExperimentClient) MatchExperiment(sceneName string, experimentContext *model.ExperimentContext) *model.ExperimentResult

MatchExperiment specifies to find match experiment by the ExperimentContext If not find the scene return error or return ExperimentResult

func (*ExperimentClient) SyncFeatureConsistencyCheckJobReplayLog added in v2.0.2

func (e *ExperimentClient) SyncFeatureConsistencyCheckJobReplayLog(replyData *model.FeatureConsistencyReplyData) (api.FeatureConsistencyReplyResponse, error)

func (*ExperimentClient) Validate

func (e *ExperimentClient) Validate() error

Validate check the ExperimentClient value

type FlowCtrlPlanTargetTraffic

type FlowCtrlPlanTargetTraffic struct {
	ItemOrExpId   string  `json:"item_or_exp_id"`
	PlanId        int     `json:"plan_id"`
	TargetId      int     `json:"target_id"`
	TargetTraffic float64 `json:"target_traffic"`
	PlanTraffic   float64 `json:"plan_traffic"`
}

type Logger

type Logger interface {
	Printf(string, ...interface{})
}

Logger interface API for log.Logger

type LoggerFunc

type LoggerFunc func(string, ...interface{})

func (LoggerFunc) Printf

func (f LoggerFunc) Printf(msg string, args ...interface{})

Jump to

Keyboard shortcuts

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