aboutsummaryrefslogtreecommitdiff
path: root/widget/api/credits.go
diff options
context:
space:
mode:
Diffstat (limited to 'widget/api/credits.go')
-rw-r--r--widget/api/credits.go23
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
+}