Skip to content

Commit cad32e0

Browse files
authored
feat: Moved server directory to api directory (frain-dev#1458)
* feat: renamed package server to api * fix: fixed ancillary files
1 parent 604e891 commit cad32e0

File tree

209 files changed

+1078
-1080
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

209 files changed

+1078
-1080
lines changed

.githooks/pre-commit

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
echo $(pwd)
77

8-
changed=$(git status -s | grep server/)
8+
changed=$(git status -s | grep api/)
99

1010
echo "$changed"
1111

@@ -15,9 +15,9 @@ then
1515
exit 0
1616
else
1717
# regenerate docs
18-
swag init --generatedTime --parseDependency --parseInternal -d server/ server/*
18+
swag init --generatedTime --parseDependency --parseInternal -d api/ api/*
1919
go run v3gen/main.go
2020
git add docs/ # add all files under the generated doc folder to git
2121
fi
2222

23-
exit 0
23+
exit 0

.github/workflows/release.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ jobs:
5050
uses: actions/download-artifact@v2
5151
with:
5252
name: dist-without-markdown
53-
path: server/ui/build
53+
path: api/ui/build
5454
fetch-depth: 0
5555

5656
- uses: docker/login-action@v1

.gitignore

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
# vendor/
1616
.idea
1717

18-
/server/ui/build/*
19-
!/server/ui/build/go_test_stub.txt
18+
/api/ui/build/*
19+
!/api/ui/build/go_test_stub.txt
2020
/data/mongo/
2121
.DS_Store
2222
*.db

Dockerfile.dev

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ WORKDIR /go/src/frain-dev/convoy
1212
COPY ./go.mod /go/src/frain-dev/convoy
1313
COPY ./go.sum /go/src/frain-dev/convoy
1414

15-
COPY --from=node-env /app/dist /go/src/frain-dev/convoy/server/ui/build
15+
COPY --from=node-env /app/dist /go/src/frain-dev/convoy/api/ui/build
1616

1717
# Get dependancies - will also be cached if we don't change mod/sum
1818
RUN go mod download
@@ -30,6 +30,6 @@ COPY --from=build-env /go/src/frain-dev/convoy/internal/email/templates/* templa
3030
COPY --from=build-env /go/src/frain-dev/convoy/configs/local/start.sh /
3131

3232
RUN chmod +x /cmd
33-
RUN apk add --no-cache gcompat
33+
RUN apk add --no-cache gcompat
3434

3535
EXPOSE 8080

server/application.go api/application.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package server
1+
package api
22

33
import (
44
"fmt"
@@ -9,9 +9,9 @@ import (
99
"github.com/frain-dev/convoy/pkg/log"
1010
"github.com/oklog/ulid/v2"
1111

12+
"github.com/frain-dev/convoy/api/models"
1213
"github.com/frain-dev/convoy/database/postgres"
1314
"github.com/frain-dev/convoy/datastore"
14-
"github.com/frain-dev/convoy/server/models"
1515
"github.com/frain-dev/convoy/services"
1616
"github.com/frain-dev/convoy/util"
1717
"github.com/go-chi/render"

server/application_integration_test.go api/application_integration_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//go:build integration
22
// +build integration
33

4-
package server
4+
package api
55

66
import (
77
"context"
@@ -21,10 +21,10 @@ import (
2121
"github.com/frain-dev/convoy/internal/pkg/metrics"
2222
"github.com/jaswdr/faker"
2323

24+
"github.com/frain-dev/convoy/api/testdb"
2425
"github.com/frain-dev/convoy/auth"
2526
"github.com/frain-dev/convoy/config"
2627
"github.com/frain-dev/convoy/datastore"
27-
"github.com/frain-dev/convoy/server/testdb"
2828
"github.com/stretchr/testify/require"
2929
"github.com/stretchr/testify/suite"
3030
)

server/configuration.go api/configuration.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
package server
1+
package api
22

33
import (
44
"net/http"
55

66
"github.com/frain-dev/convoy"
7+
"github.com/frain-dev/convoy/api/models"
78
"github.com/frain-dev/convoy/database/postgres"
89
"github.com/frain-dev/convoy/datastore"
9-
"github.com/frain-dev/convoy/server/models"
1010
"github.com/frain-dev/convoy/services"
1111
"github.com/frain-dev/convoy/util"
1212
"github.com/go-chi/render"

server/configuration_integration_test.go api/configuration_integration_test.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//go:build integration
22
// +build integration
33

4-
package server
4+
package api
55

66
import (
77
"net/http"
@@ -13,10 +13,10 @@ import (
1313
"github.com/frain-dev/convoy/internal/pkg/metrics"
1414

1515
"github.com/frain-dev/convoy"
16+
"github.com/frain-dev/convoy/api/models"
17+
"github.com/frain-dev/convoy/api/testdb"
1618
"github.com/frain-dev/convoy/config"
1719
"github.com/frain-dev/convoy/datastore"
18-
"github.com/frain-dev/convoy/server/models"
19-
"github.com/frain-dev/convoy/server/testdb"
2020
"github.com/stretchr/testify/require"
2121
"github.com/stretchr/testify/suite"
2222
)

server/dashboard.go api/dashboard.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
package server
1+
package api
22

33
import (
44
"fmt"
55
"net/http"
66
"time"
77

8+
"github.com/frain-dev/convoy/api/models"
89
"github.com/frain-dev/convoy/datastore"
9-
"github.com/frain-dev/convoy/server/models"
1010
"github.com/frain-dev/convoy/util"
1111
"github.com/go-chi/render"
1212

server/dashboard_integration_test.go api/dashboard_integration_test.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//go:build integration
22
// +build integration
33

4-
package server
4+
package api
55

66
import (
77
"context"
@@ -16,13 +16,13 @@ import (
1616
"github.com/frain-dev/convoy/database"
1717
"github.com/frain-dev/convoy/internal/pkg/metrics"
1818

19-
"github.com/frain-dev/convoy/server/testdb"
19+
"github.com/frain-dev/convoy/api/testdb"
2020
"github.com/stretchr/testify/suite"
2121

22+
"github.com/frain-dev/convoy/api/models"
2223
"github.com/frain-dev/convoy/config"
2324
"github.com/frain-dev/convoy/database/postgres"
2425
"github.com/frain-dev/convoy/datastore"
25-
"github.com/frain-dev/convoy/server/models"
2626
"github.com/sebdah/goldie/v2"
2727
"github.com/stretchr/testify/require"
2828
)

server/delivery_attempt.go api/delivery_attempt.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package server
1+
package api
22

33
import (
44
"net/http"

server/device.go api/device.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package server
1+
package api
22

33
import (
44
"net/http"

server/device_integration_test.go api/device_integration_test.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
//go:build integration
22
// +build integration
33

4-
package server
4+
package api
55

66
import (
77
"fmt"
88
"net/http"
99
"net/http/httptest"
1010
"testing"
1111

12+
"github.com/frain-dev/convoy/api/models"
13+
"github.com/frain-dev/convoy/api/testdb"
1214
"github.com/frain-dev/convoy/config"
1315
"github.com/frain-dev/convoy/database"
1416
"github.com/frain-dev/convoy/database/postgres"
1517
"github.com/frain-dev/convoy/datastore"
1618
"github.com/frain-dev/convoy/internal/pkg/metrics"
17-
"github.com/frain-dev/convoy/server/models"
18-
"github.com/frain-dev/convoy/server/testdb"
1919
"github.com/stretchr/testify/require"
2020
"github.com/stretchr/testify/suite"
2121
)

server/endpoint.go api/endpoint.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
package server
1+
package api
22

33
import (
44
"net/http"
55

66
"github.com/go-chi/chi/v5"
77

8+
"github.com/frain-dev/convoy/api/models"
89
"github.com/frain-dev/convoy/database/postgres"
910
"github.com/frain-dev/convoy/datastore"
10-
"github.com/frain-dev/convoy/server/models"
1111
"github.com/frain-dev/convoy/services"
1212
"github.com/frain-dev/convoy/util"
1313

server/endpoint_integration_test.go api/endpoint_integration_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//go:build integration
22
// +build integration
33

4-
package server
4+
package api
55

66
import (
77
"context"
@@ -19,10 +19,10 @@ import (
1919
"github.com/frain-dev/convoy/database/postgres"
2020
"github.com/frain-dev/convoy/internal/pkg/metrics"
2121

22+
"github.com/frain-dev/convoy/api/testdb"
2223
"github.com/frain-dev/convoy/auth"
2324
"github.com/frain-dev/convoy/config"
2425
"github.com/frain-dev/convoy/datastore"
25-
"github.com/frain-dev/convoy/server/testdb"
2626
"github.com/jaswdr/faker"
2727
"github.com/stretchr/testify/require"
2828
"github.com/stretchr/testify/suite"

server/event.go api/event.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package server
1+
package api
22

33
import (
44
"encoding/json"
@@ -7,10 +7,10 @@ import (
77
"net/http"
88
"time"
99

10+
"github.com/frain-dev/convoy/api/models"
1011
"github.com/frain-dev/convoy/config"
1112
"github.com/frain-dev/convoy/database/postgres"
1213
"github.com/frain-dev/convoy/datastore"
13-
"github.com/frain-dev/convoy/server/models"
1414
"github.com/frain-dev/convoy/services"
1515
"github.com/frain-dev/convoy/util"
1616
"github.com/go-chi/render"

server/event_integration_test.go api/event_integration_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//go:build integration
22
// +build integration
33

4-
package server
4+
package api
55

66
import (
77
"context"
@@ -17,10 +17,10 @@ import (
1717
"github.com/frain-dev/convoy/database/postgres"
1818
"github.com/frain-dev/convoy/internal/pkg/metrics"
1919

20+
"github.com/frain-dev/convoy/api/testdb"
2021
"github.com/frain-dev/convoy/auth"
2122
"github.com/frain-dev/convoy/config"
2223
"github.com/frain-dev/convoy/datastore"
23-
"github.com/frain-dev/convoy/server/testdb"
2424
"github.com/stretchr/testify/require"
2525
"github.com/stretchr/testify/suite"
2626
)

server/ingest.go api/ingest.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package server
1+
package api
22

33
import (
44
"encoding/json"

server/ingest_integration_test.go api/ingest_integration_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//go:build integration
22
// +build integration
33

4-
package server
4+
package api
55

66
import (
77
"encoding/json"
@@ -14,9 +14,9 @@ import (
1414
"github.com/frain-dev/convoy/database/postgres"
1515
"github.com/frain-dev/convoy/internal/pkg/metrics"
1616

17+
"github.com/frain-dev/convoy/api/testdb"
1718
"github.com/frain-dev/convoy/config"
1819
"github.com/frain-dev/convoy/datastore"
19-
"github.com/frain-dev/convoy/server/testdb"
2020
"github.com/stretchr/testify/require"
2121

2222
"github.com/stretchr/testify/suite"

server/main.go api/main.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package server
1+
package api
22

33
// This is the main doc file, swag cli needs it to be named main.go
44

File renamed without changes.

server/organisation.go api/organisation.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
package server
1+
package api
22

33
import (
44
"net/http"
55

66
"github.com/frain-dev/convoy/database/postgres"
77
"github.com/frain-dev/convoy/datastore"
88

9-
"github.com/frain-dev/convoy/server/models"
9+
"github.com/frain-dev/convoy/api/models"
1010
"github.com/frain-dev/convoy/services"
1111
"github.com/frain-dev/convoy/util"
1212
"github.com/go-chi/render"

server/organisation_integration_test.go api/organisation_integration_test.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//go:build integration
22
// +build integration
33

4-
package server
4+
package api
55

66
import (
77
"context"
@@ -15,13 +15,13 @@ import (
1515

1616
"github.com/frain-dev/convoy/internal/pkg/metrics"
1717

18+
"github.com/frain-dev/convoy/api/models"
19+
"github.com/frain-dev/convoy/api/testdb"
1820
"github.com/frain-dev/convoy/auth"
1921
"github.com/frain-dev/convoy/config"
2022
"github.com/frain-dev/convoy/database"
2123
"github.com/frain-dev/convoy/database/postgres"
2224
"github.com/frain-dev/convoy/datastore"
23-
"github.com/frain-dev/convoy/server/models"
24-
"github.com/frain-dev/convoy/server/testdb"
2525
"github.com/stretchr/testify/require"
2626
"github.com/stretchr/testify/suite"
2727
)

server/organisation_invite.go api/organisation_invite.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package server
1+
package api
22

33
import (
44
"errors"
@@ -10,7 +10,7 @@ import (
1010
"github.com/frain-dev/convoy/datastore"
1111
"github.com/frain-dev/convoy/services"
1212

13-
"github.com/frain-dev/convoy/server/models"
13+
"github.com/frain-dev/convoy/api/models"
1414
"github.com/frain-dev/convoy/util"
1515
"github.com/go-chi/chi/v5"
1616
"github.com/go-chi/render"

server/organisation_invite_integration_test.go api/organisation_invite_integration_test.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//go:build integration
22
// +build integration
33

4-
package server
4+
package api
55

66
import (
77
"fmt"
@@ -11,14 +11,14 @@ import (
1111
"testing"
1212
"time"
1313

14+
"github.com/frain-dev/convoy/api/models"
15+
"github.com/frain-dev/convoy/api/testdb"
1416
"github.com/frain-dev/convoy/auth"
1517
"github.com/frain-dev/convoy/config"
1618
"github.com/frain-dev/convoy/database"
1719
"github.com/frain-dev/convoy/database/postgres"
1820
"github.com/frain-dev/convoy/datastore"
1921
"github.com/frain-dev/convoy/internal/pkg/metrics"
20-
"github.com/frain-dev/convoy/server/models"
21-
"github.com/frain-dev/convoy/server/testdb"
2222
"github.com/stretchr/testify/require"
2323
"github.com/stretchr/testify/suite"
2424
)

0 commit comments

Comments
 (0)