storage

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: 3 Imported by: 15

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DataDropper

type DataDropper interface {
	Drop(size int64) error
}

DataDropper interface is used by dependants who need to drop data from a collection

type EventMultiSdkConsumer

type EventMultiSdkConsumer interface {
	Count() int64
	PopNRaw(int64) ([]string, int64, error)
	PopNWithMetadata(n int64) ([]dtos.QueueStoredEventDTO, error)
}

EventMultiSdkConsumer defines the methods required to consume events from a stored shared by many sdks

type EventStorageConsumer

type EventStorageConsumer interface {
	Empty() bool
	PopN(n int64) ([]dtos.EventDTO, error)
}

EventStorageConsumer interface should be implemented by structs that offer popping impressions

type EventStorageProducer

type EventStorageProducer interface {
	Push(event dtos.EventDTO, size int) error
}

EventStorageProducer interface should be implemented by structs that accept incoming events

type EventsStorage

type EventsStorage interface {
	EventStorageConsumer
	EventStorageProducer
}

EventsStorage wraps consumer and producer interfaces

type Filter

type Filter interface {
	Add(data string)
	Contains(data string) bool
	Clear()
}

Filter interfaces

type ImpressionMultiSdkConsumer

type ImpressionMultiSdkConsumer interface {
	Count() int64
	PopNRaw(int64) ([]string, int64, error)
	PopNWithMetadata(n int64) ([]dtos.ImpressionQueueObject, error)
}

ImpressionMultiSdkConsumer defines the methods required to consume impressions from a stored shared by many sdks

type ImpressionStorage

ImpressionStorage wraps consumer & producer interfaces

type ImpressionStorageConsumer

type ImpressionStorageConsumer interface {
	Empty() bool
	PopN(n int64) ([]dtos.Impression, error)
}

ImpressionStorageConsumer interface should be implemented by structs that offer popping impressions

type ImpressionStorageProducer

type ImpressionStorageProducer interface {
	LogImpressions(impressions []dtos.Impression) error
}

ImpressionStorageProducer interface should be impemented by structs that accept incoming impressions

type ImpressionsCountConsumer

type ImpressionsCountConsumer interface {
	GetImpressionsCount() (*dtos.ImpressionsCountDTO, error)
}

ImpressionsCountProducer interface

type ImpressionsCountProducer

type ImpressionsCountProducer interface {
	RecordImpressionsCount(impressions dtos.ImpressionsCountDTO) error
}

ImpressionsCountProducer interface

type ImpressionsCountStorage

type ImpressionsCountStorage interface {
	ImpressionsCountConsumer
	ImpressionsCountProducer
}

type LargeSegmentStorageConsumer added in v6.0.2

type LargeSegmentStorageConsumer interface {
	ChangeNumber(name string) int64
	Count() int
	LargeSegmentsForUser(userKey string) []string
	IsInLargeSegment(name string, key string) (bool, error)
	TotalKeys(name string) int
}

SegmentStorageConsumer interface should be implemented by all structs that ofer reading large segments

type LargeSegmentStorageProducer added in v6.0.2

type LargeSegmentStorageProducer interface {
	SetChangeNumber(name string, till int64)
	Update(name string, userKeys []string, till int64)
}

LargeSegmentStorageProducer interface should be implemented by all structs that offer writing large segments

type LargeSegmentsStorage added in v6.0.2

type LargeSegmentsStorage interface {
	LargeSegmentStorageProducer
	LargeSegmentStorageConsumer
}

LargeSegmentsStorage defines the interface for a per-user large segments storage

type SegmentStorage

type SegmentStorage interface {
	SegmentStorageProducer
	SegmentStorageConsumer
}

SegmentStorage wraps consumer and producer interfaces

type SegmentStorageConsumer

type SegmentStorageConsumer interface {
	ChangeNumber(segmentName string) (int64, error)
	Keys(segmentName string) *set.ThreadUnsafeSet
	SegmentContainsKey(segmentName string, key string) (bool, error)
	SegmentKeysCount() int64
}

SegmentStorageConsumer interface should be implemented by all structs that ofer reading segments

type SegmentStorageProducer

type SegmentStorageProducer interface {
	Update(name string, toAdd *set.ThreadUnsafeSet, toRemove *set.ThreadUnsafeSet, changeNumber int64) error
	SetChangeNumber(segmentName string, till int64) error
}

SegmentStorageProducer interface should be implemented by all structs that offer writing segments

type SplitStorage

type SplitStorage interface {
	ChangeNumber() (int64, error)
	Update(toAdd []dtos.SplitDTO, toRemove []dtos.SplitDTO, changeNumber int64)
	KillLocally(splitName string, defaultTreatment string, changeNumber int64)
	SetChangeNumber(changeNumber int64) error
	All() []dtos.SplitDTO
	FetchMany(splitNames []string) map[string]*dtos.SplitDTO
	SegmentNames() *set.ThreadUnsafeSet      // Not in Spec
	LargeSegmentNames() *set.ThreadUnsafeSet // Not in Spec
	Split(splitName string) *dtos.SplitDTO
	SplitNames() []string
	TrafficTypeExists(trafficType string) bool
	GetNamesByFlagSets(sets []string) map[string][]string
	GetAllFlagSetNames() []string
}

SplitStorage wraps consumer & producer interfaces Note: Since go's interface composition does not (yet) support interface method overlap, extracting a common subset (.ChangeNumber()), embedding it in Both consumer & Producer, and then having a wide interface that embeds both (diamond composition), results in a compilation error. The only workaround so far is to explicitly define all the methods that make up the composed interface

type SplitStorageConsumer

type SplitStorageConsumer interface {
	ChangeNumber() (int64, error)
	All() []dtos.SplitDTO
	FetchMany(splitNames []string) map[string]*dtos.SplitDTO
	SegmentNames() *set.ThreadUnsafeSet      // Not in Spec
	LargeSegmentNames() *set.ThreadUnsafeSet // Not in Spec
	Split(splitName string) *dtos.SplitDTO
	SplitNames() []string
	TrafficTypeExists(trafficType string) bool
	GetNamesByFlagSets(sets []string) map[string][]string
	GetAllFlagSetNames() []string
}

SplitStorageConsumer should be implemented by structs that offer reading splits from storage

type SplitStorageProducer

type SplitStorageProducer interface {
	ChangeNumber() (int64, error)
	Update(toAdd []dtos.SplitDTO, toRemove []dtos.SplitDTO, changeNumber int64)
	KillLocally(splitName string, defaultTreatment string, changeNumber int64)
	SetChangeNumber(changeNumber int64) error
}

SplitStorageProducer should be implemented by structs that offer writing splits in storage

type TelemetryConfigConsumer

type TelemetryConfigConsumer interface {
	GetNonReadyUsages() int64
	GetBURTimeouts() int64
}

TelemetryConfigConsumer interface for config data

type TelemetryConfigProducer

type TelemetryConfigProducer interface {
	RecordConfigData(configData dtos.Config) error
	RecordNonReadyUsage()
	RecordBURTimeout()
	RecordUniqueKeys(uniques dtos.Uniques) error
}

TelemetryConfigProducer interface for config data

type TelemetryEvaluationConsumer

type TelemetryEvaluationConsumer interface {
	PopLatencies() dtos.MethodLatencies
	PopExceptions() dtos.MethodExceptions
}

TelemetryEvaluationConsumer for evaluation

type TelemetryEvaluationProducer

type TelemetryEvaluationProducer interface {
	RecordLatency(method string, latency time.Duration)
	RecordException(method string)
}

TelemetryEvaluationProducer for evaluation

type TelemetryPeeker

type TelemetryPeeker interface {
	PeekHTTPLatencies(resource int) []int64
	PeekHTTPErrors(resource int) map[int]int
}

TelemetryPeeker interface

type TelemetryRedisProducer

type TelemetryRedisProducer interface {
	TelemetryConfigProducer
	TelemetryEvaluationProducer
}

TelemetryRedisProducer interface redis

type TelemetryRuntimeConsumer

type TelemetryRuntimeConsumer interface {
	GetImpressionsStats(dataType int) int64
	GetEventsStats(dataType int) int64
	GetLastSynchronization() dtos.LastSynchronization
	PopHTTPErrors() dtos.HTTPErrors
	PopHTTPLatencies() dtos.HTTPLatencies
	PopAuthRejections() int64
	PopTokenRefreshes() int64
	PopStreamingEvents() []dtos.StreamingEvent
	PopTags() []string
	GetSessionLength() int64
	PopUpdatesFromSSE() dtos.UpdatesFromSSE
}

TelemetryRuntimeConsumer for runtime stats

type TelemetryRuntimeProducer

type TelemetryRuntimeProducer interface {
	AddTag(tag string)
	RecordImpressionsStats(dataType int, count int64)
	RecordEventsStats(dataType int, count int64)
	RecordSuccessfulSync(resource int, when time.Time)
	RecordSyncError(resource int, status int)
	RecordSyncLatency(resource int, latency time.Duration)
	RecordAuthRejections()
	RecordTokenRefreshes()
	RecordStreamingEvent(streamingEvent *dtos.StreamingEvent)
	RecordSessionLength(session int64)
	RecordUpdatesFromSSE(updateType int)
}

TelemetryRuntimeProducer for runtime stats

type TelemetryStorage

type TelemetryStorage interface {
	TelemetryStorageConsumer
	TelemetryStorageProducer
}

TelemetryStorage wraps consumer and producer interfaces

type TelemetryStorageConsumer

TelemetryStorageConsumer interface should be implemented by structs that offer popping telemetry

type TelemetryStorageProducer

TelemetryStorageProducer interface should be implemented by struct that accepts incoming telemetry

type UniqueKeysMultiSdkConsumer

type UniqueKeysMultiSdkConsumer interface {
	Count() int64
	PopNRaw(int64) ([]string, int64, error)
}

UniqueKeysMultiSdkConsumer defines the methods required to consume unique keys from a stored shared by many sdks

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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