Add GetMessages and DeleteMessage to MessageHandler
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 35/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Ferma
- Stack tecnologico
- go
- Ambito
- api, backend-api-design
Direzione di ricerca
Inizia individuando l’interfaccia MessageHandler e la struct Message, quindi segui le relative implementazioni e l’utilizzo dell’API in tutto il repository. Determina come devono essere rappresentati gli ID dei messaggi e come devono comportarsi l’elencazione, il recupero e l’eliminazione per un plugin. Il lavoro è completato quando l’interfaccia e le implementazioni supportano le operazioni richieste con un comportamento coerente.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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
- Lingua principale
- Go
- Stelle
- 16
- Fork
- 4
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di gotify/plugin-api
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
gotify/plugin-api#8 · 1 commento ·
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 30/100
gotify/plugin-api#7 · 1 reazione ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
gotify/plugin-api#6 · 2 commenti ·
-
new-api
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
gotify/plugin-api#3 · 4 commenti · 1 reazione ·
Tutte le issue di gotify/plugin-api
Issue simili
-
area/dev-productivity area/disaster-recovery area/ipcei kind/enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 85/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
-
kind/bug status/0-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
-
🤔 refinement needed
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
equinor/radix-operator#1979 ·