Skip to content

Commit

Permalink
fix: modify comments for public functions
Browse files Browse the repository at this point in the history
issue: #240
  • Loading branch information
CodeBear801 committed Apr 13, 2020
1 parent 10eeb70 commit cba52f6
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ func (bf *basicFinder) getNearbyChargeStations(req *nearbychargestation.Request)
bf.searchRespLock.Unlock()
}

// NearbyStationsIterator provides channel which contains near by station information
func (bf *basicFinder) IterateNearbyStations() <-chan *stationfindertype.ChargeStationInfo {
if bf.searchResp == nil || len(bf.searchResp.Results) == 0 {
c := make(chan *stationfindertype.ChargeStationInfo)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ func (sf *destStationFinder) prepare() {
return
}

// NearbyStationsIterator provides channel which contains near by station information for dest
func (sf *destStationFinder) IterateNearbyStations() <-chan *stationfindertype.ChargeStationInfo {
return sf.bf.IterateNearbyStations()
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ func (sf *lowEnergyLocationStationFinder) prepare() {
return
}

// NearbyStationsIterator provides channel which contains near by station information for low energy location
func (sf *lowEnergyLocationStationFinder) IterateNearbyStations() <-chan *stationfindertype.ChargeStationInfo {
return sf.bf.IterateNearbyStations()
}
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ func (sf *origStationFinder) prepare() {
return
}

// NearbyStationsIterator provides channel which contains near by station information for orig
func (sf *origStationFinder) IterateNearbyStations() <-chan *stationfindertype.ChargeStationInfo {
return sf.bf.IterateNearbyStations()
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,12 @@ func newDestStationFinder(localFinder spatialindexer.Finder, oasisReq *oasis.Req
return obj
}

// NearbyStationsIterator provides channel which contains near by station information for dest
func (localFinder *destStationLocalFinder) IterateNearbyStations() <-chan *stationfindertype.ChargeStationInfo {
return localFinder.basicFinder.IterateNearbyStations()
}

// Stop stops functionality of finder
func (localFinder *destStationLocalFinder) Stop() {
localFinder.basicFinder.Stop()
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@ package localfinder
import (
"github.com/Telenav/osrm-backend/integration/pkg/api/nav"
"github.com/Telenav/osrm-backend/integration/service/oasis/spatialindexer"
"github.com/Telenav/osrm-backend/integration/service/oasis/stationfinder/cloudfinder"
"github.com/Telenav/osrm-backend/integration/service/oasis/stationfinder/stationfindertype"
)

// lowEnergySearchRadius defines search radius for low energy location
const lowEnergySearchRadius = 80000

type lowEnergyLocationLocalFinder struct {
basicFinder *basicLocalFinder
}
Expand All @@ -19,16 +21,18 @@ func newLowEnergyLocationLocalFinder(localFinder spatialindexer.Finder, location
obj.basicFinder.getNearbyChargeStations(spatialindexer.Location{
Lat: location.Lat,
Lon: location.Lon},
cloudfinder.LowEnergyLocationCandidateNumber)
lowEnergySearchRadius)

return obj

}

// // NearbyStationsIterator provides channel which contains near by station information for low energy point
func (localFinder *lowEnergyLocationLocalFinder) IterateNearbyStations() <-chan *stationfindertype.ChargeStationInfo {
return localFinder.basicFinder.IterateNearbyStations()
}

// Stop stops functionality of finder
func (localFinder *lowEnergyLocationLocalFinder) Stop() {
localFinder.basicFinder.Stop()
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ func newOrigStationFinder(localFinder spatialindexer.Finder, oasisReq *oasis.Req
return obj
}

// NearbyStationsIterator provides channel which contains near by station information for orig
func (localFinder *origStationLocalFinder) IterateNearbyStations() <-chan *stationfindertype.ChargeStationInfo {
return localFinder.basicFinder.IterateNearbyStations()
}
Expand Down

0 comments on commit cba52f6

Please sign in to comment.