A community based topic aggregation platform built on atproto
1package routes
2
3import (
4 "Coves/internal/api/handlers"
5 "Coves/internal/core/repository"
6 "github.com/go-chi/chi/v5"
7)
8
9// RepositoryRoutes returns repository-related routes
10func RepositoryRoutes(service repository.RepositoryService) chi.Router {
11 handler := handlers.NewRepositoryHandler(service)
12
13 r := chi.NewRouter()
14
15 // AT Protocol XRPC endpoints for repository operations
16 r.Route("/xrpc", func(r chi.Router) {
17 // Record operations
18 r.Post("/com.atproto.repo.createRecord", handler.CreateRecord)
19 r.Get("/com.atproto.repo.getRecord", handler.GetRecord)
20 r.Post("/com.atproto.repo.putRecord", handler.PutRecord)
21 r.Post("/com.atproto.repo.deleteRecord", handler.DeleteRecord)
22 r.Get("/com.atproto.repo.listRecords", handler.ListRecords)
23
24 // Repository operations
25 r.Post("/com.atproto.repo.createRepo", handler.CreateRepository)
26
27 // Sync operations
28 r.Get("/com.atproto.sync.getRepo", handler.GetRepo)
29 r.Get("/com.atproto.sync.getCommit", handler.GetCommit)
30 })
31
32 return r
33}