Add GetMessages and DeleteMessage to MessageHandler
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 35/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- go
- Lĩnh vực
- api, backend-api-design
Hướng nghiên cứu
Bắt đầu bằng cách xác định interface MessageHandler và struct Message, sau đó truy vết các triển khai của chúng và cách sử dụng API trên toàn bộ repository. Xác định cách biểu diễn ID của message và cách các thao tác liệt kê, truy xuất và xóa cần hoạt động đối với một plugin. Công việc được coi là hoàn tất khi interface và các triển khai hỗ trợ các thao tác được yêu cầu với hành vi nhất quán.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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
- Ngôn ngữ chính
- Go
- Star
- 16
- Fork
- 4
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của gotify/plugin-api
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
gotify/plugin-api#8 · 1 bình luận ·
-
Allow plugins to delete messages Đang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 30/100
gotify/plugin-api#7 · 1 reaction ·
-
Configurer comments not working. Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
gotify/plugin-api#6 · 2 bình luận ·
-
new-api
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
gotify/plugin-api#3 · 4 bình luận · 1 reaction ·
Tất cả issue của gotify/plugin-api
Issue tương tự
-
area/dev-productivity area/disaster-recovery area/ipcei kind/enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 85/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
-
kind/bug status/0-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
-
🤔 refinement needed
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
equinor/radix-operator#1979 ·