connection

package
v2.4.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2019 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
	sarama.Client
}

MockClient is a mock client

func (MockClient) Brokers

func (m MockClient) Brokers() []Broker

Brokers is for implementing sarama.Client

func (MockClient) Close

func (m MockClient) Close() error

Close is for implementing sarama.Client

func (MockClient) Coordinator

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

Coordinator is for implementing sarama.Client

func (MockClient) GetOffset

func (m MockClient) GetOffset(topic string, partitionID int32, time int64) (int64, error)

GetOffset is for implementing sarama.Client

func (MockClient) Leader

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

Leader is for implementing sarama.Client

func (MockClient) RefreshCoordinator

func (m MockClient) RefreshCoordinator(topic string) error

RefreshCoordinator is for implementing sarama.Client

type MockClusterAdmin

type MockClusterAdmin struct {
	mock.Mock
}

MockClusterAdmin is a mockable sarama.ClusterAdmin

func (MockClusterAdmin) AlterConfig

func (c MockClusterAdmin) AlterConfig(resourceType sarama.ConfigResourceType, name string, entries map[string]*string, validateOnly bool) error

AlterConfig is for implementing sarama.ClusterAdmin

func (MockClusterAdmin) Close

func (c MockClusterAdmin) Close() error

Close is for implementing sarama.ClusterAdmin

func (MockClusterAdmin) CreateACL

func (c MockClusterAdmin) CreateACL(resource sarama.Resource, acl sarama.Acl) error

CreateACL is for implementing sarama.ClusterAdmin

func (MockClusterAdmin) CreatePartitions

func (c MockClusterAdmin) CreatePartitions(topic string, count int32, assignment [][]int32, validateOnly bool) error

CreatePartitions is for implementing sarama.ClusterAdmin

func (MockClusterAdmin) CreateTopic

func (c MockClusterAdmin) CreateTopic(topic string, detail *sarama.TopicDetail, validateOnly bool) error

CreateTopic is for implementing sarama.ClusterAdmin

func (MockClusterAdmin) DeleteACL

func (c MockClusterAdmin) DeleteACL(filter sarama.AclFilter, validateOnly bool) ([]sarama.MatchingAcl, error)

DeleteACL is for implementing sarama.ClusterAdmin

func (MockClusterAdmin) DeleteConsumerGroup

func (c MockClusterAdmin) DeleteConsumerGroup(group string) error

DeleteConsumerGroup is for implementing sarama.ClusterAdmin

func (MockClusterAdmin) DeleteRecords

func (c MockClusterAdmin) DeleteRecords(topic string, partitionOffsets map[int32]int64) error

DeleteRecords is for implementing sarama.ClusterAdmin

func (MockClusterAdmin) DeleteTopic

func (c MockClusterAdmin) DeleteTopic(topic string) error

DeleteTopic is for implementing sarama.ClusterAdmin

func (MockClusterAdmin) DescribeCluster

func (c MockClusterAdmin) DescribeCluster() (brokers []*sarama.Broker, controllerID int32, err error)

DescribeCluster is for implementing sarama.ClusterAdmin

func (MockClusterAdmin) DescribeConfig

func (c MockClusterAdmin) DescribeConfig(resource sarama.ConfigResource) ([]sarama.ConfigEntry, error)

DescribeConfig is for implementing sarama.ClusterAdmin

func (MockClusterAdmin) DescribeConsumerGroups

func (c MockClusterAdmin) DescribeConsumerGroups(groups []string) ([]*sarama.GroupDescription, error)

DescribeConsumerGroups is for implementing sarama.ClusterAdmin

func (MockClusterAdmin) DescribeTopics

func (c MockClusterAdmin) DescribeTopics(topics []string) (metadata []*sarama.TopicMetadata, err error)

DescribeTopics is for implementing sarama.ClusterAdmin

func (MockClusterAdmin) ListAcls

func (c MockClusterAdmin) ListAcls(filter sarama.AclFilter) ([]sarama.ResourceAcls, error)

ListAcls is for implementing sarama.ClusterAdmin

func (MockClusterAdmin) ListConsumerGroupOffsets

func (c MockClusterAdmin) ListConsumerGroupOffsets(group string, topicPartitions map[string][]int32) (*sarama.OffsetFetchResponse, error)

ListConsumerGroupOffsets is for implementing sarama.ClusterAdmin

func (MockClusterAdmin) ListConsumerGroups

func (c MockClusterAdmin) ListConsumerGroups() (map[string]string, error)

ListConsumerGroups is for implementing sarama.ClusterAdmin

func (MockClusterAdmin) ListTopics

func (c MockClusterAdmin) ListTopics() (map[string]sarama.TopicDetail, error)

ListTopics is for implementing sarama.ClusterAdmin

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