Skip to content

Commit f1d6e3a

Browse files
core: Update imports
1 parent 9cc58b5 commit f1d6e3a

18 files changed

Lines changed: 130 additions & 303 deletions

File tree

File renamed without changes.

services/core/internal/app/seed.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ import (
77
"time"
88

99
"github.com/fancyinnovations/fancyspaces/core/internal/maven"
10-
"github.com/fancyinnovations/fancyspaces/core/internal/spaces"
1110
fakeSpacesDB "github.com/fancyinnovations/fancyspaces/core/internal/spaces/database/fake"
11+
"github.com/fancyinnovations/fancyspaces/integrations/spaces-go-sdk/spaces"
1212
)
1313

1414
func seedMavenRepos(store *maven.Store) {

services/core/internal/issues/handler/issues_handler.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,20 @@ import (
1111
"github.com/OliverSchlueter/goutils/problems"
1212
"github.com/OliverSchlueter/goutils/sloki"
1313
"github.com/fancyinnovations/fancyspaces/core/internal/issues"
14-
"github.com/fancyinnovations/fancyspaces/core/internal/spaces"
14+
spacesStore "github.com/fancyinnovations/fancyspaces/core/internal/spaces"
1515
"github.com/fancyinnovations/fancyspaces/integrations/idp-go-sdk/idp"
16+
"github.com/fancyinnovations/fancyspaces/integrations/spaces-go-sdk/spaces"
1617
)
1718

1819
type Handler struct {
1920
store *issues.Store
20-
spaces *spaces.Store
21+
spaces *spacesStore.Store
2122
userFromCtx func(ctx context.Context) *idp.User
2223
}
2324

2425
type Configuration struct {
2526
Store *issues.Store
26-
Spaces *spaces.Store
27+
Spaces *spacesStore.Store
2728
UserFromCtx func(ctx context.Context) *idp.User
2829
}
2930

@@ -66,7 +67,7 @@ func (h *Handler) handleIssues(w http.ResponseWriter, r *http.Request) {
6667
}
6768

6869
if !space.ReleaseSettings.Enabled {
69-
spaces.ProblemFeatureNotEnabled("releases").WriteToHTTP(w)
70+
spacesStore.ProblemFeatureNotEnabled("releases").WriteToHTTP(w)
7071
return
7172
}
7273

@@ -106,7 +107,7 @@ func (h *Handler) handleIssue(w http.ResponseWriter, r *http.Request) {
106107
}
107108

108109
if !space.ReleaseSettings.Enabled {
109-
spaces.ProblemFeatureNotEnabled("releases").WriteToHTTP(w)
110+
spacesStore.ProblemFeatureNotEnabled("releases").WriteToHTTP(w)
110111
return
111112
}
112113

services/core/internal/issues/issuesync/github.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import (
88
"time"
99

1010
"github.com/fancyinnovations/fancyspaces/core/internal/issues"
11-
"github.com/fancyinnovations/fancyspaces/core/internal/spaces"
11+
"github.com/fancyinnovations/fancyspaces/integrations/spaces-go-sdk/spaces"
1212
"github.com/google/go-github/v82/github"
1313
)
1414

services/core/internal/issues/issuesync/issuesync.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,21 @@ import (
66

77
"github.com/OliverSchlueter/goutils/sloki"
88
"github.com/fancyinnovations/fancyspaces/core/internal/issues"
9-
"github.com/fancyinnovations/fancyspaces/core/internal/spaces"
9+
spacesStore "github.com/fancyinnovations/fancyspaces/core/internal/spaces"
10+
"github.com/fancyinnovations/fancyspaces/integrations/spaces-go-sdk/spaces"
1011
"github.com/gofri/go-github-pagination/githubpagination"
1112
"github.com/google/go-github/v82/github"
1213
)
1314

1415
type Service struct {
15-
spacesStore *spaces.Store
16+
spacesStore *spacesStore.Store
1617
issuesStore *issues.Store
1718

1819
ghc *github.Client
1920
}
2021

2122
type Configuration struct {
22-
SpacesStore *spaces.Store
23+
SpacesStore *spacesStore.Store
2324
IssuesStore *issues.Store
2425
GitHubClient *github.Client
2526
}

services/core/internal/maven/handler/maven_api_handler.go

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ import (
1111
"github.com/OliverSchlueter/goutils/sloki"
1212
"github.com/fancyinnovations/fancyspaces/core/internal/maven"
1313
"github.com/fancyinnovations/fancyspaces/core/internal/maven/javadoccache"
14-
"github.com/fancyinnovations/fancyspaces/core/internal/spaces"
14+
spacesStore "github.com/fancyinnovations/fancyspaces/core/internal/spaces"
15+
"github.com/fancyinnovations/fancyspaces/integrations/spaces-go-sdk/spaces"
1516
)
1617

1718
var contentTypes = map[string]string{
@@ -70,7 +71,7 @@ func (h *Handler) handleRepositories(w http.ResponseWriter, r *http.Request) {
7071
}
7172

7273
if !space.MavenRepositorySettings.Enabled {
73-
spaces.ProblemFeatureNotEnabled("releases").WriteToHTTP(w)
74+
spacesStore.ProblemFeatureNotEnabled("releases").WriteToHTTP(w)
7475
return
7576
}
7677

@@ -143,7 +144,7 @@ func (h *Handler) handleRepository(w http.ResponseWriter, r *http.Request) {
143144
}
144145

145146
if !space.MavenRepositorySettings.Enabled {
146-
spaces.ProblemFeatureNotEnabled("releases").WriteToHTTP(w)
147+
spacesStore.ProblemFeatureNotEnabled("releases").WriteToHTTP(w)
147148
return
148149
}
149150

@@ -224,7 +225,7 @@ func (h *Handler) handleArtifacts(w http.ResponseWriter, r *http.Request) {
224225
}
225226

226227
if !space.MavenRepositorySettings.Enabled {
227-
spaces.ProblemFeatureNotEnabled("releases").WriteToHTTP(w)
228+
spacesStore.ProblemFeatureNotEnabled("releases").WriteToHTTP(w)
228229
return
229230
}
230231

@@ -297,7 +298,7 @@ func (h *Handler) handleArtifact(w http.ResponseWriter, r *http.Request) {
297298
}
298299

299300
if !space.MavenRepositorySettings.Enabled {
300-
spaces.ProblemFeatureNotEnabled("releases").WriteToHTTP(w)
301+
spacesStore.ProblemFeatureNotEnabled("releases").WriteToHTTP(w)
301302
return
302303
}
303304

@@ -386,7 +387,7 @@ func (h *Handler) handleJavadoc(w http.ResponseWriter, r *http.Request) {
386387
}
387388

388389
if !space.MavenRepositorySettings.Enabled {
389-
spaces.ProblemFeatureNotEnabled("releases").WriteToHTTP(w)
390+
spacesStore.ProblemFeatureNotEnabled("releases").WriteToHTTP(w)
390391
return
391392
}
392393

services/core/internal/maven/handler/maven_handler.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,21 +15,22 @@ import (
1515
"github.com/OliverSchlueter/goutils/sloki"
1616
"github.com/fancyinnovations/fancyspaces/core/internal/analytics"
1717
"github.com/fancyinnovations/fancyspaces/core/internal/maven"
18-
"github.com/fancyinnovations/fancyspaces/core/internal/spaces"
18+
spacesStore "github.com/fancyinnovations/fancyspaces/core/internal/spaces"
1919
"github.com/fancyinnovations/fancyspaces/integrations/idp-go-sdk/idp"
20+
"github.com/fancyinnovations/fancyspaces/integrations/spaces-go-sdk/spaces"
2021
)
2122

2223
type Handler struct {
2324
store *maven.Store
24-
spaces *spaces.Store
25+
spaces *spacesStore.Store
2526
analytics *analytics.Store
2627
userFromCtx func(ctx context.Context) *idp.User
2728
downloadRatelimit *ratelimit.Service
2829
}
2930

3031
type Configuration struct {
3132
Store *maven.Store
32-
Spaces *spaces.Store
33+
Spaces *spacesStore.Store
3334
Analytics *analytics.Store
3435
UserFromCtx func(ctx context.Context) *idp.User
3536
}
@@ -93,7 +94,7 @@ func (h *Handler) handleMavenRequest(w http.ResponseWriter, r *http.Request) {
9394
}
9495

9596
if !space.MavenRepositorySettings.Enabled {
96-
spaces.ProblemFeatureNotEnabled("maven-repository").WriteToHTTP(w)
97+
spacesStore.ProblemFeatureNotEnabled("maven-repository").WriteToHTTP(w)
9798
return
9899
}
99100

services/core/internal/maven/maven.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import (
99
"github.com/fancyinnovations/fancyspaces/core/internal/analytics"
1010
"github.com/fancyinnovations/fancyspaces/core/internal/maven/javadoccache"
1111
"github.com/fancyinnovations/fancyspaces/core/internal/spaces"
12+
spacesModel "github.com/fancyinnovations/fancyspaces/integrations/spaces-go-sdk/spaces"
1213
)
1314

1415
type DB interface {
@@ -248,7 +249,7 @@ func (s *Store) DownloadArtifactFile(ctx context.Context, spaceID, repoName, gro
248249
return s.fileStore.DownloadArtifactFile(ctx, spaceID, repoName, groupPath, artifactID, version, fileName)
249250
}
250251

251-
func (s *Store) GetJavadocFile(ctx context.Context, space *spaces.Space, repo *Repository, artifact *Artifact, version string, filePath string) ([]byte, error) {
252+
func (s *Store) GetJavadocFile(ctx context.Context, space *spacesModel.Space, repo *Repository, artifact *Artifact, version string, filePath string) ([]byte, error) {
252253
// If the repository is an internal mirror, redirect the request to the mirrored repository
253254
if repo.InternalMirror != nil {
254255
mirroredSpace, err := s.spaces.Get(repo.InternalMirror.SpaceID)

services/core/internal/sitemapprovider/sitemapprovider.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import (
77
"github.com/OliverSchlueter/goutils/sitemapgen"
88
"github.com/OliverSchlueter/goutils/sloki"
99
"github.com/fancyinnovations/fancyspaces/core/internal/spaces"
10+
spacesModel "github.com/fancyinnovations/fancyspaces/integrations/spaces-go-sdk/spaces"
1011
)
1112

1213
const baseURL = "https://fancyspaces.net"
@@ -66,9 +67,9 @@ func (s *Service) GenerateUrls() []sitemapgen.Url {
6667
return urls
6768
}
6869

69-
var filteredSpaces []spaces.Space
70+
var filteredSpaces []spacesModel.Space
7071
for _, space := range allSpaces {
71-
if space.Status == spaces.StatusApproved || space.Status == spaces.StatusArchived {
72+
if space.Status == spacesModel.StatusApproved || space.Status == spacesModel.StatusArchived {
7273
filteredSpaces = append(filteredSpaces, space)
7374
continue
7475
}

services/core/internal/spaces/database/fake/spaces_fake_database.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ package fake
33
import (
44
"sync"
55

6-
"github.com/fancyinnovations/fancyspaces/core/internal/spaces"
6+
spacesStore "github.com/fancyinnovations/fancyspaces/core/internal/spaces"
7+
"github.com/fancyinnovations/fancyspaces/integrations/spaces-go-sdk/spaces"
78
)
89

910
type DB struct {
@@ -57,7 +58,7 @@ func (db *DB) Create(s *spaces.Space) error {
5758

5859
for _, item := range db.Items {
5960
if item.ID == s.ID || item.Slug == s.Slug {
60-
return spaces.ErrSpaceAlreadyExists
61+
return spacesStore.ErrSpaceAlreadyExists
6162
}
6263
}
6364

0 commit comments

Comments
 (0)