使用批量请求在Google日历中添加多个事件。

huangapple go评论89阅读模式
英文:

Add multiple events in Google Calendar using batch request

问题

我想使用Google日历API在Google日历中添加多个事件。我打算使用批量请求来实现,但不幸的是,我找不到任何有用的软件包或文章来帮助我使用Golang发送批量请求。

请问有人可以解释一下如何使用Golang发送批量请求来插入事件到Google日历吗?

谢谢!

英文:

I want to add multiple events in google calendar using google calendar API. I am thinking of using batch request for the same but unfortunately, I couldn't find any helpful pkg or article to help me send batch request using golang.

can anyone please explain me how to send batch request to google calendar to insert event using golang.

Thank you!

答案1

得分: 1

你需要考虑的第一件事是为什么要费心去处理批处理。

批处理并不能节省你的配额,在某些情况下,它可能会增加出现洪水错误的可能性。批处理只能节省HTTP调用的次数。

你在单个批处理请求中最多可以进行50次调用,而且它们必须都是针对同一个授权用户的。所以,除非你计划向单个用户的日历中插入大量事件,否则没有真正的理由去处理批处理。

话虽如此,根据我所看到的,google-apis-go-client并不支持批处理,他们也没有打算添加这个功能。这意味着,如果你确实想要添加批处理,你需要查看我发布的第一个链接,并自己手动编写代码。

英文:

The first thing you need to consider is why you want to bother with batching

Batching is not going to save you quota, in some case it will increase the likly hood that you will get a flooding error. All batching saves you is the number of HTTP calls.

You're limited to 50 calls in a single batch request and they must all be to the same authorized user. So unless you are planning on inserting a large number of events to a single users calendar there is really no reason to work out batching.

That being said from what i can see the google-apis-go-client does not support batching and they dont intend to add it. Which would mean that if you do in fact want to add batching you will need to check the first link i posted and code this manually yourself.

huangapple
  • 本文由 发表于 2022年11月25日 12:47:52
  • 转载请务必保留本文链接:https://go.coder-hub.com/74568452.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定