{"id":19746229,"url":"https://github.com/itzmanish/protoc-gen-micro","last_synced_at":"2025-11-23T03:03:01.030Z","repository":{"id":57597859,"uuid":"312947733","full_name":"itzmanish/protoc-gen-micro","owner":"itzmanish","description":"Proto buffer generator plugin for go-micro","archived":false,"fork":false,"pushed_at":"2021-09-11T05:22:29.000Z","size":84,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-16T22:12:52.138Z","etag":null,"topics":["grpc","grpc-go","plugin","protobuf"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/itzmanish.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-11-15T03:08:57.000Z","updated_at":"2021-09-11T05:21:33.000Z","dependencies_parsed_at":"2022-08-28T10:21:44.259Z","dependency_job_id":null,"html_url":"https://github.com/itzmanish/protoc-gen-micro","commit_stats":null,"previous_names":["annwntech/protoc-gen-micro"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/itzmanish/protoc-gen-micro","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itzmanish%2Fprotoc-gen-micro","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itzmanish%2Fprotoc-gen-micro/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itzmanish%2Fprotoc-gen-micro/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itzmanish%2Fprotoc-gen-micro/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/itzmanish","download_url":"https://codeload.github.com/itzmanish/protoc-gen-micro/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itzmanish%2Fprotoc-gen-micro/sbom","scorecard":{"id":497758,"data":{"date":"2025-08-11","repo":{"name":"github.com/itzmanish/protoc-gen-micro","commit":"b6c4854188084350031143fdb3da506cab580c47"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.2,"checks":[{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Code-Review","score":0,"reason":"Found 0/2 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":0,"reason":"license file not detected","details":["Warn: project does not have a license file"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":0,"reason":"Project has not signed or included provenance with any releases.","details":["Warn: release artifact v1.0.0 not signed: https://api.github.com/repos/itzmanish/protoc-gen-micro/releases/33962375","Warn: release artifact v1.0.0 does not have provenance: https://api.github.com/repos/itzmanish/protoc-gen-micro/releases/33962375"],"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":9,"reason":"1 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GO-2024-2611 / GHSA-8r3f-844c-mc37"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-19T20:56:13.046Z","repository_id":57597859,"created_at":"2025-08-19T20:56:13.047Z","updated_at":"2025-08-19T20:56:13.047Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":285894271,"owners_count":27249632,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-11-23T02:00:06.149Z","response_time":135,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["grpc","grpc-go","plugin","protobuf"],"created_at":"2024-11-12T02:13:50.882Z","updated_at":"2025-11-23T03:03:01.016Z","avatar_url":"https://github.com/itzmanish.png","language":"Go","readme":"# protoc-gen-micro\n\nThis is protobuf code generation for micro. We use protoc-gen-micro to reduce boilerplate code.\n\n## Install\n\n```\ngo get github.com/itzmanish/protoc-gen-micro\n```\n\nAlso required:\n\n- [protoc](https://github.com/google/protobuf)\n- [protoc-gen-go](https://github.com/golang/protobuf)\n\n## Usage\n\nDefine your service as `greeter.proto`\n\n```\nsyntax = \"proto3\";\n\nservice Greeter {\n\trpc Hello(Request) returns (Response) {}\n}\n\nmessage Request {\n\tstring name = 1;\n}\n\nmessage Response {\n\tstring msg = 1;\n}\n```\n\nGenerate the code\n\n```\nprotoc --proto_path=$GOPATH/src:. --micro_out=. --go_out=. greeter.proto\n```\n\nYour output result should be:\n\n```\n./\n    greeter.proto\t# original protobuf file\n    greeter.pb.go\t# auto-generated by protoc-gen-go\n    greeter.micro.go\t# auto-generated by protoc-gen-micro\n```\n\nThe micro generated code includes clients and handlers which reduce boiler plate code\n\n### Server\n\nRegister the handler with your micro server\n\n```go\ntype Greeter struct{}\n\nfunc (g *Greeter) Hello(ctx context.Context, req *proto.Request, rsp *proto.Response) error {\n\trsp.Msg = \"Hello \" + req.Name\n\treturn nil\n}\n\nproto.RegisterGreeterHandler(service.Server(), \u0026Greeter{})\n```\n\n### Client\n\nCreate a service client with your micro client\n\n```go\nclient := proto.NewGreeterService(\"greeter\", service.Client())\n```\n\n### Errors\n\nIf you see an error about `protoc-gen-micro` not being found or executable, it's likely your environment may not be configured correctly. If you've already installed `protoc`, `protoc-gen-go`, and `protoc-gen-micro` ensure you've included `$GOPATH/bin` in your `PATH`.\n\nAlternative specify the Go plugin paths as arguments to the `protoc` command\n\n```\nprotoc --plugin=protoc-gen-go=$GOPATH/bin/protoc-gen-go --plugin=protoc-gen-micro=$GOPATH/bin/protoc-gen-micro --proto_path=$GOPATH/src:. --micro_out=. --go_out=. greeter.proto\n```\n\n### Endpoint\n\nAdd a micro API endpoint which routes directly to an RPC method\n\nUsage:\n\n1. Clone `github.com/googleapis/googleapis` to use this feature as it requires http annotations.\n2. The protoc command must include `-I$GOPATH/src/github.com/googleapis/googleapis` for the annotations import.\n\n```diff\nsyntax = \"proto3\";\n\nimport \"google/api/annotations.proto\";\n\nservice Greeter {\n\trpc Hello(Request) returns (Response) {\n\t\toption (google.api.http) = { post: \"/hello\"; body: \"*\"; };\n\t}\n}\n\nmessage Request {\n\tstring name = 1;\n}\n\nmessage Response {\n\tstring msg = 1;\n}\n```\n\nThe proto generates a `RegisterGreeterHandler` function with a [api.Endpoint](https://godoc.org/github.com/itzmanish/go-micro/v2/api#Endpoint).\n\n```diff\nfunc RegisterGreeterHandler(s server.Server, hdlr GreeterHandler, opts ...server.HandlerOption) error {\n\ttype greeter interface {\n\t\tHello(ctx context.Context, in *Request, out *Response) error\n\t}\n\ttype Greeter struct {\n\t\tgreeter\n\t}\n\th := \u0026greeterHandler{hdlr}\n\topts = append(opts, api.WithEndpoint(\u0026api.Endpoint{\n\t\tName:    \"Greeter.Hello\",\n\t\tPath:    []string{\"/hello\"},\n\t\tMethod:  []string{\"POST\"},\n\t\tHandler: \"rpc\",\n\t}))\n\treturn s.Handle(s.NewHandler(\u0026Greeter{h}, opts...))\n}\n```\n\n## LICENSE\n\nprotoc-gen-micro is a liberal reuse of protoc-gen-go hence we maintain the original license\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fitzmanish%2Fprotoc-gen-micro","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fitzmanish%2Fprotoc-gen-micro","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fitzmanish%2Fprotoc-gen-micro/lists"}