https://github.com/jeroenvand/kitboiler
Generator for generating Go kit endpoints and HTTP handlers
https://github.com/jeroenvand/kitboiler
code-generation code-generator gokit golang http json
Last synced: 2 months ago
JSON representation
Generator for generating Go kit endpoints and HTTP handlers
- Host: GitHub
- URL: https://github.com/jeroenvand/kitboiler
- Owner: jeroenvand
- License: mit
- Created: 2018-02-12T20:07:52.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2020-10-06T19:04:20.000Z (over 4 years ago)
- Last Synced: 2024-06-20T15:49:39.277Z (11 months ago)
- Topics: code-generation, code-generator, gokit, golang, http, json
- Language: Go
- Homepage:
- Size: 185 KB
- Stars: 4
- Watchers: 0
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# KitBoiler
KitBoiler generates endpoints, request/response types, request decoders and http handlers
for use with Go kit (https://gokit.io), based on an interface that defines a service.*NOTE: KitBoiler is still work in progress and may or may not work as advertised. It probably won't eat your cat although you can't be sure until it does.*
## Usage
Given a service definition/interface in github.com/me/mypkg/api/somefile.go:
type MyService interface {
MyFirstFunction(name string) (err error)
MyFirstQuery() (results []*model.QueryResult, err error)
MySecondQuery() (result *somepkg.FooBar, err error)
}NOTE: you HAVE to provide names for both the parameters and the return vars in your interface definition as
those are used by kitboiler. Choose the names wisely as they will become part of your public interface.You should call KitBoiler like:
kitboiler github.com/me/mypkg/api.MyService
This generates a package containing endpoint functions, request/response types and
http handler functions for all functions defined in the interface specification.Implementation is based on the impl package by Josh Snyder (https://github.com/josharian/impl) and inspiration was generously provided
by SQLBoiler (https://github.com/volatiletech/sqlboiler)