Skip to content

Commit

Permalink
code review
Browse files Browse the repository at this point in the history
  • Loading branch information
Deflaimun committed Mar 4, 2024
1 parent d5b8b30 commit 55f7844
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 34 deletions.
24 changes: 1 addition & 23 deletions modules/reference/pages/rpk/rpk-topic/rpk-topic-consume.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -71,20 +71,14 @@ there are the following modifiers:

|`%t\{hex}` |Hex encoding

|`%k\{base64}` |Base64 encoding
|`%k\{base64}` |Base64 standard encoding

|`%k\{base64raw}` |Base64 encoding raw

|`%v{unpack[<bBhH>iIqQc.$]}` |The unpack modifier has a further internal
specification, similar to timestamps above.
|===

The hex modifier hex encodes the text, the `base64` modifier base64 encodes the
text with standard encoding, and the `base64raw` modifier encodes the text with
raw standard encoding. The unpack modifier has a further internal
specification, similar to timestamps above: |Match the end of the line (append error string if anything
remains).

Unpacking text can allow translating binary input into readable output. If a
value is a big-endian uint32, `%v` prints the raw four bytes, while
`%v{unpack[>I]}` prints the number in as ASCII. If unpacking exhausts the
Expand Down Expand Up @@ -190,22 +184,6 @@ For example:
-o @:-1hr consume from the start until an hour ago
```

=== Misc

Producing requires a topic to produce to. The topic can be specified either
directly as an argument, or in the input text through `%t`. A parsed topic
takes precedence over the default passed in topic. If no topic is specified
directly and no topic is parsed, this command quits with an error.

The input format can parse partitions to produce directly to with `%p`. Doing so
requires specifying a non-negative `--partition` flag. Any parsed partition
takes precedence over the `--partition` flag. Specifying the flag is the main
requirement for being able to directly control which partition to produce to.

You can also specify an output format to write when a record is produced
successfully. The output format follows the same formatting rules as the topic
consume command. See that command's help text for a detailed description.

== Usage

[,bash]
Expand Down
24 changes: 13 additions & 11 deletions modules/reference/pages/rpk/rpk-topic/rpk-topic.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,6 @@

Create, delete, produce to and consume from Redpanda topics.

- xref:reference:rpk/rpk-topic/rpk-topic-create.adoc[Create a topic]
- xref:reference:rpk/rpk-topic/rpk-topic-produce.adoc[Produce records to a topic]
- xref:reference:rpk/rpk-topic/rpk-topic-list.adoc[List topics]
- xref:reference:rpk/rpk-topic/rpk-topic-consume.adoc[Consume records from a topic]
- xref:reference:rpk/rpk-topic/rpk-topic-delete.adoc[Delete a topic]
- xref:reference:rpk/rpk-topic/rpk-topic-describe.adoc[Describe a topic and its configuration]
- xref:reference:rpk/rpk-topic/rpk-topic-describe-storage.adoc[Describe the storage status of a topic]
- xref:reference:rpk/rpk-topic/rpk-topic-alter-config.adoc[Modify topic configuration]
- xref:reference:rpk/rpk-topic/rpk-topic-trim-prefix.adoc[Trim existing records in a topic]
- xref:reference:rpk/rpk-topic/rpk-topic-add-partitions.adoc[Add partitions to an existing topic]
== Usage

[,bash]
Expand All @@ -39,3 +28,16 @@ rpk topic [flags] [command]

|-v, --verbose |- |Enable verbose logging.
|===

== See also

- xref:reference:rpk/rpk-topic/rpk-topic-create.adoc[Create a topic]
- xref:reference:rpk/rpk-topic/rpk-topic-produce.adoc[Produce records to a topic]
- xref:reference:rpk/rpk-topic/rpk-topic-list.adoc[List topics]
- xref:reference:rpk/rpk-topic/rpk-topic-consume.adoc[Consume records from a topic]
- xref:reference:rpk/rpk-topic/rpk-topic-delete.adoc[Delete a topic]
- xref:reference:rpk/rpk-topic/rpk-topic-describe.adoc[Describe a topic and its configuration]
- xref:reference:rpk/rpk-topic/rpk-topic-describe-storage.adoc[Describe the storage status of a topic]
- xref:reference:rpk/rpk-topic/rpk-topic-alter-config.adoc[Modify topic configuration]
- xref:reference:rpk/rpk-topic/rpk-topic-trim-prefix.adoc[Trim existing records in a topic]
- xref:reference:rpk/rpk-topic/rpk-topic-add-partitions.adoc[Add partitions to an existing topic]

0 comments on commit 55f7844

Please sign in to comment.