Documentation ¶
Index ¶
- type Handler
- func (h *Handler) Create(w netHttp.ResponseWriter, r *netHttp.Request)
- func (h *Handler) Delete(w netHttp.ResponseWriter, r *netHttp.Request)
- func (h *Handler) Get(w netHttp.ResponseWriter, r *netHttp.Request)
- func (h *Handler) GetAccounts(w netHttp.ResponseWriter, r *netHttp.Request)
- func (h *Handler) InviteUser(w netHttp.ResponseWriter, r *netHttp.Request)
- func (h *Handler) List(w netHttp.ResponseWriter, r *netHttp.Request)
- func (h *Handler) RemoveUser(w netHttp.ResponseWriter, r *netHttp.Request)
- func (h *Handler) Update(w netHttp.ResponseWriter, r *netHttp.Request)
- func (h *Handler) UpdateAccountRepository(w netHttp.ResponseWriter, r *netHttp.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(databaseWrite SQL.InterfaceWrite, databaseRead SQL.InterfaceRead, broker brokerLib.IBroker, appConfig app.IAppConfig) *Handler
func (*Handler) Create ¶
func (h *Handler) Create(w netHttp.ResponseWriter, r *netHttp.Request)
@Tags Repositories @Description create repository! @ID create-repository @Accept json @Produce json @Param Repository body account.Repository true "repository info" @Param companyID path string true "companyID of the repository" @Success 201 {object} http.Response{content=string} "CREATED" @Failure 400 {object} http.Response{content=string} "BAD REQUEST" @Failure 500 {object} http.Response{content=string} "INTERNAL SERVER ERROR" @Router /api/companies/{companyID}/repositories [post] @Security ApiKeyAuth
func (*Handler) Delete ¶
func (h *Handler) Delete(w netHttp.ResponseWriter, r *netHttp.Request)
@Tags Repositories @Description delete repository! @ID delete-repository @Accept json @Produce json @Param repositoryID path string true "repositoryID of the repository" @Param companyID path string true "companyID of the company" @Success 204 {object} http.Response{content=string} "NO CONTENT" @Failure 400 {object} http.Response{content=string} "BAD REQUEST" @Failure 500 {object} http.Response{content=string} "INTERNAL SERVER ERROR" @Router /api/companies/{companyID}/repositories/{repositoryID} [delete] @Security ApiKeyAuth
func (*Handler) Get ¶
func (h *Handler) Get(w netHttp.ResponseWriter, r *netHttp.Request)
@Tags Repositories @Description get repository! @ID get-repository @Accept json @Produce json @Param companyID path string true "companyID of the repository" @Param repositoryID path string true "repositoryID of the repository" @Success 200 {object} http.Response{content=string} "OK" @Failure 400 {object} http.Response{content=string} "BAD REQUEST" @Failure 404 {object} http.Response{content=string} "NOT FOUND" @Failure 500 {object} http.Response{content=string} "INTERNAL SERVER ERROR" @Router /api/companies/{companyID}/repositories/{repositoryID} [get] @Security ApiKeyAuth
func (*Handler) GetAccounts ¶
func (h *Handler) GetAccounts(w netHttp.ResponseWriter, r *netHttp.Request)
@Tags Repositories @Description get all accounts in a repository! @ID get-repository-accounts @Accept json @Produce json @Param repositoryID path string true "repositoryID of the repository" @Param companyID path string true "companyID of the company" @Success 200 {object} http.Response{content=string} "OK" @Failure 400 {object} http.Response{content=string} "BAD REQUEST" @Failure 500 {object} http.Response{content=string} "INTERNAL SERVER ERROR" @Router /api/companies/{companyID}/repositories/{repositoryID}/roles [get] @Security ApiKeyAuth
func (*Handler) InviteUser ¶
func (h *Handler) InviteUser(w netHttp.ResponseWriter, r *netHttp.Request)
@Tags Repositories @Description invite user to repository! @ID invite-user-repository @Accept json @Produce json @Param InviteUser body dto.InviteUser true "invite user info" @Param companyID path string true "companyID of the repository" @Param repositoryID path string true "repositoryID of the repository" @Success 204 {object} http.Response{content=string} "NO CONTENT" @Failure 400 {object} http.Response{content=string} "BAD REQUEST" @Failure 404 {object} http.Response{content=string} "NOT FOUND" @Failure 409 {object} http.Response{content=string} "CONFLICT" @Failure 500 {object} http.Response{content=string} "INTERNAL SERVER ERROR" @Router /api/companies/{companyID}/repositories/{repositoryID}/roles [post] @Security ApiKeyAuth
func (*Handler) List ¶
func (h *Handler) List(w netHttp.ResponseWriter, r *netHttp.Request)
@Tags Repositories @Description list repositories! @ID list-repository @Accept json @Produce json @Param companyID path string true "companyID of the repository" @Success 200 {object} http.Response{content=string} "OK" @Failure 400 {object} http.Response{content=string} "BAD REQUEST" @Failure 404 {object} http.Response{content=string} "NOT FOUND" @Failure 500 {object} http.Response{content=string} "INTERNAL SERVER ERROR" @Router /api/companies/{companyID}/repositories [get] @Security ApiKeyAuth
func (*Handler) RemoveUser ¶
func (h *Handler) RemoveUser(w netHttp.ResponseWriter, r *netHttp.Request)
@Tags Repositories @Description remove user from repository! @ID remove-user-repository @Accept json @Produce json @Param companyID path string true "companyID of the company" @Param repositoryID path string true "repositoryID of the repository" @Param accountID path string true "accountID of the account" @Success 204 {object} http.Response{content=string} "NO CONTENT" @Failure 400 {object} http.Response{content=string} "BAD REQUEST" @Failure 404 {object} http.Response{content=string} "NOT FOUND" @Failure 500 {object} http.Response{content=string} "INTERNAL SERVER ERROR" @Router /api/companies/{companyID}/repositories/{repositoryID}/roles/{accountID} [delete] @Security ApiKeyAuth
func (*Handler) Update ¶
func (h *Handler) Update(w netHttp.ResponseWriter, r *netHttp.Request)
@Tags Repositories @Description update repository! @ID update-repository @Accept json @Produce json @Param Repository body account.Repository true "repository info" @Param companyID path string true "companyID of the repository" @Param repositoryID path string true "repositoryID of the repository" @Success 204 {object} http.Response{content=string} "NO CONTENT" @Failure 400 {object} http.Response{content=string} "BAD REQUEST" @Failure 404 {object} http.Response{content=string} "NOT FOUND" @Failure 500 {object} http.Response{content=string} "INTERNAL SERVER ERROR" @Router /api/companies/{companyID}/repositories/{repositoryID} [patch] @Security ApiKeyAuth
func (*Handler) UpdateAccountRepository ¶
func (h *Handler) UpdateAccountRepository(w netHttp.ResponseWriter, r *netHttp.Request)
@Tags Repositories @Description update account repository! @ID update-account-repository @Accept json @Produce json @Param AccountRepository body roles.AccountRepository true "account repository info" @Param companyID path string true "companyID of the repository" @Param repositoryID path string true "repositoryID of the repository" @Param accountID path string true "accountID of the repository" @Success 204 {object} http.Response{content=string} "NO CONTENT" @Failure 400 {object} http.Response{content=string} "BAD REQUEST" @Failure 404 {object} http.Response{content=string} "NOT FOUND" @Failure 500 {object} http.Response{content=string} "INTERNAL SERVER ERROR" @Router /api/companies/{companyID}/repositories/{repositoryID}/roles/{accountID} [patch] @Security ApiKeyAuth