mocks

package
v2.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2020 License: Apache-2.0 Imports: 2 Imported by: 0

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
}

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

type MockImpressionStorage struct {
	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) PopNWithMetadata

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

PopNWithMetadata mock

type MockMetricStorage

type MockMetricStorage struct {
	IncCounterCall               func(key string)
	IncLatencyCall               func(metricName string, index int)
	PutGaugeCall                 func(key string, gauge float64)
	PopGaugesCall                func() []dtos.GaugeDTO
	PopLatenciesCall             func() []dtos.LatenciesDTO
	PopCountersCall              func() []dtos.CounterDTO
	PeekCountersCall             func() map[string]int64
	PeekLatenciesCall            func() map[string][]int64
	PopGaugesWithMetadataCall    func() (*dtos.GaugeDataBulk, error)
	PopCountersWithMetadataCall  func() (*dtos.CounterDataBulk, error)
	PopLatenciesWithMetadataCall func() (*dtos.LatencyDataBulk, error)
}

MockMetricStorage is a mocked implementation of Metric Storage

func (MockMetricStorage) IncCounter

func (m MockMetricStorage) IncCounter(key string)

IncCounter mock

func (MockMetricStorage) IncLatency

func (m MockMetricStorage) IncLatency(metricName string, index int)

IncLatency mock

func (MockMetricStorage) PeekCounters

func (m MockMetricStorage) PeekCounters() map[string]int64

PeekCounters mock

func (MockMetricStorage) PeekLatencies

func (m MockMetricStorage) PeekLatencies() map[string][]int64

PeekLatencies mock

func (MockMetricStorage) PopCounters

func (m MockMetricStorage) PopCounters() []dtos.CounterDTO

PopCounters mock

func (MockMetricStorage) PopCountersWithMetadata

func (m MockMetricStorage) PopCountersWithMetadata() (*dtos.CounterDataBulk, error)

PopCountersWithMetadata mock

func (MockMetricStorage) PopGauges

func (m MockMetricStorage) PopGauges() []dtos.GaugeDTO

PopGauges mock

func (MockMetricStorage) PopGaugesWithMetadata

func (m MockMetricStorage) PopGaugesWithMetadata() (*dtos.GaugeDataBulk, error)

PopGaugesWithMetadata mock

func (MockMetricStorage) PopLatencies

func (m MockMetricStorage) PopLatencies() []dtos.LatenciesDTO

PopLatencies mock

func (MockMetricStorage) PopLatenciesWithMetadata

func (m MockMetricStorage) PopLatenciesWithMetadata() (*dtos.LatencyDataBulk, error)

PopLatenciesWithMetadata mock

func (MockMetricStorage) PutGauge

func (m MockMetricStorage) PutGauge(key string, gauge float64)

PutGauge mock

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
	CountRemovedKeysCall   func(segmentName string) int64
}

MockSegmentStorage is a mocked implementation of Segment Storage

func (MockSegmentStorage) ChangeNumber

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

ChangeNumber mock

func (MockSegmentStorage) CountRemovedKeys

func (m MockSegmentStorage) CountRemovedKeys(segmentName string) int64

CountRemovedKeys 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) 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)
	PutManyCall           func(splits []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
}

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

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

KillLocally mock

func (MockSplitStorage) PutMany

func (m MockSplitStorage) PutMany(splits []dtos.SplitDTO, changeNumber int64)

PutMany 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

Jump to

Keyboard shortcuts

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