Documentation
¶
Overview ¶
Package v1 implements routing paths. Each services in own file.
Index ¶
- func NewRouter(handler *gin.Engine, l logger.Interface, t usecase.GophKeeper)
- type GophKeeperRoutes
- func (r *GophKeeperRoutes) AddBinary(ctx *gin.Context)
- func (r *GophKeeperRoutes) AddBinaryMeta(ctx *gin.Context)
- func (r *GophKeeperRoutes) AddCard(ctx *gin.Context)
- func (r *GophKeeperRoutes) AddLogin(ctx *gin.Context)
- func (r *GophKeeperRoutes) AddNote(ctx *gin.Context)
- func (r *GophKeeperRoutes) DelBinary(ctx *gin.Context)
- func (r *GophKeeperRoutes) DelCard(ctx *gin.Context)
- func (r *GophKeeperRoutes) DelLogin(ctx *gin.Context)
- func (r *GophKeeperRoutes) DelNote(ctx *gin.Context)
- func (r *GophKeeperRoutes) DownloadBinary(ctx *gin.Context)
- func (r *GophKeeperRoutes) GetBinaries(ctx *gin.Context)
- func (r *GophKeeperRoutes) GetCards(ctx *gin.Context)
- func (r *GophKeeperRoutes) GetLogins(ctx *gin.Context)
- func (r *GophKeeperRoutes) GetNotes(ctx *gin.Context)
- func (r *GophKeeperRoutes) HealthCheck(ctx *gin.Context)
- func (r *GophKeeperRoutes) LogoutUser(ctx *gin.Context)
- func (r *GophKeeperRoutes) ProtectedByAccessToken() gin.HandlerFunc
- func (r *GophKeeperRoutes) RefreshAccessToken(ctx *gin.Context)
- func (r *GophKeeperRoutes) SignInUser(ctx *gin.Context)
- func (r *GophKeeperRoutes) SignUpUser(ctx *gin.Context)
- func (r *GophKeeperRoutes) UpdateCard(ctx *gin.Context)
- func (r *GophKeeperRoutes) UpdateLogin(ctx *gin.Context)
- func (r *GophKeeperRoutes) UpdateNote(ctx *gin.Context)
- func (r *GophKeeperRoutes) UserInfo(ctx *gin.Context)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type GophKeeperRoutes ¶
type GophKeeperRoutes struct {
// contains filtered or unexported fields
}
func (*GophKeeperRoutes) AddBinary ¶
func (r *GophKeeperRoutes) AddBinary(ctx *gin.Context)
@Summary Add user binary data @Description saving user binary data @ID add_binary @Tags Binary @Param Authorization header string true "Insert your access token" default(Bearer <Add access token here>) @Param file formData file true "Body with binary file" @Param name query string true "name for entity" @Accept json @Produce json @Success 201 {object} []entity.Binary @Failure 401 {object} response @Failure 500 {object} response @Router /user/binary [post].
func (*GophKeeperRoutes) AddBinaryMeta ¶
func (r *GophKeeperRoutes) AddBinaryMeta(ctx *gin.Context)
@Summary Add meta data for binary file @Description saving meta data @ID add_binary_meta @Tags Binary @Param Authorization header string true "Insert your access token" default(Bearer <Add access token here>) @Param id path string true "Binary ID" @Param request body []entity.Meta true "meta for save" @Accept json @Produce json @Success 202 {object} []entity.Meta @Failure 401 {object} response @Failure 500 {object} response @Router /user/binary/{id}/meta [post].
func (*GophKeeperRoutes) AddCard ¶
func (r *GophKeeperRoutes) AddCard(ctx *gin.Context)
@Summary Add user card @Description new user card @ID add_card @Tags Cards @Param Authorization header string true "Insert your access token" default(Bearer <Add access token here>) @Accept json @Produce json @Param request body entity.Card true "card for save" @Success 201 {object} entity.Card @Failure 400 {object} response @Failure 401 {object} response @Failure 500 {object} response @Router /user/cards [post].
func (*GophKeeperRoutes) AddLogin ¶
func (r *GophKeeperRoutes) AddLogin(ctx *gin.Context)
@Summary Add user login @Description new user login @ID add_login @Tags Logins @Param Authorization header string true "Insert your access token" default(Bearer <Add access token here>) @Accept json @Produce json @Param request body entity.Login true "card for save" @Success 201 {object} entity.Login @Failure 400 {object} response @Failure 401 {object} response @Failure 500 {object} response @Router /user/logins [post].
func (*GophKeeperRoutes) AddNote ¶
func (r *GophKeeperRoutes) AddNote(ctx *gin.Context)
@Summary Add user note @Description new user note @ID add_note @Tags Notes @Param Authorization header string true "Insert your access token" default(Bearer <Add access token here>) @Accept json @Produce json @Param request body entity.SecretNote true "note for save" @Success 201 {object} entity.SecretNote @Failure 400 {object} response @Failure 401 {object} response @Failure 500 {object} response @Router /user/notes [post].
func (*GophKeeperRoutes) DelBinary ¶
func (r *GophKeeperRoutes) DelBinary(ctx *gin.Context)
@Summary Delete user binary @Description del user file @ID del_binary @Tags Binary @Param Authorization header string true "Insert your access token" default(Bearer <Add access token here>) @Param id path string true "Binary ID" @Success 202 @Failure 400 {object} response @Failure 401 {object} response @Failure 500 {object} response @Router /user/binary/{id} [delete].
func (*GophKeeperRoutes) DelCard ¶
func (r *GophKeeperRoutes) DelCard(ctx *gin.Context)
@Summary Delete user card @Description del user card @ID del_card @Tags Cards @Param Authorization header string true "Insert your access token" default(Bearer <Add access token here>) @Param id path string true "Card ID" @Success 202 @Failure 400 {object} response @Failure 401 {object} response @Failure 500 {object} response @Router /user/cards/{id} [delete].
func (*GophKeeperRoutes) DelLogin ¶
func (r *GophKeeperRoutes) DelLogin(ctx *gin.Context)
@Summary Delete user login @Description del user login @ID del_login @Tags Logins @Param Authorization header string true "Insert your access token" default(Bearer <Add access token here>) @Param id path string true "login ID" @Success 202 @Failure 400 {object} response @Failure 401 {object} response @Failure 500 {object} response @Router /user/logins/{id} [delete].
func (*GophKeeperRoutes) DelNote ¶
func (r *GophKeeperRoutes) DelNote(ctx *gin.Context)
@Summary Delete user note @Description del user note @ID del_note @Tags Notes @Param Authorization header string true "Insert your access token" default(Bearer <Add access token here>) @Param id path string true "Note ID" @Success 201 @Failure 400 {object} response @Failure 401 {object} response @Failure 500 {object} response @Router /user/notes/{id} [delete].
func (*GophKeeperRoutes) DownloadBinary ¶
func (r *GophKeeperRoutes) DownloadBinary(ctx *gin.Context)
@Summary Download user binary data @Description downloading user binary data @ID download_binary @Tags Binary @Param Authorization header string true "Insert your access token" default(Bearer <Add access token here>) @Param id path string true "Binary ID" @Accept json @Produce json @Success 200 {file} binary @Success 204 @Failure 400 {object} response @Failure 401 {object} response @Failure 500 {object} response @Router /user/binary/{id} [get].
func (*GophKeeperRoutes) GetBinaries ¶
func (r *GophKeeperRoutes) GetBinaries(ctx *gin.Context)
@Summary Get user binary data @Description fetching user binary data @ID get_binary @Tags Binary @Param Authorization header string true "Insert your access token" default(Bearer <Add access token here>) @Accept json @Produce json @Success 200 {object} []entity.Binary @Success 204 @Failure 401 {object} response @Failure 500 {object} response @Router /user/binary [get].
func (*GophKeeperRoutes) GetCards ¶
func (r *GophKeeperRoutes) GetCards(ctx *gin.Context)
@Summary Get user cards @Description fetching user cards @ID get_cards @Tags Cards @Param Authorization header string true "Insert your access token" default(Bearer <Add access token here>) @Accept json @Produce json @Success 200 {object} []entity.Card @Success 204 {object} response @Failure 401 {object} response @Failure 500 {object} response @Router /user/cards [get].
func (*GophKeeperRoutes) GetLogins ¶
func (r *GophKeeperRoutes) GetLogins(ctx *gin.Context)
@Summary Get user logins @Description fetching user logins @ID get_logins @Tags Logins @Param Authorization header string true "Insert your access token" default(Bearer <Add access token here>) @Accept json @Produce json @Success 200 {object} []entity.Login @Success 204 {object} response @Failure 401 {object} response @Failure 500 {object} response @Router /user/logins [get].
func (*GophKeeperRoutes) GetNotes ¶
func (r *GophKeeperRoutes) GetNotes(ctx *gin.Context)
@Summary Get user notes @Description fetching user notes @ID notes_cards @Tags Notes @Param Authorization header string true "Insert your access token" default(Bearer <Add access token here>) @Accept json @Produce json @Success 200 {object} []entity.SecretNote @Success 204 {object} response @Failure 401 {object} response @Failure 500 {object} response @Router /user/notes [get].
func (*GophKeeperRoutes) HealthCheck ¶
func (r *GophKeeperRoutes) HealthCheck(ctx *gin.Context)
HealthCheck godoc @Summary Show the status of server. @Description get the status of server. @Tags Root @Accept */* @Produce json @Success 200 @Failure 500 @Router /health [get].
func (*GophKeeperRoutes) LogoutUser ¶
func (r *GophKeeperRoutes) LogoutUser(ctx *gin.Context)
@Summary Logout @Description dropping cookies @ID logout @Tags Auth @Success 200 @Router /auth/logout [get].
func (*GophKeeperRoutes) ProtectedByAccessToken ¶
func (r *GophKeeperRoutes) ProtectedByAccessToken() gin.HandlerFunc
func (*GophKeeperRoutes) RefreshAccessToken ¶
func (r *GophKeeperRoutes) RefreshAccessToken(ctx *gin.Context)
@Summary Refresh token @Description refresh access token @ID refresh @Tags Auth @Accept json @Produce json @Success 200 {object} entity.JWT @Failure 400 {object} response @Failure 500 {object} response @Router /auth/refresh [get].
func (*GophKeeperRoutes) SignInUser ¶
func (r *GophKeeperRoutes) SignInUser(ctx *gin.Context)
@Summary Login user @Description getting user JWT @ID login @Tags Auth @Accept json @Produce json @Param request body loginPayload true "Sing in user" @Success 200 {object} entity.JWT @Failure 400 {object} response @Failure 500 {object} response @Router /auth/login [post].
func (*GophKeeperRoutes) SignUpUser ¶
func (r *GophKeeperRoutes) SignUpUser(ctx *gin.Context)
@Summary Register user @Description add new user @ID register @Tags Auth @Accept json @Produce json @Param request body loginPayload true "Sing up new user" @Success 201 {object} entity.User @Failure 400 {object} response @Failure 500 {object} response @Router /auth/register [post].
func (*GophKeeperRoutes) UpdateCard ¶
func (r *GophKeeperRoutes) UpdateCard(ctx *gin.Context)
@Summary Update user card @Description update user card @ID update_card @Tags Cards @Param Authorization header string true "Insert your access token" default(Bearer <Add access token here>) @Accept json @Produce json @Param id path string true "Card ID" @Param request body entity.Card true "card for update" @Success 202 @Failure 400 {object} response @Failure 401 {object} response @Failure 500 {object} response @Router /user/cards/{id} [patch].
func (*GophKeeperRoutes) UpdateLogin ¶
func (r *GophKeeperRoutes) UpdateLogin(ctx *gin.Context)
@Summary Update user login @Description update user login @ID update_login @Param Authorization header string true "Insert your access token" default(Bearer <Add access token here>) @Tags Logins @Accept json @Produce json @Param id path string true "Login ID" @Param request body entity.Login true "card for update" @Success 202 @Failure 400 {object} response @Failure 401 {object} response @Failure 500 {object} response @Router /user/logins/{id} [patch].
func (*GophKeeperRoutes) UpdateNote ¶
func (r *GophKeeperRoutes) UpdateNote(ctx *gin.Context)
@Summary Update user note @Description update user note @ID update_note @Tags Notes @Param Authorization header string true "Insert your access token" default(Bearer <Add access token here>) @Accept json @Produce json @Param id path string true "Note ID" @Param request body entity.SecretNote true "card for update" @Success 202 @Failure 400 {object} response @Failure 401 {object} response @Failure 500 {object} response @Router /user/notes/{id} [patch].
func (*GophKeeperRoutes) UserInfo ¶
func (r *GophKeeperRoutes) UserInfo(ctx *gin.Context)