http

package
v0.0.0-...-c95cf46 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 14, 2018 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
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

type FeedService interface {
	GetUserRides(userID string) ([]*models.Ride, error)
}

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

type UserService

type UserService interface {
	Login(googleToken string) (string, error)
	Get(id string) (*models.User, error)
	GetAll(lastID string, limit, userAuthLevel int) ([]*models.User, error)
}

UserService is used to handle the user use cases

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL