https://github.com/horvathandris/go-type-registry
https://github.com/horvathandris/go-type-registry
cli go golang parser parsing registry
Last synced: 6 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/horvathandris/go-type-registry
- Owner: horvathandris
- License: mit
- Created: 2021-04-15T17:03:39.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2021-04-22T05:45:33.000Z (about 5 years ago)
- Last Synced: 2024-07-05T13:24:52.169Z (almost 2 years ago)
- Topics: cli, go, golang, parser, parsing, registry
- Language: Go
- Homepage:
- Size: 25.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# go-type-registry
Create a type registry of all exported struct types in your package in Go.
Supports directory parsing as well as single file parsing. When parsing a directory
the output registry will be created inside the directory.
## Usage
You can either use the CLI or the parser directly.
### CLI
```
go-type-registry [ OPTIONS ]
```
#### Flags:
- `-i, --input` the input .go file, from which the registry is created **(required)**
- `-o, --output` the output .go file, where the registry is created **(required)**
### Parser
```
parser.Start(inputFilename, outputFilename)
```
## Using the type registry
You can create an instance from the registry using MakeInstance
```
instance := typeRegistry.MakeInstance(typeName)
```