chore(grpc): add health check and grpc v1, alpha version

Signed-off-by: Bo-Yi.Wu <appleboy.tw@gmail.com>
This commit is contained in:
Bo-Yi.Wu
2022-08-20 11:53:19 +08:00
committed by Jason Song
parent 257ba77e8d
commit 2cba8fafd8
6 changed files with 65 additions and 46 deletions

View File

@ -0,0 +1,18 @@
// Copyright 2022 The Gitea Authors. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
package bots
import (
"net/http"
"code.gitea.io/gitea/modules/log"
)
func grpcHandler(h http.Handler) http.HandlerFunc {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
log.Info("Got connection: %v", r.Proto)
h.ServeHTTP(w, r)
})
}