/
api.html
4854 lines (4848 loc) · 228 KB
/
api.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
using module mode; GOMOD=/home/esabellico/workspace/confluent-kafka-go/go.mod
<!DOCTYPE html>
<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type"/>
<meta content="width=device-width, initial-scale=1" name="viewport"/>
<meta content="#375EAB" name="theme-color"/>
<title>
kafka - Go Documentation Server
</title>
<link href="static/style.css" rel="stylesheet" type="text/css"/>
<script>
window.initFuncs = [];
</script>
<script defer="" src="static/jquery.js">
</script>
<script>
var goVersion = "go1.18.2";
</script>
<script defer="" src="static/godocs.js">
</script>
</head>
<body>
<div id="lowframe" style="position: fixed; bottom: 0; left: 0; height: 0; width: 100%; border-top: thin solid grey; background-color: white; overflow: auto;">
...
</div>
<!-- #lowframe -->
<div class="wide" id="page">
<div class="container">
<h1>
Package kafka
<span class="text-muted">
</span>
</h1>
<div id="nav">
</div>
<!--
Copyright 2009 The Go Authors. All rights reserved.
Use of this source code is governed by a BSD-style
license that can be found in the LICENSE file.
-->
<!--
Note: Static (i.e., not template-generated) href and id
attributes start with "pkg-" to make it impossible for
them to conflict with generated attributes (some of which
correspond to Go identifiers).
-->
<script>
document.ANALYSIS_DATA = null;
document.CALLGRAPH = null;
</script>
<div id="short-nav">
<dl>
<dd>
<code>
import "github.com/confluentinc/confluent-kafka-go/kafka"
</code>
</dd>
</dl>
<dl>
<dd>
<a class="overviewLink" href="#pkg-overview">
Overview
</a>
</dd>
<dd>
<a class="indexLink" href="#pkg-index">
Index
</a>
</dd>
<dd>
</dd>
</dl>
</div>
<!-- The package's Name is printed as title by the top-level template -->
<div class="toggleVisible" id="pkg-overview">
<div class="collapsed">
<h2 class="toggleButton" title="Click to show Overview section">
Overview ▹
</h2>
</div>
<div class="expanded">
<h2 class="toggleButton" title="Click to hide Overview section">
Overview ▾
</h2>
<p>
Package kafka provides high-level Apache Kafka producer and consumers
using bindings on-top of the librdkafka C library.
</p>
<h3 id="hdr-High_level_Consumer">
High-level Consumer
</h3>
<p>
* Decide if you want to read messages and events by calling `.Poll()` or
the deprecated option of using the `.Events()` channel. (If you want to use
`.Events()` channel then set `"go.events.channel.enable": true`).
</p>
<p>
* Create a Consumer with `kafka.NewConsumer()` providing at
least the `bootstrap.servers` and `group.id` configuration properties.
</p>
<p>
* Call `.Subscribe()` or (`.SubscribeTopics()` to subscribe to multiple topics)
to join the group with the specified subscription set.
Subscriptions are atomic, calling `.Subscribe*()` again will leave
the group and rejoin with the new set of topics.
</p>
<p>
* Start reading events and messages from either the `.Events` channel
or by calling `.Poll()`.
</p>
<p>
* When the group has rebalanced each client member is assigned a
(sub-)set of topic+partitions.
By default the consumer will start fetching messages for its assigned
partitions at this point, but your application may enable rebalance
events to get an insight into what the assigned partitions where
as well as set the initial offsets. To do this you need to pass
`"go.application.rebalance.enable": true` to the `NewConsumer()` call
mentioned above. You will (eventually) see a `kafka.AssignedPartitions` event
with the assigned partition set. You can optionally modify the initial
offsets (they'll default to stored offsets and if there are no previously stored
offsets it will fall back to `"auto.offset.reset"`
which defaults to the `latest` message) and then call `.Assign(partitions)`
to start consuming. If you don't need to modify the initial offsets you will
not need to call `.Assign()`, the client will do so automatically for you if
you dont, unless you are using the channel-based consumer in which case
you MUST call `.Assign()` when receiving the `AssignedPartitions` and
`RevokedPartitions` events.
</p>
<p>
* As messages are fetched they will be made available on either the
`.Events` channel or by calling `.Poll()`, look for event type `*kafka.Message`.
</p>
<p>
* Handle messages, events and errors to your liking.
</p>
<p>
* When you are done consuming call `.Close()` to commit final offsets
and leave the consumer group.
</p>
<h3 id="hdr-Producer">
Producer
</h3>
<p>
* Create a Producer with `kafka.NewProducer()` providing at least
the `bootstrap.servers` configuration properties.
</p>
<p>
* Messages may now be produced either by sending a `*kafka.Message`
on the `.ProduceChannel` or by calling `.Produce()`.
</p>
<p>
* Producing is an asynchronous operation so the client notifies the application
of per-message produce success or failure through something called delivery reports.
Delivery reports are by default emitted on the `.Events()` channel as `*kafka.Message`
and you should check `msg.TopicPartition.Error` for `nil` to find out if the message
was succesfully delivered or not.
It is also possible to direct delivery reports to alternate channels
by providing a non-nil `chan Event` channel to `.Produce()`.
If no delivery reports are wanted they can be completely disabled by
setting configuration property `"go.delivery.reports": false`.
</p>
<p>
* When you are done producing messages you will need to make sure all messages
are indeed delivered to the broker (or failed), remember that this is
an asynchronous client so some of your messages may be lingering in internal
channels or tranmission queues.
To do this you can either keep track of the messages you've produced
and wait for their corresponding delivery reports, or call the convenience
function `.Flush()` that will block until all message deliveries are done
or the provided timeout elapses.
</p>
<p>
* Finally call `.Close()` to decommission the producer.
</p>
<h3 id="hdr-Transactional_producer_API">
Transactional producer API
</h3>
<p>
The transactional producer operates on top of the idempotent producer,
and provides full exactly-once semantics (EOS) for Apache Kafka when used
with the transaction aware consumer (`isolation.level=read_committed`).
</p>
<p>
A producer instance is configured for transactions by setting the
`transactional.id` to an identifier unique for the application. This
id will be used to fence stale transactions from previous instances of
the application, typically following an outage or crash.
</p>
<p>
After creating the transactional producer instance using `NewProducer()`
the transactional state must be initialized by calling
`InitTransactions()`. This is a blocking call that will
acquire a runtime producer id from the transaction coordinator broker
as well as abort any stale transactions and fence any still running producer
instances with the same `transactional.id`.
</p>
<p>
Once transactions are initialized the application may begin a new
transaction by calling `BeginTransaction()`.
A producer instance may only have one single on-going transaction.
</p>
<p>
Any messages produced after the transaction has been started will
belong to the ongoing transaction and will be committed or aborted
atomically.
It is not permitted to produce messages outside a transaction
boundary, e.g., before `BeginTransaction()` or after `CommitTransaction()`,
`AbortTransaction()` or if the current transaction has failed.
</p>
<p>
If consumed messages are used as input to the transaction, the consumer
instance must be configured with `enable.auto.commit` set to `false`.
To commit the consumed offsets along with the transaction pass the
list of consumed partitions and the last offset processed + 1 to
`SendOffsetsToTransaction()` prior to committing the transaction.
This allows an aborted transaction to be restarted using the previously
committed offsets.
</p>
<p>
To commit the produced messages, and any consumed offsets, to the
current transaction, call `CommitTransaction()`.
This call will block until the transaction has been fully committed or
failed (typically due to fencing by a newer producer instance).
</p>
<p>
Alternatively, if processing fails, or an abortable transaction error is
raised, the transaction needs to be aborted by calling
`AbortTransaction()` which marks any produced messages and
offset commits as aborted.
</p>
<p>
After the current transaction has been committed or aborted a new
transaction may be started by calling `BeginTransaction()` again.
</p>
<p>
Retriable errors:
Some error cases allow the attempted operation to be retried, this is
indicated by the error object having the retriable flag set which can
be detected by calling `err.(kafka.Error).IsRetriable()`.
When this flag is set the application may retry the operation immediately
or preferably after a shorter grace period (to avoid busy-looping).
Retriable errors include timeouts, broker transport failures, etc.
</p>
<p>
Abortable errors:
An ongoing transaction may fail permanently due to various errors,
such as transaction coordinator becoming unavailable, write failures to the
Apache Kafka log, under-replicated partitions, etc.
At this point the producer application must abort the current transaction
using `AbortTransaction()` and optionally start a new transaction
by calling `BeginTransaction()`.
Whether an error is abortable or not is detected by calling
`err.(kafka.Error).TxnRequiresAbort()` on the returned error object.
</p>
<p>
Fatal errors:
While the underlying idempotent producer will typically only raise
fatal errors for unrecoverable cluster errors where the idempotency
guarantees can't be maintained, most of these are treated as abortable by
the transactional producer since transactions may be aborted and retried
in their entirety;
The transactional producer on the other hand introduces a set of additional
fatal errors which the application needs to handle by shutting down the
producer and terminate. There is no way for a producer instance to recover
from fatal errors.
Whether an error is fatal or not is detected by calling
`err.(kafka.Error).IsFatal()` on the returned error object or by checking
the global `GetFatalError()`.
</p>
<p>
Handling of other errors:
For errors that have neither retriable, abortable or the fatal flag set
it is not always obvious how to handle them. While some of these errors
may be indicative of bugs in the application code, such as when
an invalid parameter is passed to a method, other errors might originate
from the broker and be passed thru as-is to the application.
The general recommendation is to treat these errors, that have
neither the retriable or abortable flags set, as fatal.
</p>
<p>
Error handling example:
</p>
<pre>retry:
err := producer.CommitTransaction(...)
if err == nil {
return nil
} else if err.(kafka.Error).TxnRequiresAbort() {
do_abort_transaction_and_reset_inputs()
} else if err.(kafka.Error).IsRetriable() {
goto retry
} else { // treat all other errors as fatal errors
panic(err)
}
</pre>
<h3 id="hdr-Events">
Events
</h3>
<p>
Apart from emitting messages and delivery reports the client also communicates
with the application through a number of different event types.
An application may choose to handle or ignore these events.
</p>
<h3 id="hdr-Consumer_events">
Consumer events
</h3>
<p>
* `*kafka.Message` - a fetched message.
</p>
<p>
* `AssignedPartitions` - The assigned partition set for this client following a rebalance.
Requires `go.application.rebalance.enable`
</p>
<p>
* `RevokedPartitions` - The counter part to `AssignedPartitions` following a rebalance.
`AssignedPartitions` and `RevokedPartitions` are symmetrical.
Requires `go.application.rebalance.enable`
</p>
<p>
* `PartitionEOF` - Consumer has reached the end of a partition.
NOTE: The consumer will keep trying to fetch new messages for the partition.
</p>
<p>
* `OffsetsCommitted` - Offset commit results (when `enable.auto.commit` is enabled).
</p>
<h3 id="hdr-Producer_events">
Producer events
</h3>
<p>
* `*kafka.Message` - delivery report for produced message.
Check `.TopicPartition.Error` for delivery result.
</p>
<h3 id="hdr-Generic_events_for_both_Consumer_and_Producer">
Generic events for both Consumer and Producer
</h3>
<p>
* `KafkaError` - client (error codes are prefixed with _) or broker error.
These errors are normally just informational since the
client will try its best to automatically recover (eventually).
</p>
<p>
* `OAuthBearerTokenRefresh` - retrieval of a new SASL/OAUTHBEARER token is required.
This event only occurs with sasl.mechanism=OAUTHBEARER.
Be sure to invoke SetOAuthBearerToken() on the Producer/Consumer/AdminClient
instance when a successful token retrieval is completed, otherwise be sure to
invoke SetOAuthBearerTokenFailure() to indicate that retrieval failed (or
if setting the token failed, which could happen if an extension doesn't meet
the required regular expression); invoking SetOAuthBearerTokenFailure() will
schedule a new event for 10 seconds later so another retrieval can be attempted.
</p>
<p>
Hint: If your application registers a signal notification
(signal.Notify) makes sure the signals channel is buffered to avoid
possible complications with blocking Poll() calls.
</p>
<p>
Note: The Confluent Kafka Go client is safe for concurrent use.
</p>
</div>
</div>
<div class="toggleVisible" id="pkg-index">
<div class="collapsed">
<h2 class="toggleButton" title="Click to show Index section">
Index ▹
</h2>
</div>
<div class="expanded">
<h2 class="toggleButton" title="Click to hide Index section">
Index ▾
</h2>
<!-- Table of contents for API; must be named manual-nav to turn off auto nav. -->
<div id="manual-nav">
<dl>
<dd>
<a href="#pkg-constants">
Constants
</a>
</dd>
<dd>
<a href="#LibraryVersion">
func LibraryVersion() (int, string)
</a>
</dd>
<dd>
<a href="#WriteErrorCodes">
func WriteErrorCodes(f *os.File)
</a>
</dd>
<dd>
<a href="#AdminClient">
type AdminClient
</a>
</dd>
<dd>
<a href="#NewAdminClient">
func NewAdminClient(conf *ConfigMap) (*AdminClient, error)
</a>
</dd>
<dd>
<a href="#NewAdminClientFromConsumer">
func NewAdminClientFromConsumer(c *Consumer) (a *AdminClient, err error)
</a>
</dd>
<dd>
<a href="#NewAdminClientFromProducer">
func NewAdminClientFromProducer(p *Producer) (a *AdminClient, err error)
</a>
</dd>
<dd>
<a href="#AdminClient.AlterConfigs">
func (a *AdminClient) AlterConfigs(ctx context.Context, resources []ConfigResource, options ...AlterConfigsAdminOption) (result []ConfigResourceResult, err error)
</a>
</dd>
<dd>
<a href="#AdminClient.Close">
func (a *AdminClient) Close()
</a>
</dd>
<dd>
<a href="#AdminClient.ClusterID">
func (a *AdminClient) ClusterID(ctx context.Context) (clusterID string, err error)
</a>
</dd>
<dd>
<a href="#AdminClient.ControllerID">
func (a *AdminClient) ControllerID(ctx context.Context) (controllerID int32, err error)
</a>
</dd>
<dd>
<a href="#AdminClient.CreatePartitions">
func (a *AdminClient) CreatePartitions(ctx context.Context, partitions []PartitionsSpecification, options ...CreatePartitionsAdminOption) (result []TopicResult, err error)
</a>
</dd>
<dd>
<a href="#AdminClient.CreateTopics">
func (a *AdminClient) CreateTopics(ctx context.Context, topics []TopicSpecification, options ...CreateTopicsAdminOption) (result []TopicResult, err error)
</a>
</dd>
<dd>
<a href="#AdminClient.DeleteTopics">
func (a *AdminClient) DeleteTopics(ctx context.Context, topics []string, options ...DeleteTopicsAdminOption) (result []TopicResult, err error)
</a>
</dd>
<dd>
<a href="#AdminClient.DescribeConfigs">
func (a *AdminClient) DescribeConfigs(ctx context.Context, resources []ConfigResource, options ...DescribeConfigsAdminOption) (result []ConfigResourceResult, err error)
</a>
</dd>
<dd>
<a href="#AdminClient.GetMetadata">
func (a *AdminClient) GetMetadata(topic *string, allTopics bool, timeoutMs int) (*Metadata, error)
</a>
</dd>
<dd>
<a href="#AdminClient.SetOAuthBearerToken">
func (a *AdminClient) SetOAuthBearerToken(oauthBearerToken OAuthBearerToken) error
</a>
</dd>
<dd>
<a href="#AdminClient.SetOAuthBearerTokenFailure">
func (a *AdminClient) SetOAuthBearerTokenFailure(errstr string) error
</a>
</dd>
<dd>
<a href="#AdminClient.String">
func (a *AdminClient) String() string
</a>
</dd>
<dd>
<a href="#AdminOption">
type AdminOption
</a>
</dd>
<dd>
<a href="#AdminOptionOperationTimeout">
type AdminOptionOperationTimeout
</a>
</dd>
<dd>
<a href="#SetAdminOperationTimeout">
func SetAdminOperationTimeout(t time.Duration) (ao AdminOptionOperationTimeout)
</a>
</dd>
<dd>
<a href="#AdminOptionRequestTimeout">
type AdminOptionRequestTimeout
</a>
</dd>
<dd>
<a href="#SetAdminRequestTimeout">
func SetAdminRequestTimeout(t time.Duration) (ao AdminOptionRequestTimeout)
</a>
</dd>
<dd>
<a href="#AdminOptionValidateOnly">
type AdminOptionValidateOnly
</a>
</dd>
<dd>
<a href="#SetAdminValidateOnly">
func SetAdminValidateOnly(validateOnly bool) (ao AdminOptionValidateOnly)
</a>
</dd>
<dd>
<a href="#AlterConfigsAdminOption">
type AlterConfigsAdminOption
</a>
</dd>
<dd>
<a href="#AlterOperation">
type AlterOperation
</a>
</dd>
<dd>
<a href="#AlterOperation.String">
func (o AlterOperation) String() string
</a>
</dd>
<dd>
<a href="#AssignedPartitions">
type AssignedPartitions
</a>
</dd>
<dd>
<a href="#AssignedPartitions.String">
func (e AssignedPartitions) String() string
</a>
</dd>
<dd>
<a href="#BrokerMetadata">
type BrokerMetadata
</a>
</dd>
<dd>
<a href="#ConfigEntry">
type ConfigEntry
</a>
</dd>
<dd>
<a href="#StringMapToConfigEntries">
func StringMapToConfigEntries(stringMap map[string]string, operation AlterOperation) []ConfigEntry
</a>
</dd>
<dd>
<a href="#ConfigEntry.String">
func (c ConfigEntry) String() string
</a>
</dd>
<dd>
<a href="#ConfigEntryResult">
type ConfigEntryResult
</a>
</dd>
<dd>
<a href="#ConfigEntryResult.String">
func (c ConfigEntryResult) String() string
</a>
</dd>
<dd>
<a href="#ConfigMap">
type ConfigMap
</a>
</dd>
<dd>
<a href="#ConfigMap.Get">
func (m ConfigMap) Get(key string, defval ConfigValue) (ConfigValue, error)
</a>
</dd>
<dd>
<a href="#ConfigMap.Set">
func (m ConfigMap) Set(kv string) error
</a>
</dd>
<dd>
<a href="#ConfigMap.SetKey">
func (m ConfigMap) SetKey(key string, value ConfigValue) error
</a>
</dd>
<dd>
<a href="#ConfigResource">
type ConfigResource
</a>
</dd>
<dd>
<a href="#ConfigResource.String">
func (c ConfigResource) String() string
</a>
</dd>
<dd>
<a href="#ConfigResourceResult">
type ConfigResourceResult
</a>
</dd>
<dd>
<a href="#ConfigResourceResult.String">
func (c ConfigResourceResult) String() string
</a>
</dd>
<dd>
<a href="#ConfigSource">
type ConfigSource
</a>
</dd>
<dd>
<a href="#ConfigSource.String">
func (t ConfigSource) String() string
</a>
</dd>
<dd>
<a href="#ConfigValue">
type ConfigValue
</a>
</dd>
<dd>
<a href="#Consumer">
type Consumer
</a>
</dd>
<dd>
<a href="#NewConsumer">
func NewConsumer(conf *ConfigMap) (*Consumer, error)
</a>
</dd>
<dd>
<a href="#Consumer.Assign">
func (c *Consumer) Assign(partitions []TopicPartition) (err error)
</a>
</dd>
<dd>
<a href="#Consumer.Assignment">
func (c *Consumer) Assignment() (partitions []TopicPartition, err error)
</a>
</dd>
<dd>
<a href="#Consumer.AssignmentLost">
func (c *Consumer) AssignmentLost() bool
</a>
</dd>
<dd>
<a href="#Consumer.Close">
func (c *Consumer) Close() (err error)
</a>
</dd>
<dd>
<a href="#Consumer.Commit">
func (c *Consumer) Commit() ([]TopicPartition, error)
</a>
</dd>
<dd>
<a href="#Consumer.CommitMessage">
func (c *Consumer) CommitMessage(m *Message) ([]TopicPartition, error)
</a>
</dd>
<dd>
<a href="#Consumer.CommitOffsets">
func (c *Consumer) CommitOffsets(offsets []TopicPartition) ([]TopicPartition, error)
</a>
</dd>
<dd>
<a href="#Consumer.Committed">
func (c *Consumer) Committed(partitions []TopicPartition, timeoutMs int) (offsets []TopicPartition, err error)
</a>
</dd>
<dd>
<a href="#Consumer.Events">
func (c *Consumer) Events() chan Event
</a>
</dd>
<dd>
<a href="#Consumer.GetConsumerGroupMetadata">
func (c *Consumer) GetConsumerGroupMetadata() (*ConsumerGroupMetadata, error)
</a>
</dd>
<dd>
<a href="#Consumer.GetMetadata">
func (c *Consumer) GetMetadata(topic *string, allTopics bool, timeoutMs int) (*Metadata, error)
</a>
</dd>
<dd>
<a href="#Consumer.GetRebalanceProtocol">
func (c *Consumer) GetRebalanceProtocol() string
</a>
</dd>
<dd>
<a href="#Consumer.GetWatermarkOffsets">
func (c *Consumer) GetWatermarkOffsets(topic string, partition int32) (low, high int64, err error)
</a>
</dd>
<dd>
<a href="#Consumer.IncrementalAssign">
func (c *Consumer) IncrementalAssign(partitions []TopicPartition) (err error)
</a>
</dd>
<dd>
<a href="#Consumer.IncrementalUnassign">
func (c *Consumer) IncrementalUnassign(partitions []TopicPartition) (err error)
</a>
</dd>
<dd>
<a href="#Consumer.Logs">
func (c *Consumer) Logs() chan LogEvent
</a>
</dd>
<dd>
<a href="#Consumer.OffsetsForTimes">
func (c *Consumer) OffsetsForTimes(times []TopicPartition, timeoutMs int) (offsets []TopicPartition, err error)
</a>
</dd>
<dd>
<a href="#Consumer.Pause">
func (c *Consumer) Pause(partitions []TopicPartition) (err error)
</a>
</dd>
<dd>
<a href="#Consumer.Poll">
func (c *Consumer) Poll(timeoutMs int) (event Event)
</a>
</dd>
<dd>
<a href="#Consumer.Position">
func (c *Consumer) Position(partitions []TopicPartition) (offsets []TopicPartition, err error)
</a>
</dd>
<dd>
<a href="#Consumer.QueryWatermarkOffsets">
func (c *Consumer) QueryWatermarkOffsets(topic string, partition int32, timeoutMs int) (low, high int64, err error)
</a>
</dd>
<dd>
<a href="#Consumer.ReadMessage">
func (c *Consumer) ReadMessage(timeout time.Duration) (*Message, error)
</a>
</dd>
<dd>
<a href="#Consumer.Resume">
func (c *Consumer) Resume(partitions []TopicPartition) (err error)
</a>
</dd>
<dd>
<a href="#Consumer.Seek">
func (c *Consumer) Seek(partition TopicPartition, timeoutMs int) error
</a>
</dd>
<dd>
<a href="#Consumer.SetOAuthBearerToken">
func (c *Consumer) SetOAuthBearerToken(oauthBearerToken OAuthBearerToken) error
</a>
</dd>
<dd>
<a href="#Consumer.SetOAuthBearerTokenFailure">
func (c *Consumer) SetOAuthBearerTokenFailure(errstr string) error
</a>
</dd>
<dd>
<a href="#Consumer.StoreMessage">
func (c *Consumer) StoreMessage(m *Message) (storedOffsets []TopicPartition, err error)
</a>
</dd>
<dd>
<a href="#Consumer.StoreOffsets">
func (c *Consumer) StoreOffsets(offsets []TopicPartition) (storedOffsets []TopicPartition, err error)
</a>
</dd>
<dd>
<a href="#Consumer.String">
func (c *Consumer) String() string
</a>
</dd>
<dd>
<a href="#Consumer.Subscribe">
func (c *Consumer) Subscribe(topic string, rebalanceCb RebalanceCb) error
</a>
</dd>
<dd>
<a href="#Consumer.SubscribeTopics">
func (c *Consumer) SubscribeTopics(topics []string, rebalanceCb RebalanceCb) (err error)
</a>
</dd>
<dd>
<a href="#Consumer.Subscription">
func (c *Consumer) Subscription() (topics []string, err error)
</a>
</dd>
<dd>
<a href="#Consumer.Unassign">
func (c *Consumer) Unassign() (err error)
</a>
</dd>
<dd>
<a href="#Consumer.Unsubscribe">
func (c *Consumer) Unsubscribe() (err error)
</a>
</dd>
<dd>
<a href="#ConsumerGroupMetadata">
type ConsumerGroupMetadata
</a>
</dd>
<dd>
<a href="#NewTestConsumerGroupMetadata">
func NewTestConsumerGroupMetadata(groupID string) (*ConsumerGroupMetadata, error)
</a>
</dd>
<dd>
<a href="#CreatePartitionsAdminOption">
type CreatePartitionsAdminOption
</a>
</dd>
<dd>
<a href="#CreateTopicsAdminOption">
type CreateTopicsAdminOption
</a>
</dd>
<dd>
<a href="#DeleteTopicsAdminOption">
type DeleteTopicsAdminOption
</a>
</dd>
<dd>
<a href="#DescribeConfigsAdminOption">
type DescribeConfigsAdminOption
</a>
</dd>
<dd>
<a href="#Error">
type Error
</a>
</dd>
<dd>
<a href="#NewError">
func NewError(code ErrorCode, str string, fatal bool) (err Error)
</a>
</dd>
<dd>
<a href="#Error.Code">
func (e Error) Code() ErrorCode
</a>
</dd>
<dd>
<a href="#Error.Error">
func (e Error) Error() string
</a>
</dd>
<dd>
<a href="#Error.IsFatal">
func (e Error) IsFatal() bool
</a>
</dd>
<dd>
<a href="#Error.IsRetriable">
func (e Error) IsRetriable() bool
</a>
</dd>
<dd>
<a href="#Error.String">
func (e Error) String() string
</a>
</dd>
<dd>
<a href="#Error.TxnRequiresAbort">
func (e Error) TxnRequiresAbort() bool
</a>
</dd>
<dd>
<a href="#ErrorCode">
type ErrorCode
</a>
</dd>
<dd>
<a href="#ErrorCode.String">
func (c ErrorCode) String() string
</a>
</dd>
<dd>
<a href="#Event">
type Event
</a>
</dd>
<dd>
<a href="#Handle">
type Handle
</a>
</dd>
<dd>
<a href="#Header">
type Header
</a>
</dd>
<dd>
<a href="#Header.String">
func (h Header) String() string
</a>
</dd>
<dd>
<a href="#LogEvent">
type LogEvent
</a>
</dd>
<dd>
<a href="#LogEvent.String">
func (logEvent LogEvent) String() string
</a>
</dd>
<dd>
<a href="#Message">
type Message
</a>
</dd>
<dd>
<a href="#Message.String">
func (m *Message) String() string
</a>
</dd>
<dd>
<a href="#Metadata">
type Metadata
</a>
</dd>
<dd>
<a href="#MockCluster">
type MockCluster
</a>
</dd>
<dd>
<a href="#NewMockCluster">
func NewMockCluster(brokerCount int) (*MockCluster, error)
</a>
</dd>
<dd>
<a href="#MockCluster.BootstrapServers">
func (mc *MockCluster) BootstrapServers() string
</a>
</dd>
<dd>
<a href="#MockCluster.Close">
func (mc *MockCluster) Close()
</a>
</dd>
<dd>
<a href="#OAuthBearerToken">
type OAuthBearerToken
</a>
</dd>
<dd>
<a href="#OAuthBearerTokenRefresh">
type OAuthBearerTokenRefresh
</a>
</dd>
<dd>
<a href="#OAuthBearerTokenRefresh.String">
func (o OAuthBearerTokenRefresh) String() string
</a>
</dd>
<dd>
<a href="#Offset">
type Offset
</a>
</dd>
<dd>
<a href="#NewOffset">
func NewOffset(offset interface{}) (Offset, error)
</a>
</dd>
<dd>
<a href="#OffsetTail">
func OffsetTail(relativeOffset Offset) Offset
</a>
</dd>
<dd>
<a href="#Offset.Set">
func (o *Offset) Set(offset interface{}) error
</a>
</dd>
<dd>
<a href="#Offset.String">
func (o Offset) String() string
</a>
</dd>
<dd>
<a href="#OffsetsCommitted">
type OffsetsCommitted
</a>
</dd>
<dd>
<a href="#OffsetsCommitted.String">
func (o OffsetsCommitted) String() string
</a>
</dd>
<dd>
<a href="#PartitionEOF">
type PartitionEOF
</a>
</dd>
<dd>
<a href="#PartitionEOF.String">
func (p PartitionEOF) String() string
</a>
</dd>