• 2024-07-01将 proto 文件转成 java 类
     将proto文件转成java类:将proto文件放在/resource目录下,执行mvnpackage,类会自动生成 <plugin><groupId>com.github.os72</groupId><artifactId>protoc-jar-maven-plugin</artifactId><vers
  • 2024-05-30Golang GRPC 环境 问题
    生成文件执行protoc--go_out=.--go_opt=paths=source_relative--go-grpc_out=.--go-grpc_opt=paths=source_relativeservice.proto 报下列错处理方法1.'protoc-gen-go'不是内部或外部命令,也不是可运行的程序或批处理文件。a.检查gopath目录(%GOPATH%\)的bin文件夹,是否有
  • 2024-05-13Dockerfile - build zgrpc-go-professionals:client
     FROM--platform=$BUILDPLATFORMalpineasprotocARGBUILDPLATFORM=linux/amd64TARGETOS=linuxTARGETARCH=amd64#downloadtheprotocbinaryfromgithub#Weunzipthefileinto/usr/local.Noticethatweareextractingboththeprotoc#binary(/bin/pr
  • 2024-05-13Dockerfile - build zgrpc-go-professionals:server
     FROM--platform=$BUILDPLATFORMalpineasprotocARGBUILDPLATFORM=linux/amd64TARGETOS=linuxTARGETARCH=amd64#downloadtheprotocbinaryfromgithub#Weunzipthefileinto/usr/local.Noticethatweareextractingboththeprotoc#binary(/bin/pr
  • 2024-05-05Dockerfile
     FROM--platform=$BUILDPLATFORMalpineasprotocARGBUILDPLATFORM=linux/amd64TARGETOS=linuxTARGETARCH=amd64#downloadtheprotocbinaryfromgithub#Weunzipthefileinto/usr/local.Noticethatweareextractingboththeprotoc#binary(/bin/pr
  • 2024-04-19protobuf 在嵌入式ARM平台的应用(c语言版)
    一、PC上安装protobuf和protobuf-c1.安装protobuf protocolbuffers仓库地址:https://github.com/protocolbuffers/protobuf 本文选择下载v21.12版本(太新版本protobuf-c可能不支持)$cdprotobuf-21.12$./autogen.sh$./configure#默认安装路径/usr/local/$make
  • 2024-04-17Dockerfile - Install protoc
     FROM--platform=$BUILDPLATFORMalpineasprotocARGBUILDPLATFORM=linux/amd64TARGETOS=linuxTARGETARCH=amd64#downloadtheprotocbinaryfromgithub#Weunzipthefileinto/usr/local.Noticethatweareextractingboththeprotoc#binary(/bin/pr
  • 2024-03-18protobuf和gRPC
    目录一、grpc介绍1.1RPC介绍1.2Protobuf介绍null二、下载生成proto工具三、下载go的依赖包四、快速使用4.1编写proto4.2生成go脚本4.3编写main.go4.4修改proto,加入更多参数4.5重新生成4.6修改代码五、完整的客户端服务端5.1proto文件5.2生成go脚本5.3server.go5.4cl
  • 2024-03-10kratos安装及依赖安装
    前言protoc是protobuf文件(.proto)的编译器,可以借助这个工具把.proto文件转译成各种编程语言对应的源码,包含数据类型定义、调用接口等。protoc在设计上把protobuf和不同的语言解耦了,底层用c++来实现protobuf结构的存储,然后通过插件的形式来生成不同语言的源码。
  • 2024-02-20记录一次grpc打包的坑
    GRPC打包的坑今天做的项目需要用到grpc,然后需要打jar包进行引用,打包的时候却失败了报了protocdidnotexitcleanly.Reviewoutputformoreinformation.--grpc-java_out:protoc-gen-grpc-java:Thesystemcannotfindthepathspecified.的相关错误很明显就是路径的问
  • 2024-02-06Golang Grpc-Gateway生成-基础版
    时间久了不用就会忘记指令,这里做个笔记创建一个文件//+buildtoolspackagetoolsimport(_"github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-grpc-gateway"_"github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2"_"google.gol
  • 2024-01-28go 安装grpc环境
    一:windows上安装protoc转换工具https://github.com/protocolbuffers/protobuf/releases/tag/v3.19.4 github打不开,下载个fastgithub对应版本工具目录打开运行 再次访问protoc转换工具下载地址: 找到对应版本 下载 解压,把整个目录剪切到合适位置里面目录
  • 2023-12-24创建一个能跑的go-gprc
    go-gRPC创建项目创建项目gprc,并新建文件夹server、client、pb在pb文件下创建文件hello_grpc.proto并写入如下内容syntax="proto3";optiongo_package="./;hello_grpc";packagehello_grpc;messageReq{stringmessage=1;}messageRes{stringmessage=1
  • 2023-11-29nanopb 编译 proto 文件的坑
    1、要使用nanopb自带的protoc命令2、要使用options文件,必须在.proto文件下执行命令 ➜ protobuf_cgit:(xx)✗lsudp_carrier.proto udp_proto.options /usr/local/nanopb-0.4.8-linux-x86/generator-bin/protocudp_proto.proto --nanopb_out=./
  • 2023-11-14Protobuf - Protocol Buffer Compiler Installation
    $aptinstall-yprotobuf-compiler Togeneratesourcecodefrom.protofiles,firstinstallprotoc,theprotocolbuffercompiler(https://grpc.io/docs/protoc-installation/).Theninstalltwomoremodulesto helpprotocgeneratesourcecodespecificto
  • 2023-11-05Go 生成protobuf示例
    先安装好工具goinstallgoogle.golang.org/protobuf/cmd/[email protected]/grpc/cmd/protoc-gen-go-grpc@latest下载安装protocwgethttps://github.com/protocolbuffers/protobuf/releases/download/v25.0/protoc-25.0-linux-x86_64.zip
  • 2023-10-12微服务框架之go-zero
    官方文档:  https://go-zero.dev/ [安装]脚手架goctl:goinstallgithub.com/zeromicro/go-zero/tools/goctl@latest 依赖protoc,protoc-gen-go,protoc-grpc-go安装:protoc:下载:https://github.com/protocolbuffers/protobuf/releases/download/v21.11/protoc-21
  • 2023-10-11Protobuf语法
    ProtocolBuffers(protobuf)是一种语言无关,平台无关,可扩展的用于序列化结构化数据的方式——类似XML,但比XML更灵活,更高效。 使用protobuf语法编写xxx.proto文件,然后将其编译成可供特定语言识别和使用的代码文件,供程序调用,这是protobuf的基本工作原理。以Go语言为例,使用官方提供
  • 2023-10-10golang之gRPC
    相关链接:grpc:https://grpc.io/docs/languages/go/quickstart/ protobuf:https://protobuf.dev/programming-guides/proto3/ protobuf语法: 示例:syntax="proto3";//声明请求参数messageSearchRequest{stringquery=1;int32page=2;int32pag
  • 2023-09-06windows vs使用grpc-cpp的坑
    1.通过vcpkg安装protoc和grpc-cpp2.生成proto协议代码:protoc-I..-I.--cpp_out=. test.proto3.生成grpc服务代码:protoc-I..-I.--grpc_out=.--plugin=protoc-gen-grpc=`full_path\grpc_cpp_plugin.exe` test.proto4.创建vs工程,引用生成的代码,引用vcpkg安装的pro
  • 2023-08-23【Protoc】VS2019 (VS平台) 使用 CMake 编译安装、使用 Protobuf 库
    背景:工作中需要使用到protobuf,看了一些教程,感觉都不是很适合,便自己总结一些开发环境:Win10VS2019CMake3.24.2Protobuf3.21.12(Protoc版本必须于Protobuf版本一致)MinGW版本的编译在之后有空再研究。https://stackoverflow.com/questions/9243816/how-to-build-
  • 2023-08-17使用protobuf生成各大厂的开放平台接口
    protoc-gen-go_api一款用protobuf文件生成go的http调用代码。具体代码见protoc-gen-go_api安装goinstallgithub.com/dev-openapi/protoc-gen-go_api@latest使用依赖googleapis的http.proto和annotations.proto。并且需要放到google/api/目录下如果google/api是在工程文
  • 2023-08-16【已解决】protoc-gen-go: program not found or is not executable Please specify a program using —————————
    命令(base)➜pbprotoc--go_out=.helloworld.proto报错信息MACm1环境下protoc-gen-go:programnotfoundorisnotexecutablePleasespecifyaprogramusingabsolutepathormakesuretheprogramisavailableinyourPATHsystemvari
  • 2023-08-03protoc-gen-doc 自定义模板规则详解
    protoc-gen-doc自定义模板规则详解配套演示工程此项目中所用proto文件位于./proto目录下,来源于官方proto示例此项目中所列所有模板case文件位于./tmpl目录下此教程均基于markdown文本演示前言最近有通过proto文件生成其接口文档的需求,而protoc-gen-doc所生成
  • 2023-06-16--go_out: protoc-gen-go: plugins are not supported;
    记录问题:--go_out:protoc-gen-go:pluginsarenotsupported;标签(空格分隔):grpc,protoc-gen-gogrpc官网:https://grpc.io/docs/languages/go/quickstart/官网写的要安装以下:$goinstallgoogle.golang.org/protobuf/cmd/[email protected]$goinstallgoogle.golang.or