add grpc server

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
2022-11-28 13:19:46 +03:00
parent 5608190dbf
commit a46561f48a
16 changed files with 1810 additions and 0 deletions

22
grpc/handler/handler.go Normal file
View File

@@ -0,0 +1,22 @@
package handler
import (
"context"
"github.com/jmoiron/sqlx"
pb "github.com/unistack-org/micro-examples/grpc/proto"
)
type Handler struct {
db *sqlx.DB
}
func NewHandler(db *sqlx.DB) (*Handler, error) {
return &Handler{
db: db,
}, nil
}
func (h *Handler) Hello(ctx context.Context, req *pb.HelloReq, rsp *pb.HelloRsp) error {
return nil
}