Move handler objects to common location to share with RMO

This commit is contained in:
Eli Ribble 2026-03-03 17:08:58 +00:00
parent 87fe5ec2e5
commit 0f6da8e25f
No known key found for this signature in database
33 changed files with 449 additions and 308 deletions

View file

@ -38,3 +38,15 @@ func RespondError(w http.ResponseWriter, m string, e error, s int) {
log.Warn().Int("status", s).Err(e).Str("user message", m).Msg("Responding with an error")
http.Error(w, m, s)
}
type Response[T any] struct {
Content T
Template string
}
func NewResponse[T any](template string, content T) *Response[T] {
return &Response[T]{
Content: content,
Template: template,
}
}