Documentation ¶
Index ¶
- func GetFields(products []models.Product) graphql.Fields
- type Handlers
- func (h *Handlers) GenresGet(w http.ResponseWriter, r *http.Request)
- func (h *Handlers) GraphqlList(w http.ResponseWriter, r *http.Request)
- func (h *Handlers) Login(w http.ResponseWriter, r *http.Request)
- func (h *Handlers) Logout(w http.ResponseWriter, r *http.Request)
- func (h *Handlers) ProductsGet(w http.ResponseWriter, r *http.Request)
- func (h *Handlers) ProductsGetMany(w http.ResponseWriter, r *http.Request)
- func (h *Handlers) Refresh(w http.ResponseWriter, r *http.Request)
- func (h *Handlers) Registration(w http.ResponseWriter, r *http.Request)
- func (h *Handlers) ReviewsCreate(w http.ResponseWriter, r *http.Request)
- func (h *Handlers) ReviewsGet(w http.ResponseWriter, r *http.Request)
- func (h *Handlers) ReviewsUpdate(w http.ResponseWriter, r *http.Request)
- type IUserAPILogic
- type UserAPILogic
- func (l *UserAPILogic) CreateReview(rc models.ReviewCreate, userID uuid.UUID) error
- func (l *UserAPILogic) CreateUser(req models.CreateUser) (models.UserResponse, error)
- func (l *UserAPILogic) GetProduct(productId int) (models.Product, error)
- func (l *UserAPILogic) GetProducts(after, limit, year int, genre string) ([]models.Product, error)
- func (l *UserAPILogic) GetReviews(productId int) ([]models.Review, error)
- func (l *UserAPILogic) GraphqlList(query string) (*graphql.Result, error)
- func (l *UserAPILogic) ListGenres() ([]models.Genre, error)
- func (l *UserAPILogic) Login(username, password string) (models.UserResponse, error)
- func (l *UserAPILogic) Logout(token string) error
- func (l *UserAPILogic) Refresh(token string) (models.UserResponse, error)
- func (l *UserAPILogic) UpdateReview(rc models.ReviewUpdate, userID uuid.UUID) error
- type UserAPIService
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Handlers ¶
type Handlers struct {
// contains filtered or unexported fields
}
func NewUserAPIHandlers ¶
func NewUserAPIHandlers(u IUserAPILogic, l logger.ILogger) *Handlers
func (*Handlers) GraphqlList ¶
func (h *Handlers) GraphqlList(w http.ResponseWriter, r *http.Request)
func (*Handlers) ProductsGet ¶
func (h *Handlers) ProductsGet(w http.ResponseWriter, r *http.Request)
func (*Handlers) ProductsGetMany ¶
func (h *Handlers) ProductsGetMany(w http.ResponseWriter, r *http.Request)
func (*Handlers) Registration ¶
func (h *Handlers) Registration(w http.ResponseWriter, r *http.Request)
func (*Handlers) ReviewsCreate ¶
func (h *Handlers) ReviewsCreate(w http.ResponseWriter, r *http.Request)
func (*Handlers) ReviewsGet ¶
func (h *Handlers) ReviewsGet(w http.ResponseWriter, r *http.Request)
func (*Handlers) ReviewsUpdate ¶
func (h *Handlers) ReviewsUpdate(w http.ResponseWriter, r *http.Request)
type IUserAPILogic ¶
type IUserAPILogic interface { GetReviews(productId int) ([]models.Review, error) GetProduct(productId int) (models.Product, error) GetProducts(after, limit, year int, genre string) ([]models.Product, error) CreateReview(rc models.ReviewCreate, userID uuid.UUID) error UpdateReview(rc models.ReviewUpdate, id uuid.UUID) error CreateUser(req models.CreateUser) (models.UserResponse, error) Login(username, password string) (models.UserResponse, error) Logout(token string) error Refresh(token string) (models.UserResponse, error) ListGenres() ([]models.Genre, error) GraphqlList(query string) (*graphql.Result, error) }
func NewUserAPILogic ¶
func NewUserAPILogic(repositoryPool *repo.UserAPIRepository, log logger.ILogger) IUserAPILogic
type UserAPILogic ¶
type UserAPILogic struct {
// contains filtered or unexported fields
}
func (*UserAPILogic) CreateReview ¶
func (l *UserAPILogic) CreateReview(rc models.ReviewCreate, userID uuid.UUID) error
func (*UserAPILogic) CreateUser ¶
func (l *UserAPILogic) CreateUser(req models.CreateUser) (models.UserResponse, error)
func (*UserAPILogic) GetProduct ¶
func (l *UserAPILogic) GetProduct(productId int) (models.Product, error)
func (*UserAPILogic) GetProducts ¶
func (*UserAPILogic) GetReviews ¶
func (l *UserAPILogic) GetReviews(productId int) ([]models.Review, error)
func (*UserAPILogic) GraphqlList ¶
func (l *UserAPILogic) GraphqlList(query string) (*graphql.Result, error)
func (*UserAPILogic) ListGenres ¶
func (l *UserAPILogic) ListGenres() ([]models.Genre, error)
func (*UserAPILogic) Login ¶
func (l *UserAPILogic) Login(username, password string) (models.UserResponse, error)
func (*UserAPILogic) Logout ¶
func (l *UserAPILogic) Logout(token string) error
func (*UserAPILogic) Refresh ¶
func (l *UserAPILogic) Refresh(token string) (models.UserResponse, error)
func (*UserAPILogic) UpdateReview ¶
func (l *UserAPILogic) UpdateReview(rc models.ReviewUpdate, userID uuid.UUID) error
type UserAPIService ¶
type UserAPIService struct {
// contains filtered or unexported fields
}
func NewUserAPIService ¶
func NewUserAPIService(repositoryPool *repo.UserAPIRepository, log logger.ILogger) *UserAPIService
func (*UserAPIService) Name ¶
func (s *UserAPIService) Name() string
func (*UserAPIService) Router ¶
func (s *UserAPIService) Router(r *mux.Router, mw *middleware.Middleware)
func (*UserAPIService) Start ¶
func (s *UserAPIService) Start() error
func (*UserAPIService) Stop ¶
func (s *UserAPIService) Stop() error
Click to show internal directories.
Click to hide internal directories.