Background
NewServer in internal/http/server.go takes *auth.Service and *media.Service as concrete types but immediately assigns them to authService and libraryService interface fields. The constructor signature leaks implementation details that the rest of the package never needs.
What changes
- Change
NewServer signature to accept authService and libraryService interfaces directly instead of *auth.Service and *media.Service
- Update call site in
cmd/api-proxy/main.go accordingly
Background
NewServerininternal/http/server.gotakes*auth.Serviceand*media.Serviceas concrete types but immediately assigns them toauthServiceandlibraryServiceinterface fields. The constructor signature leaks implementation details that the rest of the package never needs.What changes
NewServersignature to acceptauthServiceandlibraryServiceinterfaces directly instead of*auth.Serviceand*media.Servicecmd/api-proxy/main.goaccordingly