testing

package
v0.40.0 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MockClient

type MockClient struct {
	mock.Mock
}

func NewMockClient

func NewMockClient(options ...MockClientOption) *MockClient

func (*MockClient) Broker

func (c *MockClient) Broker(brokerID int32) (*sarama.Broker, error)

func (*MockClient) Brokers

func (c *MockClient) Brokers() []*sarama.Broker

func (*MockClient) Close

func (c *MockClient) Close() error

func (*MockClient) Closed

func (c *MockClient) Closed() bool

func (*MockClient) Config

func (c *MockClient) Config() *sarama.Config

func (*MockClient) Controller

func (c *MockClient) Controller() (*sarama.Broker, error)

func (*MockClient) Coordinator

func (c *MockClient) Coordinator(consumerGroup string) (*sarama.Broker, error)

func (*MockClient) GetOffset

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

func (*MockClient) InSyncReplicas

func (c *MockClient) InSyncReplicas(topic string, partitionID int32) ([]int32, error)

func (*MockClient) InitProducerID

func (c *MockClient) InitProducerID() (*sarama.InitProducerIDResponse, error)

func (*MockClient) Leader

func (c *MockClient) Leader(topic string, partitionID int32) (*sarama.Broker, error)

func (*MockClient) LeastLoadedBroker added in v0.39.0

func (c *MockClient) LeastLoadedBroker() *sarama.Broker

func (*MockClient) OfflineReplicas

func (c *MockClient) OfflineReplicas(topic string, partitionID int32) ([]int32, error)

func (*MockClient) Partitions

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

func (*MockClient) RefreshBrokers

func (c *MockClient) RefreshBrokers(addrs []string) error

func (*MockClient) RefreshController

func (c *MockClient) RefreshController() (*sarama.Broker, error)

func (*MockClient) RefreshCoordinator

func (c *MockClient) RefreshCoordinator(consumerGroup string) error

func (*MockClient) RefreshMetadata

func (c *MockClient) RefreshMetadata(topics ...string) error

func (*MockClient) RefreshTransactionCoordinator added in v0.39.0

func (c *MockClient) RefreshTransactionCoordinator(transactionID string) error

func (*MockClient) Replicas

func (c *MockClient) Replicas(topic string, partitionID int32) ([]int32, error)

func (*MockClient) Topics

func (c *MockClient) Topics() ([]string, error)

func (*MockClient) TransactionCoordinator added in v0.39.0

func (c *MockClient) TransactionCoordinator(transactionID string) (*sarama.Broker, error)

func (*MockClient) WritablePartitions

func (c *MockClient) WritablePartitions(topic string) ([]int32, error)

type MockClientOption

type MockClientOption = func(*MockClient)

func WithClientMockClose

func WithClientMockClose(err error) MockClientOption

func WithClientMockClosed

func WithClientMockClosed(closed bool) MockClientOption

func WithClientMockGetOffset

func WithClientMockGetOffset(topic string, partition int32, offsetTime int64, offset int64, err error) MockClientOption

func WithClientMockPartitions

func WithClientMockPartitions(topic string, partitions []int32, err error) MockClientOption

type MockOffsetManager

type MockOffsetManager struct {
	mock.Mock
}

func NewMockOffsetManager

func NewMockOffsetManager(options ...MockOffsetManagerOption) *MockOffsetManager

func (*MockOffsetManager) Close

func (o *MockOffsetManager) Close() error

func (*MockOffsetManager) Commit

func (o *MockOffsetManager) Commit()

func (*MockOffsetManager) ManagePartition

func (o *MockOffsetManager) ManagePartition(topic string, partition int32) (sarama.PartitionOffsetManager, error)

type MockOffsetManagerOption

type MockOffsetManagerOption = func(*MockOffsetManager)

func WithOffsetManagerMockClose

func WithOffsetManagerMockClose(err error) MockOffsetManagerOption

func WithOffsetManagerMockCommit

func WithOffsetManagerMockCommit() MockOffsetManagerOption

func WithOffsetManagerMockManagePartition

func WithOffsetManagerMockManagePartition(topic string, partition int32, partitionOffsetManager sarama.PartitionOffsetManager, err error) MockOffsetManagerOption

type MockPartitionOffsetManager

type MockPartitionOffsetManager struct {
	mock.Mock
}

func (*MockPartitionOffsetManager) AsyncClose

func (p *MockPartitionOffsetManager) AsyncClose()

func (*MockPartitionOffsetManager) Close

func (p *MockPartitionOffsetManager) Close() error

func (*MockPartitionOffsetManager) Errors

func (p *MockPartitionOffsetManager) Errors() <-chan *sarama.ConsumerError

func (*MockPartitionOffsetManager) MarkOffset

func (p *MockPartitionOffsetManager) MarkOffset(offset int64, metadata string)

func (*MockPartitionOffsetManager) NextOffset

func (p *MockPartitionOffsetManager) NextOffset() (int64, string)

func (*MockPartitionOffsetManager) ResetOffset

func (p *MockPartitionOffsetManager) ResetOffset(offset int64, metadata string)

type MockPartitionOffsetManagerOption

type MockPartitionOffsetManagerOption = func(*MockPartitionOffsetManager)

func WithPartitionOffsetManagerMockAsyncClose

func WithPartitionOffsetManagerMockAsyncClose() MockPartitionOffsetManagerOption

func WithPartitionOffsetManagerMockClose

func WithPartitionOffsetManagerMockClose(err error) MockPartitionOffsetManagerOption

func WithPartitionOffsetManagerMockErrors

func WithPartitionOffsetManagerMockErrors(errors ...*sarama.ConsumerError) MockPartitionOffsetManagerOption

func WithPartitionOffsetManagerMockMarkOffset

func WithPartitionOffsetManagerMockMarkOffset(offset int64, metadata string) MockPartitionOffsetManagerOption

func WithPartitionOffsetManagerMockNextOffset

func WithPartitionOffsetManagerMockNextOffset(offset int64, metadata string) MockPartitionOffsetManagerOption

func WithPartitionOffsetManagerMockResetOffset

func WithPartitionOffsetManagerMockResetOffset(offset int64, metadata string) MockPartitionOffsetManagerOption

type MockPodLister

type MockPodLister struct {
	mock.Mock
}

func (*MockPodLister) List

func (l *MockPodLister) List(selector labels.Selector) (ret []*corev1.Pod, err error)

func (*MockPodLister) Pods

type MockPodNamespaceLister

type MockPodNamespaceLister struct {
	mock.Mock
}

func (*MockPodNamespaceLister) Get

func (nl *MockPodNamespaceLister) Get(name string) (*corev1.Pod, error)

func (*MockPodNamespaceLister) List

func (nl *MockPodNamespaceLister) List(selector labels.Selector) (ret []*corev1.Pod, err error)

Jump to

Keyboard shortcuts

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