{"id":26053366,"url":"https://github.com/switchupcb/xstruct","last_synced_at":"2025-04-11T00:13:34.362Z","repository":{"id":281222160,"uuid":"944591788","full_name":"switchupcb/xstruct","owner":"switchupcb","description":"xstruct extracts any package's structs, functions, or global variables to a single file.","archived":false,"fork":false,"pushed_at":"2025-03-11T15:36:26.000Z","size":29,"stargazers_count":13,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-11T00:13:23.508Z","etag":null,"topics":["code-generation","code-generator","extract","generator","go","golang"],"latest_commit_sha":null,"homepage":"https://switchupcb.com/xstruct-license-exception/","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/switchupcb.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","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":"2025-03-07T16:08:52.000Z","updated_at":"2025-03-24T12:29:11.000Z","dependencies_parsed_at":"2025-03-07T17:43:55.366Z","dependency_job_id":null,"html_url":"https://github.com/switchupcb/xstruct","commit_stats":null,"previous_names":["switchupcb/xstruct"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/switchupcb%2Fxstruct","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/switchupcb%2Fxstruct/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/switchupcb%2Fxstruct/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/switchupcb%2Fxstruct/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/switchupcb","download_url":"https://codeload.github.com/switchupcb/xstruct/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248317730,"owners_count":21083530,"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":["code-generation","code-generator","extract","generator","go","golang"],"created_at":"2025-03-08T07:28:11.219Z","updated_at":"2025-04-11T00:13:34.347Z","avatar_url":"https://github.com/switchupcb.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Extract a package's structs, functions, or global variables.\n\n[![GoDoc](https://img.shields.io/badge/godoc-reference-5272B4.svg?style=for-the-badge\u0026logo=appveyor\u0026logo=appveyor)](https://pkg.go.dev/github.com/switchupcb/xstruct)\n[![License](https://img.shields.io/github/license/switchupcb/xstruct.svg?style=for-the-badge)](https://github.com/switchupcb/xstruct/blob/main/LICENSE)\n\nUse `xstruct` to stop wasting time refactoring and debugging projects.\n\n## What is xstruct?\n\n`xstruct` helps you extract any package's structs, functions, or global variables to a single file.\n\n## Table of Contents\n\n| Topic                                                   |\n| :------------------------------------------------------ |\n| [Using `xstruct`](#how-do-you-use-xstruct)              |\n| [Usecases](#when-do-you-use-xstruct)                    |\n| [License](#what-is-the-license)                         |\n| [License Exception](#what-can-you-do-with-this-license) |\n\n## How do you use xstruct?\n\nInstall the command line tool: `xstruct`.\n\n```\ngo install github.com/switchupcb/xstruct@latest\n```\n\nRun the executable with the following flags.\n    \n```bash\nxstruct -d relative/path/to/dir\n```\n\n| Flag | Description                             | Usage                                                |\n| :--- | :-------------------------------------- | :--------------------------------------------------- |\n| `-d` | Directory to extract.                   | `-d relative/path/to/dir` (`/...` for nested search) |\n| `-p` | Set the output file's package.          | `-p xstruct` (`xstruct` by default)                  |\n| `-g` | Extract global variables and constants. | `-g`                                                 |\n| `-f` | Extract function declarations.          | `-f`                                                 |\n| `-s` | Sort the extracted objects.             | `-s`                                                 |\n| `\u003e`  | Pipe standard output to a file.         | `\u003e file.go`                                          |\n\n_Note: Using `-g` and `-f` extracts additional declarations **in addition** to structs._\n\n## When do you use xstruct?\n\nYou can use `xstruct` to stop wasting time refactoring and debugging projects.\n\n**Here is Open Source Software using `xstruct`.**\n\n| Software                                       | Description                         | `xstruct` Use                                                                                                         |\n| :--------------------------------------------- | :---------------------------------- | :-------------------------------------------------------------------------------------------------------------------- |\n| [`disgo`](https://github.com/switchupcb/disgo) | API Wrapper (SDK Client)            | Disgo uses `xstruct` to combine a Go type library into a single file, which code is generated from.                   |\n| [`dbgo`](https://github.com/switchupcb/dbgo)   | Database Consumer Package Generator | `dbgo` uses `xstruct` to combine generated database models into a single file, which can be used with an interpreter. |\n\n## What is the license?\n\n`xstruct` uses an [AGPLv3 License](https://www.gnu.org/licenses/agpl-3.0.en.html).\n\n## What can you do with this license?\n\n**Code generated by `xstruct`  can be used without restriction (including proprietary and commercial usage) since generated code is not considered a derivative work.** However, modifications to the `xstruct` Software Source Code or implementing `xstruct` in a larger work programmatically requires you to adhere to the AGPLv3 License.\n\n_Read the [GPL FAQ](https://www.gnu.org/licenses/gpl-faq.html) for more information._\n\n## What is a license exception?\n\nA license exception lets you modify and use `xstruct` programmatically without restriction.\n\nYou can receive a license exception for `xstruct` by contacting SwitchUpCB using the [`xstruct` License Exception Inquiry Form](https://switchupcb.com/xstruct-license-exception/).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fswitchupcb%2Fxstruct","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fswitchupcb%2Fxstruct","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fswitchupcb%2Fxstruct/lists"}