这个问题类似于Python KafkaConsumer start 消费来自时间戳的消息,除了我想知道如何在 Confluence 的官方 Python Kafka 客户端中执行此操作。
我研究了Consumer.offsets_for_times函数,但我对它接受TopicPartition.offset字段中的时间戳感到困惑。
a 如何offset等同于时间戳?
我正在编写一个扩展,需要通过多部分表单数据上传选定的文件。
我找到了一些片段,例如Cannot POST a multipart/form-data using Fetch TYPESCRIPT,并写了类似的内容:
window.showOpenDialog({
canSelectFiles: true,
canSelectFolders: false,
canSelectMany: false,
filters: {
'image': ['jpg', 'png'],
},
title: 'Add Image',
}).then(async uriList => {
if (undefined === uriList || uriList.length === 0) {
return;
}
let imageFile = createReadStream(uriList[0].fsPath);
let formData = new FormData();
formData.append('file', imageFile); // <- ts(2345) error
});
Run Code Online (Sandbox Code Playgroud)
然而它抱怨:
Argument of type 'ReadStream' is not assignable to parameter of type 'string | Blob'.
Type 'ReadStream' is missing the following properties from …Run Code Online (Sandbox Code Playgroud) multipartform-data typescript visual-studio-code vscode-extensions