抱歉,標(biāo)題太奇怪了,這是我無法理解的。我正在使用一個(gè)go庫(kù),它已經(jīng)完成了,但是還沒有:https://github.com/yfronto/go-statuspage-api發(fā)布事件時(shí),statuspage.io API支持以下參數(shù):incident[components][component_id] - Map of status changes to apply to affected components.一個(gè)例子是:"incident[components][ftgks51sfs2d]=degraded_performance"不幸的是,庫(kù)中定義的結(jié)構(gòu)不支持該特定字段:type NewIncidentUpdate struct { Name string Status string Message string WantsTwitterUpdate bool ImpactOverride string ComponentIDs []string}func (i *NewIncidentUpdate) String() string { return encodeParams(map[string]interface{}{ "incident[name]": i.Name, "incident[status]": i.Status, "incident[message]": i.Message, "incident[wants_twitter_update]": i.WantsTwitterUpdate, "incident[impact_override]": i.ImpactOverride, "incident[component_ids]": i.ComponentIDs, })}如何更新此結(jié)構(gòu)(和關(guān)聯(lián)的encodeParams函數(shù))以支持傳遞組件和關(guān)聯(lián)狀態(tài)的任意映射?
- 1 回答
- 0 關(guān)注
- 263 瀏覽
添加回答
舉報(bào)
0/150
提交
取消