1package server
2
3import (
4 "github.com/labstack/echo/v4"
5)
6
7type Label struct {
8 Ver *int `json:"ver,omitempty"`
9 Src string `json:"src"`
10 Uri string `json:"uri"`
11 Cid *string `json:"cid,omitempty"`
12 Val string `json:"val"`
13 Neg *bool `json:"neg,omitempty"`
14 Cts string `json:"cts"`
15 Exp *string `json:"exp,omitempty"`
16 Sig []byte `json:"sig,omitempty"`
17}
18
19type ComAtprotoLabelQueryLabelsResponse struct {
20 Cursor *string `json:"cursor,omitempty"`
21 Labels []Label `json:"labels"`
22}
23
24func (s *Server) handleLabelQueryLabels(e echo.Context) error {
25 svc := e.Request().Header.Get("atproto-proxy")
26 if svc != "" || s.config.FallbackProxy != "" {
27 return s.handleProxy(e)
28 }
29
30 return e.JSON(200, ComAtprotoLabelQueryLabelsResponse{
31 Cursor: nil,
32 Labels: []Label{},
33 })
34}