Skip to content

Commit

Permalink
Use grpc-gateway v1.5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
izumin5210 committed Sep 17, 2018
1 parent 7ca4fe1 commit 6b28cfa
Show file tree
Hide file tree
Showing 8 changed files with 58 additions and 66 deletions.
19 changes: 16 additions & 3 deletions Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Gopkg.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ required = [

[[constraint]]
name = "github.com/grpc-ecosystem/grpc-gateway"
version = "^1.4.1"
version = "^1.5.0"

[[constraint]]
name = "github.com/pkg/errors"
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ require (
github.com/golang/protobuf v1.2.0
github.com/google/go-cmp v0.2.0
github.com/grpc-ecosystem/go-grpc-middleware v1.0.0
github.com/grpc-ecosystem/grpc-gateway v1.4.1
github.com/grpc-ecosystem/grpc-gateway v1.5.0
github.com/hashicorp/hcl v0.0.0-20171017181929-23c074d0eceb // indirect
github.com/inconshreveable/mousetrap v1.0.0 // indirect
github.com/izumin5210/clicontrib v0.1.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ github.com/google/go-cmp v0.2.0 h1:+dTQ8DZQJz0Mb/HjFlkptS1FeQ4cWSnN941F8aEG4SQ=
github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
github.com/grpc-ecosystem/go-grpc-middleware v1.0.0 h1:BWIsLfhgKhV5g/oF34aRjniBHLTZe5DNekSjbAjIS6c=
github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs=
github.com/grpc-ecosystem/grpc-gateway v1.4.1 h1:pX7cnDwSSmG0dR9yNjCQSSpmsJOqFdT7SzVp5Yl9uVw=
github.com/grpc-ecosystem/grpc-gateway v1.4.1/go.mod h1:RSKVYQBd5MCa4OVpNdGskqpgL2+G+NZTnrVHpWWfpdw=
github.com/grpc-ecosystem/grpc-gateway v1.5.0 h1:WcmKMm43DR7RdtlkEXQJyo5ws8iTp98CyhCCbOHMvNI=
github.com/grpc-ecosystem/grpc-gateway v1.5.0/go.mod h1:RSKVYQBd5MCa4OVpNdGskqpgL2+G+NZTnrVHpWWfpdw=
github.com/hashicorp/hcl v0.0.0-20171017181929-23c074d0eceb h1:1OvvPvZkn/yCQ3xBcM8y4020wdkMXPHLB4+NfoGWh4U=
github.com/hashicorp/hcl v0.0.0-20171017181929-23c074d0eceb/go.mod h1:oZtUIOe8dh44I2q6ScRibXws4Ajl+d+nod3AaR9vL5w=
github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI=
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,5 @@ required = [

[[override]]
name = "github.com/grpc-ecosystem/grpc-gateway"
# To use `paths` option in `protoc-gen-grpc-gateway`
# See https://github.com/grpc-ecosystem/grpc-gateway/pull/711
revision = "42fa2028fd3ba4a546dd525d9db71573f1992ba1"

[[override]]
name = "google.golang.org/grpc"
# To ignore grpc-gateway@42fa2028's constraints
version = "^1.11.3"
version = "^1.5.0"

Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,5 @@ required = [

[[override]]
name = "github.com/grpc-ecosystem/grpc-gateway"
# To use `paths` option in `protoc-gen-grpc-gateway`
# See https://github.com/grpc-ecosystem/grpc-gateway/pull/711
revision = "42fa2028fd3ba4a546dd525d9db71573f1992ba1"

[[override]]
name = "google.golang.org/grpc"
# To ignore grpc-gateway@42fa2028's constraints
version = "^1.11.3"
version = "^1.5.0"

70 changes: 35 additions & 35 deletions pkg/grapicmd/internal/module/generator/template/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,41 +6,41 @@ import (
"github.com/jessevdk/go-assets"
)

var _Initbc4053f4dd26ceb67e4646e8c1d2cc75897c4dd0 = "package app\n\nimport (\n\t\"github.com/izumin5210/grapi/pkg/grapiserver\"\n)\n\n// Run starts the grapiserver.\nfunc Run() error {\n\ts := grapiserver.New(\n\t\tgrapiserver.WithDefaultLogger(),\n\t\tgrapiserver.WithServers(\n\t\t// TODO\n\t\t),\n\t)\n\treturn s.Serve()\n}\n"
var _Init23b808cac963edf44a497827f2a6eff5ddac970f = "required = [\n \"github.com/golang/protobuf/protoc-gen-go\",\n \"github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway\",\n \"github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger\",\n]\n\n[[constraint]]\n{{- if .headUsed }}\n branch = \"master\"\n{{- end }}\n name = \"github.com/izumin5210/grapi\"\n{{- if not .headUsed }}\n version = \"{{ .version }}\"\n{{- end }}\n\n[[override]]\n name = \"github.com/grpc-ecosystem/grpc-gateway\"\n # To use `paths` option in `protoc-gen-grpc-gateway`\n # See https://github.com/grpc-ecosystem/grpc-gateway/pull/711\n revision = \"42fa2028fd3ba4a546dd525d9db71573f1992ba1\"\n\n[[override]]\n name = \"google.golang.org/grpc\"\n # To ignore grpc-gateway@42fa2028's constraints\n version = \"^1.11.3\"\n"
var _Initc051c9ff1a8e446bc9636d3144c2775a7e235322 = "package = \"{{.packageName}}\"\n\n[grapi]\nserver_dir = \"./app/server\"\n\n[protoc]\nprotos_dir = \"./api/protos\"\nout_dir = \"./api\"\nimport_dirs = [\n \"./api/protos\",\n \"./vendor/github.com/grpc-ecosystem/grpc-gateway\",\n \"./vendor/github.com/grpc-ecosystem/grpc-gateway/third_party/googleapis\",\n]\n\n [[protoc.plugins]]\n path = \"./vendor/github.com/golang/protobuf/protoc-gen-go\"\n name = \"go\"\n args = { plugins = \"grpc\", paths = \"source_relative\" }\n\n [[protoc.plugins]]\n path = \"./vendor/github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway\"\n name = \"grpc-gateway\"\n args = { logtostderr = true, paths = \"source_relative\" }\n\n [[protoc.plugins]]\n path = \"./vendor/github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger\"\n name = \"swagger\"\n args = { logtostderr = true }\n"
var _Initd135936e91856b6159ac2eedcf89aa9f07773f82 = "package main\n\nimport (\n\t\"os\"\n\n\t\"google.golang.org/grpc/grpclog\"\n\n\t\"{{ .importPath }}/app\"\n)\n\nfunc main() {\n\tos.Exit(run())\n}\n\nfunc run() int {\n\terr := app.Run()\n\tif err != nil {\n\t\tgrpclog.Errorf(\"server was shutdown with errors: %v\", err)\n\t\treturn 1\n\t}\n\treturn 0\n}\n"
var _Init8d21956ba8abe388f964e47be0f7e5d170a2fce5 = ""
var _Init38e76c5db8962fa825cf2bd8b23a2dc985c4513e = "*.so\n/vendor\n/bin\n/tmp\n"
var _Init8d21956ba8abe388f964e47be0f7e5d170a2fce5 = ""
var _Initd135936e91856b6159ac2eedcf89aa9f07773f82 = "package main\n\nimport (\n\t\"os\"\n\n\t\"google.golang.org/grpc/grpclog\"\n\n\t\"{{ .importPath }}/app\"\n)\n\nfunc main() {\n\tos.Exit(run())\n}\n\nfunc run() int {\n\terr := app.Run()\n\tif err != nil {\n\t\tgrpclog.Errorf(\"server was shutdown with errors: %v\", err)\n\t\treturn 1\n\t}\n\treturn 0\n}\n"
var _Init23b808cac963edf44a497827f2a6eff5ddac970f = "required = [\n \"github.com/golang/protobuf/protoc-gen-go\",\n \"github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway\",\n \"github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger\",\n]\n\n[[constraint]]\n{{- if .headUsed }}\n branch = \"master\"\n{{- end }}\n name = \"github.com/izumin5210/grapi\"\n{{- if not .headUsed }}\n version = \"{{ .version }}\"\n{{- end }}\n\n[[override]]\n name = \"github.com/grpc-ecosystem/grpc-gateway\"\n version = \"^1.5.0\"\n"
var _Initc051c9ff1a8e446bc9636d3144c2775a7e235322 = "package = \"{{.packageName}}\"\n\n[grapi]\nserver_dir = \"./app/server\"\n\n[protoc]\nprotos_dir = \"./api/protos\"\nout_dir = \"./api\"\nimport_dirs = [\n \"./api/protos\",\n \"./vendor/github.com/grpc-ecosystem/grpc-gateway\",\n \"./vendor/github.com/grpc-ecosystem/grpc-gateway/third_party/googleapis\",\n]\n\n [[protoc.plugins]]\n path = \"./vendor/github.com/golang/protobuf/protoc-gen-go\"\n name = \"go\"\n args = { plugins = \"grpc\", paths = \"source_relative\" }\n\n [[protoc.plugins]]\n path = \"./vendor/github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway\"\n name = \"grpc-gateway\"\n args = { logtostderr = true, paths = \"source_relative\" }\n\n [[protoc.plugins]]\n path = \"./vendor/github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger\"\n name = \"swagger\"\n args = { logtostderr = true }\n"
var _Initbc4053f4dd26ceb67e4646e8c1d2cc75897c4dd0 = "package app\n\nimport (\n\t\"github.com/izumin5210/grapi/pkg/grapiserver\"\n)\n\n// Run starts the grapiserver.\nfunc Run() error {\n\ts := grapiserver.New(\n\t\tgrapiserver.WithDefaultLogger(),\n\t\tgrapiserver.WithServers(\n\t\t// TODO\n\t\t),\n\t)\n\treturn s.Serve()\n}\n"
var _Init71ed560e812a4261bc8b56d9feaef4800830e0b7 = ""

// Init returns go-assets FileSystem
var Init = assets.NewFileSystem(map[string][]string{"/api/protos": []string{".keep.tmpl"}, "/app": []string{"run.go.tmpl"}, "/app/server": []string{".keep.tmpl"}, "/cmd": []string{}, "/cmd/server": []string{"run.go.tmpl"}, "/": []string{".gitignore.tmpl", "Gopkg.toml.tmpl", "grapi.toml.tmpl"}, "/api": []string{}}, map[string]*assets.File{
"/api/protos/.keep.tmpl": &assets.File{
Path: "/api/protos/.keep.tmpl",
FileMode: 0x1a4,
var Init = assets.NewFileSystem(map[string][]string{"/": []string{".gitignore.tmpl", "Gopkg.toml.tmpl", "grapi.toml.tmpl"}, "/api": []string{}, "/api/protos": []string{".keep.tmpl"}, "/app": []string{"run.go.tmpl"}, "/app/server": []string{".keep.tmpl"}, "/cmd": []string{}, "/cmd/server": []string{"run.go.tmpl"}}, map[string]*assets.File{
"/api/protos": &assets.File{
Path: "/api/protos",
FileMode: 0x800001ed,
Mtime: time.Unix(1520753819, 1520753819000000000),
Data: []byte(_Init8d21956ba8abe388f964e47be0f7e5d170a2fce5),
Data: nil,
}, "/app": &assets.File{
Path: "/app",
FileMode: 0x800001ed,
Mtime: time.Unix(1521995193, 1521995193000000000),
Data: nil,
}, "/app/run.go.tmpl": &assets.File{
Path: "/app/run.go.tmpl",
FileMode: 0x1a4,
Mtime: time.Unix(1521995193, 1521995193000000000),
Data: []byte(_Initbc4053f4dd26ceb67e4646e8c1d2cc75897c4dd0),
}, "/app/server": &assets.File{
Path: "/app/server",
FileMode: 0x800001ed,
Mtime: time.Unix(1521042119, 1521042119000000000),
Data: nil,
}, "/cmd/server/run.go.tmpl": &assets.File{
Path: "/cmd/server/run.go.tmpl",
FileMode: 0x1a4,
Mtime: time.Unix(1530424640, 1530424640000000000),
Data: []byte(_Initd135936e91856b6159ac2eedcf89aa9f07773f82),
}, "/.gitignore.tmpl": &assets.File{
Path: "/.gitignore.tmpl",
}, "/app/server/.keep.tmpl": &assets.File{
Path: "/app/server/.keep.tmpl",
FileMode: 0x1a4,
Mtime: time.Unix(1520753819, 1520753819000000000),
Data: []byte(_Init38e76c5db8962fa825cf2bd8b23a2dc985c4513e),
Mtime: time.Unix(1521042119, 1521042119000000000),
Data: []byte(_Init71ed560e812a4261bc8b56d9feaef4800830e0b7),
}, "/cmd/server": &assets.File{
Path: "/cmd/server",
FileMode: 0x800001ed,
Expand All @@ -49,41 +49,41 @@ var Init = assets.NewFileSystem(map[string][]string{"/api/protos": []string{".ke
}, "/": &assets.File{
Path: "/",
FileMode: 0x800001ed,
Mtime: time.Unix(1534689869, 1534689869000000000),
Mtime: time.Unix(1537186773, 1537186773000000000),
Data: nil,
}, "/api": &assets.File{
Path: "/api",
FileMode: 0x800001ed,
Mtime: time.Unix(1520753819, 1520753819000000000),
Data: nil,
}, "/app/server/.keep.tmpl": &assets.File{
Path: "/app/server/.keep.tmpl",
FileMode: 0x1a4,
Mtime: time.Unix(1521042119, 1521042119000000000),
Data: []byte(_Init71ed560e812a4261bc8b56d9feaef4800830e0b7),
}, "/cmd": &assets.File{
Path: "/cmd",
FileMode: 0x800001ed,
Mtime: time.Unix(1520753819, 1520753819000000000),
Data: nil,
}, "/api/protos": &assets.File{
Path: "/api/protos",
FileMode: 0x800001ed,
}, "/.gitignore.tmpl": &assets.File{
Path: "/.gitignore.tmpl",
FileMode: 0x1a4,
Mtime: time.Unix(1520753819, 1520753819000000000),
Data: nil,
}, "/app/run.go.tmpl": &assets.File{
Path: "/app/run.go.tmpl",
Data: []byte(_Init38e76c5db8962fa825cf2bd8b23a2dc985c4513e),
}, "/api/protos/.keep.tmpl": &assets.File{
Path: "/api/protos/.keep.tmpl",
FileMode: 0x1a4,
Mtime: time.Unix(1521995193, 1521995193000000000),
Data: []byte(_Initbc4053f4dd26ceb67e4646e8c1d2cc75897c4dd0),
Mtime: time.Unix(1520753819, 1520753819000000000),
Data: []byte(_Init8d21956ba8abe388f964e47be0f7e5d170a2fce5),
}, "/cmd/server/run.go.tmpl": &assets.File{
Path: "/cmd/server/run.go.tmpl",
FileMode: 0x1a4,
Mtime: time.Unix(1530424640, 1530424640000000000),
Data: []byte(_Initd135936e91856b6159ac2eedcf89aa9f07773f82),
}, "/Gopkg.toml.tmpl": &assets.File{
Path: "/Gopkg.toml.tmpl",
FileMode: 0x1a4,
Mtime: time.Unix(1534681778, 1534681778000000000),
Mtime: time.Unix(1537186773, 1537186773000000000),
Data: []byte(_Init23b808cac963edf44a497827f2a6eff5ddac970f),
}, "/grapi.toml.tmpl": &assets.File{
Path: "/grapi.toml.tmpl",
FileMode: 0x1a4,
Mtime: time.Unix(1534689869, 1534689869000000000),
Mtime: time.Unix(1537184177, 1537184177000000000),
Data: []byte(_Initc051c9ff1a8e446bc9636d3144c2775a7e235322),
}}, "")
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,4 @@ required = [

[[override]]
name = "github.com/grpc-ecosystem/grpc-gateway"
# To use `paths` option in `protoc-gen-grpc-gateway`
# See https://github.com/grpc-ecosystem/grpc-gateway/pull/711
revision = "42fa2028fd3ba4a546dd525d9db71573f1992ba1"

[[override]]
name = "google.golang.org/grpc"
# To ignore grpc-gateway@42fa2028's constraints
version = "^1.11.3"
version = "^1.5.0"

0 comments on commit 6b28cfa

Please sign in to comment.