nu-modules/kafka.nu

23 lines
631 B
Plaintext

def call_kafka [args] {
run-external --redirect-stdout kafka-admin-cli $args
}
# list all kafka topics on your broker
export def topics [] {
call_kafka list-topics | lines | sort
}
# delete topics. Reads the topic names from plain stdin
export def "delete topics" [] {
$in | to text | call_kafka delete-topics
}
# describe topics. Reads the topic names from plain stdin
export def "describe topics" [] {
$in | to text | call_kafka describe-topics
}
# get the info for a list of topics. Reads the topic names from plain stdin
export def "topic info" [] {
$in | to text | call_kafka topics-info | from json
}