mocks

package
v5.2.1 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2024 License: Apache-2.0 Imports: 3 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MockEventStorage

type MockEventStorage struct {
	EmptyCall            func() bool
	CountCall            func() int64
	PopNCall             func(n int64) ([]dtos.EventDTO, error)
	PopNWithMetadataCall func(n int64) ([]dtos.QueueStoredEventDTO, error)
	PushCall             func(event dtos.EventDTO, size int) error
	DropCall             func(size *int64) error
	PopNRawCall          func(size int64) ([]string, int64, error)
}

MockEventStorage is a mocked implementation of Event Storage

func (MockEventStorage) Count

func (m MockEventStorage) Count() int64

Count mock

func (MockEventStorage) Drop

func (m MockEventStorage) Drop(size *int64) error

Drop mock

func (MockEventStorage) Empty

func (m MockEventStorage) Empty() bool

Empty mock

func (MockEventStorage) PopN

func (m MockEventStorage) PopN(n int64) ([]dtos.EventDTO, error)

PopN mock

func (MockEventStorage) PopNRaw

func (m MockEventStorage) PopNRaw(size int64) ([]string, int64, error)

PopNRaw mock

func (MockEventStorage) PopNWithMetadata

func (m MockEventStorage) PopNWithMetadata(n int64) ([]dtos.QueueStoredEventDTO, error)

PopNWithMetadata mock

func (MockEventStorage) Push

func (m MockEventStorage) Push(event dtos.EventDTO, size int) error

Push mock

type MockFilter

type MockFilter struct {
	AddCall      func(data string)
	ContainsCall func(data string) bool
	ClearCall    func()
}

MockFilter is a mocked implementation of BloomFilter

func (MockFilter) Add

func (m MockFilter) Add(data string)

Add mock

func (MockFilter) Clear

func (m MockFilter) Clear()

Clear mock

func (MockFilter) Contains

func (m MockFilter) Contains(data string) bool

Contains mock

type MockImpressionStorage

type MockImpressionStorage struct {
	PopNRawCall          func(int64) ([]string, int64, error)
	EmptyCall            func() bool
	CountCall            func() int64
	LogImpressionsCall   func(impressions []dtos.Impression) error
	PopNCall             func(n int64) ([]dtos.Impression, error)
	PopNWithMetadataCall func(n int64) ([]dtos.ImpressionQueueObject, error)
	DropCall             func(size *int64) error
}

MockImpressionStorage is a mocked implementation of Impression Storage

func (MockImpressionStorage) Count

func (m MockImpressionStorage) Count() int64

Count mock

func (MockImpressionStorage) Drop

func (m MockImpressionStorage) Drop(size *int64) error

Drop mock

func (MockImpressionStorage) Empty

func (m MockImpressionStorage) Empty() bool

Empty mock

func (MockImpressionStorage) LogImpressions

func (m MockImpressionStorage) LogImpressions(impressions []dtos.Impression) error

LogImpressions mock

func (MockImpressionStorage) PopN

PopN mock

func (MockImpressionStorage) PopNRaw

func (m MockImpressionStorage) PopNRaw(n int64) ([]string, int64, error)

PopNRaw mock

func (MockImpressionStorage) PopNWithMetadata

func (m MockImpressionStorage) PopNWithMetadata(n int64) ([]dtos.ImpressionQueueObject, error)

PopNWithMetadata mock

type MockImpressionsCountStorage

type MockImpressionsCountStorage struct {
	RecordImpressionsCountCall func(impressions dtos.ImpressionsCountDTO) error
	GetImpressionsCountCall    func() (dtos.ImpressionsCountDTO, error)
}

func (MockImpressionsCountStorage) GetImpressionsCount

func (m MockImpressionsCountStorage) GetImpressionsCount() (dtos.ImpressionsCountDTO, error)

func (MockImpressionsCountStorage) RecordImpressionsCount

func (m MockImpressionsCountStorage) RecordImpressionsCount(impressions dtos.ImpressionsCountDTO) error

type MockSegmentStorage

type MockSegmentStorage struct {
	ChangeNumberCall       func(segmentName string) (int64, error)
	KeysCall               func(segmentName string) *set.ThreadUnsafeSet
	UpdateCall             func(name string, toAdd *set.ThreadUnsafeSet, toRemove *set.ThreadUnsafeSet, changeNumber int64) error
	SegmentContainsKeyCall func(segmentName string, key string) (bool, error)
	SetChangeNumberCall    func(segmentName string, till int64) error
	SegmentKeysCountCall   func() int64
}

MockSegmentStorage is a mocked implementation of Segment Storage

func (MockSegmentStorage) ChangeNumber

func (m MockSegmentStorage) ChangeNumber(segmentName string) (int64, error)

ChangeNumber mock

func (MockSegmentStorage) Keys

func (m MockSegmentStorage) Keys(segmentName string) *set.ThreadUnsafeSet

Keys mock

func (MockSegmentStorage) SegmentContainsKey

func (m MockSegmentStorage) SegmentContainsKey(segmentName string, key string) (bool, error)

SegmentContainsKey mock

func (MockSegmentStorage) SegmentKeysCount

func (m MockSegmentStorage) SegmentKeysCount() int64

SegmentKeysCount mock

func (MockSegmentStorage) SetChangeNumber

func (m MockSegmentStorage) SetChangeNumber(segmentName string, till int64) error

SetChangeNumber mock

func (MockSegmentStorage) Update

func (m MockSegmentStorage) Update(name string, toAdd *set.ThreadUnsafeSet, toRemove *set.ThreadUnsafeSet, changeNumber int64) error

Update mock

type MockSplitStorage

type MockSplitStorage struct {
	AllCall                func() []dtos.SplitDTO
	ChangeNumberCall       func() (int64, error)
	FetchManyCall          func(splitNames []string) map[string]*dtos.SplitDTO
	KillLocallyCall        func(splitName string, defaultTreatment string, changeNumber int64)
	UpdateCall             func(toAdd []dtos.SplitDTO, toRemove []dtos.SplitDTO, changeNumber int64)
	RemoveCall             func(splitName string)
	SegmentNamesCall       func() *set.ThreadUnsafeSet
	SetChangeNumberCall    func(changeNumber int64) error
	SplitCall              func(splitName string) *dtos.SplitDTO
	SplitNamesCall         func() []string
	TrafficTypeExistsCall  func(trafficType string) bool
	GetNamesByFlagSetsCall func(sets []string) map[string][]string
	GetAllFlagSetNamesCall func() []string
}

MockSplitStorage is a mocked implementation of Split Storage

func (MockSplitStorage) All

func (m MockSplitStorage) All() []dtos.SplitDTO

All mock

func (MockSplitStorage) ChangeNumber

func (m MockSplitStorage) ChangeNumber() (int64, error)

ChangeNumber mock

func (MockSplitStorage) FetchMany

func (m MockSplitStorage) FetchMany(splitNames []string) map[string]*dtos.SplitDTO

FetchMany mock

func (MockSplitStorage) GetAllFlagSetNames added in v5.2.0

func (m MockSplitStorage) GetAllFlagSetNames() []string

func (MockSplitStorage) GetNamesByFlagSets added in v5.1.0

func (m MockSplitStorage) GetNamesByFlagSets(sets []string) map[string][]string

GetNamesByFLagSets mock

func (MockSplitStorage) KillLocally

func (m MockSplitStorage) KillLocally(splitName string, defaultTreatment string, changeNumber int64)

KillLocally mock

func (MockSplitStorage) Remove

func (m MockSplitStorage) Remove(splitname string)

Remove mock

func (MockSplitStorage) SegmentNames

func (m MockSplitStorage) SegmentNames() *set.ThreadUnsafeSet

SegmentNames mock

func (MockSplitStorage) SetChangeNumber

func (m MockSplitStorage) SetChangeNumber(changeNumber int64) error

SetChangeNumber mock

func (MockSplitStorage) Split

func (m MockSplitStorage) Split(splitName string) *dtos.SplitDTO

Split mock

func (MockSplitStorage) SplitNames

func (m MockSplitStorage) SplitNames() []string

SplitNames mock

func (MockSplitStorage) TrafficTypeExists

func (m MockSplitStorage) TrafficTypeExists(trafficType string) bool

TrafficTypeExists mock

func (MockSplitStorage) Update

func (m MockSplitStorage) Update(toAdd []dtos.SplitDTO, toRemove []dtos.SplitDTO, changeNumber int64)

Update mock

type MockTelemetryStorage

type MockTelemetryStorage struct {
	RecordConfigDataCall       func(configData dtos.Config) error
	RecordLatencyCall          func(method string, latency time.Duration)
	RecordExceptionCall        func(method string)
	RecordImpressionsStatsCall func(dataType int, count int64)
	RecordEventsStatsCall      func(dataType int, count int64)
	RecordSuccessfulSyncCall   func(resource int, when time.Time)
	RecordSyncErrorCall        func(resource int, status int)
	RecordSyncLatencyCall      func(resource int, latency time.Duration)
	RecordAuthRejectionsCall   func()
	RecordTokenRefreshesCall   func()
	RecordStreamingEventCall   func(streamingEvent *dtos.StreamingEvent)
	AddTagCall                 func(tag string)
	RecordSessionLengthCall    func(session int64)
	RecordNonReadyUsageCall    func()
	RecordBURTimeoutCall       func()
	RecordUpdatesFromSSECall   func(updateType int)
	PopLatenciesCall           func() dtos.MethodLatencies
	PopExceptionsCall          func() dtos.MethodExceptions
	GetImpressionsStatsCall    func(dataType int) int64
	GetEventsStatsCall         func(dataType int) int64
	GetLastSynchronizationCall func() dtos.LastSynchronization
	PopHTTPErrorsCall          func() dtos.HTTPErrors
	PopHTTPLatenciesCall       func() dtos.HTTPLatencies
	PopAuthRejectionsCall      func() int64
	PopTokenRefreshesCall      func() int64
	PopStreamingEventsCall     func() []dtos.StreamingEvent
	PopTagsCall                func() []string
	PopUpdatesFromSSECall      func() dtos.UpdatesFromSSE
	GetSessionLengthCall       func() int64
	GetNonReadyUsagesCall      func() int64
	GetBURTimeoutsCall         func() int64
	RecordUniqueKeysCall       func(uniques dtos.Uniques) error
}

MockTelemetryStorage is a mocked implementation of Telemetry Storage

func (MockTelemetryStorage) AddTag

func (m MockTelemetryStorage) AddTag(tag string)

AddTag mock

func (MockTelemetryStorage) GetBURTimeouts

func (m MockTelemetryStorage) GetBURTimeouts() int64

GetBURTimeouts mock

func (MockTelemetryStorage) GetEventsStats

func (m MockTelemetryStorage) GetEventsStats(dataType int) int64

GetEventsStats mock

func (MockTelemetryStorage) GetImpressionsStats

func (m MockTelemetryStorage) GetImpressionsStats(dataType int) int64

GetImpressionsStats mock

func (MockTelemetryStorage) GetLastSynchronization

func (m MockTelemetryStorage) GetLastSynchronization() dtos.LastSynchronization

GetLastSynchronization mock

func (MockTelemetryStorage) GetNonReadyUsages

func (m MockTelemetryStorage) GetNonReadyUsages() int64

GetNonReadyUsages mock

func (MockTelemetryStorage) GetSessionLength

func (m MockTelemetryStorage) GetSessionLength() int64

GetSessionLength mock

func (MockTelemetryStorage) PopAuthRejections

func (m MockTelemetryStorage) PopAuthRejections() int64

PopAuthRejections mock

func (MockTelemetryStorage) PopExceptions

func (m MockTelemetryStorage) PopExceptions() dtos.MethodExceptions

PopExceptions mock

func (MockTelemetryStorage) PopHTTPErrors

func (m MockTelemetryStorage) PopHTTPErrors() dtos.HTTPErrors

PopHTTPErrors mock

func (MockTelemetryStorage) PopHTTPLatencies

func (m MockTelemetryStorage) PopHTTPLatencies() dtos.HTTPLatencies

PopHTTPLatencies mock

func (MockTelemetryStorage) PopLatencies

func (m MockTelemetryStorage) PopLatencies() dtos.MethodLatencies

PopLatencies mock

func (MockTelemetryStorage) PopStreamingEvents

func (m MockTelemetryStorage) PopStreamingEvents() []dtos.StreamingEvent

PopStreamingEvents mock

func (MockTelemetryStorage) PopTags

func (m MockTelemetryStorage) PopTags() []string

PopTags mock

func (MockTelemetryStorage) PopTokenRefreshes

func (m MockTelemetryStorage) PopTokenRefreshes() int64

PopTokenRefreshes mock

func (MockTelemetryStorage) PopUpdatesFromSSE

func (m MockTelemetryStorage) PopUpdatesFromSSE() dtos.UpdatesFromSSE

PopUpdatesFromSSE mock

func (MockTelemetryStorage) RecordAuthRejections

func (m MockTelemetryStorage) RecordAuthRejections()

RecordAuthRejections mock

func (MockTelemetryStorage) RecordBURTimeout

func (m MockTelemetryStorage) RecordBURTimeout()

RecordBURTimeout mock

func (MockTelemetryStorage) RecordConfigData

func (m MockTelemetryStorage) RecordConfigData(configData dtos.Config) error

RecordConfigData mock

func (MockTelemetryStorage) RecordEventsStats

func (m MockTelemetryStorage) RecordEventsStats(dataType int, count int64)

RecordEventsStats mock

func (MockTelemetryStorage) RecordException

func (m MockTelemetryStorage) RecordException(method string)

RecordException mock

func (MockTelemetryStorage) RecordImpressionsStats

func (m MockTelemetryStorage) RecordImpressionsStats(dataType int, count int64)

RecordImpressionsStats mock

func (MockTelemetryStorage) RecordLatency

func (m MockTelemetryStorage) RecordLatency(method string, latency time.Duration)

RecordLatency mock

func (MockTelemetryStorage) RecordNonReadyUsage

func (m MockTelemetryStorage) RecordNonReadyUsage()

RecordNonReadyUsage mock

func (MockTelemetryStorage) RecordSessionLength

func (m MockTelemetryStorage) RecordSessionLength(session int64)

RecordSessionLength mock

func (MockTelemetryStorage) RecordStreamingEvent

func (m MockTelemetryStorage) RecordStreamingEvent(streamingEvent *dtos.StreamingEvent)

RecordStreamingEvent mock

func (MockTelemetryStorage) RecordSuccessfulSync

func (m MockTelemetryStorage) RecordSuccessfulSync(resource int, time time.Time)

RecordSuccessfulSync mock

func (MockTelemetryStorage) RecordSyncError

func (m MockTelemetryStorage) RecordSyncError(resource int, status int)

RecordSyncError mock

func (MockTelemetryStorage) RecordSyncLatency

func (m MockTelemetryStorage) RecordSyncLatency(resource int, latency time.Duration)

RecordSyncLatency mock

func (MockTelemetryStorage) RecordTokenRefreshes

func (m MockTelemetryStorage) RecordTokenRefreshes()

RecordTokenRefreshes mock

func (MockTelemetryStorage) RecordUniqueKeys

func (m MockTelemetryStorage) RecordUniqueKeys(uniques dtos.Uniques) error

RecordUniqueKeys mock

func (MockTelemetryStorage) RecordUpdatesFromSSE

func (m MockTelemetryStorage) RecordUpdatesFromSSE(updateType int)

RecordUpdatesFromSSE mock

type MockUniqueKeysStorage

type MockUniqueKeysStorage struct {
	CountCall   func() int64
	PopNRawCall func(n int64) ([]string, int64, error)
}

func (MockUniqueKeysStorage) Count

func (m MockUniqueKeysStorage) Count() int64

Count mock

func (MockUniqueKeysStorage) PopNRaw

func (m MockUniqueKeysStorage) PopNRaw(n int64) ([]string, int64, error)

Jump to

Keyboard shortcuts

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