-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
product services wire setup finlizing and other package error fixed
- Loading branch information
1 parent
0c66cd3
commit ac5da51
Showing
5 changed files
with
84 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,24 @@ | ||
package main | ||
|
||
import ( | ||
"log" | ||
|
||
"github.com/abhinandpn/MicroServices-GoLang/admin-services/pkg/config" | ||
"github.com/abhinandpn/MicroServices-GoLang/admin-services/pkg/di" | ||
) | ||
|
||
func main() { | ||
|
||
cfg, confErr := config.LoadCOnfig() | ||
|
||
if confErr != nil { | ||
log.Fatal("cannot load config: ", confErr) | ||
} | ||
server, Dierror := di.InitializeApi(cfg) | ||
|
||
if Dierror != nil { | ||
log.Fatal("cannot start server: ", Dierror) | ||
} else { | ||
server.Start() | ||
} | ||
} |
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,2 @@ | ||
wire: ## Generate wire_gen.go | ||
cd pkg/di && wire |
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,32 @@ | ||
//go:build wireinject | ||
// +build wireinject | ||
|
||
package di | ||
|
||
import ( | ||
http "github.com/abhinandpn/MicroServices-GoLang/product-services/pkg/api" | ||
"github.com/abhinandpn/MicroServices-GoLang/product-services/pkg/api/handler" | ||
"github.com/abhinandpn/MicroServices-GoLang/product-services/pkg/config" | ||
"github.com/abhinandpn/MicroServices-GoLang/product-services/pkg/database" | ||
"github.com/abhinandpn/MicroServices-GoLang/product-services/pkg/repositories" | ||
"github.com/abhinandpn/MicroServices-GoLang/product-services/pkg/usecase" | ||
"github.com/google/wire" | ||
) | ||
|
||
func InitializeApi(cfg config.Config) (*http.ServerHTTP, error) { | ||
wire.Build( | ||
database.ConnectDatabase, | ||
|
||
//handler | ||
handler.NewProductHandler, | ||
|
||
//usecase | ||
usecase.NewProductUsecase, | ||
|
||
//repository | ||
repositories.NewProductRepository, | ||
|
||
http.NewServerHTTP) | ||
|
||
return &http.ServerHTTP{}, nil | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.