Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Handler ¶
func NewHandler ¶
func NewHandler(postgresRead relational.InterfaceRead, postgresWrite relational.InterfaceWrite) *Handler
func (*Handler) Delete ¶
func (h *Handler) Delete(w http.ResponseWriter, r *http.Request)
@Tags Tokens @Security ApiKeyAuth @Description Delete a company token @ID company-delete-token @Param companyID path string true "companyID of the company" @Param tokenID path string true "ID of the token" @Success 204 {object} http.Response{content=string} "NO CONTENT" @Success 400 {object} http.Response{content=string} "BAD REQUEST" @Success 401 {object} http.Response{content=string} "UNAUTHORIZED" @Failure 500 {object} http.Response{content=string} "INTERNAL SERVER ERROR" @Router /api/companies/{companyID}/tokens/{tokenID} [delete]
func (*Handler) Get ¶
func (h *Handler) Get(w http.ResponseWriter, r *http.Request)
@Tags Tokens @Security ApiKeyAuth @Description Delete a company token @ID company-get-all-token @Param companyID path string true "companyID of the company" @Success 200 {object} http.Response{content=string} "OK" @Success 400 {object} http.Response{content=string} "BAD REQUEST" @Success 401 {object} http.Response{content=string} "UNAUTHORIZED" @Failure 500 {object} http.Response{content=string} "INTERNAL SERVER ERROR" @Router /api/companies/{companyID}/tokens [get]
func (*Handler) Post ¶
func (h *Handler) Post(w http.ResponseWriter, r *http.Request)
@Tags Tokens @Security ApiKeyAuth @Description Create a new company token @ID company-new-token @Accept json @Produce json @Param companyID path string true "companyID of the company" @Param Token body api.Token true "token info" @Success 200 {object} http.Response{content=string} "CREATED" @Success 400 {object} http.Response{content=string} "BAD REQUEST" @Success 401 {object} http.Response{content=string} "UNAUTHORIZED" @Success 422 {object} http.Response{content=string} "UNPROCESSABLE ENTITY" @Failure 500 {object} http.Response{content=string} "INTERNAL SERVER ERROR" @Router /api/companies/{companyID}/tokens [post]