-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: migrate api endpoints to use use cases
- Loading branch information
Showing
80 changed files
with
2,813 additions
and
1,796 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package clock | ||
|
||
import ( | ||
"github.com/jonboulle/clockwork" | ||
) | ||
|
||
func Provide() clockwork.Clock { | ||
return clockwork.NewRealClock() | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package container | ||
|
||
import ( | ||
"go.uber.org/fx" | ||
|
||
"github.com/sergeii/swat4master/internal/core/usecases/addserver" | ||
"github.com/sergeii/swat4master/internal/core/usecases/getserver" | ||
"github.com/sergeii/swat4master/internal/core/usecases/listservers" | ||
) | ||
|
||
type Container struct { | ||
GetServer getserver.UseCase | ||
AddServer addserver.UseCase | ||
ListServers listservers.UseCase | ||
} | ||
|
||
func New( | ||
getServerUseCase getserver.UseCase, | ||
addServerUseCase addserver.UseCase, | ||
listServersUseCase listservers.UseCase, | ||
) Container { | ||
return Container{ | ||
GetServer: getServerUseCase, | ||
AddServer: addServerUseCase, | ||
ListServers: listServersUseCase, | ||
} | ||
} | ||
|
||
var Module = fx.Module("container", | ||
fx.Provide(getserver.New), | ||
fx.Provide(addserver.New), | ||
fx.Provide(listservers.New), | ||
fx.Provide(New), | ||
) |
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.
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 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 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
Oops, something went wrong.