decision

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2019 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package decision //

Package decision //

Package decision //

Package decision //

Package decision //

Package decision //

Package decision //

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CompositeExperimentService

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

CompositeExperimentService bridges together the various experiment decision services that ship by default with the SDK

func NewCompositeExperimentService

func NewCompositeExperimentService() *CompositeExperimentService

NewCompositeExperimentService creates a new instance of the CompositeExperimentService

func (CompositeExperimentService) GetDecision

GetDecision returns a decision for the given experiment and user context

type CompositeFeatureService

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

CompositeFeatureService is the default out-of-the-box feature decision service

func NewCompositeFeatureService

func NewCompositeFeatureService() *CompositeFeatureService

NewCompositeFeatureService returns a new instance of the CompositeFeatureService

func (CompositeFeatureService) GetDecision

func (f CompositeFeatureService) GetDecision(decisionContext FeatureDecisionContext, userContext entities.UserContext) (FeatureDecision, error)

GetDecision returns a decision for the given feature and user context

type CompositeService

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

CompositeService is the entrypoint into the decision service. It provides out of the box decision making for Features and Experiments.

func NewCompositeService

func NewCompositeService(notificationCenter notification.Center) *CompositeService

NewCompositeService returns a new instance of the DefeaultDecisionEngine

func (CompositeService) GetFeatureDecision

func (s CompositeService) GetFeatureDecision(featureDecisionContext FeatureDecisionContext, userContext entities.UserContext) (FeatureDecision, error)

GetFeatureDecision returns a decision for the given feature key

func (CompositeService) OnDecision

func (s CompositeService) OnDecision(callback func(notification.DecisionNotification))

OnDecision registers a handler for Decision notifications

type Decision

type Decision struct {
	Reason reasons.Reason
}

Decision contains base information about a decision

type ExperimentBucketerService

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

ExperimentBucketerService makes a decision using the experiment bucketer

func NewExperimentBucketerService

func NewExperimentBucketerService() *ExperimentBucketerService

NewExperimentBucketerService returns a new instance of the ExperimentBucketerService

func (ExperimentBucketerService) GetDecision

GetDecision returns the decision with the variation the user is bucketed into

type ExperimentDecision

type ExperimentDecision struct {
	Decision
	Variation *entities.Variation
}

ExperimentDecision contains the decision information about an experiment

type ExperimentDecisionContext

type ExperimentDecisionContext struct {
	Experiment    *entities.Experiment
	ProjectConfig optimizely.ProjectConfig
}

ExperimentDecisionContext contains the information needed to be able to make a decision for a given experiment

type ExperimentService added in v0.2.0

type ExperimentService interface {
	GetDecision(decisionContext ExperimentDecisionContext, userContext entities.UserContext) (ExperimentDecision, error)
}

ExperimentService can make a decision about an experiment

type FeatureDecision

type FeatureDecision struct {
	Decision
	Source     Source
	Experiment entities.Experiment
	Variation  *entities.Variation
}

FeatureDecision contains the decision information about a feature

type FeatureDecisionContext

type FeatureDecisionContext struct {
	Feature       *entities.Feature
	ProjectConfig optimizely.ProjectConfig
}

FeatureDecisionContext contains the information needed to be able to make a decision for a given feature

type FeatureService added in v0.2.0

type FeatureService interface {
	GetDecision(decisionContext FeatureDecisionContext, userContext entities.UserContext) (FeatureDecision, error)
}

FeatureService can make a decision about a Feature Flag (can be feature test or rollout)

type RolloutService

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

RolloutService makes a feature decision for a given feature rollout

func NewRolloutService

func NewRolloutService() *RolloutService

NewRolloutService returns a new instance of the Rollout service

func (RolloutService) GetDecision

func (r RolloutService) GetDecision(decisionContext FeatureDecisionContext, userContext entities.UserContext) (FeatureDecision, error)

GetDecision returns a decision for the given feature and user context

type Service added in v0.2.0

type Service interface {
	GetFeatureDecision(FeatureDecisionContext, entities.UserContext) (FeatureDecision, error)
	OnDecision(func(notification.DecisionNotification))
}

Service interface is used to make a decision for a given feature or experiment

type Source

type Source string

Source is where the decision came from

const (
	// Rollout - the decision came from a rollout
	Rollout Source = "rollout"
	// FeatureTest - the decision came from a feature test
	FeatureTest Source = "feature-test"
)

Directories

Path Synopsis
Package bucketer //
Package bucketer //
Package evaluator // Package evaluator // Package evaluator //
Package evaluator // Package evaluator // Package evaluator //
matchers
Package matchers // Package matchers // Package matchers // Package matchers // Package matchers // Package matchers //
Package matchers // Package matchers // Package matchers // Package matchers // Package matchers // Package matchers //
matchers/utils
Package utils //
Package utils //
Package reasons //
Package reasons //

Jump to

Keyboard shortcuts

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