@@ -6,11 +6,11 @@ import (
66 "github.com/friendsofgo/errors"
77 "github.com/kevinmichaelchen/api-dispatch/internal/service"
88 "github.com/kevinmichaelchen/api-dispatch/internal/service/db"
9- "github.com/kevinmichaelchen/api-dispatch/internal/service/distance "
9+ "github.com/kevinmichaelchen/api-dispatch/internal/service/maps "
1010 "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp"
1111 "go.uber.org/fx"
1212 "go.uber.org/zap"
13- "googlemaps.github.io/maps"
13+ gmaps "googlemaps.github.io/maps"
1414 "os"
1515)
1616
@@ -26,7 +26,7 @@ var Module = fx.Module("service",
2626type Params struct {
2727 fx.In
2828 DataStore * db.Store
29- DistanceService * distance .Service `optional:"true"`
29+ DistanceService * maps .Service `optional:"true"`
3030}
3131
3232func NewService (p Params ) * service.Service {
@@ -37,24 +37,24 @@ func NewDataStore(sqlDB *sql.DB) *db.Store {
3737 return db .NewStore (sqlDB )
3838}
3939
40- func NewMapsClient () (* maps .Client , error ) {
40+ func NewMapsClient () (* gmaps .Client , error ) {
4141 apiKey := os .Getenv ("API_KEY" )
4242 if apiKey == "" {
4343 return nil , errors .New ("missing API_KEY for Google Maps" )
4444 }
45- c , err := maps .NewClient (
46- maps .WithAPIKey (apiKey ),
47- maps .WithHTTPClient (otelhttp .DefaultClient ),
45+ c , err := gmaps .NewClient (
46+ gmaps .WithAPIKey (apiKey ),
47+ gmaps .WithHTTPClient (otelhttp .DefaultClient ),
4848 )
4949 if err != nil {
5050 return nil , fmt .Errorf ("failed to build Google Maps client: %w" , err )
5151 }
5252 return c , nil
5353}
5454
55- func NewDistanceService (logger * zap.Logger , client * maps .Client ) (* distance .Service , error ) {
55+ func NewDistanceService (logger * zap.Logger , client * gmaps .Client ) (* maps .Service , error ) {
5656 if client == nil {
5757 return nil , errors .New ("no maps client" )
5858 }
59- return distance .NewService (client ), nil
59+ return maps .NewService (client ), nil
6060}
0 commit comments