redisclient

package
v0.1.8-alpha Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClientMock

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

ClientMock is a mock for redis client

func NewClientMock

func NewClientMock(broken bool) *ClientMock

NewClientMock is a constuctor for ClientMock

func (*ClientMock) Close

func (m *ClientMock) Close() error

Close does nothing in mock

func (*ClientMock) DeliverMessages

func (m *ClientMock) DeliverMessages(data []string) error

DeliverMessages stores data in buffer

func (*ClientMock) GetBuffer

func (m *ClientMock) GetBuffer() []string

GetBuffer return content of buffer in mock

type RedisClient

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

RedisClient contains underlying redigo pool and follows transport interface

func NewRedisClient

func NewRedisClient(config configuration.RedisTransportConfig) *RedisClient

NewRedisClient is a constructor for RedisClient

func (*RedisClient) Close

func (client *RedisClient) Close() error

Close releases pool resources

func (*RedisClient) DeliverMessages

func (client *RedisClient) DeliverMessages(messages []string) error

DeliverMessages tries to send slice of messages to Redis, acquiring connection from pool

func (*RedisClient) ReceiveMessage

func (client *RedisClient) ReceiveMessage() ([]byte, error)

ReceiveMessage returns message from list, only for test purposes for now

Jump to

Keyboard shortcuts

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