diff options
| author | Anhgelus Morhtuuzh <william@herges.fr> | 2025-09-22 23:00:18 +0200 |
|---|---|---|
| committer | Anhgelus Morhtuuzh <william@herges.fr> | 2025-09-22 23:00:18 +0200 |
| commit | 215ce412a8bf37f31f5e779fe45930b87b1bffec (patch) | |
| tree | 2d1ff059478e1546cb8b192739aa1becc6082c7c /widget/api/credits.go | |
| parent | b19108ed8d4ad56e7bbf1ec59d0470e118275a49 (diff) | |
feat(widget): creditsfeat/custom-widget
Diffstat (limited to 'widget/api/credits.go')
| -rw-r--r-- | widget/api/credits.go | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/widget/api/credits.go b/widget/api/credits.go new file mode 100644 index 0000000..e30cbea --- /dev/null +++ b/widget/api/credits.go @@ -0,0 +1,23 @@ +package api + +import ( + "encoding/json" + "io" +) + +const MethodCredits Method = "credits" + +type Credits struct { + Author string `json:"author"` + Homepage string `json:"homepage"` + Other []string `json:"other,omitempty"` +} + +func (c *Credits) Respond(w io.Writer, _ ...string) error { + b, err := json.Marshal(c) + if err != nil { + return err + } + _, err = w.Write(b) + return err +} |
