improve shutdown and app service boilerplate
All checks were successful
Build and Publish / check-chart (push) Successful in 14s
Build and Publish / helm-release (push) Has been skipped
Build and Publish / release (push) Successful in 4m30s

This commit is contained in:
2025-07-20 18:16:12 -04:00
parent 378df897b2
commit c1c296a0c0
11 changed files with 185 additions and 98 deletions

View File

@ -0,0 +1,44 @@
package demohttp
import (
"context"
"net/http"
"gitea.libretechconsulting.com/rmcguire/go-app/pkg/srv/http/opts"
"gitea.libretechconsulting.com/rmcguire/go-server-with-otel/pkg/config"
)
type DemoHTTPServer struct {
ctx context.Context
cfg *config.ServiceConfig
}
func NewDemoHTTPServer(ctx context.Context, cfg *config.ServiceConfig) *DemoHTTPServer {
return &DemoHTTPServer{
ctx: ctx,
cfg: cfg,
}
}
func (dh *DemoHTTPServer) GetHandleFuncs() []opts.HTTPFunc {
// TODO: Implement real http handle funcs
return []opts.HTTPFunc{
{
Path: "/test",
HandlerFunc: func(w http.ResponseWriter, r *http.Request) {
w.WriteHeader(http.StatusNotImplemented)
w.Write([]byte("unimplemented demo app"))
},
},
}
}
func (dh *DemoHTTPServer) GetHealthCheckFuncs() []opts.HealthCheckFunc {
return []opts.HealthCheckFunc{
func(ctx context.Context) error {
// TODO: Implement real health checks
return nil
},
}
}