feature

package
v0.0.0-...-57b459a Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DecisionMaker

type DecisionMaker interface {
	IsFeatureEnable(featureID string, user *entity.User) bool
}

DecisionMaker determines whether a feature should be turned on or off under certain conditions.

type DecisionMakerFactory

type DecisionMakerFactory interface {
	NewDecision(instrumentation instrumentation.Instrumentation) DecisionMaker
}

DecisionMakerFactory creates feature decision maker.

type DynamicDecisionMaker

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

DynamicDecisionMaker determines whether a feature should be turned on or off under certain conditions.

func (DynamicDecisionMaker) IsFeatureEnable

func (d DynamicDecisionMaker) IsFeatureEnable(featureID string, user *entity.User) bool

IsFeatureEnable determines whether a feature is enabled given featureID.

type DynamicDecisionMakerFactory

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

DynamicDecisionMakerFactory creates feature decision maker.

func NewDynamicDecisionMakerFactory

func NewDynamicDecisionMakerFactory(
	featureToggleRepo repository.FeatureToggle,
	authorizer authorizer.Authorizer,
) DynamicDecisionMakerFactory

NewDynamicDecisionMakerFactory creates DynamicDecisionMakerFactory.

func (DynamicDecisionMakerFactory) NewDecision

NewDecision creates feature decision maker with instrumentation.

type PermissionChecker

type PermissionChecker func(user entity.User) (bool, error)

PermissionChecker checks whether the user is allowed to access a feature

type PermissionToggle

type PermissionToggle string
const (
	AdminPanel PermissionToggle = "admin-panel"
)

type StaticDecisionMaker

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

StaticDecisionMaker makes feature decisions based on hardcoded values.

func (StaticDecisionMaker) IsFeatureEnable

func (s StaticDecisionMaker) IsFeatureEnable(featureID string, user *entity.User) bool

IsFeatureEnable determines whether a feature is enabled given featureID.

type StaticDecisionMakerFactory

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

StaticDecisionMakerFactory creates static feature decision maker.

func NewStaticDecisionMakerFactory

func NewStaticDecisionMakerFactory(authorizer authorizer.Authorizer) StaticDecisionMakerFactory

NewStaticDecisionMakerFactory creates StaticDecisionMakerFactory.

func (StaticDecisionMakerFactory) NewDecision

func (s StaticDecisionMakerFactory) NewDecision(
	instrumentation instrumentation.Instrumentation,
) DecisionMaker

NewDecision creates static feature decision maker with config map.

Jump to

Keyboard shortcuts

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