api

package
v0.0.0-...-4564669 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewRouter

func NewRouter() *chi.Mux

func SetupRoutes

func SetupRoutes(router *chi.Mux)

Types

type CreateUserProfileRequest

type CreateUserProfileRequest struct {
	UserID  int    `json:"user_id"`
	Name    string `json:"name"`
	Photo   string `json:"photo"`
	Country string `json:"country"`
	Address string `json:"address"`
	Phone   string `json:"phone"`
}

type CreateUserProfileResponse

type CreateUserProfileResponse struct {
	ID int `json:"id"`
}

type CreateUserRequest

type CreateUserRequest struct {
	Email    string `json:"email"`
	Password string `json:"password"`
}

type CreateUserResponse

type CreateUserResponse struct {
	ID int `json:"id"`
}

type GetUserProfileRequest

type GetUserProfileRequest struct {
	UserID int `json:"user_id"`
}

type GetUserRequest

type GetUserRequest struct {
	Email string `json:"email"`
}

type UpdateUserProfileRequest

type UpdateUserProfileRequest struct {
	UserID  int    `json:"user_id"`
	Name    string `json:"name"`
	Photo   string `json:"photo"`
	Country string `json:"country"`
	Address string `json:"address"`
	Phone   string `json:"phone"`
}

type UserAPI

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

func NewUserAPI

func NewUserAPI(service *service.UserService) *UserAPI

NewUserAPI returns a new user API given an instance of a user service.

func (*UserAPI) CreateUser

func (u *UserAPI) CreateUser(w http.ResponseWriter, r *http.Request)

func (*UserAPI) CreateUserProfile

func (u *UserAPI) CreateUserProfile(w http.ResponseWriter, r *http.Request)

func (*UserAPI) GetUser

func (u *UserAPI) GetUser(w http.ResponseWriter, r *http.Request)

func (*UserAPI) GetUserProfile

func (u *UserAPI) GetUserProfile(w http.ResponseWriter, r *http.Request)

func (*UserAPI) UpdateUserProfile

func (u *UserAPI) UpdateUserProfile(w http.ResponseWriter, r *http.Request)

Jump to

Keyboard shortcuts

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