grammar

package
v5.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// SplitStatusActive represents an active feature flag
	SplitStatusActive = "ACTIVE"
	// SplitStatusArchived represents an archived feature flag
	SplitStatusArchived = "ARCHIVED"

	// SplitAlgoLegacy represents the legacy implementation of hash function for bucketing
	SplitAlgoLegacy = 1

	// SplitAlgoMurmur represents the murmur implementation of the hash funcion for bucketing
	SplitAlgoMurmur = 2

	// ConditionTypeWhitelist represents a normal condition
	ConditionTypeWhitelist = "WHITELIST"
	// ConditionTypeRollout represents a condition that will return default if traffic allocatio is exceeded
	ConditionTypeRollout = "ROLLOUT"

	// MatcherCombinerAnd represents that all matchers in the group are required
	MatcherCombinerAnd = 0
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Condition

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

Condition struct with added logic that wraps around a DTO

func NewCondition

func NewCondition(cond *dtos.ConditionDTO, ctx *injection.Context, logger logging.LoggerInterface) *Condition

NewCondition instantiates a new Condition struct with appropriate wrappers around dtos and returns it.

func (*Condition) CalculateTreatment

func (c *Condition) CalculateTreatment(bucket int) *string

CalculateTreatment calulates the treatment for a specific condition based on the bucket

func (*Condition) ConditionType

func (c *Condition) ConditionType() string

ConditionType returns validated condition type. Whitelist by default

func (*Condition) Label

func (c *Condition) Label() string

Label returns the condition's label

func (*Condition) Matches

func (c *Condition) Matches(key string, bucketingKey *string, attributes map[string]interface{}) bool

Matches returns true if the condition matches for a specific key and/or set of attributes

type Partition

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

Partition struct with added logic that wraps around a DTO

type Split

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

Split struct with added logic that wraps around a DTO

func NewSplit

func NewSplit(splitDTO *dtos.SplitDTO, ctx *injection.Context, logger logging.LoggerInterface) *Split

NewSplit instantiates a new Split object and all it's internal structures mapped to model classes

func (*Split) Algo

func (s *Split) Algo() int

Algo returns the hashing algorithm configured for this feature flag

func (*Split) ChangeNumber

func (s *Split) ChangeNumber() int64

ChangeNumber returns the change number for this feature flag

func (*Split) Conditions

func (s *Split) Conditions() []*Condition

Conditions returns a slice of Condition objects

func (*Split) Configurations

func (s *Split) Configurations() map[string]string

Configurations returns the configurations for this feature flag

func (*Split) DefaultTreatment

func (s *Split) DefaultTreatment() string

DefaultTreatment returns the default treatment for the current feature flag

func (*Split) Killed

func (s *Split) Killed() bool

Killed returns whether the feature flag has been killed or not

func (*Split) Name

func (s *Split) Name() string

Name returns the name of the feature

func (*Split) Seed

func (s *Split) Seed() int64

Seed returns the seed use for hashing

func (*Split) Status

func (s *Split) Status() string

Status returns whether the feature flag is active or arhived

func (*Split) TrafficAllocation

func (s *Split) TrafficAllocation() int

TrafficAllocation returns the traffic allocation configured for the current feature flag

func (*Split) TrafficAllocationSeed

func (s *Split) TrafficAllocationSeed() int64

TrafficAllocationSeed returns the seed for traffic allocation configured for this feature flag

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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