Feat(Initial): Initial Go codebase
All checks were successful
Webhook-Everything/Webhook-Everything/pipeline/head This commit looks good

This commit is contained in:
2022-05-29 00:06:52 +08:00
parent f31bc0cd52
commit 53829a2788
27 changed files with 1489 additions and 0 deletions

View File

@@ -0,0 +1,24 @@
package common
import (
"net/http"
"github.com/go-chi/render"
)
type TextResponse struct {
Status string `json:"status"` // user-level status message
Text string `json:"text"` // application-specific error code
}
func (e *TextResponse) Render(w http.ResponseWriter, r *http.Request) error {
render.Status(r, http.StatusOK)
return nil
}
func NewGenericTextResponse(status string, text string) render.Renderer {
return &TextResponse{
Status: status,
Text: text,
}
}