
Security News
curl Shuts Down Bug Bounty Program After Flood of AI Slop Reports
A surge of AI-generated vulnerability reports has pushed open source maintainers to rethink bug bounties and tighten security disclosure processes.
www.github.com/charlesbases/protoc-gen-doc.git
Advanced tools
# 方式一
go get github.com/charlesbases/protoc-gen-doc
# 方式二
git clone https://github.com/charlesbases/protoc-gen-doc.git
cd protoc-gen-doc && go install .
git clone https://github.com/charlesbases/protobuf.git
cd protobuf && make init
# 或
cd protobuf && cp -r google ${GOPATH}/src/.
protoc -I=${GOPATH}/src:. --gogo_out=paths=source_relative:. --doc_out=doc pb/*.proto
syntax = "proto3";
option go_package = ".;pb";
package pb;
// 用户服务
service Users {
// 用户列表
rpc List (Request) returns (Response) {}
}
// 入参
message Request {
// 用户id
int64 id = 1;
// 用户名
string name = 2;
}
// 出参
message Response {
// 用户id
int64 id = 1;
// 用户名
string name = 2;
}
syntax = "proto3";
option go_package = ".;pb";
package pb;
import "google/protobuf/plugin/http.proto";
// 用户服务
service Users {
// 获取用户
rpc User (Request) returns (Response) {
option (google.protobuf.plugin.http) = {
get: "/api/v1/users/{uid}"
};
}
// 用户列表
rpc UserList (Request) returns (Response) {
option (google.protobuf.plugin.http) = {
get: "/api/v1/users"
};
}
// 创建用户
rpc UserCreate (Request) returns (Response) {
option (google.protobuf.plugin.http) = {
post: "/api/v1/users"
};
}
// 更新用户
rpc UserUpdate (Request) returns (Response) {
option (google.protobuf.plugin.http) = {
put: "/api/v1/users/{uid}"
};
}
// 删除用户
rpc UserDelete (Request) returns (Response) {
option (google.protobuf.plugin.http) = {
delete: "/api/v1/users/{uid}"
};
}
// 用户头像上传
rpc UserUpload (Upload) returns (Response) {
option (google.protobuf.plugin.http) = {
put: "/api/v1/users/{uid}"
consume: "multipart/form-data"
};
}
// 用户头像下载
rpc UserUpload (Request) returns (Upload) {
option (google.protobuf.plugin.http) = {
get: "/api/v1/users/{uid}"
produce: "multipart/form-data"
};
}
}
// 入参
message Request {
// 用户id
int64 id = 1;
// 用户名
string name = 2;
}
// 出参
message Response {
// 用户id
int64 id = 1;
// 用户名
string name = 2;
}
// 头像上传
message Upload {
FileType type = 1;
bytes file = 2;
}
// 图片类型
enum FileType {
JPG = 0;
PNG = 1;
GIF = 2;
}
FAQs
Unknown package
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
A surge of AI-generated vulnerability reports has pushed open source maintainers to rethink bug bounties and tighten security disclosure processes.

Product
Scan results now load faster and remain consistent over time, with stable URLs and on-demand rescans for fresh security data.

Product
Socket's new Alert Details page is designed to surface more context, with a clearer layout, reachability dependency chains, and structured review.