mock

package
v0.0.0-...-e105d0e Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewProviderMock

func NewProviderMock(name string) base.Provider

Types

type MockStore

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

func NewMockStore

func NewMockStore() *MockStore

func (*MockStore) Get

func (m *MockStore) Get(key string) ([]byte, error)

func (*MockStore) Set

func (m *MockStore) Set(key string, value any, ttl time.Duration) error

type MockStream

type MockStream[T any] struct {
	Messages   []*T
	MessageMap map[string]int
	// contains filtered or unexported fields
}

func NewMockStream

func NewMockStream[T any](t *testing.T) *MockStream[T]

func (*MockStream[T]) Close

func (m *MockStream[T]) Close()

func (*MockStream[T]) GetChannel

func (m *MockStream[T]) GetChannel() chan *T

func (*MockStream[T]) Run

func (m *MockStream[T]) Run() error

func (*MockStream[T]) Send

func (m *MockStream[T]) Send(data *T)

func (*MockStream[T]) SetCounter

func (m *MockStream[T]) SetCounter(counter *uint32)

SetCounter sets the counter used to count the number of messages sent. Multiple streams can share the same counter to count the total number of messages sent across all streams.

Jump to

Keyboard shortcuts

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