Documentation ¶
Index ¶
Constants ¶
View Source
const ( EVENT_TRIP_STARTED string = "trip-started" EVENT_TRIP_ENDED string = "trip-ended" EVENT_TRIP_UPDATED string = "trip-update" EVENT_PERIODIC_UPDATE string = "periodic-update" )
View Source
const ( SCOOTER_STATUS_AVAILABLE string = "available" SCOOTER_STATUS_INUSE string = "inuse" SCOOTER_STATUS_COLLECTION string = "scooter-status" )
View Source
const (
SCOOTER_COLLECTION = "scooter"
)
Variables ¶
This section is empty.
Functions ¶
func NewScooterCreator ¶
func NewScooterCreator(DB *mongo.Database) (scooteriface.ScooterCreator, error)
func NewStatusUpdater ¶
func NewStatusUpdater(ScooterReserver scooteriface.ScooterReserver, DB *mongo.Database) (scooteriface.StatusUpdater, error)
Types ¶
type ScooterCreator ¶
func (*ScooterCreator) Create ¶
func (c *ScooterCreator) Create(ctx context.Context, scooter scootertype.Scooter) error
type ScooterFinder ¶
func NewScooterFinder ¶
func NewScooterFinder(DB *mongo.Database) (*ScooterFinder, error)
func (*ScooterFinder) RectangularQuery ¶
func (s *ScooterFinder) RectangularQuery(ctx context.Context, q struct { Status string BottomLeft scootertype.Location TopRight scootertype.Location }) (*scootertype.RectangularQueryResult, error)
type ScooterReserver ¶
func NewScooterReserver ¶
func NewScooterReserver(DB *mongo.Database) (*ScooterReserver, error)
func (*ScooterReserver) ReleaseScooter ¶
func (s *ScooterReserver) ReleaseScooter(ctx context.Context, scooterID string) error
func (*ScooterReserver) ReserveScooter ¶
type StatusUpdater ¶
type StatusUpdater struct { DB *mongo.Database ScooterReserver scooteriface.ScooterReserver }
Click to show internal directories.
Click to hide internal directories.