Add GetMessages and DeleteMessage to MessageHandler
還沒有人認領這個 Issue。
評估
- 難度
- 5/5
- 預估耗時
- 一週以上
- 新手友好度
- 35/100
- Issue 類型
- 功能
- 描述清晰度
- 基本清楚
- 活躍度
- 停滯
- 技術堆疊
- go
研究方向
先定位 MessageHandler 介面和 Message 結構,再追蹤它們在整個儲存庫中的實作和 API 使用情況。確定訊息 ID 應如何表示,以及對於 plugin,列出、取得和刪除應如何運作。介面和實作支援所要求的操作並具有一致的行為,即表示完成。
由索引模型根據 Issue 內容生成。
描述
Currently, the MessageHandler has an API gap in that it cannot list, get, or delete messages. This would be valuable for plugins who want to display a persistent notification while some event is ongoing.
I think the MessageHandler interface could just be extended with a few extra functions
// MessageHandler consists of message callbacks to be used by plugins.
type MessageHandler interface {
// SendMessage sends a message with the given information in the request.
SendMessage(msg Message) error
// GetMessages returns all active messages sent by this plugin.
GetMessages() ([]Message, error)
// GetMessage returns a specific message by ID.
GetMessage(id uint) (*Message, error)
// DeleteMessages deletes all messages created by this plugin.
DeleteMessages() error
// DeleteMessage deletes a specific message by ID.
DeleteMessage(id uint) error
}
I think the Message struct might also need to be extended or a new struct would need to be defined that includes an ID.
As background, I want to make a plugin for Alertmanager where alerts will be persistently created as notifications in Gotify so that I only get one notification for the alert and it gets deleted automatically when it resolves. Additionally, I want to add special handling for the watchdog alert so if Alertmanager stops sending it, I get a notification. With the current plugin API, I am only able to send messages when I get them from alertmanager.
If this is a desirable inclusion, I would love to implement it.
Relates to #7
- 主要語言
- Go
- 星號
- 16
- 分支
- 4
- PR 合併指標
- 30 天內沒有已合併 PR
環境準備
這個專案沒有提供開發容器、Dockerfile 或貢獻指南,環境需要你自己搭建:先看它的 README,通用步驟見我們的新手貢獻指南。
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
gotify/plugin-api 的其他 Issue
-
難度 5/5 一週以上 新手友好度 35/100
gotify/plugin-api#8 · 1 則留言 ·
-
難度 5/5 一週以上 新手友好度 30/100
gotify/plugin-api#7 · 1 個 reaction ·
-
難度 4/5 3-5 天 新手友好度 35/100
gotify/plugin-api#6 · 2 則留言 ·
-
new-api
難度 5/5 一週以上 新手友好度 25/100
gotify/plugin-api#3 · 4 則留言 · 1 個 reaction ·
查看 gotify/plugin-api 的全部 Issue
相似的 Issue
-
難度 2/5 1-3 小時 新手友好度 82/100
維護者通常 4 天內回覆
-
bug needs-acceptance
難度 2/5 1-3 小時 新手友好度 86/100
vllm-project/semantic-router#4744 ·
維護者通常 1 天內回覆
-
ScalingModifiers formula fails with "formula returned non-float result" when expression evaluates to an integer可能已有人在做 @Sarthak-Pandey 今天認領。 未關閉bug
難度 2/5 1-3 小時 新手友好度 73/100
維護者通常 1 天內回覆
-
bug from-studio
難度 2/5 1-3 小時 新手友好度 63/100
esengine/DeepSeek-Reasonix#12355 ·
維護者通常 1 天內回覆
-
[Bug]: Gemini provider replaces a client-supplied `extra_content.google.thought_signature` with `skip_thought_signature_validator`, and writes the sentinel on every replayed function call (old turns, all models)可能已有人在做 關聯的 PR 仍在進行中或已合併。 未關閉
難度 2/5 1-3 小時 新手友好度 85/100
維護者通常 1 天內回覆