gmail api 批量请求一次获取多条消息 golang
gmail api batch request to get multiple messages at once golang
是否有批量获取消息?来自 golang 客户端库?
我没看到
https://godoc.org/google.golang.org/api/gmail/v1
我可以获得消息 ID 列表,但必须按 ID 一次获取一条消息。
回答
Go 客户端的存储库中有一个关于此主题的 Github issue,显然短期内不太可能看到对此功能的支持。但是,它可能会在下一代客户端中实现。
可能的解决方法
您可以通过对 www.googleapis.com/batch
或 www.googleapis.com/batch/api/version
端点进行 HTTP 调用来实现自己的批处理功能。前者将在 August 12, 2020 but you can still use the latter past this date for homogeneous requests (in your case, doing GET requests based on messageId, you should have no problem doing so). You can read more about this in the following Official Google Developers Blog post: https://developers.googleblog.com/2018/03/discontinuing-support-for-json-rpc-and.html
中弃用
是否有批量获取消息?来自 golang 客户端库?
我没看到 https://godoc.org/google.golang.org/api/gmail/v1
我可以获得消息 ID 列表,但必须按 ID 一次获取一条消息。
回答
Go 客户端的存储库中有一个关于此主题的 Github issue,显然短期内不太可能看到对此功能的支持。但是,它可能会在下一代客户端中实现。
可能的解决方法
您可以通过对 www.googleapis.com/batch
或 www.googleapis.com/batch/api/version
端点进行 HTTP 调用来实现自己的批处理功能。前者将在 August 12, 2020 but you can still use the latter past this date for homogeneous requests (in your case, doing GET requests based on messageId, you should have no problem doing so). You can read more about this in the following Official Google Developers Blog post: https://developers.googleblog.com/2018/03/discontinuing-support-for-json-rpc-and.html