{"id":18953423,"url":"https://github.com/pthethanh/micro","last_synced_at":"2025-10-04T05:26:03.946Z","repository":{"id":55958376,"uuid":"232469420","full_name":"pthethanh/micro","owner":"pthethanh","description":"A simple tool kit for building microservices.","archived":false,"fork":false,"pushed_at":"2023-11-22T10:43:34.000Z","size":690,"stargazers_count":18,"open_issues_count":0,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-15T09:34:56.785Z","etag":null,"topics":["go","golang","grpc","grpc-gateway","micro","microservice","microservices"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pthethanh.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-01-08T03:28:24.000Z","updated_at":"2025-02-20T14:52:05.000Z","dependencies_parsed_at":"2024-06-18T22:58:30.117Z","dependency_job_id":"7ba80fac-3f6f-465a-a3f2-05dda6cd73c5","html_url":"https://github.com/pthethanh/micro","commit_stats":null,"previous_names":[],"tags_count":21,"template":false,"template_full_name":null,"purl":"pkg:github/pthethanh/micro","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pthethanh%2Fmicro","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pthethanh%2Fmicro/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pthethanh%2Fmicro/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pthethanh%2Fmicro/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pthethanh","download_url":"https://codeload.github.com/pthethanh/micro/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pthethanh%2Fmicro/sbom","scorecard":{"id":748755,"data":{"date":"2025-08-11","repo":{"name":"github.com/pthethanh/micro","commit":"6a5111f87eabfd2e46acf7548e7b6088328391b3"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.5,"checks":[{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","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":"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":"Code-Review","score":0,"reason":"Found 0/30 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":"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":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/go.yml:1","Info: no jobLevel write permissions found"],"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":"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":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/go.yml:17: update your workflow using https://app.stepsecurity.io/secureworkflow/pthethanh/micro/go.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/go.yml:23: update your workflow using https://app.stepsecurity.io/secureworkflow/pthethanh/micro/go.yml/master?enable=pin","Info:   0 out of   2 GitHub-owned GitHubAction dependencies pinned"],"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":"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":"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":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"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":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Vulnerabilities","score":0,"reason":"11 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GO-2024-3250 / GHSA-29wx-vh33-7x7r","Warn: Project is vulnerable to: GO-2025-3553 / GHSA-mh63-6h87-95cp","Warn: Project is vulnerable to: GO-2024-2958 / GHSA-3669-72x9-r9p3","Warn: Project is vulnerable to: GO-2023-2402 / GHSA-45x7-px36-x8w8","Warn: Project is vulnerable to: GO-2024-3321 / GHSA-v778-237x-gjrc","Warn: Project is vulnerable to: GO-2025-3487 / GHSA-hcg3-q754-cr77","Warn: Project is vulnerable to: GO-2024-2687 / GHSA-4v7x-pqxf-cx7m","Warn: Project is vulnerable to: GO-2024-3333","Warn: Project is vulnerable to: GO-2025-3503 / GHSA-qxp5-gwg8-xv66","Warn: Project is vulnerable to: GO-2025-3595 / GHSA-vvgc-356p-c3xw","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-22T19:38:43.163Z","repository_id":55958376,"created_at":"2025-08-22T19:38:43.164Z","updated_at":"2025-08-22T19:38:43.164Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278267339,"owners_count":25958828,"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-10-04T02:00:05.491Z","response_time":63,"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":["go","golang","grpc","grpc-gateway","micro","microservice","microservices"],"created_at":"2024-11-08T13:38:29.091Z","updated_at":"2025-10-04T05:26:03.924Z","avatar_url":"https://github.com/pthethanh.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# micro\n[![Actions Status](https://github.com/pthethanh/micro/workflows/Go/badge.svg)](https://github.com/pthethanh/micro/actions)\n[![GoDoc](https://godoc.org/github.com/pthethanh/micro?status.svg)](https://pkg.go.dev/mod/github.com/pthethanh/micro)\n[![GoReportCard](https://goreportcard.com/badge/github.com/pthethanh/micro)](https://goreportcard.com/report/github.com/pthethanh/micro)\n\nJust a simple tool kit for building microservices.\n\nNew version of micro is [nano](https://github.com/pthethanh/nano) which is available [here](https://github.com/pthethanh/nano).\n\n## What is micro?\n\nmicro is a Go tool kit for enterprise targeted for microservices or well designed monolith application. It doesn't aim to be a framework, but just a microservices tool kit/library for easily and quickly build API applications.\n\nmicro's vision is to be come a good tool kit for beginner/intermediate developers and hence it should be:\n\n- Easy to use.\n- Compatible with Go, gRPC native libraries.\n- Come with default ready to use features.\n- Backward compatible.\n\nI expect micro requires no more than 15 minutes for a beginner/intermediate developer to be able to use the tool kit effectively. This means micro will come with lots of useful default features, but at the same time provide developers ability to provide their alternatives.\n\nmicro is built around gRPC. It exposes both gRPC and REST API over 1 single port using [grpc-gateway](https://github.com/grpc-ecosystem/grpc-gateway), with default ready to use logger, metrics, health check APIs.\n\nCurrently micro comes with a collection of plugins that can be found [here](https://github.com/pthethanh/micro/tree/master/plugins)\n\n## Getting Started\n\n### Start your own\n\nDefine your proto, an example can be found [here](https://github.com/pthethanh/micro/blob/master/examples/helloworld/helloworld/helloworld.proto):\n\n```proto\nsyntax = \"proto3\";\n\npackage helloworld;\noption go_package = \"github.com/pthethanh/micro/examples/helloworld/helloworld;helloworld\";\n\nimport \"google/api/annotations.proto\";\n\n// The greeting service definition.\nservice Greeter {\n  // Sends a greeting\n  rpc SayHello (HelloRequest) returns (HelloReply) {\n    option (google.api.http) = {\n      post: \"/api/v1/hello\"\n      body: \"*\"\n    };\n  }\n}\n\n// The request message containing the user's name.\nmessage HelloRequest {\n  string name = 1;\n}\n\n// The response message containing the greetings\nmessage HelloReply {\n  string message = 1;\n}\n```\n\nGenerate boiler plate code with [protoc-gen-micro](https://github.com/pthethanh/micro/blob/master/cmd/protoc-gen-micro), an example can be found [here](https://github.com/pthethanh/micro/blob/master/Makefile#L63):\n```shell\n$(PROTOC_ENV) protoc -I $(PROTOC_INCLUDES) -I $(GOOGLE_APIS_PROTO) -I ./examples/helloworld/helloworld \\\n\t --go_out $(PROTO_OUT) \\\n\t --micro_out $(PROTO_OUT) \\\n\t --micro_opt generate_gateway=true \\\n\t --go-grpc_out $(PROTO_OUT) \\\n\t --grpc-gateway_out $(PROTO_OUT) \\\n     --grpc-gateway_opt logtostderr=true \\\n     --grpc-gateway_opt generate_unbound_methods=true \\\n     ./examples/helloworld/helloworld/helloworld.proto\n```\n\nCreate new gRPC service, an example can be found [here](https://github.com/pthethanh/micro/blob/master/examples/helloworld/server/main.go)\n\n```go\ntype (\n\tservice struct {\n        // Embed the unimplemented server so that all the registration methods are available to the micro server.\n\t\tpb.UnimplementedGreeterServer\n\t}\n)\n\n// SayHello implements pb.GreeterServer interface.\nfunc (s *service) SayHello(ctx context.Context, req *pb.HelloRequest) (*pb.HelloReply, error) {\n\tlog.Context(ctx).Info(\"name\", req.Name)\n\tif req.Name == \"\" {\n\t\treturn nil, status.InvalidArgument(\"name must not be empty\")\n\t}\n\treturn \u0026pb.HelloReply{\n\t\tMessage: \"Hello \" + req.GetName(),\n\t}, nil\n}\n```\n\nStart a simple server, get configurations from environment variables.\n\n```go\npackage main\n\nimport (\n    \"github.com/pthethanh/micro/server\"\n)\n\nfunc main() {\n    srv := \u0026service{}\n    if err := server.ListenAndServe(srv); err != nil {\n        panic(err)\n    }\n}\n```\n\nMore complex with custom options.\n\n```go\npackage main\n\nimport (\n    \"github.com/pthethanh/micro/log\"\n    \"github.com/pthethanh/micro/server\"\n)\n\nfunc main() {\n    srv := server.New(\n        server.FromEnv(),\n        server.PProf(\"\"),\n        server.Address(\":8088\"),\n        server.JWT(\"secret\"),\n        server.Web(\"/\", \"web\", \"index.html\"),\n        server.Logger(log.Fields(\"service\", \"my_service\")),\n        server.CORS(true, []string{\"*\"}, []string{\"POST\"}, []string{\"http://localhost:8080\"}),\n    )\n    if err := srv.ListenAndServe( /*services...*/ ); err != nil {\n        panic(err)\n    }\n}\n\n```\n\nSee [doc](https://pkg.go.dev/github.com/pthethanh/micro/server?tab=doc) for more options.\n\n## Features\n\nCurrently, micro supports following features:\n\n### Server\n\n- Exposes both gRPC and REST in 1 single port.\n- Internal APIs:\n  - Prometheus metrics.\n  - Health checks.\n  - Debug profiling.\n- Context logging/tracing with X-Request-Id/X-Correlation-Id header/metadata.\n- Authentication interceptors\n- Other options: CORS, HTTP Handler, Serving Single Page Application, Interceptors,...\n\nSee [doc](https://pkg.go.dev/github.com/pthethanh/micro/server?tab=doc) and [examples](https://pkg.go.dev/github.com/pthethanh/micro/server?tab=doc#pkg-examples) for more detail.\n\n### Auth\n\n- Authenticator interface.\n- JWT\n- Authenticator, WhiteList, Chains.\n- Interceptors for both gRPC \u0026 HTTP\n\nSee [doc](https://pkg.go.dev/github.com/pthethanh/micro/auth?tab=doc) for  more detail.\n\n### Broker\n\n- Standard message broker interface.\n- Memory broker.\n- NATS plugin.\n- More plugins can be found [here](https://github.com/pthethanh/micro/tree/master/plugins/broker).\n\nSee [doc](https://pkg.go.dev/github.com/pthethanh/micro/broker?tab=doc) for  more detail.\n\n### Cache\n\n- Standard cache service interface.\n- Memory cache.\n- Redis plugin.\n- More plugins can be found [here](https://github.com/pthethanh/micro/tree/master/plugins/cache).\n\nSee [doc](https://pkg.go.dev/github.com/pthethanh/micro/cache?tab=doc) for  more detail.\n\n### Config\n\n- Standard config interface.\n- Config from environment variables.\n- Config from file and other options.\n\nSee [doc](https://pkg.go.dev/github.com/pthethanh/micro/config?tab=doc) for  more detail.\n\n### Health\n\n- Health check for readiness and liveness.\n- Utilities for checking health.\n\nSee [doc](https://pkg.go.dev/github.com/pthethanh/micro/health?tab=doc) for  more detail.\n\n### Log\n\n- Standard logger interface.\n- Logrus implementation.\n- Context logger \u0026 tracing using X-Request-Id and X-Correlation-Id\n- Interceptors for HTTP \u0026 gRPC.\n\nSee [doc](https://pkg.go.dev/github.com/pthethanh/micro/log?tab=doc) for  more detail.\n\n### Util\n\n- Some utilities that might need during the development using micro.\n\nSee [doc](https://pkg.go.dev/github.com/pthethanh/micro/util?tab=doc) for  more detail.\n\n### Interceptors and Other Options\n\nmicro is completely compatible with Go native and gRPC native, hence you can use external interceptors and other external libraries along with the provided options.\n\nInterceptors: [go-grpc-middleware](https://github.com/grpc-ecosystem/go-grpc-middleware)\n\nSee [examples](https://pkg.go.dev/github.com/pthethanh/micro/server?tab=doc#example_New_withExternalInterceptors) for more detail.\n\n## Why a new standard libraries?\n\nmicro is inspired by [go-kit](https://github.com/go-kit/kit) and [go-micro](https://github.com/micro/go-micro).\n\ngo-kit is a good tool kit, but one of the thing I don't like go-kit is its over use of interface{} which cause a lot of unnecessary type conversions and some of other abstractions in the libraries which are not compatible with Go native libraries. Although go-kit is very flexible, it's a little bit hard to use for beginner/intermediate developers. It has a lot of options for developers to choose and hence hard to force everyone inside a company to use the same set of standards.\n\ngo-micro is a great framework for microservices and very well designed. And it influences micro very much, but there are some coding styles that I don't like go-micro, that's why I made micro for myself.\n\n**Update**: go-micro is now moved to https://github.com/asim/go-micro and it's very well designed. I recommend trying it first to see if it fits your needs.\n\n## Documentation\n\n- See [doc](https://pkg.go.dev/mod/github.com/pthethanh/micro) for package and API descriptions.\n- Examples can be found in the [examples](https://github.com/pthethanh/micro/tree/master/examples) directory.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpthethanh%2Fmicro","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpthethanh%2Fmicro","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpthethanh%2Fmicro/lists"}