Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Add GetMessages and DeleteMessage to MessageHandler

オープン
#11 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
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 はありません

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

gotify/plugin-api のほかの issue

gotify/plugin-api の issue をすべて見る

似ている issue

Go の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。