aboutsummaryrefslogtreecommitdiff
path: root/widget/api/credits.go
blob: e30cbeab09865ccb0afed15a7e7acae90fdc5dc9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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
}