Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/IBM/sarama
/ functions
Functions
3,668 in github.com/IBM/sarama
⨍
Functions
3,668
◇
Types & classes
511
↓ 273 callers
Method
Error
(...any)
mockresponses.go:12
↓ 261 callers
Function
NewTestConfig
NewTestConfig returns a config meant to be used by tests. Due to inconsistencies with the request versions the clients send using the default Kafka ve
config_test.go:19
↓ 254 callers
Method
Errorf
(string, ...any)
mocks/mocks.go:27
↓ 245 callers
Method
Fatal
(...any)
mockresponses.go:14
↓ 212 callers
Function
NewMockBroker
NewMockBroker launches a fake Kafka broker. It takes a TestReporter as provided by the test framework and a channel of responses to use. If an error
mockbroker.go:406
↓ 210 callers
Method
Close
Close terminates the broker blocking until it stops internal goroutines and releases all resources.
mockbroker.go:148
↓ 202 callers
Method
Addr
Addr returns the broker connection string in the form "<address>:<port>".
mockbroker.go:142
↓ 193 callers
Method
BrokerID
BrokerID returns broker ID assigned to the broker.
mockbroker.go:120
↓ 152 callers
Method
putEmptyTaggedFieldArray
()
packet_encoder.go:37
↓ 149 callers
Method
Is
(target error)
errors.go:133
↓ 149 callers
Method
getEmptyTaggedFieldArray
()
packet_decoder.go:28
↓ 121 callers
Method
SetHandlerByMap
SetHandlerByMap defines mapping of Request types to MockResponses. When a request is received by the broker, it looks up the request type in the map a
mockbroker.go:88
↓ 119 callers
Function
safeClose
(t testing.TB, c io.Closer)
helpers_test.go:11
↓ 113 callers
Function
NewMockMetadataResponse
(t TestReporter)
mockresponses.go:144
↓ 113 callers
Method
SetBroker
(addr string, brokerID int32)
mockresponses.go:168
↓ 108 callers
Method
Close
Close shuts down all broker connections managed by this client. It is required to call this function before a client object passes out of scope, as it
client.go:124
↓ 103 callers
Method
Printf
(format string, v ...any)
sarama.go:129
↓ 103 callers
Method
Run
(addr string)
examples/http_server/http_server.go:108
↓ 100 callers
Method
putArrayLength
(in int)
packet_encoder.go:21
↓ 97 callers
Method
getArrayLength
()
packet_decoder.go:24
↓ 90 callers
Method
putString
(in string)
packet_encoder.go:31
↓ 89 callers
Method
getString
()
packet_decoder.go:36
↓ 88 callers
Function
NewClusterAdmin
NewClusterAdmin creates a new ClusterAdmin using the given broker addresses and configuration.
admin.go:214
↓ 86 callers
Function
testRequest
(t *testing.T, name string, rb protocolBody, expected []byte)
request_test.go:596
↓ 85 callers
Method
encode
(pe packetEncoder)
encoder_decoder.go:12
↓ 81 callers
Function
NewClient
NewClient creates a new Client. It connects to one of the given broker addresses and uses that broker to automatically fetch metadata on the rest of t
client.go:177
↓ 80 callers
Method
Returns
(e encoderWithHeader)
mockbroker.go:469
↓ 79 callers
Method
AddBroker
testing API
metadata_response.go:400
↓ 79 callers
Method
Helper
()
mockresponses.go:16
↓ 75 callers
Method
Fatalf
(string, ...any)
mockresponses.go:15
↓ 74 callers
Method
SetController
(brokerID int32)
mockresponses.go:173
↓ 73 callers
Method
Close
Close shuts down the admin and closes underlying client.
admin.go:205
↓ 70 callers
Function
NewFunctionalTestConfig
NewFunctionalTestConfig returns a config meant to be used by functional tests.
functional_test.go:97
↓ 70 callers
Method
putInt32
(in int32)
packet_encoder.go:16
↓ 69 callers
Method
getInt32
()
packet_decoder.go:19
↓ 68 callers
Method
Add
Add appends elem, growing the buffer if it is full.
internal/queue/queue.go:36
↓ 68 callers
Method
IsAtLeast
IsAtLeast return true if and only if the version it is called on is greater than or equal to the version passed in: V1.IsAtLeast(V2) // false V2.Is
utils.go:134
↓ 68 callers
Function
testVersionDecodable
(t *testing.T, name string, out versionedDecoder, in []byte, version int16)
request_test.go:588
↓ 64 callers
Method
Input
Input is the input channel for the user to write messages to that they wish to send.
async_producer.go:54
↓ 62 callers
Function
setupFunctionalTest
(t testing.TB)
functional_test.go:491
↓ 62 callers
Function
teardownFunctionalTest
(t testing.TB)
functional_test.go:496
↓ 58 callers
Method
Messages
Messages returns the read channel for the messages that are returned by the broker.
consumer.go:399
↓ 57 callers
Method
decode
(pd packetDecoder)
encoder_decoder.go:61
↓ 54 callers
Function
testResponse
(t *testing.T, name string, res protocolBody, expected []byte)
request_test.go:652
↓ 53 callers
Method
Done
Done should return true when the SCRAM conversation is over.
broker.go:128
↓ 53 callers
Method
getNullableString
()
packet_decoder.go:37
↓ 52 callers
Function
NewAsyncProducer
NewAsyncProducer creates a new AsyncProducer using the given broker addresses and configuration.
async_producer.go:283
↓ 52 callers
Method
putNullableString
(in *string)
packet_encoder.go:32
↓ 50 callers
Method
AddTopicPartition
testing API
offset_response.go:257
↓ 50 callers
Method
version
()
request.go:13
↓ 49 callers
Method
Println
(v ...any)
sarama.go:130
↓ 48 callers
Method
ConsumePartition
ConsumePartition creates a PartitionConsumer on the given topic/partition with the given offset. It will return an error if this Consumer is already c
consumer.go:68
↓ 48 callers
Method
SetLeader
(topic string, partition, brokerID int32)
mockresponses.go:158
↓ 48 callers
Method
getKError
()
packet_decoder.go:26
↓ 47 callers
Method
ID
ID returns the broker ID retrieved from Kafka's metadata, or -1 if that is not known.
broker.go:427
↓ 47 callers
Function
checkKafkaVersion
(t testing.TB, requiredVersion string)
functional_test.go:451
↓ 47 callers
Method
putKError
(in KError)
packet_encoder.go:23
↓ 45 callers
Method
sendAndReceive
(req protocolBody, res protocolBody)
broker.go:1212
↓ 41 callers
Function
NewConsumer
NewConsumer creates a new consumer using the given broker addresses and configuration.
consumer.go:116
↓ 36 callers
Method
Open
Open tries to connect to the Broker if it is not already connected or connecting, but does not block waiting for the connection to complete. This mean
broker.go:189
↓ 36 callers
Method
String
()
utils.go:352
↓ 35 callers
Method
Len
()
utils.go:22
↓ 34 callers
Method
SetOffset
(topic string, partition int32, time, offset int64)
mockresponses.go:236
↓ 33 callers
Method
Errors
Errors returns a read channel of errors that occurred during consuming, if enabled. By default, errors are logged and not returned over this channel.
consumer.go:405
↓ 31 callers
Method
Name
Name uniquely identifies the strategy.
balance_strategy.go:52
↓ 31 callers
Function
NewMockOffsetResponse
(t TestReporter)
mockresponses.go:229
↓ 31 callers
Function
encode
Encode takes an Encoder and turns it into bytes while potentially recording metrics.
encoder_decoder.go:21
↓ 31 callers
Method
putDurationMs
(in time.Duration)
packet_encoder.go:24
↓ 31 callers
Method
putInt64
(in int64)
packet_encoder.go:17
↓ 30 callers
Method
getDurationMs
()
packet_decoder.go:27
↓ 29 callers
Method
getInt64
()
packet_decoder.go:20
↓ 28 callers
Method
SendMessage
SendMessage produces a given message, and returns only when it either has succeeded or failed to produce. It will return the partition and the offset
sync_producer.go:26
↓ 27 callers
Method
Addr
Addr returns the broker address as either retrieved from Kafka's metadata or passed to NewBroker.
broker.go:432
↓ 27 callers
Method
RefreshMetadata
RefreshMetadata takes a list of topics and queries the cluster to refresh the available metadata for those topics. If no topics are provided, it will
client.go:83
↓ 27 callers
Method
SetError
(topic string, partition int32, kerror KError)
mockresponses.go:570
↓ 27 callers
Function
newTestReporterMock
()
mocks/async_producer_test.go:32
↓ 26 callers
Function
closeProducer
(t *testing.T, p AsyncProducer)
helpers_test.go:62
↓ 26 callers
Method
putInt16
(in int16)
packet_encoder.go:15
↓ 26 callers
Method
retryOnError
retryOnError will repeatedly call the given (error-returning) func in the case that its response is non-nil and retryable (as determined by the provid
admin.go:296
↓ 25 callers
Method
Cleanup
Cleanup is run at the end of a session, once all ConsumeClaim goroutines have exited but before the offsets are committed for the very last time.
consumer_group_session.go:416
↓ 25 callers
Method
Stop
()
functional_consumer_group_test.go:512
↓ 24 callers
Function
NewBroker
NewBroker creates and returns a Broker targeting the given host:port address. This does not attempt to actually connect, you have to call Open() for t
broker.go:156
↓ 24 callers
Method
Plan
Plan implements BalanceStrategy.
balance_strategy.go:234
↓ 24 callers
Method
getInt16
()
packet_decoder.go:18
↓ 24 callers
Method
putInt8
Primitives
packet_encoder.go:14
↓ 23 callers
Method
Brokers
Brokers returns the current set of active brokers as retrieved from cluster metadata.
client.go:39
↓ 23 callers
Method
Config
Config returns the Config struct of the client. This struct should not be altered after it has been created.
client.go:27
↓ 23 callers
Function
NewConfig
NewConfig returns a new configuration instance with sane defaults.
config.go:548
↓ 23 callers
Function
NewMockFindCoordinatorResponse
(t TestReporter)
mockresponses.go:451
↓ 23 callers
Method
getInt8
Primitives
packet_decoder.go:17
↓ 22 callers
Function
NewSyncProducer
NewSyncProducer creates a new SyncProducer using the given broker addresses and configuration.
sync_producer.go:77
↓ 22 callers
Method
SetCoordinator
(coordinatorType CoordinatorType, group string, broker *MockBroker)
mockresponses.go:459
↓ 22 callers
Function
verifyPlanIsBalancedAndSticky
(t *testing.T, s *stickyBalanceStrategy, members map[string]ConsumerGroupMemberMetadata, plan BalanceStrategyP
balance_strategy_test.go:2174
↓ 21 callers
Function
NewTestConfig
NewTestConfig returns a config meant to be used by tests. Due to inconsistencies with the request versions the clients send using the default Kafka ve
mocks/mocks.go:103
↓ 21 callers
Function
expectResults
(t *testing.T, p AsyncProducer, successCount, errorCount int)
async_producer_test.go:59
↓ 20 callers
Function
ParseKafkaVersion
ParseKafkaVersion parses and returns kafka version or error from a string
utils.go:327
↓ 20 callers
Function
assertMessageOffset
(t *testing.T, msg *ConsumerMessage, expectedOffset int64)
consumer_test.go:2075
↓ 20 callers
Method
getBool
()
packet_decoder.go:25
↓ 20 callers
Method
putBool
(in bool)
packet_encoder.go:22
↓ 20 callers
Method
putUVarint
(in uint64)
packet_encoder.go:19
next →
1–100 of 3,668, ranked by callers