Documentation
¶
Index ¶
- func CorsMiddleware(next http.Handler) http.Handler
- type CompileRequest
- type EmailSubscriptionRequest
- type EmailSubscriptionResponse
- type ErrorResponse
- type FixCodeRequest
- type FixCodeResponse
- type FmtResponse
- type GetExecutionStepsRequest
- type Handler
- func (h *Handler) HandleCompile(w http.ResponseWriter, r *http.Request)
- func (h *Handler) HandleDashboard(w http.ResponseWriter, r *http.Request)
- func (h *Handler) HandleEmailSubscription(w http.ResponseWriter, r *http.Request)
- func (h *Handler) HandleFixCode(w http.ResponseWriter, r *http.Request)
- func (h *Handler) HandleFmt(w http.ResponseWriter, r *http.Request)
- func (h *Handler) HandleGetExecutionSteps(w http.ResponseWriter, r *http.Request)
- func (h *Handler) HandleHealthz(w http.ResponseWriter, _ *http.Request)
- func (h *Handler) HandleUnsubscribe(w http.ResponseWriter, r *http.Request)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CompileRequest ¶
type CompileRequest struct {
SourceCode string `json:"source_code"`
}
CompileRequest is the request for the Compile method
type EmailSubscriptionRequest ¶
type EmailSubscriptionRequest struct {
Email string `json:"email"`
}
EmailSubscriptionRequest is the request for the email subscription
type EmailSubscriptionResponse ¶
type EmailSubscriptionResponse struct {
Message string `json:"message"`
}
EmailSubscriptionResponse is the response for the email subscription
type ErrorResponse ¶
type ErrorResponse struct {
Error string `json:"error"`
}
ErrorResponse is the response in case of an error
type FixCodeRequest ¶
type FixCodeRequest struct {
SourceCode string `json:"source_code"`
Error string `json:"error,omitempty"`
}
FixCodeRequest is the request for the FixCode method
type FixCodeResponse ¶
type FixCodeResponse struct {
FixedCode string `json:"fixed_code"`
}
FixCodeResponse is the response for the FixCode method
type FmtResponse ¶
type FmtResponse struct {
Body string `json:"body"`
}
FmtResponse is the response for the Fmt request
type GetExecutionStepsRequest ¶
type GetExecutionStepsRequest struct {
SourceCode string `json:"source_code"`
}
GetExecutionStepsRequest is the request for the GetExecutionSteps method
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
func NewHandler ¶
func NewHandler(logger zerolog.Logger, db *db.DB, controller *controller.Controller, pprofPort int, containerWatcher *metrics.ContainerWatcher) *Handler
NewHandler creates a new Handler
func (*Handler) HandleCompile ¶
func (h *Handler) HandleCompile(w http.ResponseWriter, r *http.Request)
HandleCompile handles the Compile request
func (*Handler) HandleDashboard ¶
func (h *Handler) HandleDashboard(w http.ResponseWriter, r *http.Request)
HandleDashboard serves a password-protected dashboard showing DB contents.
func (*Handler) HandleEmailSubscription ¶
func (h *Handler) HandleEmailSubscription(w http.ResponseWriter, r *http.Request)
HandleEmailSubscription handles email subscription requests
func (*Handler) HandleFixCode ¶
func (h *Handler) HandleFixCode(w http.ResponseWriter, r *http.Request)
HandleFixCode handles the FixCode request using LLM
func (*Handler) HandleFmt ¶
func (h *Handler) HandleFmt(w http.ResponseWriter, r *http.Request)
HandleFmt handles the Fmt request
func (*Handler) HandleGetExecutionSteps ¶
func (h *Handler) HandleGetExecutionSteps(w http.ResponseWriter, r *http.Request)
HandleGetExecutionSteps handles the GetExecutionSteps request
func (*Handler) HandleHealthz ¶
func (h *Handler) HandleHealthz(w http.ResponseWriter, _ *http.Request)
HandleHealthz is a liveness probe. It deliberately does no work: no DB call, no semaphore acquire, no logging. If the HTTP loop is wedged this won't answer either, which is exactly the signal an external monitor needs.
func (*Handler) HandleUnsubscribe ¶
func (h *Handler) HandleUnsubscribe(w http.ResponseWriter, r *http.Request)
HandleUnsubscribe handles email unsubscribe requests via GET.