A community based topic aggregation platform built on atproto

style: apply gofumpt formatting to entire codebase

- Run gofumpt -l -w on all Go files
- Fix import statement formatting (blank lines between groups)
- Auto-fix via make lint-fix
- All linter checks now pass

No functional changes, formatting only

+198 -284
+11 -12
cmd/server/main.go
··· 1 1 package main 2 2 3 3 import ( 4 - "bytes" 5 - "context" 6 - "database/sql" 7 - "encoding/json" 8 - "fmt" 9 - "io" 10 - "log" 11 - "net/http" 12 - "os" 13 - "strings" 14 - "time" 15 - 16 4 "Coves/internal/api/middleware" 17 5 "Coves/internal/api/routes" 18 6 "Coves/internal/atproto/auth" ··· 26 14 "Coves/internal/core/posts" 27 15 "Coves/internal/core/timeline" 28 16 "Coves/internal/core/users" 17 + "bytes" 18 + "context" 19 + "database/sql" 20 + "encoding/json" 21 + "fmt" 22 + "io" 23 + "log" 24 + "net/http" 25 + "os" 26 + "strings" 27 + "time" 29 28 30 29 "github.com/go-chi/chi/v5" 31 30 chiMiddleware "github.com/go-chi/chi/v5/middleware"
+1 -2
internal/api/handlers/aggregator/errors.go
··· 1 1 package aggregator 2 2 3 3 import ( 4 + "Coves/internal/core/aggregators" 4 5 "encoding/json" 5 6 "log" 6 7 "net/http" 7 - 8 - "Coves/internal/core/aggregators" 9 8 ) 10 9 11 10 // ErrorResponse represents an XRPC error response
+1 -2
internal/api/handlers/aggregator/get_authorizations.go
··· 1 1 package aggregator 2 2 3 3 import ( 4 + "Coves/internal/core/aggregators" 4 5 "encoding/json" 5 6 "log" 6 7 "net/http" 7 8 "strconv" 8 - 9 - "Coves/internal/core/aggregators" 10 9 ) 11 10 12 11 // GetAuthorizationsHandler handles listing authorizations for an aggregator
+1 -2
internal/api/handlers/aggregator/get_services.go
··· 1 1 package aggregator 2 2 3 3 import ( 4 + "Coves/internal/core/aggregators" 4 5 "encoding/json" 5 6 "log" 6 7 "net/http" 7 8 "strings" 8 - 9 - "Coves/internal/core/aggregators" 10 9 ) 11 10 12 11 // GetServicesHandler handles aggregator service details retrieval
+1 -2
internal/api/handlers/aggregator/list_for_community.go
··· 1 1 package aggregator 2 2 3 3 import ( 4 + "Coves/internal/core/aggregators" 4 5 "encoding/json" 5 6 "log" 6 7 "net/http" 7 8 "strconv" 8 - 9 - "Coves/internal/core/aggregators" 10 9 ) 11 10 12 11 // ListForCommunityHandler handles listing aggregators for a community
+1 -2
internal/api/handlers/comments/errors.go
··· 1 1 package comments 2 2 3 3 import ( 4 + "Coves/internal/core/comments" 4 5 "encoding/json" 5 6 "log" 6 7 "net/http" 7 - 8 - "Coves/internal/core/comments" 9 8 ) 10 9 11 10 // errorResponse represents a standardized JSON error response
+2 -3
internal/api/handlers/comments/get_comments.go
··· 3 3 package comments 4 4 5 5 import ( 6 + "Coves/internal/api/middleware" 7 + "Coves/internal/core/comments" 6 8 "encoding/json" 7 9 "log" 8 10 "net/http" 9 11 "strconv" 10 - 11 - "Coves/internal/api/middleware" 12 - "Coves/internal/core/comments" 13 12 ) 14 13 15 14 // GetCommentsHandler handles comment retrieval for posts
+1 -2
internal/api/handlers/comments/middleware.go
··· 1 1 package comments 2 2 3 3 import ( 4 + "Coves/internal/api/middleware" 4 5 "net/http" 5 - 6 - "Coves/internal/api/middleware" 7 6 ) 8 7 9 8 // OptionalAuthMiddleware wraps the existing OptionalAuth middleware from the middleware package.
+1 -2
internal/api/handlers/comments/service_adapter.go
··· 1 1 package comments 2 2 3 3 import ( 4 + "Coves/internal/core/comments" 4 5 "net/http" 5 - 6 - "Coves/internal/core/comments" 7 6 ) 8 7 9 8 // ServiceAdapter adapts the core comments.Service to the handler's Service interface
+2 -3
internal/api/handlers/community/block.go
··· 1 1 package community 2 2 3 3 import ( 4 + "Coves/internal/api/middleware" 5 + "Coves/internal/core/communities" 4 6 "encoding/json" 5 7 "log" 6 8 "net/http" 7 9 "regexp" 8 10 "strings" 9 - 10 - "Coves/internal/api/middleware" 11 - "Coves/internal/core/communities" 12 11 ) 13 12 14 13 // Package-level compiled regex for DID validation (compiled once at startup)
+2 -3
internal/api/handlers/community/create.go
··· 1 1 package community 2 2 3 3 import ( 4 + "Coves/internal/api/middleware" 5 + "Coves/internal/core/communities" 4 6 "encoding/json" 5 7 "net/http" 6 - 7 - "Coves/internal/api/middleware" 8 - "Coves/internal/core/communities" 9 8 ) 10 9 11 10 // CreateHandler handles community creation
+1 -2
internal/api/handlers/community/errors.go
··· 1 1 package community 2 2 3 3 import ( 4 + "Coves/internal/core/communities" 4 5 "encoding/json" 5 6 "log" 6 7 "net/http" 7 - 8 - "Coves/internal/core/communities" 9 8 ) 10 9 11 10 // XRPCError represents an XRPC error response
+1 -2
internal/api/handlers/community/get.go
··· 1 1 package community 2 2 3 3 import ( 4 + "Coves/internal/core/communities" 4 5 "encoding/json" 5 6 "net/http" 6 - 7 - "Coves/internal/core/communities" 8 7 ) 9 8 10 9 // GetHandler handles community retrieval
+1 -2
internal/api/handlers/community/list.go
··· 1 1 package community 2 2 3 3 import ( 4 + "Coves/internal/core/communities" 4 5 "encoding/json" 5 6 "net/http" 6 7 "strconv" 7 - 8 - "Coves/internal/core/communities" 9 8 ) 10 9 11 10 // ListHandler handles listing communities
+1 -2
internal/api/handlers/community/search.go
··· 1 1 package community 2 2 3 3 import ( 4 + "Coves/internal/core/communities" 4 5 "encoding/json" 5 6 "net/http" 6 7 "strconv" 7 - 8 - "Coves/internal/core/communities" 9 8 ) 10 9 11 10 // SearchHandler handles community search
+2 -3
internal/api/handlers/community/subscribe.go
··· 1 1 package community 2 2 3 3 import ( 4 + "Coves/internal/api/middleware" 5 + "Coves/internal/core/communities" 4 6 "encoding/json" 5 7 "log" 6 8 "net/http" 7 9 "strings" 8 - 9 - "Coves/internal/api/middleware" 10 - "Coves/internal/core/communities" 11 10 ) 12 11 13 12 // SubscribeHandler handles community subscriptions
+2 -3
internal/api/handlers/community/update.go
··· 1 1 package community 2 2 3 3 import ( 4 + "Coves/internal/api/middleware" 5 + "Coves/internal/core/communities" 4 6 "encoding/json" 5 7 "net/http" 6 - 7 - "Coves/internal/api/middleware" 8 - "Coves/internal/core/communities" 9 8 ) 10 9 11 10 // UpdateHandler handles community updates
+1 -2
internal/api/handlers/communityFeed/errors.go
··· 1 1 package communityFeed 2 2 3 3 import ( 4 + "Coves/internal/core/communityFeeds" 4 5 "encoding/json" 5 6 "errors" 6 7 "log" 7 8 "net/http" 8 - 9 - "Coves/internal/core/communityFeeds" 10 9 ) 11 10 12 11 // ErrorResponse represents an XRPC error response
+1 -2
internal/api/handlers/communityFeed/get_community.go
··· 1 1 package communityFeed 2 2 3 3 import ( 4 + "Coves/internal/core/communityFeeds" 4 5 "encoding/json" 5 6 "log" 6 7 "net/http" 7 8 "strconv" 8 - 9 - "Coves/internal/core/communityFeeds" 10 9 ) 11 10 12 11 // GetCommunityHandler handles community feed retrieval
+1 -2
internal/api/handlers/discover/errors.go
··· 1 1 package discover 2 2 3 3 import ( 4 + "Coves/internal/core/discover" 4 5 "encoding/json" 5 6 "errors" 6 7 "log" 7 8 "net/http" 8 - 9 - "Coves/internal/core/discover" 10 9 ) 11 10 12 11 // XRPCError represents an XRPC error response
+1 -2
internal/api/handlers/discover/get_discover.go
··· 1 1 package discover 2 2 3 3 import ( 4 + "Coves/internal/core/discover" 4 5 "encoding/json" 5 6 "log" 6 7 "net/http" 7 8 "strconv" 8 - 9 - "Coves/internal/core/discover" 10 9 ) 11 10 12 11 // GetDiscoverHandler handles discover feed retrieval
+2 -3
internal/api/handlers/post/create.go
··· 1 1 package post 2 2 3 3 import ( 4 + "Coves/internal/api/middleware" 5 + "Coves/internal/core/posts" 4 6 "encoding/json" 5 7 "log" 6 8 "net/http" 7 9 "strings" 8 - 9 - "Coves/internal/api/middleware" 10 - "Coves/internal/core/posts" 11 10 ) 12 11 13 12 // CreateHandler handles post creation requests
+2 -3
internal/api/handlers/post/errors.go
··· 1 1 package post 2 2 3 3 import ( 4 + "Coves/internal/core/aggregators" 5 + "Coves/internal/core/posts" 4 6 "encoding/json" 5 7 "log" 6 8 "net/http" 7 - 8 - "Coves/internal/core/aggregators" 9 - "Coves/internal/core/posts" 10 9 ) 11 10 12 11 type errorResponse struct {
+1 -2
internal/api/handlers/timeline/errors.go
··· 1 1 package timeline 2 2 3 3 import ( 4 + "Coves/internal/core/timeline" 4 5 "encoding/json" 5 6 "errors" 6 7 "log" 7 8 "net/http" 8 - 9 - "Coves/internal/core/timeline" 10 9 ) 11 10 12 11 // XRPCError represents an XRPC error response
+2 -3
internal/api/handlers/timeline/get_timeline.go
··· 1 1 package timeline 2 2 3 3 import ( 4 + "Coves/internal/api/middleware" 5 + "Coves/internal/core/timeline" 4 6 "encoding/json" 5 7 "log" 6 8 "net/http" 7 9 "strconv" 8 10 "strings" 9 - 10 - "Coves/internal/api/middleware" 11 - "Coves/internal/core/timeline" 12 11 ) 13 12 14 13 // GetTimelineHandler handles timeline feed retrieval
+1 -2
internal/api/middleware/auth.go
··· 1 1 package middleware 2 2 3 3 import ( 4 + "Coves/internal/atproto/auth" 4 5 "context" 5 6 "log" 6 7 "net/http" 7 8 "strings" 8 - 9 - "Coves/internal/atproto/auth" 10 9 ) 11 10 12 11 // Context keys for storing user information
+1 -2
internal/api/routes/user.go
··· 1 1 package routes 2 2 3 3 import ( 4 + "Coves/internal/core/users" 4 5 "encoding/json" 5 6 "errors" 6 7 "log" 7 8 "net/http" 8 9 "time" 9 - 10 - "Coves/internal/core/users" 11 10 12 11 "github.com/go-chi/chi/v5" 13 12 )
+1 -2
internal/atproto/jetstream/aggregator_consumer.go
··· 1 1 package jetstream 2 2 3 3 import ( 4 + "Coves/internal/core/aggregators" 4 5 "context" 5 6 "encoding/json" 6 7 "fmt" 7 8 "log" 8 9 "time" 9 - 10 - "Coves/internal/core/aggregators" 11 10 ) 12 11 13 12 // AggregatorEventConsumer consumes aggregator-related events from Jetstream
+2 -3
internal/atproto/jetstream/comment_consumer.go
··· 1 1 package jetstream 2 2 3 3 import ( 4 + "Coves/internal/atproto/utils" 5 + "Coves/internal/core/comments" 4 6 "context" 5 7 "database/sql" 6 8 "encoding/json" ··· 8 10 "log" 9 11 "strings" 10 12 "time" 11 - 12 - "Coves/internal/atproto/utils" 13 - "Coves/internal/core/comments" 14 13 15 14 "github.com/lib/pq" 16 15 )
+3 -4
internal/atproto/jetstream/community_consumer.go
··· 1 1 package jetstream 2 2 3 3 import ( 4 + "Coves/internal/atproto/identity" 5 + "Coves/internal/atproto/utils" 6 + "Coves/internal/core/communities" 4 7 "context" 5 8 "encoding/json" 6 9 "fmt" ··· 8 11 "net/http" 9 12 "strings" 10 13 "time" 11 - 12 - "Coves/internal/atproto/identity" 13 - "Coves/internal/atproto/utils" 14 - "Coves/internal/core/communities" 15 14 16 15 lru "github.com/hashicorp/golang-lru/v2" 17 16 "golang.org/x/net/publicsuffix"
+3 -4
internal/atproto/jetstream/post_consumer.go
··· 1 1 package jetstream 2 2 3 3 import ( 4 + "Coves/internal/core/communities" 5 + "Coves/internal/core/posts" 6 + "Coves/internal/core/users" 4 7 "context" 5 8 "database/sql" 6 9 "encoding/json" ··· 8 11 "log" 9 12 "strings" 10 13 "time" 11 - 12 - "Coves/internal/core/communities" 13 - "Coves/internal/core/posts" 14 - "Coves/internal/core/users" 15 14 ) 16 15 17 16 // PostEventConsumer consumes post-related events from Jetstream
+2 -3
internal/atproto/jetstream/user_consumer.go
··· 1 1 package jetstream 2 2 3 3 import ( 4 + "Coves/internal/atproto/identity" 5 + "Coves/internal/core/users" 4 6 "context" 5 7 "encoding/json" 6 8 "fmt" 7 9 "log" 8 10 "sync" 9 11 "time" 10 - 11 - "Coves/internal/atproto/identity" 12 - "Coves/internal/core/users" 13 12 14 13 "github.com/gorilla/websocket" 15 14 )
+3 -4
internal/atproto/jetstream/vote_consumer.go
··· 1 1 package jetstream 2 2 3 3 import ( 4 + "Coves/internal/atproto/utils" 5 + "Coves/internal/core/users" 6 + "Coves/internal/core/votes" 4 7 "context" 5 8 "database/sql" 6 9 "fmt" 7 10 "log" 8 11 "strings" 9 12 "time" 10 - 11 - "Coves/internal/atproto/utils" 12 - "Coves/internal/core/users" 13 - "Coves/internal/core/votes" 14 13 ) 15 14 16 15 // VoteEventConsumer consumes vote-related events from Jetstream
+1 -2
internal/core/aggregators/service.go
··· 1 1 package aggregators 2 2 3 3 import ( 4 + "Coves/internal/core/communities" 4 5 "context" 5 6 "encoding/json" 6 7 "fmt" 7 8 "time" 8 - 9 - "Coves/internal/core/communities" 10 9 11 10 "github.com/xeipuuv/gojsonschema" 12 11 )
+3 -4
internal/core/comments/comment_service.go
··· 1 1 package comments 2 2 3 3 import ( 4 + "Coves/internal/core/communities" 5 + "Coves/internal/core/posts" 6 + "Coves/internal/core/users" 4 7 "context" 5 8 "encoding/json" 6 9 "errors" ··· 9 12 "net/url" 10 13 "strings" 11 14 "time" 12 - 13 - "Coves/internal/core/communities" 14 - "Coves/internal/core/posts" 15 - "Coves/internal/core/users" 16 15 ) 17 16 18 17 const (
+15 -16
internal/core/comments/comment_service_test.go
··· 1 1 package comments 2 2 3 3 import ( 4 + "Coves/internal/core/communities" 5 + "Coves/internal/core/posts" 6 + "Coves/internal/core/users" 4 7 "context" 5 8 "errors" 6 9 "testing" 7 10 "time" 8 - 9 - "Coves/internal/core/communities" 10 - "Coves/internal/core/posts" 11 - "Coves/internal/core/users" 12 11 13 12 "github.com/stretchr/testify/assert" 14 13 ) ··· 18 17 // mockCommentRepo is a mock implementation of the comment Repository interface 19 18 type mockCommentRepo struct { 20 19 comments map[string]*Comment 21 - listByParentWithHotRankFunc func(ctx context.Context, parentURI string, sort string, timeframe string, limit int, cursor *string) ([]*Comment, *string, error) 20 + listByParentWithHotRankFunc func(ctx context.Context, parentURI, sort, timeframe string, limit int, cursor *string) ([]*Comment, *string, error) 22 21 listByParentsBatchFunc func(ctx context.Context, parentURIs []string, sort string, limitPerParent int) (map[string][]*Comment, error) 23 22 getVoteStateForCommentsFunc func(ctx context.Context, viewerDID string, commentURIs []string) (map[string]interface{}, error) 24 23 } ··· 342 341 343 342 // Helper functions to create test data 344 343 345 - func createTestPost(uri string, authorDID string, communityDID string) *posts.Post { 344 + func createTestPost(uri, authorDID, communityDID string) *posts.Post { 346 345 title := "Test Post" 347 346 content := "Test content" 348 347 return &posts.Post{ ··· 362 361 } 363 362 } 364 363 365 - func createTestComment(uri string, commenterDID string, commenterHandle string, rootURI string, parentURI string, replyCount int) *Comment { 364 + func createTestComment(uri, commenterDID, commenterHandle, rootURI, parentURI string, replyCount int) *Comment { 366 365 return &Comment{ 367 366 URI: uri, 368 367 CID: "bafycomment123", ··· 384 383 } 385 384 } 386 385 387 - func createTestUser(did string, handle string) *users.User { 386 + func createTestUser(did, handle string) *users.User { 388 387 return &users.User{ 389 388 DID: did, 390 389 Handle: handle, ··· 394 393 } 395 394 } 396 395 397 - func createTestCommunity(did string, handle string) *communities.Community { 396 + func createTestCommunity(did, handle string) *communities.Community { 398 397 return &communities.Community{ 399 398 DID: did, 400 399 Handle: handle, ··· 438 437 comment1 := createTestComment("at://did:plc:commenter123/comment/1", commenterDID, "commenter.test", postURI, postURI, 0) 439 438 comment2 := createTestComment("at://did:plc:commenter123/comment/2", commenterDID, "commenter.test", postURI, postURI, 0) 440 439 441 - commentRepo.listByParentWithHotRankFunc = func(ctx context.Context, parentURI string, sort string, timeframe string, limit int, cursor *string) ([]*Comment, *string, error) { 440 + commentRepo.listByParentWithHotRankFunc = func(ctx context.Context, parentURI, sort, timeframe string, limit int, cursor *string) ([]*Comment, *string, error) { 442 441 if parentURI == postURI { 443 442 return []*Comment{comment1, comment2}, nil, nil 444 443 } ··· 556 555 community := createTestCommunity(communityDID, "test.community.coves.social") 557 556 _, _ = communityRepo.Create(context.Background(), community) 558 557 559 - commentRepo.listByParentWithHotRankFunc = func(ctx context.Context, parentURI string, sort string, timeframe string, limit int, cursor *string) ([]*Comment, *string, error) { 558 + commentRepo.listByParentWithHotRankFunc = func(ctx context.Context, parentURI, sort, timeframe string, limit int, cursor *string) ([]*Comment, *string, error) { 560 559 return []*Comment{}, nil, nil 561 560 } 562 561 ··· 605 604 comment1URI := "at://did:plc:commenter123/comment/1" 606 605 comment1 := createTestComment(comment1URI, commenterDID, "commenter.test", postURI, postURI, 0) 607 606 608 - commentRepo.listByParentWithHotRankFunc = func(ctx context.Context, parentURI string, sort string, timeframe string, limit int, cursor *string) ([]*Comment, *string, error) { 607 + commentRepo.listByParentWithHotRankFunc = func(ctx context.Context, parentURI, sort, timeframe string, limit int, cursor *string) ([]*Comment, *string, error) { 609 608 if parentURI == postURI { 610 609 return []*Comment{comment1}, nil, nil 611 610 } ··· 673 672 674 673 comment1 := createTestComment("at://did:plc:commenter123/comment/1", commenterDID, "commenter.test", postURI, postURI, 0) 675 674 676 - commentRepo.listByParentWithHotRankFunc = func(ctx context.Context, parentURI string, sort string, timeframe string, limit int, cursor *string) ([]*Comment, *string, error) { 675 + commentRepo.listByParentWithHotRankFunc = func(ctx context.Context, parentURI, sort, timeframe string, limit int, cursor *string) ([]*Comment, *string, error) { 677 676 if parentURI == postURI { 678 677 return []*Comment{comment1}, nil, nil 679 678 } ··· 741 740 742 741 comment1 := createTestComment("at://did:plc:commenter123/comment/1", commenterDID, "commenter.test", postURI, postURI, 0) 743 742 744 - commentRepo.listByParentWithHotRankFunc = func(ctx context.Context, parentURI string, sort string, timeframe string, limit int, cursor *string) ([]*Comment, *string, error) { 743 + commentRepo.listByParentWithHotRankFunc = func(ctx context.Context, parentURI, sort, timeframe string, limit int, cursor *string) ([]*Comment, *string, error) { 745 744 return []*Comment{comment1}, nil, nil 746 745 } 747 746 } ··· 791 790 _, _ = communityRepo.Create(context.Background(), community) 792 791 793 792 // Mock repository error 794 - commentRepo.listByParentWithHotRankFunc = func(ctx context.Context, parentURI string, sort string, timeframe string, limit int, cursor *string) ([]*Comment, *string, error) { 793 + commentRepo.listByParentWithHotRankFunc = func(ctx context.Context, parentURI, sort, timeframe string, limit int, cursor *string) ([]*Comment, *string, error) { 795 794 return nil, nil, errors.New("database error") 796 795 } 797 796 ··· 1332 1331 postURI := "at://did:plc:post123/app.bsky.feed.post/test" 1333 1332 1334 1333 tests := []struct { 1335 - name string 1336 1334 facetsValue *string 1337 1335 embedValue *string 1338 1336 labelsValue *string 1337 + name string 1339 1338 expectFacetsNil bool 1340 1339 expectEmbedNil bool 1341 1340 expectRecordLabels bool
+1 -2
internal/core/communities/service.go
··· 1 1 package communities 2 2 3 3 import ( 4 + "Coves/internal/atproto/utils" 4 5 "bytes" 5 6 "context" 6 7 "encoding/json" ··· 13 14 "strings" 14 15 "sync" 15 16 "time" 16 - 17 - "Coves/internal/atproto/utils" 18 17 ) 19 18 20 19 // Community handle validation regex (DNS-valid handle: name.community.instance.com)
+1 -2
internal/core/communityFeeds/service.go
··· 1 1 package communityFeeds 2 2 3 3 import ( 4 + "Coves/internal/core/communities" 4 5 "context" 5 6 "fmt" 6 - 7 - "Coves/internal/core/communities" 8 7 ) 9 8 10 9 type feedService struct {
+1 -2
internal/core/communityFeeds/types.go
··· 1 1 package communityFeeds 2 2 3 3 import ( 4 + "Coves/internal/core/posts" 4 5 "time" 5 - 6 - "Coves/internal/core/posts" 7 6 ) 8 7 9 8 // GetCommunityFeedRequest represents input for fetching a community feed
+1 -2
internal/core/discover/types.go
··· 1 1 package discover 2 2 3 3 import ( 4 + "Coves/internal/core/posts" 4 5 "context" 5 6 "errors" 6 - 7 - "Coves/internal/core/posts" 8 7 ) 9 8 10 9 // Repository defines discover data access interface
+3 -4
internal/core/posts/service.go
··· 1 1 package posts 2 2 3 3 import ( 4 + "Coves/internal/api/middleware" 5 + "Coves/internal/core/aggregators" 6 + "Coves/internal/core/communities" 4 7 "bytes" 5 8 "context" 6 9 "encoding/json" ··· 9 12 "log" 10 13 "net/http" 11 14 "time" 12 - 13 - "Coves/internal/api/middleware" 14 - "Coves/internal/core/aggregators" 15 - "Coves/internal/core/communities" 16 15 ) 17 16 18 17 type postService struct {
+1 -2
internal/core/timeline/types.go
··· 1 1 package timeline 2 2 3 3 import ( 4 + "Coves/internal/core/posts" 4 5 "context" 5 6 "errors" 6 7 "time" 7 - 8 - "Coves/internal/core/posts" 9 8 ) 10 9 11 10 // Repository defines timeline data access interface
+1 -2
internal/core/users/service.go
··· 1 1 package users 2 2 3 3 import ( 4 + "Coves/internal/atproto/identity" 4 5 "bytes" 5 6 "context" 6 7 "encoding/json" ··· 11 12 "regexp" 12 13 "strings" 13 14 "time" 14 - 15 - "Coves/internal/atproto/identity" 16 15 ) 17 16 18 17 // atProto handle validation regex (per official atProto spec: https://atproto.com/specs/handle)
+1 -2
internal/db/postgres/aggregator_repo.go
··· 1 1 package postgres 2 2 3 3 import ( 4 + "Coves/internal/core/aggregators" 4 5 "context" 5 6 "database/sql" 6 7 "fmt" 7 8 "strings" 8 9 "time" 9 - 10 - "Coves/internal/core/aggregators" 11 10 ) 12 11 13 12 type postgresAggregatorRepo struct {
+1 -2
internal/db/postgres/comment_repo.go
··· 1 1 package postgres 2 2 3 3 import ( 4 + "Coves/internal/core/comments" 4 5 "context" 5 6 "database/sql" 6 7 "encoding/base64" 7 8 "fmt" 8 9 "log" 9 10 "strings" 10 - 11 - "Coves/internal/core/comments" 12 11 13 12 "github.com/lib/pq" 14 13 )
+1 -2
internal/db/postgres/community_repo.go
··· 1 1 package postgres 2 2 3 3 import ( 4 + "Coves/internal/core/communities" 4 5 "context" 5 6 "database/sql" 6 7 "fmt" 7 8 "log" 8 9 "strings" 9 - 10 - "Coves/internal/core/communities" 11 10 12 11 "github.com/lib/pq" 13 12 )
+1 -2
internal/db/postgres/community_repo_blocks.go
··· 1 1 package postgres 2 2 3 3 import ( 4 + "Coves/internal/core/communities" 4 5 "context" 5 6 "database/sql" 6 7 "fmt" 7 8 "log" 8 - 9 - "Coves/internal/core/communities" 10 9 ) 11 10 12 11 // BlockCommunity creates a new block record (idempotent)
+1 -2
internal/db/postgres/community_repo_memberships.go
··· 1 1 package postgres 2 2 3 3 import ( 4 + "Coves/internal/core/communities" 4 5 "context" 5 6 "database/sql" 6 7 "fmt" 7 8 "log" 8 9 "strings" 9 - 10 - "Coves/internal/core/communities" 11 10 ) 12 11 13 12 // CreateMembership creates a new membership record
+1 -2
internal/db/postgres/community_repo_subscriptions.go
··· 1 1 package postgres 2 2 3 3 import ( 4 + "Coves/internal/core/communities" 4 5 "context" 5 6 "database/sql" 6 7 "fmt" 7 8 "log" 8 9 "strings" 9 - 10 - "Coves/internal/core/communities" 11 10 ) 12 11 13 12 // Subscribe creates a new subscription record
+1 -2
internal/db/postgres/discover_repo.go
··· 1 1 package postgres 2 2 3 3 import ( 4 + "Coves/internal/core/discover" 4 5 "context" 5 6 "database/sql" 6 7 "fmt" 7 - 8 - "Coves/internal/core/discover" 9 8 ) 10 9 11 10 type postgresDiscoverRepo struct {
+1 -2
internal/db/postgres/feed_repo.go
··· 1 1 package postgres 2 2 3 3 import ( 4 + "Coves/internal/core/communityFeeds" 4 5 "context" 5 6 "database/sql" 6 7 "fmt" 7 - 8 - "Coves/internal/core/communityFeeds" 9 8 ) 10 9 11 10 type postgresFeedRepo struct {
+1 -2
internal/db/postgres/feed_repo_base.go
··· 1 1 package postgres 2 2 3 3 import ( 4 + "Coves/internal/core/posts" 4 5 "crypto/hmac" 5 6 "crypto/sha256" 6 7 "database/sql" ··· 11 12 "strconv" 12 13 "strings" 13 14 "time" 14 - 15 - "Coves/internal/core/posts" 16 15 ) 17 16 18 17 // feedRepoBase contains shared logic for timeline and discover feed repositories
+1 -2
internal/db/postgres/post_repo.go
··· 1 1 package postgres 2 2 3 3 import ( 4 + "Coves/internal/core/posts" 4 5 "context" 5 6 "database/sql" 6 7 "fmt" 7 8 "strings" 8 - 9 - "Coves/internal/core/posts" 10 9 ) 11 10 12 11 type postgresPostRepo struct {
+1 -2
internal/db/postgres/timeline_repo.go
··· 1 1 package postgres 2 2 3 3 import ( 4 + "Coves/internal/core/timeline" 4 5 "context" 5 6 "database/sql" 6 7 "fmt" 7 - 8 - "Coves/internal/core/timeline" 9 8 ) 10 9 11 10 type postgresTimelineRepo struct {
+1 -2
internal/db/postgres/user_repo.go
··· 1 1 package postgres 2 2 3 3 import ( 4 + "Coves/internal/core/users" 4 5 "context" 5 6 "database/sql" 6 7 "fmt" 7 8 "log" 8 9 "strings" 9 - 10 - "Coves/internal/core/users" 11 10 12 11 "github.com/lib/pq" 13 12 )
+1 -2
internal/db/postgres/vote_repo.go
··· 1 1 package postgres 2 2 3 3 import ( 4 + "Coves/internal/core/votes" 4 5 "context" 5 6 "database/sql" 6 7 "fmt" 7 8 "strings" 8 - 9 - "Coves/internal/core/votes" 10 9 ) 11 10 12 11 type postgresVoteRepo struct {
+1 -2
internal/db/postgres/vote_repo_test.go
··· 1 1 package postgres 2 2 3 3 import ( 4 + "Coves/internal/core/votes" 4 5 "context" 5 6 "database/sql" 6 7 "os" 7 8 "testing" 8 9 "time" 9 - 10 - "Coves/internal/core/votes" 11 10 12 11 _ "github.com/lib/pq" 13 12 "github.com/pressly/goose/v3"
+4 -5
tests/e2e/user_signup_test.go
··· 1 1 package e2e 2 2 3 3 import ( 4 + "Coves/internal/atproto/identity" 5 + "Coves/internal/atproto/jetstream" 6 + "Coves/internal/core/users" 7 + "Coves/internal/db/postgres" 4 8 "bytes" 5 9 "context" 6 10 "database/sql" ··· 10 14 "os" 11 15 "testing" 12 16 "time" 13 - 14 - "Coves/internal/atproto/identity" 15 - "Coves/internal/atproto/jetstream" 16 - "Coves/internal/core/users" 17 - "Coves/internal/db/postgres" 18 17 19 18 _ "github.com/lib/pq" 20 19 "github.com/pressly/goose/v3"
+10 -11
tests/integration/aggregator_e2e_test.go
··· 1 1 package integration 2 2 3 3 import ( 4 + "Coves/internal/api/handlers/aggregator" 5 + "Coves/internal/api/handlers/post" 6 + "Coves/internal/api/middleware" 7 + "Coves/internal/atproto/identity" 8 + "Coves/internal/atproto/jetstream" 9 + "Coves/internal/core/aggregators" 10 + "Coves/internal/core/communities" 11 + "Coves/internal/core/posts" 12 + "Coves/internal/core/users" 13 + "Coves/internal/db/postgres" 4 14 "bytes" 5 15 "context" 6 16 "database/sql" ··· 12 22 "strings" 13 23 "testing" 14 24 "time" 15 - 16 - "Coves/internal/api/handlers/aggregator" 17 - "Coves/internal/api/handlers/post" 18 - "Coves/internal/api/middleware" 19 - "Coves/internal/atproto/identity" 20 - "Coves/internal/atproto/jetstream" 21 - "Coves/internal/core/aggregators" 22 - "Coves/internal/core/communities" 23 - "Coves/internal/core/posts" 24 - "Coves/internal/core/users" 25 - "Coves/internal/db/postgres" 26 25 27 26 _ "github.com/lib/pq" 28 27 "github.com/pressly/goose/v3"
+3 -4
tests/integration/aggregator_test.go
··· 1 1 package integration 2 2 3 3 import ( 4 + "Coves/internal/core/aggregators" 5 + "Coves/internal/core/communities" 6 + "Coves/internal/db/postgres" 4 7 "context" 5 8 "encoding/json" 6 9 "fmt" 7 10 "testing" 8 11 "time" 9 - 10 - "Coves/internal/core/aggregators" 11 - "Coves/internal/core/communities" 12 - "Coves/internal/db/postgres" 13 12 ) 14 13 15 14 // TestAggregatorRepository_Create tests basic aggregator creation
+3 -4
tests/integration/comment_consumer_test.go
··· 1 1 package integration 2 2 3 3 import ( 4 + "Coves/internal/atproto/jetstream" 5 + "Coves/internal/core/comments" 6 + "Coves/internal/db/postgres" 4 7 "context" 5 8 "fmt" 6 9 "testing" 7 10 "time" 8 - 9 - "Coves/internal/atproto/jetstream" 10 - "Coves/internal/core/comments" 11 - "Coves/internal/db/postgres" 12 11 ) 13 12 14 13 func TestCommentConsumer_CreateComment(t *testing.T) {
+3 -4
tests/integration/comment_query_test.go
··· 1 1 package integration 2 2 3 3 import ( 4 + "Coves/internal/atproto/jetstream" 5 + "Coves/internal/core/comments" 6 + "Coves/internal/db/postgres" 4 7 "context" 5 8 "database/sql" 6 9 "encoding/json" ··· 10 13 "strings" 11 14 "testing" 12 15 "time" 13 - 14 - "Coves/internal/atproto/jetstream" 15 - "Coves/internal/core/comments" 16 - "Coves/internal/db/postgres" 17 16 18 17 "github.com/stretchr/testify/assert" 19 18 "github.com/stretchr/testify/require"
+4 -5
tests/integration/comment_vote_test.go
··· 1 1 package integration 2 2 3 3 import ( 4 + "Coves/internal/atproto/jetstream" 5 + "Coves/internal/core/comments" 6 + "Coves/internal/core/users" 7 + "Coves/internal/db/postgres" 4 8 "context" 5 9 "fmt" 6 10 "testing" 7 11 "time" 8 - 9 - "Coves/internal/atproto/jetstream" 10 - "Coves/internal/core/comments" 11 - "Coves/internal/core/users" 12 - "Coves/internal/db/postgres" 13 12 ) 14 13 15 14 // TestCommentVote_CreateAndUpdate tests voting on comments and vote count updates
+2 -3
tests/integration/community_blocking_test.go
··· 1 1 package integration 2 2 3 3 import ( 4 + "Coves/internal/atproto/jetstream" 5 + "Coves/internal/core/communities" 4 6 "context" 5 7 "database/sql" 6 8 "fmt" 7 9 "testing" 8 10 "time" 9 - 10 - "Coves/internal/atproto/jetstream" 11 - "Coves/internal/core/communities" 12 11 13 12 postgresRepo "Coves/internal/db/postgres" 14 13 )
+4 -5
tests/integration/community_consumer_test.go
··· 1 1 package integration 2 2 3 3 import ( 4 + "Coves/internal/atproto/identity" 5 + "Coves/internal/atproto/jetstream" 6 + "Coves/internal/core/communities" 7 + "Coves/internal/db/postgres" 4 8 "context" 5 9 "errors" 6 10 "fmt" 7 11 "testing" 8 12 "time" 9 - 10 - "Coves/internal/atproto/identity" 11 - "Coves/internal/atproto/jetstream" 12 - "Coves/internal/core/communities" 13 - "Coves/internal/db/postgres" 14 13 ) 15 14 16 15 func TestCommunityConsumer_HandleCommunityProfile(t *testing.T) {
+2 -3
tests/integration/community_credentials_test.go
··· 1 1 package integration 2 2 3 3 import ( 4 + "Coves/internal/core/communities" 5 + "Coves/internal/db/postgres" 4 6 "context" 5 7 "fmt" 6 8 "testing" 7 9 "time" 8 - 9 - "Coves/internal/core/communities" 10 - "Coves/internal/db/postgres" 11 10 ) 12 11 13 12 // TestCommunityRepository_CredentialPersistence tests that PDS credentials are properly persisted
+8 -9
tests/integration/community_e2e_test.go
··· 1 1 package integration 2 2 3 3 import ( 4 + "Coves/internal/api/middleware" 5 + "Coves/internal/api/routes" 6 + "Coves/internal/atproto/identity" 7 + "Coves/internal/atproto/jetstream" 8 + "Coves/internal/atproto/utils" 9 + "Coves/internal/core/communities" 10 + "Coves/internal/core/users" 11 + "Coves/internal/db/postgres" 4 12 "bytes" 5 13 "context" 6 14 "database/sql" ··· 14 22 "strings" 15 23 "testing" 16 24 "time" 17 - 18 - "Coves/internal/api/middleware" 19 - "Coves/internal/api/routes" 20 - "Coves/internal/atproto/identity" 21 - "Coves/internal/atproto/jetstream" 22 - "Coves/internal/atproto/utils" 23 - "Coves/internal/core/communities" 24 - "Coves/internal/core/users" 25 - "Coves/internal/db/postgres" 26 25 27 26 "github.com/go-chi/chi/v5" 28 27 "github.com/gorilla/websocket"
+2 -3
tests/integration/community_hostedby_security_test.go
··· 1 1 package integration 2 2 3 3 import ( 4 + "Coves/internal/atproto/jetstream" 5 + "Coves/internal/db/postgres" 4 6 "context" 5 7 "fmt" 6 8 "testing" 7 9 "time" 8 - 9 - "Coves/internal/atproto/jetstream" 10 - "Coves/internal/db/postgres" 11 10 ) 12 11 13 12 // TestHostedByVerification_DomainMatching tests that hostedBy domain must match handle domain
+2 -3
tests/integration/community_identifier_resolution_test.go
··· 1 1 package integration 2 2 3 3 import ( 4 + "Coves/internal/core/communities" 5 + "Coves/internal/db/postgres" 4 6 "context" 5 7 "fmt" 6 8 "os" 7 9 "strings" 8 10 "testing" 9 11 "time" 10 - 11 - "Coves/internal/core/communities" 12 - "Coves/internal/db/postgres" 13 12 14 13 "github.com/stretchr/testify/assert" 15 14 "github.com/stretchr/testify/require"
+2 -3
tests/integration/community_provisioning_test.go
··· 1 1 package integration 2 2 3 3 import ( 4 + "Coves/internal/core/communities" 5 + "Coves/internal/db/postgres" 4 6 "context" 5 7 "fmt" 6 8 "strings" 7 9 "testing" 8 10 "time" 9 - 10 - "Coves/internal/core/communities" 11 - "Coves/internal/db/postgres" 12 11 ) 13 12 14 13 // TestCommunityRepository_PasswordEncryption verifies P0 fix:
+2 -3
tests/integration/community_repo_test.go
··· 1 1 package integration 2 2 3 3 import ( 4 + "Coves/internal/core/communities" 5 + "Coves/internal/db/postgres" 4 6 "context" 5 7 "fmt" 6 8 "testing" 7 9 "time" 8 - 9 - "Coves/internal/core/communities" 10 - "Coves/internal/db/postgres" 11 10 ) 12 11 13 12 func TestCommunityRepository_Create(t *testing.T) {
+2 -3
tests/integration/community_service_integration_test.go
··· 1 1 package integration 2 2 3 3 import ( 4 + "Coves/internal/core/communities" 5 + "Coves/internal/db/postgres" 4 6 "bytes" 5 7 "context" 6 8 "encoding/json" ··· 10 12 "strings" 11 13 "testing" 12 14 "time" 13 - 14 - "Coves/internal/core/communities" 15 - "Coves/internal/db/postgres" 16 15 ) 17 16 18 17 // TestCommunityService_CreateWithRealPDS tests the complete service layer flow
+3 -4
tests/integration/community_v2_validation_test.go
··· 1 1 package integration 2 2 3 3 import ( 4 + "Coves/internal/atproto/jetstream" 5 + "Coves/internal/core/communities" 6 + "Coves/internal/db/postgres" 4 7 "context" 5 8 "fmt" 6 9 "testing" 7 10 "time" 8 - 9 - "Coves/internal/atproto/jetstream" 10 - "Coves/internal/core/communities" 11 - "Coves/internal/db/postgres" 12 11 ) 13 12 14 13 // TestCommunityConsumer_V2RKeyValidation tests that only V2 communities (rkey="self") are accepted
+2 -3
tests/integration/discover_test.go
··· 1 1 package integration 2 2 3 3 import ( 4 + "Coves/internal/api/handlers/discover" 5 + "Coves/internal/db/postgres" 4 6 "context" 5 7 "encoding/json" 6 8 "fmt" ··· 8 10 "net/http/httptest" 9 11 "testing" 10 12 "time" 11 - 12 - "Coves/internal/api/handlers/discover" 13 - "Coves/internal/db/postgres" 14 13 15 14 discoverCore "Coves/internal/core/discover" 16 15
+4 -5
tests/integration/feed_test.go
··· 1 1 package integration 2 2 3 3 import ( 4 + "Coves/internal/api/handlers/communityFeed" 5 + "Coves/internal/core/communities" 6 + "Coves/internal/core/communityFeeds" 7 + "Coves/internal/db/postgres" 4 8 "context" 5 9 "encoding/json" 6 10 "fmt" ··· 8 12 "net/http/httptest" 9 13 "testing" 10 14 "time" 11 - 12 - "Coves/internal/api/handlers/communityFeed" 13 - "Coves/internal/core/communities" 14 - "Coves/internal/core/communityFeeds" 15 - "Coves/internal/db/postgres" 16 15 17 16 "github.com/stretchr/testify/assert" 18 17 "github.com/stretchr/testify/require"
+2 -3
tests/integration/helpers.go
··· 1 1 package integration 2 2 3 3 import ( 4 + "Coves/internal/atproto/auth" 5 + "Coves/internal/core/users" 4 6 "bytes" 5 7 "context" 6 8 "database/sql" ··· 12 14 "strings" 13 15 "testing" 14 16 "time" 15 - 16 - "Coves/internal/atproto/auth" 17 - "Coves/internal/core/users" 18 17 19 18 "github.com/golang-jwt/jwt/v5" 20 19 )
+1 -2
tests/integration/identity_resolution_test.go
··· 1 1 package integration 2 2 3 3 import ( 4 + "Coves/internal/atproto/identity" 4 5 "context" 5 6 "fmt" 6 7 "os" 7 8 "testing" 8 9 "time" 9 - 10 - "Coves/internal/atproto/identity" 11 10 ) 12 11 13 12 // uniqueID generates a unique identifier for test isolation
+3 -4
tests/integration/jetstream_consumer_test.go
··· 1 1 package integration 2 2 3 3 import ( 4 - "context" 5 - "testing" 6 - "time" 7 - 8 4 "Coves/internal/atproto/identity" 9 5 "Coves/internal/atproto/jetstream" 10 6 "Coves/internal/core/users" 11 7 "Coves/internal/db/postgres" 8 + "context" 9 + "testing" 10 + "time" 12 11 ) 13 12 14 13 func TestUserIndexingFromJetstream(t *testing.T) {
+4 -5
tests/integration/post_creation_test.go
··· 1 1 package integration 2 2 3 3 import ( 4 - "context" 5 - "fmt" 6 - "strings" 7 - "testing" 8 - 9 4 "Coves/internal/api/middleware" 10 5 "Coves/internal/atproto/identity" 11 6 "Coves/internal/core/communities" 12 7 "Coves/internal/core/posts" 13 8 "Coves/internal/core/users" 14 9 "Coves/internal/db/postgres" 10 + "context" 11 + "fmt" 12 + "strings" 13 + "testing" 15 14 16 15 "github.com/stretchr/testify/assert" 17 16 "github.com/stretchr/testify/require"
+8 -9
tests/integration/post_e2e_test.go
··· 1 1 package integration 2 2 3 3 import ( 4 + "Coves/internal/api/handlers/post" 5 + "Coves/internal/api/middleware" 6 + "Coves/internal/atproto/identity" 7 + "Coves/internal/atproto/jetstream" 8 + "Coves/internal/core/communities" 9 + "Coves/internal/core/posts" 10 + "Coves/internal/core/users" 11 + "Coves/internal/db/postgres" 4 12 "bytes" 5 13 "context" 6 14 "database/sql" ··· 13 21 "strings" 14 22 "testing" 15 23 "time" 16 - 17 - "Coves/internal/api/handlers/post" 18 - "Coves/internal/api/middleware" 19 - "Coves/internal/atproto/identity" 20 - "Coves/internal/atproto/jetstream" 21 - "Coves/internal/core/communities" 22 - "Coves/internal/core/posts" 23 - "Coves/internal/core/users" 24 - "Coves/internal/db/postgres" 25 24 26 25 "github.com/gorilla/websocket" 27 26 _ "github.com/lib/pq"
+5 -6
tests/integration/post_handler_test.go
··· 1 1 package integration 2 2 3 3 import ( 4 + "Coves/internal/api/handlers/post" 5 + "Coves/internal/api/middleware" 6 + "Coves/internal/core/communities" 7 + "Coves/internal/core/posts" 8 + "Coves/internal/db/postgres" 4 9 "bytes" 5 10 "encoding/json" 6 11 "net/http" 7 12 "net/http/httptest" 8 13 "strings" 9 14 "testing" 10 - 11 - "Coves/internal/api/handlers/post" 12 - "Coves/internal/api/middleware" 13 - "Coves/internal/core/communities" 14 - "Coves/internal/core/posts" 15 - "Coves/internal/db/postgres" 16 15 17 16 "github.com/stretchr/testify/assert" 18 17 "github.com/stretchr/testify/require"
+2 -3
tests/integration/subscription_indexing_test.go
··· 1 1 package integration 2 2 3 3 import ( 4 + "Coves/internal/atproto/jetstream" 5 + "Coves/internal/core/communities" 4 6 "context" 5 7 "database/sql" 6 8 "fmt" 7 9 "testing" 8 10 "time" 9 - 10 - "Coves/internal/atproto/jetstream" 11 - "Coves/internal/core/communities" 12 11 13 12 postgresRepo "Coves/internal/db/postgres" 14 13 )
+3 -4
tests/integration/timeline_test.go
··· 1 1 package integration 2 2 3 3 import ( 4 + "Coves/internal/api/handlers/timeline" 5 + "Coves/internal/api/middleware" 6 + "Coves/internal/db/postgres" 4 7 "context" 5 8 "encoding/json" 6 9 "fmt" ··· 8 11 "net/http/httptest" 9 12 "testing" 10 13 "time" 11 - 12 - "Coves/internal/api/handlers/timeline" 13 - "Coves/internal/api/middleware" 14 - "Coves/internal/db/postgres" 15 14 16 15 timelineCore "Coves/internal/core/timeline" 17 16
+2 -3
tests/integration/token_refresh_test.go
··· 1 1 package integration 2 2 3 3 import ( 4 + "Coves/internal/core/communities" 5 + "Coves/internal/db/postgres" 4 6 "context" 5 7 "encoding/base64" 6 8 "encoding/json" 7 9 "fmt" 8 10 "testing" 9 11 "time" 10 - 11 - "Coves/internal/core/communities" 12 - "Coves/internal/db/postgres" 13 12 ) 14 13 15 14 // TestTokenRefresh_ExpirationDetection tests the NeedsRefresh function with various token states
+4 -5
tests/integration/user_test.go
··· 1 1 package integration 2 2 3 3 import ( 4 + "Coves/internal/api/routes" 5 + "Coves/internal/atproto/identity" 6 + "Coves/internal/core/users" 7 + "Coves/internal/db/postgres" 4 8 "context" 5 9 "database/sql" 6 10 "encoding/json" ··· 10 14 "os" 11 15 "strings" 12 16 "testing" 13 - 14 - "Coves/internal/api/routes" 15 - "Coves/internal/atproto/identity" 16 - "Coves/internal/core/users" 17 - "Coves/internal/db/postgres" 18 17 19 18 "github.com/go-chi/chi/v5" 20 19 _ "github.com/lib/pq"
+1 -2
tests/unit/community_service_test.go
··· 1 1 package unit 2 2 3 3 import ( 4 + "Coves/internal/core/communities" 4 5 "context" 5 6 "fmt" 6 7 "net/http" ··· 9 10 "sync/atomic" 10 11 "testing" 11 12 "time" 12 - 13 - "Coves/internal/core/communities" 14 13 ) 15 14 16 15 // mockCommunityRepo is a minimal mock for testing service layer