repository

package
v0.0.0-...-46e61fc Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2022 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

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) Options

func (h *Handler) Options(w http.ResponseWriter, _ *http.Request)

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

Jump to

Keyboard shortcuts

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