mutexmap

package
v6.0.2 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2024 License: Apache-2.0 Imports: 7 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LargeSegmentsStorageImpl added in v6.0.2

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

LargeSegmentsStorageImpl implements the LargeSegmentsStorage interface

func NewLargeSegmentsStorage added in v6.0.2

func NewLargeSegmentsStorage() *LargeSegmentsStorageImpl

NewLargeSegmentsStorage constructs a new LargeSegments cache

func (*LargeSegmentsStorageImpl) ChangeNumber added in v6.0.2

func (s *LargeSegmentsStorageImpl) ChangeNumber(name string) int64

func (*LargeSegmentsStorageImpl) Count added in v6.0.2

func (s *LargeSegmentsStorageImpl) Count() int

Count retuns the amount of Large Segments

func (*LargeSegmentsStorageImpl) IsInLargeSegment added in v6.0.2

func (s *LargeSegmentsStorageImpl) IsInLargeSegment(name string, key string) (bool, error)

func (*LargeSegmentsStorageImpl) LargeSegmentsForUser added in v6.0.2

func (s *LargeSegmentsStorageImpl) LargeSegmentsForUser(userKey string) []string

SegmentsForUser returns the list of segments a certain user belongs to

func (*LargeSegmentsStorageImpl) SetChangeNumber added in v6.0.2

func (s *LargeSegmentsStorageImpl) SetChangeNumber(name string, till int64)

func (*LargeSegmentsStorageImpl) TotalKeys added in v6.0.2

func (s *LargeSegmentsStorageImpl) TotalKeys(name string) int

func (*LargeSegmentsStorageImpl) Update added in v6.0.2

func (s *LargeSegmentsStorageImpl) Update(name string, userKeys []string, till int64)

Update adds and remove keys to segments

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 added in v6.0.2

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) 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

func (*MMSplitStorage) Update

func (m *MMSplitStorage) Update(toAdd []dtos.SplitDTO, toRemove []dtos.SplitDTO, till int64)

Update atomically registers new splits, removes archived ones and updates the change number

Jump to

Keyboard shortcuts

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