Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move message api into its own folder #239

Merged
merged 1 commit into from
Oct 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package api
package message

import (
"context"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package api_test
package message_test

import (
"context"
Expand Down
2 changes: 1 addition & 1 deletion pkg/api/service.go → pkg/api/message/service.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package api
package message

import (
"context"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package api
package message

import (
"context"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package api_test
package message_test

import (
"context"
Expand All @@ -7,7 +7,7 @@ import (
"time"

"github.com/stretchr/testify/require"
"github.com/xmtp/xmtpd/pkg/api"
"github.com/xmtp/xmtpd/pkg/api/message"
"github.com/xmtp/xmtpd/pkg/db"
"github.com/xmtp/xmtpd/pkg/db/queries"
"github.com/xmtp/xmtpd/pkg/proto/xmtpv4/message_api"
Expand Down Expand Up @@ -76,7 +76,7 @@ func insertInitialRows(t *testing.T, store *sql.DB) {
testutils.InsertGatewayEnvelopes(t, store, []queries.InsertGatewayEnvelopeParams{
allRows[0], allRows[1],
})
time.Sleep(api.SubscribeWorkerPollTime + 100*time.Millisecond)
time.Sleep(message.SubscribeWorkerPollTime + 100*time.Millisecond)
}

func insertAdditionalRows(t *testing.T, store *sql.DB, notifyChan ...chan bool) {
Expand Down
3 changes: 2 additions & 1 deletion pkg/api/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
"google.golang.org/grpc/reflection"

"github.com/pires/go-proxyproto"
"github.com/xmtp/xmtpd/pkg/api/message"
"github.com/xmtp/xmtpd/pkg/blockchain"
"github.com/xmtp/xmtpd/pkg/proto/xmtpv4/message_api"
"github.com/xmtp/xmtpd/pkg/registrant"
Expand Down Expand Up @@ -86,7 +87,7 @@ func NewAPIServer(
healthcheck := health.NewServer()
healthgrpc.RegisterHealthServer(s.grpcServer, healthcheck)

replicationService, err := NewReplicationApiService(
replicationService, err := message.NewReplicationApiService(
ctx,
log,
registrant,
Expand Down
4 changes: 2 additions & 2 deletions pkg/interceptors/client/auth_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"testing"

"github.com/stretchr/testify/require"
"github.com/xmtp/xmtpd/pkg/api"
"github.com/xmtp/xmtpd/pkg/api/message"
"github.com/xmtp/xmtpd/pkg/authn"
"github.com/xmtp/xmtpd/pkg/constants"
"github.com/xmtp/xmtpd/pkg/proto/xmtpv4/message_api"
Expand All @@ -22,7 +22,7 @@ import (
// Create a mock implementation of the ReplicationApiServer interface
// but that embeds `UnimplementedReplicationApiServer` (which mockery won't do for us)
type mockReplicationApiServer struct {
api.Service
message.Service
expectedToken string
}

Expand Down
Loading