项目作者: jeroenvand

项目描述 :
Generator for generating Go kit endpoints and HTTP handlers
高级语言: Go
项目地址: git://github.com/jeroenvand/kitboiler.git
创建时间: 2018-02-12T20:07:52Z
项目社区:https://github.com/jeroenvand/kitboiler

开源协议:MIT License

下载


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:

  1. type MyService interface {
  2. MyFirstFunction(name string) (err error)
  3. MyFirstQuery() (results []*model.QueryResult, err error)
  4. MySecondQuery() (result *somepkg.FooBar, err error)
  5. }

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:

  1. 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)