user_api

package
v0.0.0-...-da5a4cc Latest Latest
Warning

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

Go to latest
Published: May 18, 2023 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetFields

func GetFields(products []models.Product) graphql.Fields

Types

type Handlers

type Handlers struct {
	// contains filtered or unexported fields
}

func NewUserAPIHandlers

func NewUserAPIHandlers(u IUserAPILogic, l logger.ILogger) *Handlers

func (*Handlers) GenresGet

func (h *Handlers) GenresGet(w http.ResponseWriter, r *http.Request)

func (*Handlers) GraphqlList

func (h *Handlers) GraphqlList(w http.ResponseWriter, r *http.Request)

func (*Handlers) Login

func (h *Handlers) Login(w http.ResponseWriter, r *http.Request)

func (*Handlers) Logout

func (h *Handlers) Logout(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) Refresh

func (h *Handlers) Refresh(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 (l *UserAPILogic) GetProducts(after, limit, year int, genre string) ([]models.Product, error)

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

Jump to

Keyboard shortcuts

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