micro-examples/grpc/handler/handler.go

23 lines
353 B
Go
Raw Permalink Normal View History

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
}