confluent-kafka-go icon indicating copy to clipboard operation
confluent-kafka-go copied to clipboard

godoc: Minor API doc edits. Timestamps are Unix milliseconds.

Open evanj opened this issue 1 year ago • 1 comments

This is a collection of minor API documentation edits I noticed while using ListOffsets. Notably: I had to look around to figure out that timestamps are Unix milliseconds.

Detailed edits:

  • OffsetSpec: Reference defined constants and NewOffsetSpecForTimestamp. Attempt to clarify the constants using the wording from Java: https://kafka.apache.org/26/javadoc/org/apache/kafka/clients/admin/OffsetSpec.html
  • NewOffsetSpecForTimestamp: Rename parameter and clarify that timestamps are in Unix milliseconds.
  • ListOffsetsResultInfo: Timestamp is in Unix milliseconds.
  • ListOffsetsResult: Fix TopicPartiton typo. Clarify that this returns offsets for many TopicPartitions. Document how to create a valid OffsetSpec.
  • Consumer.OffsetsForTimes: Timestamps are Unix milliseconds.
  • Error: Document that Code() == ErrNoError is not an error.
  • Error.Error(): Separate two sentences so they are not incorrectly combined by godoc e.g. here: https://pkg.go.dev/github.com/confluentinc/confluent-kafka-go/[email protected]/kafka#Error.Error
  • ErrorCode: Document that ErrNoError is success.
  • offsets.go offsetsForTimes: Copy doc from Consumer.OffsetsForTimes.
  • Producer.OffsetsForTimes: Copy doc from Consumer.OffsetsForTimes.

evanj avatar Dec 01 '23 19:12 evanj

This conflicts with https://github.com/confluentinc/confluent-kafka-go/pull/1109 because it edits the documentation of some constants. I think that PR should be merged first, then I will rebase and/or fix the merge conflicts here (whatever you prefer).

evanj avatar Dec 01 '23 19:12 evanj