Add GetMessages and DeleteMessage to MessageHandler
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 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 はありません
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
gotify/plugin-api のほかの issue
-
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
gotify/plugin-api#8 · コメント 1 件 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 30/100
gotify/plugin-api#7 · リアクション 1 件 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
gotify/plugin-api#6 · コメント 2 件 ·
-
new-api
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
gotify/plugin-api#3 · コメント 4 件 · リアクション 1 件 ·
gotify/plugin-api の issue をすべて見る
似ている issue
-
textual definition
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
geneontology/go-ontology#32653 ·
-
難易度 1/5 1時間未満 初心者へのやさしさ 75/100
-
needs design
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
Priority/High ready-for-agent Severity/Major Type/Bug
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100