Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/petr-korobeinikov/oto-showcase
An example of how to use oto.
https://github.com/petr-korobeinikov/oto-showcase
httprpc json-api oto rpc
Last synced: about 1 month ago
JSON representation
An example of how to use oto.
- Host: GitHub
- URL: https://github.com/petr-korobeinikov/oto-showcase
- Owner: petr-korobeinikov
- Created: 2021-04-17T13:43:59.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2021-04-17T14:50:26.000Z (almost 4 years ago)
- Last Synced: 2024-11-06T12:53:52.528Z (3 months ago)
- Topics: httprpc, json-api, oto, rpc
- Language: Go
- Homepage:
- Size: 7.81 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# oto-showcase
An example of how to use oto:
- https://github.com/pacedotdev/oto
- https://pace.dev/blog/2020/07/27/how-code-generation-wrote-our-api-and-cli.html## Install
```shell
# outside of go.mod
go get github.com/pacedotdev/oto
```## Templates
### wget
```shell
mkdir templates
wget https://raw.githubusercontent.com/pacedotdev/oto/master/otohttp/templates/server.go.plush -q -O ./templates/server.go.plush
```### curl
```shell
mkdir templates
curl -s https://raw.githubusercontent.com/pacedotdev/oto/master/otohttp/templates/server.go.plush > ./templates/server.go.plush
```## Generate
```shell
mkdir generatedoto -template ./templates/server.go.plush \
-out ./generated/oto.gen.go \
-ignore Ignorer \
-pkg generated \
./definitions# optional, but useful
gofmt -w ./generated/oto.gen.go ./generated/oto.gen.go
```