repository

package
v0.0.0-...-8991645 Latest Latest
Warning

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

Go to latest
Published: May 30, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IKVRepository

type IKVRepository interface {
	GetServerTimestamp(ctx context.Context) (int64, error)
	Ping(ctx context.Context) (string, error)
	AddStreamEvent(ctx context.Context, streamKey string, streamId string, payload interface{}) (string, error)
	AddToUnsortedSet(ctx context.Context, UnsortedSetKey string, objects ...*Object) (int64, error)
}

interface of kv store and sql-like are quite different

func NewRedisRepository

func NewRedisRepository(ctx context.Context, config config.IConfig, logger *zap.Logger) (IKVRepository, error)

type MockIKVRepository

type MockIKVRepository struct {
	mock.Mock
}

MockIKVRepository is an autogenerated mock type for the IKVRepository type

func NewMockIKVRepository

func NewMockIKVRepository(t interface {
	mock.TestingT
	Cleanup(func())
}) *MockIKVRepository

NewMockIKVRepository creates a new instance of MockIKVRepository. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.

func (*MockIKVRepository) AddStreamEvent

func (_m *MockIKVRepository) AddStreamEvent(ctx context.Context, streamKey string, streamId string, payload interface{}) (string, error)

AddStreamEvent provides a mock function with given fields: ctx, streamKey, streamId, payload

func (*MockIKVRepository) AddToUnsortedSet

func (_m *MockIKVRepository) AddToUnsortedSet(ctx context.Context, UnsortedSetKey string, objects ...*Object) (int64, error)

AddToUnsortedSet provides a mock function with given fields: ctx, UnsortedSetKey, objects

func (*MockIKVRepository) GetServerTimestamp

func (_m *MockIKVRepository) GetServerTimestamp(ctx context.Context) (int64, error)

GetServerTimestamp provides a mock function with given fields: ctx

func (*MockIKVRepository) Ping

func (_m *MockIKVRepository) Ping(ctx context.Context) (string, error)

Ping provides a mock function with given fields: ctx

type Object

type Object struct {
	Key        string
	Payload    interface{}
	Expiration time.Duration
}

Jump to

Keyboard shortcuts

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