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
↓ 19 callers
Method
AddError
(topic string, partition int32, err KError)
fetch_response.go:585
↓ 19 callers
Method
Controller
()
admin.go:246
↓ 19 callers
Method
Partition
Partition takes a message and partition count and chooses a partition
partitioner.go:16
↓ 19 callers
Method
Successes
Successes is the success output channel back to the user when Return.Successes is enabled. If Return.Successes is true, you MUST read from this channe
async_producer.go:60
↓ 19 callers
Function
decode
decode takes bytes and a decoder and fills the fields of the decoder from the bytes, interpreted using Kafka's encoding rules.
encoder_decoder.go:75
↓ 19 callers
Function
testEncodable
not specific to request tests, just helper functions for testing structures that implement the encoder or decoder interfaces that needed somewhere to
request_test.go:570
↓ 18 callers
Method
GetBlock
(topic string, partition int32)
fetch_response.go:573
↓ 18 callers
Function
NewMockFetchResponse
(t TestReporter, batchSize int)
mockresponses.go:301
↓ 17 callers
Method
Leader
Leader returns the broker object that is the leader of the current topic/partition, as determined by querying the cluster metadata.
client.go:57
↓ 17 callers
Function
NewMockSequence
(responses ...any)
mockresponses.go:48
↓ 17 callers
Method
Validate
Validate checks a Config instance. It will return a ConfigurationError if the specified values don't make sense. nolint:gocyclo // This function's cy
config.go:623
↓ 17 callers
Method
getInt32Array
()
packet_decoder.go:38
↓ 17 callers
Method
putInt32Array
(in []int32)
packet_encoder.go:34
↓ 17 callers
Function
safeAddMessage
(t *testing.T, ps *produceSet, msg *ProducerMessage)
produce_set_test.go:22
↓ 16 callers
Method
Close
Close closes the broker resources
broker.go:374
↓ 16 callers
Method
Close
Close shuts down the producer and waits for any buffered messages to be flushed. You must call this function before a producer object passes out of sc
async_producer.go:50
↓ 16 callers
Method
Closed
()
client.go:343
↓ 16 callers
Function
newProduceSet
(parent *asyncProducer)
produce_set.go:25
↓ 16 callers
Function
versionedDecode
(buf []byte, in versionedDecoder, version int16, metricRegistry metrics.Registry)
encoder_decoder.go:95
↓ 15 callers
Method
AddTopic
(topic string, err KError)
metadata_response.go:404
↓ 15 callers
Method
Connected
Connected returns true if the broker is connected and false otherwise. If the broker is not connected but it had tried to connect, the error from that
broker.go:348
↓ 15 callers
Method
Errors
Errors is the error output channel back to the user. You MUST read from this channel or the Producer will deadlock when the channel is full. Alternati
async_producer.go:66
↓ 15 callers
Function
NewSyncProducer
NewSyncProducer instantiates a new SyncProducer mock. The t argument should be the *testing.T instance of your test method. An error will be written t
mocks/sync_producer.go:33
↓ 15 callers
Method
SetMessage
(topic string, partition int32, offset int64, msg Encoder)
mockresponses.go:311
↓ 15 callers
Method
setHandler
setHandler sets the specified function as the request handler. Whenever a mock broker reads a request from the wire it passes the request to the funct
mockbroker.go:164
↓ 15 callers
Function
testFuncConsumerGroupID
--------------------------------------------------------------------
functional_consumer_group_test.go:303
↓ 14 callers
Method
AddBlock
(topic string, partitionID int32, fetchOffset int64, maxBytes int32, leaderEpoch int32)
fetch_request.go:344
↓ 14 callers
Method
Close
Close shuts down the consumer. It must be called after all child PartitionConsumers have already been closed.
consumer.go:76
↓ 14 callers
Method
Encode
()
utils.go:67
↓ 14 callers
Method
For
(reqBody versionedDecoder)
mockresponses.go:23
↓ 14 callers
Function
NewAsyncProducerFromClient
NewAsyncProducerFromClient creates a new Producer using the given client. It is still necessary to call Close() on the underlying client when shutting
async_producer.go:293
↓ 14 callers
Method
remaining
subsets
real_decoder.go:314
↓ 14 callers
Function
withRecover
(fn func())
utils.go:40
↓ 13 callers
Method
Get
(name string)
metrics.go:73
↓ 13 callers
Function
NewConsumer
NewConsumer returns a new mock Consumer instance. The t argument should be the *testing.T instance of your test method. An error will be written to it
mocks/consumer.go:25
↓ 13 callers
Function
Wrap
(sentinel error, wrapped ...error)
errors.go:141
↓ 13 callers
Method
getBytes
Collections
packet_decoder.go:32
↓ 13 callers
Method
putBytes
Collections
packet_encoder.go:27
↓ 13 callers
Method
refreshController
()
admin.go:254
↓ 12 callers
Method
BeginTxn
BeginTxn mark current transaction as ready.
sync_producer.go:46
↓ 12 callers
Method
Close
Close stops the ConsumerGroup and detaches any running sessions. It is required to call this function before the object passes out of scope, as it wil
consumer_group.go:71
↓ 12 callers
Method
Coordinator
Coordinator returns the coordinating broker for a consumer group. It will return a locally cached value if it's available. You can call RefreshCoordin
client.go:95
↓ 12 callers
Function
NewMetadataRequest
(version KafkaVersion, topics []string)
metadata_request.go:26
↓ 12 callers
Function
encodeSubscriberPlan
(t *testing.T, assignments map[string][]int32)
balance_strategy_test.go:2285
↓ 12 callers
Method
remaining
Subsets
packet_decoder.go:44
↓ 11 callers
Method
Close
Close shuts down the producer; you must call this function before a producer object passes out of scope, as it may otherwise leak memory. You must cal
sync_producer.go:37
↓ 11 callers
Method
DescribeTransactions
DescribeTransactions returns the current state of the given transactional ids, querying each transaction's coordinator. Requires Kafka 3.0.0.0 or high
admin_transactions.go:26
↓ 11 callers
Method
HighWaterMarkOffset
HighWaterMarkOffset returns the high water mark offset of the partition, i.e. the offset that will be used for the next message that will be produced.
consumer.go:410
↓ 11 callers
Method
ManagePartition
ManagePartition creates a PartitionOffsetManager on the given topic/partition. It will return an error if this OffsetManager is already managing the g
offset_manager.go:16
↓ 11 callers
Function
NewAsyncProducer
NewAsyncProducer instantiates a new Producer mock. The t argument should be the *testing.T instance of your test method. An error will be written to i
mocks/async_producer.go:35
↓ 11 callers
Function
NewBalanceStrategyRange
-------------------------------------------------------------------- NewBalanceStrategyRange returns a range balance strategy, which is the default an
balance_strategy.go:129
↓ 11 callers
Function
NewConsumerGroup
NewConsumerGroup creates a new consumer group the given broker addresses and configuration.
consumer_group.go:119
↓ 11 callers
Method
Partitions
Partitions returns the sorted list of all partition IDs for the given topic.
client.go:48
↓ 11 callers
Method
empty
()
produce_set.go:357
↓ 11 callers
Method
isPartial
()
records.go:122
↓ 11 callers
Function
newPartitionMuter
()
async_producer.go:135
↓ 11 callers
Method
numRecords
()
records.go:100
↓ 11 callers
Method
pop
()
packet_encoder.go:44
↓ 11 callers
Method
push
Stacks, see PushEncoder
packet_encoder.go:43
↓ 11 callers
Function
testRequestEncode
(t *testing.T, name string, rb protocolBody, expected []byte)
request_test.go:613
↓ 11 callers
Function
verifyFullyBalanced
verify that the plan is fully balanced, assumes that all consumers can consume from the same set of topics
balance_strategy_test.go:2326
↓ 10 callers
Method
AddTransaction
(transactionalID string, producerID int64, state string)
mockresponses.go:1681
↓ 10 callers
Method
Close
Close implements the Close method from the sarama.Consumer interface. It will close all registered PartitionConsumer instances.
mocks/consumer.go:121
↓ 10 callers
Method
Commit
Commit commits the offsets. This method can be used if AutoCommit.Enable is set to false.
offset_manager.go:26
↓ 10 callers
Method
CommitTxn
CommitTxn commit current transaction.
sync_producer.go:49
↓ 10 callers
Method
Consume
Consume joins a cluster of consumers for a given list of topics and starts a blocking ConsumerGroupSession through the ConsumerGroupHandler. The life
consumer_group.go:61
↓ 10 callers
Method
Context
Context returns the session context.
consumer_group_session.go:52
↓ 10 callers
Method
GetMetadata
GetMetadata send a metadata request and returns a metadata response or error
broker.go:448
↓ 10 callers
Method
MarkOffset
MarkOffset marks the provided offset, alongside a metadata string that represents the state of the partition consumer at that point in time. The metad
offset_manager.go:613
↓ 10 callers
Function
NewClusterAdminFromClient
NewClusterAdminFromClient creates a new ClusterAdmin using the given client. Note that underlying client will also be closed on admin's Close() call.
admin.go:228
↓ 10 callers
Function
NewOffsetManagerFromClient
NewOffsetManagerFromClient creates a new OffsetManager from the given client. It is still necessary to call Close() on the underlying client when fini
offset_manager.go:56
↓ 10 callers
Method
NextOffset
NextOffset returns the next offset that should be consumed for the managed partition, accompanied by metadata which can be used to reconstruct the sta
offset_manager.go:598
↓ 10 callers
Method
RefreshCoordinator
RefreshCoordinator retrieves the coordinator for a consumer group and stores it in local cache. This function only works on Kafka 0.8.2 and higher.
client.go:99
↓ 10 callers
Method
SetHandlerFuncByMap
SetHandlerFuncByMap defines mapping of Request types to RequestHandlerFunc. When a request is received by the broker, it looks up the request type in
mockbroker.go:103
↓ 10 callers
Function
initPartitionOffsetManager
(t *testing.T, om OffsetManager, coordinator *MockBroker, initialOffset int64, metadata string, )
offset_manager_test.go:68
↓ 10 callers
Function
isRetriableControllerError
isRetriableControllerError returns `true` if the given error type unwraps to an `ErrNotController` or `EOF` response from Kafka
admin.go:260
↓ 10 callers
Method
transitionTo
Try to transition to a valid status and return an error otherwise.
transaction_manager.go:212
↓ 10 callers
Method
unmute
unmute decrements the in-flight counter for all partitions in the set.
async_producer.go:238
↓ 9 callers
Method
AddMessage
(topic string, partition int32, key, value Encoder, offset int64)
fetch_response.go:720
↓ 9 callers
Method
AddTopicPartition
(topic string, partition, brokerID int32, replicas, isr []int32, offline []int32, err KError)
metadata_response.go:424
↓ 9 callers
Method
AssertCleanShutdown
()
functional_consumer_group_test.go:461
↓ 9 callers
Method
ConsumePartition
Consumer interface implementation ConsumePartition implements the ConsumePartition method from the sarama.Consumer interface. Before you can start c
mocks/consumer.go:48
↓ 9 callers
Method
ExpectConsumePartition
ExpectConsumePartition will register a topic/partition, so you can set expectations on it. The registered PartitionConsumer will be returned, so you c
mocks/consumer.go:211
↓ 9 callers
Method
ListTransactions
ListTransactions lists the transactions known to the cluster, optionally filtered by state, producer id, or (Kafka 3.8.0.0+) minimum duration in milli
admin_transactions.go:32
↓ 9 callers
Function
NewMockApiVersionsResponse
(t TestReporter)
mockresponses.go:1479
↓ 9 callers
Method
WaitForState
(expected int32)
functional_consumer_group_test.go:485
↓ 9 callers
Method
getStringArray
()
packet_decoder.go:41
↓ 9 callers
Function
initOffsetManager
(t *testing.T, retention time.Duration)
offset_manager_test.go:62
↓ 9 callers
Function
makeProduceSet
()
produce_set_test.go:11
↓ 9 callers
Method
putStringArray
(in []string)
packet_encoder.go:33
↓ 9 callers
Function
testDecodable
(t *testing.T, name string, out decoder, in []byte)
request_test.go:580
↓ 9 callers
Method
tryMute
tryMute checks if any of the partitions in the given produceSet are already muted, returning false if they are, otherwise it reserves every partition
async_producer.go:178
↓ 8 callers
Method
AddTopicPartition
Testing API
produce_response.go:463
↓ 8 callers
Method
DescribeProducers
DescribeProducers lists the active producers for the given topic partitions, querying each partition's leader. Requires Kafka 2.8.0.0 or higher.
admin_transactions.go:21
↓ 8 callers
Method
ExpectInputAndSucceed
ExpectInputAndSucceed sets an expectation on the mock producer that a message will be provided on the input channel. The mock producer will handle the
mocks/async_producer.go:267
↓ 8 callers
Method
History
History returns a slice of RequestResponse pairs in the order they were processed by the broker. Note that in case of multiple connections to the brok
mockbroker.go:128
↓ 8 callers
Function
NewMockDescribeTransactionsResponse
(t TestReporter)
mockresponses.go:1631
↓ 8 callers
Function
NewMockWrapper
(res encoderWithHeader)
mockresponses.go:36
↓ 8 callers
Function
NewRandomPartitioner
NewRandomPartitioner returns a Partitioner which chooses a random partition each time.
partitioner.go:99
↓ 8 callers
Method
Port
Port returns the TCP port number the broker is listening for requests on.
mockbroker.go:137
← previous
next →
101–200 of 3,668, ranked by callers