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

refactor: Introduce InfrastructureModule #3274

Merged
merged 1 commit into from
Jun 12, 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
Expand Up @@ -43,6 +43,8 @@ import org.knora.webapi.slice.admin.domain.service.*
import org.knora.webapi.slice.admin.domain.service.ProjectExportStorageService
import org.knora.webapi.slice.common.api.*
import org.knora.webapi.slice.common.repo.service.PredicateObjectMapper
import org.knora.webapi.slice.infrastructure.CacheManager
import org.knora.webapi.slice.infrastructure.InfrastructureModule
import org.knora.webapi.slice.infrastructure.JwtService
import org.knora.webapi.slice.infrastructure.JwtServiceLive
import org.knora.webapi.slice.infrastructure.api.ManagementEndpoints
Expand Down Expand Up @@ -105,6 +107,7 @@ object LayersTest {
DspIngestClient &
GravsearchTypeInspectionRunner &
GroupRestService &
InfrastructureModule.Provided &
InferenceOptimizationService &
InvalidTokenCache &
IriConverter &
Expand Down Expand Up @@ -167,6 +170,7 @@ object LayersTest {
ConstructResponseUtilV2Live.layer,
DspIngestClientLive.layer,
HandlerMapper.layer,
InfrastructureModule.layer,
InferenceOptimizationService.layer,
InvalidTokenCache.layer,
IriConverter.layer,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ import org.knora.webapi.slice.admin.api.service.UserRestService
import org.knora.webapi.slice.admin.domain.service.*
import org.knora.webapi.slice.common.api.*
import org.knora.webapi.slice.common.repo.service.PredicateObjectMapper
import org.knora.webapi.slice.infrastructure.InfrastructureModule
import org.knora.webapi.slice.infrastructure.JwtService
import org.knora.webapi.slice.infrastructure.JwtServiceLive
import org.knora.webapi.slice.infrastructure.api.ManagementEndpoints
Expand Down Expand Up @@ -88,6 +89,7 @@ object LayersLive {
GroupRestService &
HttpServer &
IIIFRequestMessageHandler &
InfrastructureModule.Provided &
InstrumentationServerConfig &
InvalidTokenCache &
IriConverter &
Expand Down Expand Up @@ -145,6 +147,7 @@ object LayersLive {
HandlerMapper.layer,
HttpServer.layer,
IIIFRequestMessageHandlerLive.layer,
InfrastructureModule.layer,
InvalidTokenCache.layer,
IriConverter.layer,
IriService.layer,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,21 @@ import org.knora.webapi.responders.IriService
import org.knora.webapi.slice.admin.domain.AdminDomainModule
import org.knora.webapi.slice.admin.repo.AdminRepoModule
import org.knora.webapi.slice.common.repo.service.PredicateObjectMapper
import org.knora.webapi.slice.infrastructure.CacheManager
import org.knora.webapi.slice.ontology.domain.service.OntologyRepo
import org.knora.webapi.store.triplestore.api.TriplestoreService

object AdminModule {

type Dependencies =
AppConfig & IriService & OntologyRepo & PredicateObjectMapper & TriplestoreService
// format: off
AppConfig &
CacheManager &
IriService &
OntologyRepo &
PredicateObjectMapper &
TriplestoreService
// format: on

type Provided = AdminDomainModule.Provided

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,18 @@ import org.knora.webapi.store.triplestore.api.TriplestoreService
object AdminDomainModule {

type Dependencies =
AppConfig & AdminRepoModule.Provided & IriService & OntologyRepo & TriplestoreService
// format: off
AdminRepoModule.Provided &
AppConfig &
CacheManager &
IriService &
OntologyRepo &
TriplestoreService
// format: on

type Provided =
// format: off
AdministrativePermissionService &
CacheManager &
GroupService &
KnoraGroupService &
KnoraProjectService &
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,21 @@ import org.knora.webapi.store.triplestore.api.TriplestoreService

object AdminRepoModule {

type Dependencies = TriplestoreService
type Provided = AdministrativePermissionRepo & CacheManager & KnoraGroupRepo & KnoraProjectRepo & KnoraUserRepo
type Dependencies =
// format: off
TriplestoreService &
CacheManager
// format: on

type Provided =
// format: off
AdministrativePermissionRepo &
KnoraGroupRepo &
KnoraProjectRepo &
KnoraUserRepo
// format: on

val layer = ZLayer.makeSome[Dependencies, Provided](
CacheManager.layer,
KnoraGroupRepoLive.layer,
KnoraProjectRepoLive.layer,
KnoraUserRepoLive.layer,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/*
* Copyright © 2021 - 2024 Swiss National Data and Service Center for the Humanities and/or DaSCH Service Platform contributors.
* SPDX-License-Identifier: Apache-2.0
*/

package org.knora.webapi.slice.infrastructure

import zio.ZLayer

object InfrastructureModule {

type Dependencies =
// format: off
Any
// format: on

type Provided =
// format: off
CacheManager
// format: on
seakayone marked this conversation as resolved.
Show resolved Hide resolved

val layer = ZLayer.makeSome[Dependencies, Provided](
CacheManager.layer,
)
}
Loading