Skip to content

Commit ebdbe77

Browse files
committed
kgo.Record: clarify some field documentation
1 parent 750bf54 commit ebdbe77

File tree

1 file changed

+13
-10
lines changed

1 file changed

+13
-10
lines changed

Diff for: pkg/kgo/record_and_fetch.go

+13-10
Original file line numberDiff line numberDiff line change
@@ -101,27 +101,30 @@ type Record struct {
101101

102102
// Partition is the partition that a record is written to.
103103
//
104-
// For producing, this is left unset. This will be set by the client as
105-
// appropriate. Alternatively, you can use the ManualPartitioner, which
106-
// makes it such that this field is always the field chosen when
107-
// partitioning (i.e., you partition manually ahead of time).
104+
// For producing, this is left unset. This will be set by the client
105+
// before the record is unbuffered. If you use the ManualPartitioner,
106+
// the value of this field is always the partition chosen when
107+
// producing (i.e., you partition manually ahead of time).
108108
Partition int32
109109

110110
// Attrs specifies what attributes were on this record.
111+
//
112+
// For producing, this is left unset. This will be set by the client
113+
// before the record is unbuffered.
111114
Attrs RecordAttrs
112115

113116
// ProducerEpoch is the producer epoch of this message if it was
114117
// produced with a producer ID. An epoch and ID of 0 means it was not.
115118
//
116119
// For producing, this is left unset. This will be set by the client
117-
// as appropriate.
120+
// before the record is unbuffered.
118121
ProducerEpoch int16
119122

120123
// ProducerEpoch is the producer ID of this message if it was produced
121124
// with a producer ID. An epoch and ID of 0 means it was not.
122125
//
123126
// For producing, this is left unset. This will be set by the client
124-
// as appropriate.
127+
// before the record is unbuffered.
125128
ProducerID int64
126129

127130
// LeaderEpoch is the leader epoch of the broker at the time this
@@ -133,10 +136,10 @@ type Record struct {
133136

134137
// Offset is the offset that a record is written as.
135138
//
136-
// For producing, this is left unset. This will be set by the client as
137-
// appropriate. If you are producing with no acks, this will just be
138-
// the offset used in the produce request and does not mirror the
139-
// offset actually stored within Kafka.
139+
// For producing, this is left unset. This will be set by the client
140+
// before the record is unbuffered. If you are producing with no acks,
141+
// this will just be the offset used in the produce request and does
142+
// not mirror the offset actually stored within Kafka.
140143
Offset int64
141144

142145
// Context is an optional field that is used for enriching records.

0 commit comments

Comments
 (0)