{"id":21141299,"url":"https://github.com/influx6/moz","last_synced_at":"2025-07-08T15:06:59.798Z","repository":{"id":138760338,"uuid":"91991042","full_name":"influx6/moz","owner":"influx6","description":"Flexible codegen in go","archived":false,"fork":false,"pushed_at":"2018-05-29T18:42:56.000Z","size":1706,"stargazers_count":8,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-18T22:35:33.067Z","etag":null,"topics":["annotations","code-generation","codegenerator","function-composition","gen","go","gocodegenerator","moz"],"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/influx6.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":"2017-05-21T22:17:45.000Z","updated_at":"2020-04-02T23:26:45.000Z","dependencies_parsed_at":null,"dependency_job_id":"29964c47-383e-448b-bbd5-636d8575c21f","html_url":"https://github.com/influx6/moz","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/influx6/moz","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/influx6%2Fmoz","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/influx6%2Fmoz/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/influx6%2Fmoz/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/influx6%2Fmoz/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/influx6","download_url":"https://codeload.github.com/influx6/moz/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/influx6%2Fmoz/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264292952,"owners_count":23586063,"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":["annotations","code-generation","codegenerator","function-composition","gen","go","gocodegenerator","moz"],"created_at":"2024-11-20T07:26:42.610Z","updated_at":"2025-07-08T15:06:59.777Z","avatar_url":"https://github.com/influx6.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"Moz\r\n=======\r\nMoz exists has a library to provide a solid foundation for code generation by combining functional composition and Go ast for flexible content creation.\r\n\r\nInstall\r\n-----------\r\n\r\n```shell\r\ngo get -u github.com/influx6/moz\r\n```\r\n\r\nIntroduction\r\n----------------------------\r\n\r\nMoz is a code generator which builds around the concepts of pluggable `io.WriteTo` elements that allow a elegant but capable system for generating code programmatically.\r\n\r\nIt uses functional compositions to define code structures that connect to create contents and using the Go ast parser, generates elegant structures for easier interaction with source files.\r\n\r\n\r\nFeatures\r\n----------\r\n\r\n- Basic Programming structures\r\n- Simple Coding Blocks\r\n- Go text/template support\r\n- Annotation code generation\r\n\r\n\r\nProjects Using Moz\r\n--------------------\r\n\r\n- [Gu](https://github.com/gu-io/gu)\r\n- [Dime](https://github.com/influx6/dime)\r\n\r\nCode Generation with Moz\r\n--------------------------\r\n\r\nMoz is intended to be very barebones and minimal, it focuses around providing very basic structures, that allows the most flexibility in how you generate new content.\r\n\r\nIt provides two packages that are the center of it's system:\r\n\r\n## [Gen](./gen)\r\n\r\nGen provides compositional structures for creating content with functions.\r\n\r\n#### Generate Go struct using [Gen](./gen)\r\n\r\n```go\r\nimport \"github.com/influx6/moz/gen\"\r\n\r\nfloppy := gen.Struct(\r\n\t\tgen.Name(\"Floppy\"),\r\n\t\tgen.Commentary(\r\n\t\t\tgen.Text(\"Floppy provides a basic function.\"),\r\n\t\t\tgen.Text(\"Demonstration of using floppy API.\"),\r\n\t\t),\r\n\t\tgen.Annotations(\r\n\t\t\t\"Flipo\",\r\n\t\t\t\"API\",\r\n\t\t),\r\n\t\tgen.Field(\r\n\t\t\tgen.Name(\"Name\"),\r\n\t\t\tgen.Type(\"string\"),\r\n\t\t\tgen.Tag(\"json\", \"name\"),\r\n\t\t),\r\n)\r\n\r\nvar source bytes.Buffer\r\n\r\nfloppy.WriteTo(\u0026source) /*\r\n// Floppy provides a basic function.\r\n//\r\n// Demonstration of using floppy API.\r\n//\r\n//\r\n//@Flipo\r\n//@API\r\ntype Floppy struct {\r\n\r\n    Name string `json:\"name\"`\r\n\r\n}\r\n*/\r\n```\r\n\r\n\r\nContributors\r\n----------------\r\nPlease feel welcome to contribute with issues and PRs to improve Moz. :)\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finflux6%2Fmoz","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Finflux6%2Fmoz","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finflux6%2Fmoz/lists"}