forked from hailey.at/cocoon
An atproto PDS written in Go
1package server 2 3import ( 4 "github.com/haileyok/cocoon/internal/helpers" 5 "github.com/labstack/echo/v4" 6) 7 8type ComAtprotoSyncGetRepoStatusResponse struct { 9 Did string `json:"did"` 10 Active bool `json:"active"` 11 Status *string `json:"status,omitempty"` 12 Rev *string `json:"rev,omitempty"` 13} 14 15// TODO: make this actually do the right thing 16func (s *Server) handleSyncGetRepoStatus(e echo.Context) error { 17 ctx := e.Request().Context() 18 19 did := e.QueryParam("did") 20 if did == "" { 21 return helpers.InputError(e, nil) 22 } 23 24 urepo, err := s.getRepoActorByDid(ctx, did) 25 if err != nil { 26 return err 27 } 28 29 return e.JSON(200, ComAtprotoSyncGetRepoStatusResponse{ 30 Did: urepo.Repo.Did, 31 Active: urepo.Active(), 32 Status: urepo.Status(), 33 Rev: &urepo.Rev, 34 }) 35}