{"id":31714522,"url":"https://github.com/kujtimiihoxha/gk","last_synced_at":"2025-10-09T01:25:37.728Z","repository":{"id":57488101,"uuid":"87240598","full_name":"kujtimiihoxha/gk","owner":"kujtimiihoxha","description":"Go-Kit Genetator","archived":false,"fork":false,"pushed_at":"2017-10-08T18:08:30.000Z","size":75,"stargazers_count":151,"open_issues_count":4,"forks_count":28,"subscribers_count":10,"default_branch":"master","last_synced_at":"2024-06-19T05:46:35.374Z","etag":null,"topics":["cli","generator","go-kit","golang","kit-generator"],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kujtimiihoxha.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}},"created_at":"2017-04-04T22:20:26.000Z","updated_at":"2023-10-14T16:19:21.000Z","dependencies_parsed_at":"2022-08-29T15:01:12.859Z","dependency_job_id":null,"html_url":"https://github.com/kujtimiihoxha/gk","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/kujtimiihoxha/gk","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kujtimiihoxha%2Fgk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kujtimiihoxha%2Fgk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kujtimiihoxha%2Fgk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kujtimiihoxha%2Fgk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kujtimiihoxha","download_url":"https://codeload.github.com/kujtimiihoxha/gk/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kujtimiihoxha%2Fgk/sbom","scorecard":{"id":573125,"data":{"date":"2025-08-11","repo":{"name":"github.com/kujtimiihoxha/gk","commit":"e2cbee1f40740f2af0508ff24fb0d44de160c250"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"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":"Code-Review","score":0,"reason":"Found 2/24 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":"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":"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":"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":"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":"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":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"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: Apache License 2.0: 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":"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":"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":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 6 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-20T16:53:19.739Z","repository_id":57488101,"created_at":"2025-08-20T16:53:19.739Z","updated_at":"2025-08-20T16:53:19.739Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279000720,"owners_count":26082894,"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-08T02:00:06.501Z","response_time":56,"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":["cli","generator","go-kit","golang","kit-generator"],"created_at":"2025-10-09T01:25:34.675Z","updated_at":"2025-10-09T01:25:37.720Z","avatar_url":"https://github.com/kujtimiihoxha.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Go-Kit generator.\nGo-kit generator is a cli application that generates boilerplate code for your go-kit services.\n\n:information_source: If you want a more advanced (but somewhat more opinionated) version of `gk` you can find it [here](https://github.com/kujtimiihoxha/kit). :information_source:\n\n## Why?\n\n**Because I'm lazy**, and because it would make it easier for go-kit newcomers to start using it.\n\n## Installation\n```bash\ngo get github.com/kujtimiihoxha/gk\ngo install github.com/kujtimiihoxha/gk\n```\n## Running the generator\n`gk` must be run from a project inside the specified `$GOPATH` for it to work.\nWhen it is run for the first time it will search for `gk.json` configuration file, if it does not find it it will create one\nwith the default settings.\n\n#### Create a new service\nInside the project run:\n```bash\ngk new service hello\n```\nor the shorter command:\n```bash\ngk n s hello\n```\nthis will create a new service called `HelloService` inside :\n```\nproject\n└───hello\n│   └───pkg\n│   │   └───service\n│   │   │    service.go\n```\n**service.go**\n```go\npackage service\n// Implement yor service methods methods.\n// e.x: Foo(ctx context.Context,s string)(rs string,err error)\ntype HelloService interface {\n}\n```\nNow you need to add the interface methods and initiate your service:\ne.x:\n```go\npackage service\nimport \"context\"\n// Implement yor service methods methods.\n// e.x: Foo(ctx context.Context,s string)(rs string,err error)\ntype HelloService interface {\n\tFoo(ctx context.Context,s string)(rs string,err error)\n}\n```\nthan run : \n```bash\ngk init hello\n```\nthis will create the service `struct` , `methods`, `endpoints`, `transport` .\n\n[Example GIF](https://drive.google.com/open?id=0B11R03qTqELWbk9nYXRtOTRQdDg)\n\nThe final folder structure is the same as  [addsvc](https://github.com/peterbourgon/go-microservices/tree/master/addsvc) \nBy Default the generator will use `default_transport` setting from `gk.json` and create the transport. If you want to specify\nthe transport use `-t` flag\n```bash\ngk init hello -t grpc\n```\n\n## Add other transports\nTo add another transport to your existing service use `gk add [transporteType] [serviceName]`   \ne.x adding grpc:\n```bash\ngk add grpc hello\n```\nFor `grpc`  and `thrift` after you execute the above command you will see this message : \n```bash\nINFO[0000] Generating grpc transport...                 \nWARN[0000] -------------------------------------------------------------------- \nWARN[0000] The service is still not ready!!             \nWARN[0000] To create the grpc transport please create your protobuf. \nWARN[0000] Than follow the instructions in compile.sh and compile the .proto file. \nWARN[0000] After the file is compiled run `gk init grpc hello`. \nWARN[0000] -------------------------------------------------------------------- \n```\nto complete the generation of the grpc transport you need to implement the protobuffer and compile it, the compile script\nwith instructions on how to install proto is generated by `gk`. After you compile the protobuffer run:\n```bash\ngk init grpc hello\n```\nAfter this the `handler.go` file will be created and you will only need to implement the `Decode/Encode` of the grpc message.\n\n[Example GIF](https://drive.google.com/open?id=0B11R03qTqELWZE9mcEhZVHhFWFk)\n\ne.x adding thrift:\n```bash\ngk add thrift hello\n```\nThis generator will work similar as the `grpc` generator.\n\n[Example GIF](https://drive.google.com/open?id=0B11R03qTqELWbE9VeFB2ZDdhb2c)\n\n## I don't like the folder structure!\n\nThe folder structure that the generator is using is following https://github.com/go-kit/kit/issues/70 but \nthat can be changed using `gk.json` all the paths are configurable there.\n\n## Cli Help\nEvery command has the `-h` or `--help` flag this will give you more info on what the command does and how to use it.\ne.x \n```bash\ngk init -h\n```\nwill return\n```bash\nInitiates a service\n\nUsage:\n  gk init [flags]\n\nFlags:\n  -t, --transport string   Specify the transport you want to initiate for the service\n\nGlobal Flags:\n  -d, --debug           If you want to se the debug logs.\n      --folder string   If you want to specify the base folder of the project.\n  -f, --force           Force overide existing files without asking.\n      --testing         If testing the generator.\n\n```\n## What is working\nThe example you see here  https://github.com/go-kit/kit/issues/70\n\n## Examples\nYou can find examples under the `test_dir`\n\n## TODO-s\n\n - Implement the update commands, this commands would be used to update an existing service e.x add \n a new request parameter to an endpoint(Probably not needed).\n - Implement middleware generator (service,endpoint).\n - Implement automatic creation of the service main file.\n - Tests tests tests ...\n## Warnings\n\n- I only tested this on the mac, should work on other os-s but I have not tested it, I would appreciate feedback on this. \n## Contribute\nThanks a lot for contributing. \n\nTo test your new features/bug-fixes you need a way to run `gk` inside your project this can be done using `test_dir`.\n\nExecute this in your command line :\n```bash\nexport GK_FOLDER=\"test_dir\" \n```\nCreate a folder in the `gk` repository called `test_dir`, now every time you run `go run main.go [anything]`\n`gk` will treat `test_dir` as the project root.\n\nIf you edit the templates you need to run `compile.sh` inside the templates folder.\n \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkujtimiihoxha%2Fgk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkujtimiihoxha%2Fgk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkujtimiihoxha%2Fgk/lists"}