add grpc support

This commit is contained in:
2025-03-06 17:16:27 -05:00
parent 004c1b1ee6
commit e11c563c3a
10 changed files with 225 additions and 142 deletions

View File

@ -129,23 +129,19 @@ func prepHTTPServer(opts *HTTPServerOpts) *http.Server {
// Returns a shutdown func and a done channel if the
// server aborts abnormally. Panics on error.
func MustInitHTTPServer(opts *HTTPServerOpts) (
func(context.Context) error, <-chan interface{},
func InitHTTPServer(opts *HTTPServerOpts) (
func(context.Context) error, <-chan any, error,
) {
shutdownFunc, doneChan, err := InitHTTPServer(opts)
if err != nil {
panic(err)
}
return shutdownFunc, doneChan
return initHTTPServer(opts)
}
// Returns a shutdown func and a done channel if the
// server aborts abnormally. Returns error on failure to start
func InitHTTPServer(opts *HTTPServerOpts) (
func(context.Context) error, <-chan interface{}, error,
func initHTTPServer(opts *HTTPServerOpts) (
func(context.Context) error, <-chan any, error,
) {
l := zerolog.Ctx(opts.Ctx)
doneChan := make(chan interface{})
doneChan := make(chan any)
var server *http.Server