experiments

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

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 WithErrorLogger

func WithErrorLogger(l Logger) ClientOption

func WithLogger

func WithLogger(l Logger) ClientOption

type ExperimentClient

type ExperimentClient struct {
	// Host A/B Test server host
	Host string

	// APIClient invoke api to connect to the A/B Test Server
	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(config *api.Configuration, opts ...ClientOption) (*ExperimentClient, error)

func (*ExperimentClient) LoadExperimentData

func (e *ExperimentClient) LoadExperimentData()

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

func (*ExperimentClient) MatchExperiment

func (e *ExperimentClient) MatchExperiment(projectName 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) Validate

func (e *ExperimentClient) Validate() error

Validate check the ExperimentClient value

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