{"id":29271999,"url":"https://github.com/bukalapak/godec","last_synced_at":"2025-07-05T00:10:21.360Z","repository":{"id":57610785,"uuid":"141231937","full_name":"bukalapak/godec","owner":"bukalapak","description":"Decorator Fabricator","archived":false,"fork":false,"pushed_at":"2018-08-23T09:19:51.000Z","size":20,"stargazers_count":3,"open_issues_count":1,"forks_count":1,"subscribers_count":9,"default_branch":"master","last_synced_at":"2024-06-20T15:42:48.603Z","etag":null,"topics":["decorator","decorator-pattern","decorators","go","golang"],"latest_commit_sha":null,"homepage":null,"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/bukalapak.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":"2018-07-17T04:38:48.000Z","updated_at":"2018-12-05T19:02:20.000Z","dependencies_parsed_at":"2022-08-30T05:21:45.348Z","dependency_job_id":null,"html_url":"https://github.com/bukalapak/godec","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/bukalapak/godec","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bukalapak%2Fgodec","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bukalapak%2Fgodec/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bukalapak%2Fgodec/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bukalapak%2Fgodec/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bukalapak","download_url":"https://codeload.github.com/bukalapak/godec/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bukalapak%2Fgodec/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263636825,"owners_count":23492312,"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","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":["decorator","decorator-pattern","decorators","go","golang"],"created_at":"2025-07-05T00:10:20.444Z","updated_at":"2025-07-05T00:10:21.354Z","avatar_url":"https://github.com/bukalapak.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.org/bukalapak/godec.svg?branch=master)](https://travis-ci.org/bukalapak/godec)\n[![Go Report Card](https://goreportcard.com/badge/github.com/bukalapak/godec)](https://goreportcard.com/report/github.com/bukalapak/godec)\n[![Documentation](https://godoc.org/github.com/bukalapak/godec?status.svg)](http://godoc.org/github.com/bukalapak/godec)\n\n# Godec\n\n## Description\n\nGodec is decorator fabricator. Godec will automatically create a decorator for desired interface using desired template. The desired template must be placed in folder [template/](https://github.com/bukalapak/godec/tree/master/template).\n\n## Installation\n\n```sh\ngo install github.com/bukalapak/godec/app/godec\n```\n\n## Usage\n\n1. Add `go:generate` hook in desired file\n\n    ```go\n    //go:generate godec MyInterface canceler\n    type MyInterface interface {\n      Sample(int, string) (float64, error)\n    }\n    ```\n\n    godec needs two or more arguments to run correctly.\n\n    ```sh\n    godec [interface name] [decorator name]...\n    ```\n\n    [interface name] is the name of interface to be decorated. In the example above, interface's name is `MyInterface`.\n    [decorator name] is the name of decorator. In the example above, decorator's name is `canceler`. Please, note that desired decorator must be placed in [template/](https://github.com/bukalapak/godec/tree/master/template) folder. Godec will find the desired template there. The name of the template decorator must be `\u003cname\u003e.go.tmpl`. Please, look at [template/](https://github.com/bukalapak/godec/tree/master/template) for clarity.\n\n2. Run `go generate`\n\n    ```sh\n    go generate\n    ```\n\n    Decorator will be created in folder `decorator/`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbukalapak%2Fgodec","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbukalapak%2Fgodec","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbukalapak%2Fgodec/lists"}