Documentation ¶
Index ¶
- type Handler
- func (h *Handler) Create(w netHTTP.ResponseWriter, r *netHTTP.Request)
- func (h *Handler) ListAll(w netHTTP.ResponseWriter, r *netHTTP.Request)
- func (h *Handler) Options(w netHTTP.ResponseWriter, r *netHTTP.Request)
- func (h *Handler) Remove(w netHTTP.ResponseWriter, r *netHTTP.Request)
- func (h *Handler) Update(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 NewHandler ¶
func NewHandler(databaseWrite SQL.InterfaceWrite, databaseRead SQL.InterfaceRead) *Handler
func (*Handler) Create ¶
func (h *Handler) Create(w netHTTP.ResponseWriter, r *netHTTP.Request)
@Tags Webhooks @Description create webhook! @ID create-webhook @Accept json @Produce json @Param Webhook body webhook.Webhook{headers=[]webhook.Headers} true "webhook info, method allowed is POST" @Param companyID path string true "companyID of the webhook" @Param repositoryID path string true "repositoryID of the webhook" @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/webhook/{companyID}/{repositoryID} [post] @Security ApiKeyAuth
func (*Handler) ListAll ¶
func (h *Handler) ListAll(w netHTTP.ResponseWriter, r *netHTTP.Request)
@Tags Webhooks @Description get webhook! @ID get-webhook @Accept json @Produce json @Param companyID path string true "companyID of the webhook" @Success 200 {object} http.Response{content=[]webhook.ResponseWebhook{headers=[]webhook.Headers,repository=account.RepositoryResponse}} "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/webhook/{companyID} [get] @Security ApiKeyAuth
func (*Handler) Remove ¶
func (h *Handler) Remove(w netHTTP.ResponseWriter, r *netHTTP.Request)
@Tags Webhooks @Description get webhook by repositoryID! @ID delete-webhook @Accept json @Produce json @Param companyID path string true "companyID of the webhook" @Param repositoryID path string true "repositoryID of the webhook" @Param webhookID path string true "webhookID of the webhook" @Success 204 @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/webhook/{companyID}/{repositoryID}/{webhookID} [delete] @Security ApiKeyAuth
func (*Handler) Update ¶
func (h *Handler) Update(w netHTTP.ResponseWriter, r *netHTTP.Request)
@Tags Webhooks @Description get webhook by repositoryID! @ID update-webhook @Accept json @Produce json @Param Webhook body webhook.Webhook{headers=[]webhook.Headers} true "webhook info, method allowed is POST" @Param companyID path string true "companyID of the webhook" @Param repositoryID path string true "repositoryID of the webhook" @Param webhookID path string true "webhookID of the webhook" @Success 204 @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/webhook/{companyID}/{repositoryID}/{webhookID} [put] @Security ApiKeyAuth