Skip to content
Open
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
2 changes: 1 addition & 1 deletion pkg/cli/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ func (cli *CLI) newServeCommand() *cobra.Command {
// Get the HTTP server from the dependency injection container
// This demonstrates how to access services from the CLI using do
server := do.MustInvoke[*httpservice.HTTPServer](cli.injector)
logger := do.MustInvoke[zerolog.Logger](cli.injector)
logger := do.MustInvoke[*zerolog.Logger](cli.injector)

// Setup graceful shutdown
_, cancel := context.WithCancel(context.Background())
Expand Down
8 changes: 4 additions & 4 deletions pkg/http/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ import (
// HTTPServer represents the HTTP server service
// This demonstrates how to create an HTTP server with dependency injection using do.
type HTTPServer struct {
config *config.Config `do:""`
logger zerolog.Logger `do:""`
userHandler *UserHandler `do:""`
healthHandler *HealthHandler `do:""`
config *config.Config `do:""`
logger *zerolog.Logger `do:""`
userHandler *UserHandler `do:""`
healthHandler *HealthHandler `do:""`
server *http.Server
engine *gin.Engine
}
Expand Down