connection

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2018 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Broker

Broker is an interface for mocking

type Client

type Client interface {
	Brokers() []Broker
	Topics() ([]string, error)
	Partitions(string) ([]int32, error)
	RefreshCoordinator(string) error
	Coordinator(string) (Broker, error)
	Leader(string, int32) (Broker, error)
	Close() error
	GetOffset(string, int32, int64) (int64, error)
}

Client is an interface for mocking

type MockBroker

type MockBroker struct {
	mock.Mock
}

MockBroker is a mock implementation of the Broker interface

func (MockBroker) Close

func (b MockBroker) Close() error

Close is a mocked implementation of the sarama.Broker.Close() method

func (MockBroker) Connected

func (b MockBroker) Connected() (bool, error)

Connected is a mocked implementation of the sarama.Broker.Connected() method

func (MockBroker) DescribeGroups

DescribeGroups is a mocked implementation of the sarama.Broker.DescribeGroups() method

func (MockBroker) Fetch

func (b MockBroker) Fetch(request *sarama.FetchRequest) (*sarama.FetchResponse, error)

Fetch is a mocked implementation of the sarama.Broker.Fetch() method

func (MockBroker) FetchOffset

FetchOffset is a mocked implementation of the sarama.Broker.FetchOffset() method

func (MockBroker) ListGroups

ListGroups is a mocked implementation of the sarama.Broker.ListGroups() method

func (MockBroker) Open

func (b MockBroker) Open(config *sarama.Config) error

Open is a mocked implementation of the sarama.Broker.Open() method

type MockClient

type MockClient struct {
	mock.Mock
}

MockClient is a mock implementation of the Client interface

func (MockClient) Brokers

func (m MockClient) Brokers() []Broker

Brokers is a mocked implementation of the sarama.Client.Brokers() method

func (MockClient) Close

func (m MockClient) Close() error

Close is a mocked implementation of the sarama.Client.Close() method

func (MockClient) Coordinator

func (m MockClient) Coordinator(groupID string) (Broker, error)

Coordinator is a mocked implementation of the sarama.Client.Coordinator() method

func (MockClient) GetOffset

func (m MockClient) GetOffset(topic string, partition int32, offset int64) (int64, error)

GetOffset is a mocked implementation of the sarama.Client.GetOffset() method

func (MockClient) Leader

func (m MockClient) Leader(topic string, partition int32) (Broker, error)

Leader is a mocked implementation of the sarama.Client.Leader() method

func (MockClient) Partitions

func (m MockClient) Partitions(topic string) ([]int32, error)

Partitions is a mocked implementation of the sarama.Client.Partitions() method

func (MockClient) RefreshCoordinator

func (m MockClient) RefreshCoordinator(groupID string) error

RefreshCoordinator is a mocked implementation of the sarama.Client.RefreshCoordinator() method

func (MockClient) Topics

func (m MockClient) Topics() ([]string, error)

Topics is a mocked implementation of the sarama.Client.Topics() method

type SaramaClient

type SaramaClient struct {
	sarama.Client
}

SaramaClient is a wrapper struct for sarama.Client

func (SaramaClient) Brokers

func (c SaramaClient) Brokers() []Broker

Brokers wraps the sarama Brokers function

func (SaramaClient) Coordinator

func (c SaramaClient) Coordinator(groupID string) (Broker, error)

Coordinator wraps the sarama.Client.Coordinator() function

func (SaramaClient) Leader

func (c SaramaClient) Leader(topic string, partition int32) (Broker, error)

Leader wraps the sarama.Client.Leader() function

Jump to

Keyboard shortcuts

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