-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Simplified Cinterface providers and inbound communication handlers un…
…der one single 'infra' layer
- Loading branch information
1 parent
8bad1e4
commit 43b4b5c
Showing
13 changed files
with
21 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
20 changes: 14 additions & 6 deletions
20
internal/interfaceadapters/services.go → internal/infra/services.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,31 @@ | ||
// Package interfaceadapters contains the services of the interface adapters | ||
package interfaceadapters | ||
// Package infra contains the services of the interface adapters | ||
package infra | ||
|
||
import ( | ||
"github.com/pkritiotis/go-climb-clean-architecture-example/internal/app" | ||
"github.com/pkritiotis/go-climb-clean-architecture-example/internal/app/notification" | ||
"github.com/pkritiotis/go-climb-clean-architecture-example/internal/domain/crag" | ||
"github.com/pkritiotis/go-climb-clean-architecture-example/internal/interfaceadapters/notification/console" | ||
"github.com/pkritiotis/go-climb-clean-architecture-example/internal/interfaceadapters/storage/memory" | ||
"github.com/pkritiotis/go-climb-clean-architecture-example/internal/infra/http" | ||
"github.com/pkritiotis/go-climb-clean-architecture-example/internal/infra/notification/console" | ||
"github.com/pkritiotis/go-climb-clean-architecture-example/internal/infra/storage/memory" | ||
) | ||
|
||
// Services contains the exposed services of interface adapters | ||
type Services struct { | ||
NotificationService notification.Service | ||
CragRepository crag.Repository | ||
Server *http.Server | ||
} | ||
|
||
// NewServices Instantiates the interface adapter services | ||
func NewServices() Services { | ||
// NewInfraProviders Instantiates the infra services | ||
func NewInfraProviders() Services { | ||
return Services{ | ||
NotificationService: console.NewNotificationService(), | ||
CragRepository: memory.NewRepo(), | ||
} | ||
} | ||
|
||
// NewHTTPServer creates a new server | ||
func NewHTTPServer(appServices app.Services) *http.Server { | ||
return http.NewServer(appServices) | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file was deleted.
Oops, something went wrong.