Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // ErrNotAllowed occurs when the user does not have sufficient auth level ErrNotAllowed = echo.NewHTTPError(http.StatusForbidden, "user not allowed") )
Functions ¶
This section is empty.
Types ¶
type CarController ¶
type CarController struct {
// contains filtered or unexported fields
}
CarController http adapter
func NewCarController ¶
func NewCarController(c CarService, l interfaces.Logger) *CarController
NewCarController creates a new car controller
func (*CarController) MountRoutes ¶
func (cc *CarController) MountRoutes(c *echo.Group)
MountRoutes mounts the car routes
type CarService ¶
type CarService interface {
GetAll(lastID string, limit, authLevel int) ([]*models.Car, error)
GetCar(id string) (*models.Car, error)
AddCar(body models.Car, userID string) (*models.Car, error)
DeleteCar(id, userID string) error
}
CarService is used to handle all car CRUD operations
type FeedController ¶
type FeedController struct {
// contains filtered or unexported fields
}
FeedController is the controller for the feed
func NewFeedController ¶
func NewFeedController(f FeedService, l interfaces.Logger) *FeedController
NewFeedController creates a new feed controller
func (*FeedController) MountRoutes ¶
func (f *FeedController) MountRoutes(c *echo.Group)
MountRoutes adds the pages routes to the apps
type FeedService ¶
FeedService handles the use cases for the feed
type PagesController ¶
type PagesController struct {
// contains filtered or unexported fields
}
PagesController is the controller for pages
func NewPagesController ¶
func NewPagesController(l interfaces.Logger) *PagesController
NewPagesController creates a new pages controller
func (*PagesController) MountRoutes ¶
func (p *PagesController) MountRoutes(c *echo.Group)
MountRoutes adds the pages routes to the apps
type PassengerController ¶
type PassengerController struct {
// contains filtered or unexported fields
}
PassengerController http adapter
func NewPassengerController ¶
func NewPassengerController(r PassengerService, l interfaces.Logger) *PassengerController
NewPassengerController creates a new passenger controller
func (*PassengerController) MountRoutes ¶
func (p *PassengerController) MountRoutes(c *echo.Group)
MountRoutes mounts the auth routes
type PassengerService ¶
type PassengerService interface {
Create(*models.Passenger, *auth.UserClaims) error
Get(id string, user *auth.UserClaims) (*models.Passenger, error)
Update(updates *models.PassengerChangeSet, passengerID string, user *auth.UserClaims) (*models.Passenger, error)
GetAll(lastID string, limit, userAuthLevel int) ([]*models.Passenger, error)
GetAllByRideID(rideID string, user *auth.UserClaims) ([]*models.Passenger, error)
Delete(id string, user *auth.UserClaims) error
}
PassengerService is used to handle the passenger use cases
type RideController ¶
type RideController struct {
// contains filtered or unexported fields
}
RideController http adapter
func NewRideController ¶
func NewRideController(r RideService, p PassengerService, l interfaces.Logger) *RideController
NewRideController creates a new auth controller
func (*RideController) MountRoutes ¶
func (r *RideController) MountRoutes(c *echo.Group)
MountRoutes mounts the auth routes
type RideService ¶
type RideService interface {
Create(*models.Ride, *auth.UserClaims) error
Get(id string) (*models.Ride, error)
Update(updates *models.RideChangeSet, rideID string, user *auth.UserClaims) (*models.Ride, error)
GetAll(lastID string, limit, userAuthLevel int) ([]*models.Ride, error)
Delete(id string, user *auth.UserClaims) error
}
RideService is used to handle the ride use cases
type UserController ¶
type UserController struct {
// contains filtered or unexported fields
}
UserController http adapter
func NewUserController ¶
func NewUserController(u UserService, daysTokenValidFor int, cookieName string, l interfaces.Logger) *UserController
NewUserController creates a new auth controller
func (*UserController) MountRoutes ¶
func (u *UserController) MountRoutes(c *echo.Group)
MountRoutes mounts the auth routes