├── .gitignore ├── logo.jpg ├── templates ├── handler.go.tmpl ├── querier.go.tmpl ├── types.go.tmpl ├── codec.go.tmpl ├── keeper.go.tmpl ├── genesis.go.tmpl └── module.go.tmpl ├── go.mod ├── Makefile ├── README.md ├── .circleci └── config.yml ├── main.go ├── go.sum └── LICENSE /.gitignore: -------------------------------------------------------------------------------- 1 | x/* 2 | cosmos-gen 3 | process.yml 4 | -------------------------------------------------------------------------------- /logo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nature613/cosmos-gen/HEAD/logo.jpg -------------------------------------------------------------------------------- /templates/handler.go.tmpl: -------------------------------------------------------------------------------- 1 | package {{ .Name }} 2 | 3 | import ( 4 | "fmt" 5 | 6 | sdk "github.com/cosmos/cosmos-sdk/types" 7 | ) 8 | 9 | // NewHandler creates a new handler for {{ .Name }} module 10 | func NewHandler(keeper Keeper) sdk.Handler { 11 | return func(ctx sdk.Context, msg sdk.Msg) sdk.Result { 12 | errMsg := fmt.Sprintf("Unrecognized {{ .Name }} message type: %T", msg) 13 | return sdk.ErrUnknownRequest(errMsg).Result() 14 | } 15 | } -------------------------------------------------------------------------------- /templates/querier.go.tmpl: -------------------------------------------------------------------------------- 1 | package {{ .Name }} 2 | 3 | import ( 4 | abci "github.com/tendermint/tendermint/abci/types" 5 | sdk "github.com/cosmos/cosmos-sdk/types" 6 | ) 7 | 8 | // NewQuerier creates a new querier 9 | func NewQuerier(keeper Keeper) sdk.Querier { 10 | return func(ctx sdk.Context, path []string, req abci.RequestQuery) ([]byte, sdk.Error) { 11 | return nil, sdk.ErrUnknownRequest("Unknown package {{ .Name }} query endpoint") 12 | } 13 | } -------------------------------------------------------------------------------- /templates/types.go.tmpl: -------------------------------------------------------------------------------- 1 | package {{ .Name }} 2 | 3 | import ( 4 | "time" 5 | 6 | sdk "github.com/cosmos/cosmos-sdk/types" 7 | ) 8 | 9 | // Defines {{ .Name }} module constants 10 | const ( 11 | DefaultParamspace = ModuleName 12 | StoreKey = ModuleName 13 | RouterKey = ModuleName 14 | QuerierRoute = ModuleName 15 | ) 16 | 17 | // {{ .Name | title }} stores data about a {{ .Name }} 18 | type {{ .Name | title }} struct { 19 | // fill me in 20 | } 21 | -------------------------------------------------------------------------------- /templates/codec.go.tmpl: -------------------------------------------------------------------------------- 1 | package {{ .Name }} 2 | 3 | import "github.com/cosmos/cosmos-sdk/codec" 4 | 5 | // RegisterCodec registers all the necessary types and interfaces for the module 6 | func RegisterCodec(cdc *codec.Codec) { 7 | 8 | } 9 | 10 | // ModuleCodec encodes module codec 11 | var ModuleCodec *codec.Codec 12 | 13 | func init() { 14 | ModuleCodec = codec.New() 15 | RegisterCodec(ModuleCodec) 16 | codec.RegisterCrypto(ModuleCodec) 17 | ModuleCodec.Seal() 18 | } 19 | -------------------------------------------------------------------------------- /go.mod: -------------------------------------------------------------------------------- 1 | module github.com/shanev/cosmos-gen 2 | 3 | go 1.12 4 | 5 | require ( 6 | github.com/gobuffalo/genny v0.1.1 // indirect 7 | github.com/gobuffalo/gogen v0.1.1 // indirect 8 | github.com/gobuffalo/packr/v2 v2.2.0 9 | github.com/jinzhu/inflection v0.0.0-20180308033659-04140366298a 10 | github.com/karrick/godirwalk v1.10.3 // indirect 11 | github.com/sirupsen/logrus v1.4.2 // indirect 12 | golang.org/x/crypto v0.0.0-20190530122614-20be4c3c3ed5 // indirect 13 | golang.org/x/sys v0.0.0-20190602015325-4c4f7f33c9ed // indirect 14 | golang.org/x/tools v0.0.0-20190601110225-0abef6e9ecb8 // indirect 15 | ) 16 | -------------------------------------------------------------------------------- /templates/keeper.go.tmpl: -------------------------------------------------------------------------------- 1 | package {{ .Name }} 2 | 3 | import ( 4 | "github.com/cosmos/cosmos-sdk/codec" 5 | sdk "github.com/cosmos/cosmos-sdk/types" 6 | "github.com/cosmos/cosmos-sdk/x/params" 7 | ) 8 | 9 | // Keeper is the model object for the package {{ .Name }} module 10 | type Keeper struct { 11 | storeKey sdk.StoreKey 12 | codec *codec.Codec 13 | paramStore params.Subspace 14 | } 15 | 16 | // NewKeeper creates a new keeper of the {{ .Name }} Keeper 17 | func NewKeeper(storeKey sdk.StoreKey, paramStore params.Subspace, codec *codec.Codec) Keeper { 18 | return Keeper{ 19 | storeKey, 20 | codec, 21 | paramStore.WithKeyTable(ParamKeyTable()), 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | GO_BIN ?= go 2 | OS := $(shell uname -s) 3 | 4 | install: deps 5 | make build 6 | $(GO_BIN) install -v . 7 | 8 | tidy: 9 | $(GO_BIN) mod tidy 10 | 11 | deps: 12 | $(GO_BIN) get -u github.com/gobuffalo/packr/v2/packr2 13 | packr2 clean 14 | make tidy 15 | 16 | build: 17 | ifeq ($(OS), Darwin) 18 | packr2 build -v . 19 | endif 20 | ifeq ($(OS), Linux) 21 | GOOS=linux GOARCH=amd64 CGO_ENABLED=0 packr2 build -v . 22 | endif 23 | 24 | buidl: build 25 | 26 | # --- Linting 27 | lint: 28 | golangci-lint run --verbose 29 | 30 | install-lint: 31 | ifeq ($(OS), Darwin) 32 | brew install golangci/tap/golangci-lint 33 | endif 34 | ifeq ($(OS), Linux) 35 | GO111MODULE=on $(GO_BIN) get github.com/golangci/golangci-lint/cmd/golangci-lint@692dacb773b703162c091c2d8c59f9cd2d6801db 36 | endif 37 | # --- 38 | -------------------------------------------------------------------------------- /templates/genesis.go.tmpl: -------------------------------------------------------------------------------- 1 | package {{ .Name }} 2 | 3 | import sdk "github.com/cosmos/cosmos-sdk/types" 4 | 5 | // GenesisState defines genesis data for the module 6 | type GenesisState struct { 7 | {{ .Name | title | pluralize }} []{{ .Name | title }} `json:"{{ .Name | pluralize }}"` 8 | } 9 | 10 | // NewGenesisState creates a new genesis state. 11 | func NewGenesisState() GenesisState { 12 | return GenesisState{ 13 | {{ .Name | title | pluralize }}: nil, 14 | } 15 | } 16 | 17 | // DefaultGenesisState returns a default genesis state 18 | func DefaultGenesisState() GenesisState { return NewGenesisState() } 19 | 20 | // InitGenesis initializes story state from genesis file 21 | func InitGenesis(ctx sdk.Context, keeper Keeper, data GenesisState) { 22 | } 23 | 24 | // ExportGenesis exports the genesis state 25 | func ExportGenesis(ctx sdk.Context, keeper Keeper) GenesisState { 26 | return GenesisState{ 27 | // {{ .Name | title | pluralize }}: keeper.{{ .Name | title | pluralize }}(ctx), 28 | } 29 | } 30 | 31 | // ValidateGenesis validates the genesis state data 32 | func ValidateGenesis(data GenesisState) error { 33 | 34 | return nil 35 | } 36 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ![logo](./logo.jpg) 2 | 3 | Cosmos Module Generator generates boilerplate for building [Cosmos SDK](https://github.com/cosmos/cosmos-sdk) modules. 4 | 5 | [![CircleCI](https://circleci.com/gh/shanev/cosmos-gen.svg?style=svg)](https://circleci.com/gh/shanev/cosmos-gen) 6 | [![Go Report Card](https://goreportcard.com/badge/github.com/shanev/cosmos-gen)](https://goreportcard.com/report/github.com/shanev/cosmos-gen) 7 | 8 | ## Getting Started 9 | 10 | ### Prerequisites 11 | 12 | [Go 1.12+](https://golang.org/doc/install) 13 | 14 | ### Install 15 | 16 | ```sh 17 | go get -u github.com/shanev/cosmos-gen 18 | ``` 19 | 20 | ## Usage 21 | 22 | ```sh 23 | cosmos-gen claim 24 | ``` 25 | 26 | This generates the following boilerplate files: 27 | 28 | ``` 29 | └── x 30 | ├── claim 31 | │   ├── codec.go 32 | │   ├── genesis.go 33 | │   ├── handler.go 34 | │   ├── keeper.go 35 | │   ├── module.go 36 | │   ├── params.go 37 | │   ├── querier.go 38 | │   └── types.go 39 | ``` 40 | 41 | ## Built With 42 | 43 | * [Packr](https://github.com/gobuffalo/packr) - Pack templates into a single binary 44 | 45 | ## Authors 46 | 47 | * **Shane Vitarana** - Initial work 48 | -------------------------------------------------------------------------------- /.circleci/config.yml: -------------------------------------------------------------------------------- 1 | version: 2.1 2 | 3 | executors: 4 | go: 5 | docker: 6 | - image: circleci/golang:1.12 7 | working_directory: /tmp/cosmos-gen 8 | jobs: 9 | lint: 10 | executor: go 11 | parallelism: 2 12 | steps: 13 | - checkout 14 | - run: make install-lint 15 | - run: make lint 16 | build: 17 | executor: go 18 | parallelism: 2 19 | steps: 20 | - checkout 21 | - restore_cache: 22 | keys: 23 | - go-mod-v3-{{ checksum "go.sum" }} 24 | - run: make deps 25 | - run: make build 26 | - run: 27 | name: List built binaries 28 | command: | 29 | pwd 30 | ls -l cosmos-gen 31 | - save_cache: 32 | key: go-mod-v3-{{ checksum "go.sum" }} 33 | paths: 34 | - "/go/pkg/mod" 35 | - persist_to_workspace: 36 | root: . 37 | paths: 38 | - cosmos-gen 39 | test: 40 | executor: go 41 | steps: 42 | - attach_workspace: 43 | at: /tmp/cosmos-gen 44 | - run: 45 | name: Run test 46 | command: | 47 | ./cosmos-gen claim 48 | - run: 49 | name: List generated files 50 | command: | 51 | pwd 52 | ls -l ./x/claim/ 53 | workflows: 54 | build-flow: 55 | jobs: 56 | - lint 57 | - build 58 | - test: 59 | requires: 60 | - build 61 | 62 | 63 | -------------------------------------------------------------------------------- /main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "path" 7 | "strings" 8 | "text/template" 9 | 10 | packr "github.com/gobuffalo/packr/v2" 11 | "github.com/jinzhu/inflection" 12 | ) 13 | 14 | // Module specifies the data needed to construct a module 15 | type Module struct { 16 | Name string 17 | } 18 | 19 | func main() { 20 | funcMap := template.FuncMap{ 21 | "title": strings.Title, 22 | "pluralize": inflection.Plural, 23 | } 24 | 25 | name := os.Args[1] 26 | module := Module{name} 27 | 28 | box := packr.New("Cosmos Module Templates", "./templates") 29 | 30 | files := []string{ 31 | "codec.go", 32 | "genesis.go", 33 | "module.go", 34 | "handler.go", 35 | "keeper.go", 36 | "querier.go", 37 | "types.go", 38 | } 39 | 40 | for _, moduleFilename := range files { 41 | moduleTemplateFilename := moduleFilename + ".tmpl" 42 | filename, err := box.FindString(moduleTemplateFilename) 43 | if err != nil { 44 | log.Fatal(err) 45 | return 46 | } 47 | t, err := template.New(moduleTemplateFilename).Funcs(funcMap).Parse(filename) 48 | if err != nil { 49 | log.Fatal(err) 50 | return 51 | } 52 | modulePath := path.Join("x", name) 53 | err = os.MkdirAll(modulePath, os.ModePerm) 54 | if err != nil { 55 | log.Fatal(err) 56 | return 57 | } 58 | f, err := os.Create(path.Join(modulePath, moduleFilename)) 59 | if err != nil { 60 | log.Fatal(err) 61 | return 62 | } 63 | err = t.Execute(f, module) 64 | if err != nil { 65 | log.Fatal("Execute: ", err) 66 | return 67 | } 68 | err = f.Close() 69 | if err != nil { 70 | log.Println(err) 71 | return 72 | } 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /templates/module.go.tmpl: -------------------------------------------------------------------------------- 1 | package {{ .Name }} 2 | 3 | import ( 4 | "encoding/json" 5 | 6 | "github.com/gorilla/mux" 7 | "github.com/spf13/cobra" 8 | 9 | "github.com/cosmos/cosmos-sdk/client/context" 10 | "github.com/cosmos/cosmos-sdk/codec" 11 | sdk "github.com/cosmos/cosmos-sdk/types" 12 | "github.com/cosmos/cosmos-sdk/types/module" 13 | abci "github.com/tendermint/tendermint/abci/types" 14 | ) 15 | 16 | var ( 17 | _ module.AppModule = AppModule{} 18 | _ module.AppModuleBasic = AppModuleBasic{} 19 | ) 20 | 21 | // ModuleName is the name of this module 22 | const ModuleName = "{{.Name}}" 23 | 24 | // AppModuleBasic defines the internal data for the module 25 | // ---------------------------------------------------------------------------- 26 | type AppModuleBasic struct{} 27 | 28 | var _ module.AppModuleBasic = AppModuleBasic{} 29 | 30 | // Name define the name of the module 31 | func (AppModuleBasic) Name() string { 32 | return ModuleName 33 | } 34 | 35 | // RegisterCodec registers the types needed for amino encoding/decoding 36 | func (AppModuleBasic) RegisterCodec(cdc *codec.Codec) { 37 | RegisterCodec(cdc) 38 | } 39 | 40 | // DefaultGenesis creates the default genesis state for testing 41 | func (AppModuleBasic) DefaultGenesis() json.RawMessage { 42 | return ModuleCodec.MustMarshalJSON(DefaultGenesisState()) 43 | } 44 | 45 | // ValidateGenesis validates the genesis state 46 | func (AppModuleBasic) ValidateGenesis(bz json.RawMessage) error { 47 | var data GenesisState 48 | err := ModuleCodec.UnmarshalJSON(bz, &data) 49 | if err != nil { 50 | return err 51 | } 52 | return ValidateGenesis(data) 53 | } 54 | 55 | // register rest routes 56 | func (AppModuleBasic) RegisterRESTRoutes(ctx context.CLIContext, rtr *mux.Router) { 57 | // rest.RegisterRoutes(ctx, rtr, StoreKey) 58 | } 59 | 60 | // get the root tx command of this module 61 | func (AppModuleBasic) GetTxCmd(cdc *codec.Codec) *cobra.Command { 62 | // return cli.GetTxCmd(cdc) 63 | panic("need to add cli.GetTxCmd(cdc)") 64 | } 65 | 66 | // get the root query command of this module 67 | func (AppModuleBasic) GetQueryCmd(cdc *codec.Codec) *cobra.Command { 68 | // return cli.GetQueryCmd(cdc) 69 | panic("need to add cli.GetQueryCmd(cdc)") 70 | } 71 | 72 | // AppModule defines external data for the module 73 | // ---------------------------------------------------------------------------- 74 | type AppModule struct { 75 | AppModuleBasic 76 | keeper Keeper 77 | } 78 | 79 | // NewAppModule creates a new app module 80 | func NewAppModule(keeper Keeper) AppModule { 81 | return AppModule{ 82 | AppModuleBasic: AppModuleBasic{}, 83 | keeper: keeper, 84 | } 85 | } 86 | 87 | // RegisterInvariants enforces registering of invariants 88 | func (AppModule) RegisterInvariants(_ sdk.InvariantRouter) {} 89 | 90 | // Route defines the key for the route 91 | func (AppModule) Route() string { 92 | return RouterKey 93 | } 94 | 95 | // NewHandler creates the handler for the {{.Name}} module 96 | func (am AppModule) NewHandler() sdk.Handler { 97 | return NewHandler(am.keeper) 98 | } 99 | 100 | // QuerierRoute defines the querier route 101 | func (AppModule) QuerierRoute() string { 102 | return QuerierRoute 103 | } 104 | 105 | // NewQuerierHandler creates a new querier handler 106 | func (am AppModule) NewQuerierHandler() sdk.Querier { 107 | return NewQuerier(am.keeper) 108 | } 109 | 110 | // InitGenesis enforces the creation of the genesis state for the {{.Name}} module 111 | func (am AppModule) InitGenesis(ctx sdk.Context, data json.RawMessage) []abci.ValidatorUpdate { 112 | var genesisState GenesisState 113 | ModuleCodec.MustUnmarshalJSON(data, &genesisState) 114 | InitGenesis(ctx, am.keeper, genesisState) 115 | return []abci.ValidatorUpdate{} 116 | } 117 | 118 | // ExportGenesis enforces exporting this module's data to a genesis file 119 | func (am AppModule) ExportGenesis(ctx sdk.Context) json.RawMessage { 120 | gs := ExportGenesis(ctx, am.keeper) 121 | return ModuleCodec.MustMarshalJSON(gs) 122 | } 123 | 124 | // BeginBlock runs before a block is processed 125 | func (AppModule) BeginBlock(_ sdk.Context, _ abci.RequestBeginBlock) sdk.Tags { 126 | return sdk.EmptyTags() 127 | } 128 | 129 | // EndBlock runs at the end of each block 130 | func (AppModule) EndBlock(_ sdk.Context, _ abci.RequestEndBlock) ([]abci.ValidatorUpdate, sdk.Tags) { 131 | return []abci.ValidatorUpdate{}, sdk.EmptyTags() 132 | } 133 | -------------------------------------------------------------------------------- /go.sum: -------------------------------------------------------------------------------- 1 | github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= 2 | github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= 3 | github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= 4 | github.com/gobuffalo/attrs v0.0.0-20190224210810-a9411de4debd/go.mod h1:4duuawTqi2wkkpB4ePgWMaai6/Kc6WEz83bhFwpHzj0= 5 | github.com/gobuffalo/depgen v0.0.0-20190329151759-d478694a28d3/go.mod h1:3STtPUQYuzV0gBVOY3vy6CfMm/ljR4pABfrTeHNLHUY= 6 | github.com/gobuffalo/depgen v0.1.0/go.mod h1:+ifsuy7fhi15RWncXQQKjWS9JPkdah5sZvtHc2RXGlg= 7 | github.com/gobuffalo/envy v1.6.15/go.mod h1:n7DRkBerg/aorDM8kbduw5dN3oXGswK5liaSCx4T5NI= 8 | github.com/gobuffalo/envy v1.7.0 h1:GlXgaiBkmrYMHco6t4j7SacKO4XUjvh5pwXh0f4uxXU= 9 | github.com/gobuffalo/envy v1.7.0/go.mod h1:n7DRkBerg/aorDM8kbduw5dN3oXGswK5liaSCx4T5NI= 10 | github.com/gobuffalo/flect v0.1.0/go.mod h1:d2ehjJqGOH/Kjqcoz+F7jHTBbmDb38yXA598Hb50EGs= 11 | github.com/gobuffalo/flect v0.1.1/go.mod h1:8JCgGVbRjJhVgD6399mQr4fx5rRfGKVzFjbj6RE/9UI= 12 | github.com/gobuffalo/flect v0.1.3/go.mod h1:8JCgGVbRjJhVgD6399mQr4fx5rRfGKVzFjbj6RE/9UI= 13 | github.com/gobuffalo/genny v0.0.0-20190329151137-27723ad26ef9/go.mod h1:rWs4Z12d1Zbf19rlsn0nurr75KqhYp52EAGGxTbBhNk= 14 | github.com/gobuffalo/genny v0.0.0-20190403191548-3ca520ef0d9e h1:JbHBQOMhE0wmpSuejnSkdnL2rULqQTwEGgVe85o7+No= 15 | github.com/gobuffalo/genny v0.0.0-20190403191548-3ca520ef0d9e/go.mod h1:80lIj3kVJWwOrXWWMRzzdhW3DsrdjILVil/SFKBzF28= 16 | github.com/gobuffalo/genny v0.1.0/go.mod h1:XidbUqzak3lHdS//TPu2OgiFB+51Ur5f7CSnXZ/JDvo= 17 | github.com/gobuffalo/genny v0.1.1 h1:iQ0D6SpNXIxu52WESsD+KoQ7af2e3nCfnSBoSF/hKe0= 18 | github.com/gobuffalo/genny v0.1.1/go.mod h1:5TExbEyY48pfunL4QSXxlDOmdsD44RRq4mVZ0Ex28Xk= 19 | github.com/gobuffalo/gitgen v0.0.0-20190315122116-cc086187d211/go.mod h1:vEHJk/E9DmhejeLeNt7UVvlSGv3ziL+djtTr3yyzcOw= 20 | github.com/gobuffalo/gogen v0.0.0-20190315121717-8f38393713f5 h1:f3Fpd5AqsFuTHUEhUeEMIFJkX8FpVnzdW+GpYxIyXkA= 21 | github.com/gobuffalo/gogen v0.0.0-20190315121717-8f38393713f5/go.mod h1:V9QVDIxsgKNZs6L2IYiGR8datgMhB577vzTDqypH360= 22 | github.com/gobuffalo/gogen v0.1.0/go.mod h1:8NTelM5qd8RZ15VjQTFkAW6qOMx5wBbW4dSCS3BY8gg= 23 | github.com/gobuffalo/gogen v0.1.1 h1:dLg+zb+uOyd/mKeQUYIbwbNmfRsr9hd/WtYWepmayhI= 24 | github.com/gobuffalo/gogen v0.1.1/go.mod h1:y8iBtmHmGc4qa3urIyo1shvOD8JftTtfcKi+71xfDNE= 25 | github.com/gobuffalo/logger v0.0.0-20190315122211-86e12af44bc2 h1:8thhT+kUJMTMy3HlX4+y9Da+BNJck+p109tqqKp7WDs= 26 | github.com/gobuffalo/logger v0.0.0-20190315122211-86e12af44bc2/go.mod h1:QdxcLw541hSGtBnhUc4gaNIXRjiDppFGaDqzbrBd3v8= 27 | github.com/gobuffalo/mapi v1.0.1/go.mod h1:4VAGh89y6rVOvm5A8fKFxYG+wIW6LO1FMTG9hnKStFc= 28 | github.com/gobuffalo/mapi v1.0.2 h1:fq9WcL1BYrm36SzK6+aAnZ8hcp+SrmnDyAxhNx8dvJk= 29 | github.com/gobuffalo/mapi v1.0.2/go.mod h1:4VAGh89y6rVOvm5A8fKFxYG+wIW6LO1FMTG9hnKStFc= 30 | github.com/gobuffalo/packd v0.0.0-20190315124812-a385830c7fc0 h1:P6naWPiHm/7R3eYx/ub3VhaW9G+1xAMJ6vzACePaGPI= 31 | github.com/gobuffalo/packd v0.0.0-20190315124812-a385830c7fc0/go.mod h1:M2Juc+hhDXf/PnmBANFCqx4DM3wRbgDvnVWeG2RIxq4= 32 | github.com/gobuffalo/packd v0.1.0 h1:4sGKOD8yaYJ+dek1FDkwcxCHA40M4kfKgFHx8N2kwbU= 33 | github.com/gobuffalo/packd v0.1.0/go.mod h1:M2Juc+hhDXf/PnmBANFCqx4DM3wRbgDvnVWeG2RIxq4= 34 | github.com/gobuffalo/packr/v2 v2.0.9/go.mod h1:emmyGweYTm6Kdper+iywB6YK5YzuKchGtJQZ0Odn4pQ= 35 | github.com/gobuffalo/packr/v2 v2.2.0 h1:Ir9W9XIm9j7bhhkKE9cokvtTl1vBm62A/fene/ZCj6A= 36 | github.com/gobuffalo/packr/v2 v2.2.0/go.mod h1:CaAwI0GPIAv+5wKLtv8Afwl+Cm78K/I/VCm/3ptBN+0= 37 | github.com/gobuffalo/syncx v0.0.0-20190224160051-33c29581e754 h1:tpom+2CJmpzAWj5/VEHync2rJGi+epHNIeRSWjzGA+4= 38 | github.com/gobuffalo/syncx v0.0.0-20190224160051-33c29581e754/go.mod h1:HhnNqWY95UYwwW3uSASeV7vtgYkT2t16hJgV3AEPUpw= 39 | github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= 40 | github.com/jinzhu/inflection v0.0.0-20180308033659-04140366298a h1:eeaG9XMUvRBYXJi4pg1ZKM7nxc5AfXfojeLLW7O5J3k= 41 | github.com/jinzhu/inflection v0.0.0-20180308033659-04140366298a/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc= 42 | github.com/joho/godotenv v1.3.0 h1:Zjp+RcGpHhGlrMbJzXTrZZPrWj+1vfm90La1wgB6Bhc= 43 | github.com/joho/godotenv v1.3.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg= 44 | github.com/karrick/godirwalk v1.8.0 h1:ycpSqVon/QJJoaT1t8sae0tp1Stg21j+dyuS7OoagcA= 45 | github.com/karrick/godirwalk v1.8.0/go.mod h1:H5KPZjojv4lE+QYImBI8xVtrBRgYrIVsaRPx4tDPEn4= 46 | github.com/karrick/godirwalk v1.10.3 h1:lOpSw2vJP0y5eLBW906QwKsUK/fe/QDyoqM5rnnuPDY= 47 | github.com/karrick/godirwalk v1.10.3/go.mod h1:RoGL9dQei4vP9ilrpETWE8CLOZ1kiN0LhBygSwrAsHA= 48 | github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= 49 | github.com/konsorten/go-windows-terminal-sequences v1.0.2 h1:DB17ag19krx9CFsz4o3enTrPXyIXCl+2iCXH/aMAp9s= 50 | github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= 51 | github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= 52 | github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= 53 | github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= 54 | github.com/markbates/oncer v0.0.0-20181203154359-bf2de49a0be2 h1:JgVTCPf0uBVcUSWpyXmGpgOc62nK5HWUBKAGc3Qqa5k= 55 | github.com/markbates/oncer v0.0.0-20181203154359-bf2de49a0be2/go.mod h1:Ld9puTsIW75CHf65OeIOkyKbteujpZVXDpWK6YGZbxE= 56 | github.com/markbates/safe v1.0.1 h1:yjZkbvRM6IzKj9tlu/zMJLS0n/V351OZWRnF3QfaUxI= 57 | github.com/markbates/safe v1.0.1/go.mod h1:nAqgmRi7cY2nqMc92/bSEeQA+R4OheNU2T1kNSCBdG0= 58 | github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= 59 | github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= 60 | github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= 61 | github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= 62 | github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= 63 | github.com/rogpeppe/go-internal v1.1.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= 64 | github.com/rogpeppe/go-internal v1.2.2/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= 65 | github.com/rogpeppe/go-internal v1.3.0 h1:RR9dF3JtopPvtkroDZuVD7qquD0bnHlKSqaQhgwt8yk= 66 | github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= 67 | github.com/sirupsen/logrus v1.4.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= 68 | github.com/sirupsen/logrus v1.4.1 h1:GL2rEmy6nsikmW0r8opw9JIRScdMF5hA8cOYLH7In1k= 69 | github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= 70 | github.com/sirupsen/logrus v1.4.2 h1:SPIRibHv4MatM3XXNO2BJeFLZwZ2LvZgfQ5+UNI2im4= 71 | github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= 72 | github.com/spf13/cobra v0.0.3 h1:ZlrZ4XsMRm04Fr5pSFxBgfND2EBVa1nLpiy1stUsX/8= 73 | github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= 74 | github.com/spf13/pflag v1.0.3 h1:zPAT6CGy6wXeQ7NtTnaTerfKOsV6V6F8agHXFiazDkg= 75 | github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= 76 | github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= 77 | github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= 78 | github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= 79 | github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q= 80 | github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= 81 | golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= 82 | golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2 h1:VklqNMn3ovrHsnt90PveolxSbWFaJdECFbxSq0Mqo2M= 83 | golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= 84 | golang.org/x/crypto v0.0.0-20190422162423-af44ce270edf/go.mod h1:WFFai1msRO1wXaEeE5yQxYXgSfI8pQAWXbQop6sCtWE= 85 | golang.org/x/crypto v0.0.0-20190530122614-20be4c3c3ed5 h1:8dUaAV7K4uHsF56JQWkprecIQKdPHtR9jCHF5nB8uzc= 86 | golang.org/x/crypto v0.0.0-20190530122614-20be4c3c3ed5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= 87 | golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= 88 | golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= 89 | golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 90 | golang.org/x/sync v0.0.0-20190412183630-56d357773e84 h1:IqXQ59gzdXv58Jmm2xn0tSOR9i6HqroaOFRQ3wR/dJQ= 91 | golang.org/x/sync v0.0.0-20190412183630-56d357773e84/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 92 | golang.org/x/sync v0.0.0-20190423024810-112230192c58 h1:8gQV6CLnAEikrhgkHFbMAEhagSSnXWGV915qUMm9mrU= 93 | golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 94 | golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= 95 | golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a h1:1BGLXjeY4akVXGgbC9HugT3Jv3hCI0z56oJR5vAMgBU= 96 | golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= 97 | golang.org/x/sys v0.0.0-20190403152447-81d4e9dc473e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 98 | golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 99 | golang.org/x/sys v0.0.0-20190419153524-e8e3143a4f4a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 100 | golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 101 | golang.org/x/sys v0.0.0-20190602015325-4c4f7f33c9ed h1:uPxWBzB3+mlnjy9W58qY1j/cjyFjutgw/Vhan2zLy/A= 102 | golang.org/x/sys v0.0.0-20190602015325-4c4f7f33c9ed/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 103 | golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= 104 | golang.org/x/tools v0.0.0-20190329151228-23e29df326fe/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= 105 | golang.org/x/tools v0.0.0-20190416151739-9c9e1878f421 h1:0lteSdckF24NlQCFAMS8BzXQy45S0v4SY3N3BBkq/gA= 106 | golang.org/x/tools v0.0.0-20190416151739-9c9e1878f421/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= 107 | golang.org/x/tools v0.0.0-20190420181800-aa740d480789/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= 108 | golang.org/x/tools v0.0.0-20190601110225-0abef6e9ecb8 h1:KFgOV120pDm8h0MBnt26wwMmwdhSXE+K+G9jg1ZjxbE= 109 | golang.org/x/tools v0.0.0-20190601110225-0abef6e9ecb8/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= 110 | gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= 111 | gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= 112 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright [yyyy] [name of copyright owner] 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | --------------------------------------------------------------------------------