Documentation
¶
Index ¶
- type LargeSegmentsStorageImpl
- func (s *LargeSegmentsStorageImpl) ChangeNumber(name string) int64
- func (s *LargeSegmentsStorageImpl) Count() int
- func (s *LargeSegmentsStorageImpl) IsInLargeSegment(name string, key string) (bool, error)
- func (s *LargeSegmentsStorageImpl) LargeSegmentsForUser(userKey string) []string
- func (s *LargeSegmentsStorageImpl) SetChangeNumber(name string, till int64)
- func (s *LargeSegmentsStorageImpl) TotalKeys(name string) int
- func (s *LargeSegmentsStorageImpl) Update(name string, userKeys []string, till int64)
- type MMSegmentStorage
- func (m *MMSegmentStorage) ChangeNumber(segmentName string) (int64, error)
- func (m *MMSegmentStorage) Keys(segmentName string) *set.ThreadUnsafeSet
- func (m *MMSegmentStorage) SegmentContainsKey(segmentName string, key string) (bool, error)
- func (m *MMSegmentStorage) SegmentKeysCount() int64
- func (m *MMSegmentStorage) SetChangeNumber(name string, till int64) error
- func (m *MMSegmentStorage) Update(name string, toAdd *set.ThreadUnsafeSet, toRemove *set.ThreadUnsafeSet, ...) error
- type MMSplitStorage
- func (m *MMSplitStorage) All() []dtos.SplitDTO
- func (m *MMSplitStorage) ChangeNumber() (int64, error)
- func (m *MMSplitStorage) FetchMany(splitNames []string) map[string]*dtos.SplitDTO
- func (m *MMSplitStorage) GetAllFlagSetNames() []string
- func (m *MMSplitStorage) GetNamesByFlagSets(sets []string) map[string][]string
- func (m *MMSplitStorage) KillLocally(splitName string, defaultTreatment string, changeNumber int64)
- func (m *MMSplitStorage) LargeSegmentNames() *set.ThreadUnsafeSet
- func (m *MMSplitStorage) Remove(splitName string)
- func (m *MMSplitStorage) ReplaceAll(toAdd []dtos.SplitDTO, changeNumber int64) error
- func (m *MMSplitStorage) RuleBasedSegmentNames() *set.ThreadUnsafeSet
- func (m *MMSplitStorage) SegmentNames() *set.ThreadUnsafeSet
- func (m *MMSplitStorage) SetChangeNumber(till int64) error
- func (m *MMSplitStorage) Split(splitName string) *dtos.SplitDTO
- func (m *MMSplitStorage) SplitNames() []string
- func (m *MMSplitStorage) TrafficTypeExists(trafficType string) bool
- func (m *MMSplitStorage) Update(toAdd []dtos.SplitDTO, toRemove []dtos.SplitDTO, till int64)
- type RuleBasedSegmentsStorageImpl
- func (r *RuleBasedSegmentsStorageImpl) All() []dtos.RuleBasedSegmentDTO
- func (r *RuleBasedSegmentsStorageImpl) ChangeNumber() (int64, error)
- func (r *RuleBasedSegmentsStorageImpl) Contains(ruleBasedSegmentNames []string) bool
- func (m *RuleBasedSegmentsStorageImpl) FetchMany(rbsNames []string) map[string]*dtos.RuleBasedSegmentDTO
- func (r *RuleBasedSegmentsStorageImpl) GetRuleBasedSegmentByName(name string) (*dtos.RuleBasedSegmentDTO, error)
- func (r *RuleBasedSegmentsStorageImpl) LargeSegments() *set.ThreadUnsafeSet
- func (r *RuleBasedSegmentsStorageImpl) ReplaceAll(toAdd []dtos.RuleBasedSegmentDTO, changeNumber int64) error
- func (r *RuleBasedSegmentsStorageImpl) RuleBasedSegmentNames() ([]string, error)
- func (r *RuleBasedSegmentsStorageImpl) Segments() *set.ThreadUnsafeSet
- func (r *RuleBasedSegmentsStorageImpl) SetChangeNumber(till int64) error
- func (r *RuleBasedSegmentsStorageImpl) Update(toAdd []dtos.RuleBasedSegmentDTO, toRemove []dtos.RuleBasedSegmentDTO, ...) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LargeSegmentsStorageImpl ¶
type LargeSegmentsStorageImpl struct {
// contains filtered or unexported fields
}
LargeSegmentsStorageImpl implements the LargeSegmentsStorage interface
func NewLargeSegmentsStorage ¶
func NewLargeSegmentsStorage() *LargeSegmentsStorageImpl
NewLargeSegmentsStorage constructs a new LargeSegments cache
func (*LargeSegmentsStorageImpl) ChangeNumber ¶
func (s *LargeSegmentsStorageImpl) ChangeNumber(name string) int64
func (*LargeSegmentsStorageImpl) Count ¶
func (s *LargeSegmentsStorageImpl) Count() int
Count retuns the amount of Large Segments
func (*LargeSegmentsStorageImpl) IsInLargeSegment ¶
func (s *LargeSegmentsStorageImpl) IsInLargeSegment(name string, key string) (bool, error)
func (*LargeSegmentsStorageImpl) LargeSegmentsForUser ¶
func (s *LargeSegmentsStorageImpl) LargeSegmentsForUser(userKey string) []string
SegmentsForUser returns the list of segments a certain user belongs to
func (*LargeSegmentsStorageImpl) SetChangeNumber ¶
func (s *LargeSegmentsStorageImpl) SetChangeNumber(name string, till int64)
func (*LargeSegmentsStorageImpl) TotalKeys ¶
func (s *LargeSegmentsStorageImpl) TotalKeys(name string) int
type MMSegmentStorage ¶
type MMSegmentStorage struct {
// contains filtered or unexported fields
}
MMSegmentStorage contains is an in-memory implementation of segment storage
func NewMMSegmentStorage ¶
func NewMMSegmentStorage() *MMSegmentStorage
NewMMSegmentStorage instantiates a new MMSegmentStorage
func (*MMSegmentStorage) ChangeNumber ¶
func (m *MMSegmentStorage) ChangeNumber(segmentName string) (int64, error)
ChangeNumber returns the latest timestamp the segment was fetched
func (*MMSegmentStorage) Keys ¶
func (m *MMSegmentStorage) Keys(segmentName string) *set.ThreadUnsafeSet
Keys retrieves a segment from the in-memory storage NOTE: A pointer TO A COPY is returned, in order to avoid race conditions between evaluations and sdk <-> backend sync
func (*MMSegmentStorage) SegmentContainsKey ¶
func (m *MMSegmentStorage) SegmentContainsKey(segmentName string, key string) (bool, error)
SegmentContainsKey returns true if the segment contains a specific key
func (*MMSegmentStorage) SegmentKeysCount ¶
func (m *MMSegmentStorage) SegmentKeysCount() int64
SegmentKeysCount returns the total number of cached segment keys
func (*MMSegmentStorage) SetChangeNumber ¶
func (m *MMSegmentStorage) SetChangeNumber(name string, till int64) error
SetChangeNumber sets the till value belong to segmentName
func (*MMSegmentStorage) Update ¶
func (m *MMSegmentStorage) Update(name string, toAdd *set.ThreadUnsafeSet, toRemove *set.ThreadUnsafeSet, till int64) error
Update adds a new segment to the in-memory storage
type MMSplitStorage ¶
type MMSplitStorage struct {
// contains filtered or unexported fields
}
MMSplitStorage struct contains is an in-memory implementation of split storage
func NewMMSplitStorage ¶
func NewMMSplitStorage(flagSetFilter flagsets.FlagSetFilter) *MMSplitStorage
NewMMSplitStorage instantiates a new MMSplitStorage
func (*MMSplitStorage) All ¶
func (m *MMSplitStorage) All() []dtos.SplitDTO
All returns a list with a copy of each split. NOTE: This method will block any further operations regarding splits. Use with caution
func (*MMSplitStorage) ChangeNumber ¶
func (m *MMSplitStorage) ChangeNumber() (int64, error)
ChangeNumber returns the last timestamp the split was fetched
func (*MMSplitStorage) FetchMany ¶
func (m *MMSplitStorage) FetchMany(splitNames []string) map[string]*dtos.SplitDTO
FetchMany fetches features in redis and returns an array of split dtos
func (*MMSplitStorage) GetAllFlagSetNames ¶
func (m *MMSplitStorage) GetAllFlagSetNames() []string
func (*MMSplitStorage) GetNamesByFlagSets ¶
func (m *MMSplitStorage) GetNamesByFlagSets(sets []string) map[string][]string
GetNamesByFlagSets grabs all the feature flags linked to the passed sets
func (*MMSplitStorage) KillLocally ¶
func (m *MMSplitStorage) KillLocally(splitName string, defaultTreatment string, changeNumber int64)
KillLocally kills the split locally
func (*MMSplitStorage) LargeSegmentNames ¶
func (m *MMSplitStorage) LargeSegmentNames() *set.ThreadUnsafeSet
LargeSegmentNames returns a slice with the names of all large segments referenced in splits
func (*MMSplitStorage) Remove ¶
func (m *MMSplitStorage) Remove(splitName string)
Remove deletes a split from the in-memory storage
func (*MMSplitStorage) ReplaceAll ¶
func (m *MMSplitStorage) ReplaceAll(toAdd []dtos.SplitDTO, changeNumber int64) error
func (*MMSplitStorage) RuleBasedSegmentNames ¶
func (m *MMSplitStorage) RuleBasedSegmentNames() *set.ThreadUnsafeSet
func (*MMSplitStorage) SegmentNames ¶
func (m *MMSplitStorage) SegmentNames() *set.ThreadUnsafeSet
SegmentNames returns a slice with the names of all segments referenced in splits
func (*MMSplitStorage) SetChangeNumber ¶
func (m *MMSplitStorage) SetChangeNumber(till int64) error
SetChangeNumber sets the till value belong to split
func (*MMSplitStorage) Split ¶
func (m *MMSplitStorage) Split(splitName string) *dtos.SplitDTO
Split retrieves a split from the MMSplitStorage NOTE: A pointer TO A COPY is returned, in order to avoid race conditions between evaluations and sdk <-> backend sync
func (*MMSplitStorage) SplitNames ¶
func (m *MMSplitStorage) SplitNames() []string
SplitNames returns a slice with the names of all the current splits
func (*MMSplitStorage) TrafficTypeExists ¶
func (m *MMSplitStorage) TrafficTypeExists(trafficType string) bool
TrafficTypeExists returns true or false depending on existence and counter of trafficType
type RuleBasedSegmentsStorageImpl ¶
type RuleBasedSegmentsStorageImpl struct {
// contains filtered or unexported fields
}
RuleBasedSegmentsStorageImpl implements the RuleBasedSegmentsStorage interface
func NewRuleBasedSegmentsStorage ¶
func NewRuleBasedSegmentsStorage() *RuleBasedSegmentsStorageImpl
NewRuleBasedSegmentsStorage constructs a new RuleBasedSegments cache
func (*RuleBasedSegmentsStorageImpl) All ¶
func (r *RuleBasedSegmentsStorageImpl) All() []dtos.RuleBasedSegmentDTO
All returns a list with a copy of each rule-based. NOTE: This method will block any further operations regarding rule-baseds. Use with caution
func (*RuleBasedSegmentsStorageImpl) ChangeNumber ¶
func (r *RuleBasedSegmentsStorageImpl) ChangeNumber() (int64, error)
ChangeNumber return the actual rule-based till
func (*RuleBasedSegmentsStorageImpl) Contains ¶
func (r *RuleBasedSegmentsStorageImpl) Contains(ruleBasedSegmentNames []string) bool
Contains returns true or false if all the rule-based segment names are present
func (*RuleBasedSegmentsStorageImpl) FetchMany ¶
func (m *RuleBasedSegmentsStorageImpl) FetchMany(rbsNames []string) map[string]*dtos.RuleBasedSegmentDTO
FetchMany fetches rule-based segments in the storage and returns an array of rule-based segments dtos
func (*RuleBasedSegmentsStorageImpl) GetRuleBasedSegmentByName ¶
func (r *RuleBasedSegmentsStorageImpl) GetRuleBasedSegmentByName(name string) (*dtos.RuleBasedSegmentDTO, error)
func (*RuleBasedSegmentsStorageImpl) LargeSegments ¶
func (r *RuleBasedSegmentsStorageImpl) LargeSegments() *set.ThreadUnsafeSet
func (*RuleBasedSegmentsStorageImpl) ReplaceAll ¶
func (r *RuleBasedSegmentsStorageImpl) ReplaceAll(toAdd []dtos.RuleBasedSegmentDTO, changeNumber int64) error
func (*RuleBasedSegmentsStorageImpl) RuleBasedSegmentNames ¶
func (r *RuleBasedSegmentsStorageImpl) RuleBasedSegmentNames() ([]string, error)
RuleBasedSegmentNames returns a slice with the names of all the current rule-baseds
func (*RuleBasedSegmentsStorageImpl) Segments ¶
func (r *RuleBasedSegmentsStorageImpl) Segments() *set.ThreadUnsafeSet
SegmentNames returns a slice with the names of all segments referenced in rule-based
func (*RuleBasedSegmentsStorageImpl) SetChangeNumber ¶
func (r *RuleBasedSegmentsStorageImpl) SetChangeNumber(till int64) error
SetChangeNumber sets the till value belong to rule-based
func (*RuleBasedSegmentsStorageImpl) Update ¶
func (r *RuleBasedSegmentsStorageImpl) Update(toAdd []dtos.RuleBasedSegmentDTO, toRemove []dtos.RuleBasedSegmentDTO, till int64) error
Update atomically registers new rule-based segments, removes archived ones and updates the change number