Documentation ¶
Index ¶
- type Handler
- func (h *Handler) Create(w http.ResponseWriter, r *http.Request)
- func (h *Handler) CreateToken(w http.ResponseWriter, r *http.Request)
- func (h *Handler) Delete(w http.ResponseWriter, r *http.Request)
- func (h *Handler) DeleteToken(w http.ResponseWriter, r *http.Request)
- func (h *Handler) Get(w http.ResponseWriter, r *http.Request)
- func (h *Handler) GetUsers(w http.ResponseWriter, r *http.Request)
- func (h *Handler) InviteUser(w http.ResponseWriter, r *http.Request)
- func (h *Handler) List(w http.ResponseWriter, r *http.Request)
- func (h *Handler) ListTokens(w http.ResponseWriter, r *http.Request)
- func (h *Handler) Options(w http.ResponseWriter, _ *http.Request)
- func (h *Handler) RemoveUser(w http.ResponseWriter, r *http.Request)
- func (h *Handler) Update(w http.ResponseWriter, r *http.Request)
- func (h *Handler) UpdateRole(w http.ResponseWriter, r *http.Request)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
func NewRepositoryHandler ¶
func NewRepositoryHandler(useCases repositoryUseCases.IUseCases, controller repositoryController.IController, appConfig app.IConfig, authGRPC proto.AuthServiceClient, useCasesRole roleUseCases.IUseCases, useCasesToken tokenUseCases.IUseCases) *Handler
func (*Handler) Create ¶
func (h *Handler) Create(w http.ResponseWriter, r *http.Request)
@Tags Repository @Description Create a new repository @ID create-repository @Accept json @Produce json @Param workspaceID path string true "ID of the workspace" @Param Repository body repositoryEntities.Data true "create repository data" @Success 201 {object} entities.Response @Failure 400 {object} entities.Response @Failure 401 {object} entities.Response @Failure 500 {object} entities.Response @Router /core/workspaces/{workspaceID}/repositories [post] @Security ApiKeyAuth
func (*Handler) CreateToken ¶
func (h *Handler) CreateToken(w http.ResponseWriter, r *http.Request)
@Tags Repository @Description Create a new repository token @ID create-repository-token @Accept json @Produce json @Param workspaceID path string true "ID of the workspace" @Param repositoryID path string true "ID of the repository" @Param Token body tokenEntities.Data true "create repository token data" @Success 201 {object} entities.Response @Failure 400 {object} entities.Response @Failure 401 {object} entities.Response @Failure 500 {object} entities.Response @Router /core/workspaces/{workspaceID}/repositories/{repositoryID}/tokens [post] @Security ApiKeyAuth
func (*Handler) Delete ¶
func (h *Handler) Delete(w http.ResponseWriter, r *http.Request)
@Tags Repository @Description Delete a repository by id @ID delete-repository @Accept json @Produce json @Param workspaceID path string true "ID of the workspace" @Param repositoryID path string true "ID of the repository" @Success 204 {object} entities.Response @Failure 400 {object} entities.Response @Failure 401 {object} entities.Response @Failure 404 {object} entities.Response @Failure 500 {object} entities.Response @Router /core/workspaces/{workspaceID}/repositories/{repositoryID} [delete] @Security ApiKeyAuth
func (*Handler) DeleteToken ¶
func (h *Handler) DeleteToken(w http.ResponseWriter, r *http.Request)
@Tags Repository @Description Delete a repository token @ID delete-repository-token @Accept json @Produce json @Param workspaceID path string true "ID of the workspace" @Param repositoryID path string true "ID of the repository" @Param tokenID path string true "ID of the token" @Success 204 {object} entities.Response @Failure 400 {object} entities.Response @Failure 401 {object} entities.Response @Failure 500 {object} entities.Response @Router /core/workspaces/{workspaceID}/repositories/{repositoryID}/tokens/{tokenID} [delete] @Security ApiKeyAuth
func (*Handler) Get ¶
func (h *Handler) Get(w http.ResponseWriter, r *http.Request)
@Tags Repository @Description Search for a existing repository by id @ID get-repository @Accept json @Produce json @Param workspaceID path string true "ID of the workspace" @Param repositoryID path string true "ID of the repository" @Success 200 {object} entities.Response @Failure 400 {object} entities.Response @Failure 401 {object} entities.Response @Failure 404 {object} entities.Response @Failure 500 {object} entities.Response @Router /core/workspaces/{workspaceID}/repositories/{repositoryID} [get] @Security ApiKeyAuth
func (*Handler) GetUsers ¶
func (h *Handler) GetUsers(w http.ResponseWriter, r *http.Request)
@Tags Repository @Description Get all users of a repository @ID get-repository-users @Accept json @Produce json @Param workspaceID path string true "ID of the workspace" @Param repositoryID path string true "ID of the repository" @Success 200 {object} entities.Response @Failure 400 {object} entities.Response @Failure 401 {object} entities.Response @Failure 404 {object} entities.Response @Failure 500 {object} entities.Response @Router /core/workspaces/{workspaceID}/repositories/{repositoryID}/roles [get] @Security ApiKeyAuth
func (*Handler) InviteUser ¶
func (h *Handler) InviteUser(w http.ResponseWriter, r *http.Request)
@Tags Repository @Description Invite a user to a repository @ID invite-user-repository @Accept json @Produce json @Param workspaceID path string true "ID of the workspace" @Param repositoryID path string true "ID of the repository" @Param User Data body roleEntities.UserData true "user account data" @Success 200 {object} entities.Response @Failure 400 {object} entities.Response @Failure 401 {object} entities.Response @Failure 404 {object} entities.Response @Failure 500 {object} entities.Response @Router /core/workspaces/{workspaceID}/repositories/{repositoryID}/roles [post] @Security ApiKeyAuth
func (*Handler) List ¶
func (h *Handler) List(w http.ResponseWriter, r *http.Request)
@Tags Repository @Description List all repositories of an account in a workspace @ID list-repositories @Accept json @Produce json @Param workspaceID path string true "ID of the workspace" @Success 200 {object} entities.Response @Failure 400 {object} entities.Response @Failure 401 {object} entities.Response @Failure 500 {object} entities.Response @Router /core/workspaces/{workspaceID}/repositories [get] @Security ApiKeyAuth
func (*Handler) ListTokens ¶
func (h *Handler) ListTokens(w http.ResponseWriter, r *http.Request)
@Tags Repository @Description List all repository tokens @ID list-repository-tokens @Accept json @Produce json @Param workspaceID path string true "ID of the workspace" @Param repositoryID path string true "ID of the repository" @Success 201 {object} entities.Response @Failure 400 {object} entities.Response @Failure 401 {object} entities.Response @Failure 500 {object} entities.Response @Router /core/workspaces/{workspaceID}/repositories/{repositoryID}/tokens [get] @Security ApiKeyAuth
func (*Handler) RemoveUser ¶
func (h *Handler) RemoveUser(w http.ResponseWriter, r *http.Request)
@Tags Repository @Description Remove a user from a repository @ID remove-repository-user @Accept json @Produce json @Param workspaceID path string true "ID of the workspace" @Param repositoryID path string true "ID of the repository" @Param accountID path string true "ID of the account" @Success 200 {object} entities.Response @Failure 400 {object} entities.Response @Failure 401 {object} entities.Response @Failure 404 {object} entities.Response @Failure 500 {object} entities.Response @Router /core/workspaces/{workspaceID}/repositories/{repositoryID}/roles/{accountID} [delete] @Security ApiKeyAuth
func (*Handler) Update ¶
func (h *Handler) Update(w http.ResponseWriter, r *http.Request)
@Tags Repository @Description Updates a existing repository by id @ID update-repository @Accept json @Produce json @Param workspaceID path string true "ID of the workspace" @Param repositoryID path string true "ID of the repository" @Param Repository body repositoryEntities.Data true "update repository data" @Success 200 {object} entities.Response @Failure 400 {object} entities.Response @Failure 401 {object} entities.Response @Failure 404 {object} entities.Response @Failure 500 {object} entities.Response @Router /core/workspaces/{workspaceID}/repositories/{repositoryID} [patch] @Security ApiKeyAuth
func (*Handler) UpdateRole ¶
func (h *Handler) UpdateRole(w http.ResponseWriter, r *http.Request)
@Tags Repository @Description Update an account role of a repository @ID update-repository-role @Accept json @Produce json @Param workspaceID path string true "ID of the workspace" @Param accountID path string true "ID of the account" @Param repositoryID path string true "ID of the repository" @Param Role body roleEntities.Data true "update role of a account in a specific workspace" @Success 200 {object} entities.Response @Failure 400 {object} entities.Response @Failure 401 {object} entities.Response @Failure 404 {object} entities.Response @Failure 500 {object} entities.Response @Router /core/workspaces/{workspaceID}/repositories/{repositoryID}/roles/{accountID} [patch] @Security ApiKeyAuth