support runtime.ServeMux opts for grpc-gateway
This commit is contained in:
10
app.go
10
app.go
@ -2,6 +2,7 @@ package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
|
||||
"gitea.libretechconsulting.com/rmcguire/go-app/pkg/app"
|
||||
grpcopts "gitea.libretechconsulting.com/rmcguire/go-app/pkg/srv/grpc/opts"
|
||||
@ -38,11 +39,13 @@ func prepareApp(ctx context.Context, aw *ambient.AmbientWeather) *app.App {
|
||||
CustomListener: ambienthttp.NewAWNMutatingListener(ctx,
|
||||
aw.Config.HTTP.Listen), // Necessary to fix certain bad AWN firmware
|
||||
|
||||
// Health check funcs
|
||||
HealthChecks: []httpopts.HealthCheckFunc{
|
||||
// TODO: Implement
|
||||
// Check recorder health
|
||||
// Only redis implements this
|
||||
func(ctx context.Context) error {
|
||||
return nil
|
||||
var errs error
|
||||
errs = errors.Join(errs, aw.GetRecorder().Ping(ctx))
|
||||
return errs
|
||||
},
|
||||
},
|
||||
},
|
||||
@ -52,6 +55,7 @@ func prepareApp(ctx context.Context, aw *ambient.AmbientWeather) *app.App {
|
||||
GRPCDialOpts: []grpc.DialOption{
|
||||
grpc.WithTransportCredentials(insecure.NewCredentials()),
|
||||
},
|
||||
GRPCGatewayOpts: aw.GetGatewayOpts(),
|
||||
Services: []*grpcopts.GRPCService{
|
||||
{
|
||||
Name: "Weather Service",
|
||||
|
Reference in New Issue
Block a user