Coder Social home page Coder Social logo

undefined: api.HelloReq about kratos HOT 3 CLOSED

go-kratos avatar go-kratos commented on July 18, 2024
undefined: api.HelloReq

from kratos.

Comments (3)

lintanghui avatar lintanghui commented on July 18, 2024

this had been mentioned at #41 . if you want to use grpc, kprotoc must be installed to generate api.pb.go. you can use kratos/tool/kprotoc/install_kprotoc.sh to install this tool

from kratos.

zhaoshichen1 avatar zhaoshichen1 commented on July 18, 2024

yes.

or you could run directly kratos/tool/kprotoc/kprotoc.sh to install protoc and then run this command:
protoc -I. --gogofast_out=plugins=grpc:. api.proto
in this kratos-demo/api directory, thus you will get the api.pb.go file generated which could allow you build this project

from kratos.

felixhao avatar felixhao commented on July 18, 2024

GOOS

  • macos: shoult always be successful, if not install protoc and gogo protobuf, then run:
    • cd kratos-demo/api
    • kratos tool kprotoc
    • cd kratos-demo/cmd & go build
  • windows: install protoc and gogo protobuf,then run:
    • cd kratos-demo/api
    • protoc --gogofast_out=plugins=grpc:$GOPATH/src api.proto
    • cd kratos-demo/cmd & go build
  • linux: install protoc first, then run:
    • cd kratos-demo/api
    • kratos tool kprotoc
    • cd kratos-demo/cmd & go build

protoc:https://github.com/protocolbuffers/protobuf#protocol-compiler-installation
gogo protobuf:https://github.com/gogo/protobuf
kratos tool:https://github.com/bilibili/kratos/blob/master/doc/wiki-cn/kratos-tool.md

from kratos.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.