diff --git a/grpc-gateway/Gopkg.lock b/grpc-gateway/Gopkg.lock deleted file mode 100644 index a083ce6..0000000 --- a/grpc-gateway/Gopkg.lock +++ /dev/null @@ -1,110 +0,0 @@ -# This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'. - - -[[projects]] - name = "github.com/golang/protobuf" - packages = [ - "jsonpb", - "proto", - "protoc-gen-go/descriptor", - "ptypes", - "ptypes/any", - "ptypes/duration", - "ptypes/struct", - "ptypes/timestamp" - ] - revision = "b4deda0973fb4c70b50d226b1af49f3da59f5265" - version = "v1.1.0" - -[[projects]] - name = "github.com/grpc-ecosystem/grpc-gateway" - packages = [ - "runtime", - "runtime/internal", - "utilities" - ] - revision = "92583770e3f01b09a0d3e9bdf64321d8bebd48f2" - version = "v1.4.1" - -[[projects]] - branch = "master" - name = "golang.org/x/net" - packages = [ - "context", - "http/httpguts", - "http2", - "http2/hpack", - "idna", - "internal/timeseries", - "trace" - ] - revision = "97aa3a539ec716117a9d15a4659a911f50d13c3c" - -[[projects]] - name = "golang.org/x/text" - packages = [ - "collate", - "collate/build", - "internal/colltab", - "internal/gen", - "internal/tag", - "internal/triegen", - "internal/ucd", - "language", - "secure/bidirule", - "transform", - "unicode/bidi", - "unicode/cldr", - "unicode/norm", - "unicode/rangetable" - ] - revision = "f21a4dfb5e38f5895301dc265a8def02365cc3d0" - version = "v0.3.0" - -[[projects]] - branch = "master" - name = "google.golang.org/genproto" - packages = [ - "googleapis/api/annotations", - "googleapis/rpc/status" - ] - revision = "ff3583edef7de132f219f0efc00e097cabcc0ec0" - -[[projects]] - name = "google.golang.org/grpc" - packages = [ - ".", - "balancer", - "balancer/base", - "balancer/roundrobin", - "codes", - "connectivity", - "credentials", - "encoding", - "encoding/proto", - "grpclog", - "internal", - "internal/backoff", - "internal/channelz", - "internal/grpcrand", - "keepalive", - "metadata", - "naming", - "peer", - "resolver", - "resolver/dns", - "resolver/passthrough", - "stats", - "status", - "tap", - "transport" - ] - revision = "168a6198bcb0ef175f7dacec0b8691fc141dc9b8" - version = "v1.13.0" - -[solve-meta] - analyzer-name = "dep" - analyzer-version = 1 - inputs-digest = "b01280c8f99d0e9fac2829c13bfd2db7584bf9b1b2b3348a91a92d5732845bcb" - solver-name = "gps-cdcl" - solver-version = 1 diff --git a/grpc-gateway/Gopkg.toml b/grpc-gateway/Gopkg.toml deleted file mode 100644 index 00da9f0..0000000 --- a/grpc-gateway/Gopkg.toml +++ /dev/null @@ -1,50 +0,0 @@ -# Gopkg.toml example -# -# Refer to https://github.com/golang/dep/blob/master/docs/Gopkg.toml.md -# for detailed Gopkg.toml documentation. -# -# required = ["github.com/user/thing/cmd/thing"] -# ignored = ["github.com/user/project/pkgX", "bitbucket.org/user/project/pkgA/pkgY"] -# -# [[constraint]] -# name = "github.com/user/project" -# version = "1.0.0" -# -# [[constraint]] -# name = "github.com/user/project2" -# branch = "dev" -# source = "github.com/myfork/project2" -# -# [[override]] -# name = "github.com/x/y" -# version = "2.4.0" -# -# [prune] -# non-go = false -# go-tests = true -# unused-packages = true - - -[[constraint]] - name = "github.com/golang/protobuf" - version = "1.1.0" - -[[constraint]] - name = "github.com/grpc-ecosystem/grpc-gateway" - version = "1.4.1" - -[[constraint]] - branch = "master" - name = "golang.org/x/net" - -[[constraint]] - branch = "master" - name = "google.golang.org/genproto" - -[[constraint]] - name = "google.golang.org/grpc" - version = "1.13.0" - -[prune] - go-tests = true - unused-packages = true diff --git a/grpc-gateway/Makefile b/grpc-gateway/Makefile index 67ab083..1df67ef 100644 --- a/grpc-gateway/Makefile +++ b/grpc-gateway/Makefile @@ -1,10 +1,7 @@ -.PHONY: prepare build proto +.PHONY: build proto REGISTRY_DOMAIN := jun06t -prepare: - dep ensure -v - build: docker build -f Dockerfile-gateway -t ${REGISTRY_DOMAIN}/grpc-gateway:latest . docker build -f Dockerfile-grpc -t ${REGISTRY_DOMAIN}/grpc-backend:latest . diff --git a/grpc-gateway/gateway/main.go b/grpc-gateway/gateway/main.go index b73244d..3e887c4 100644 --- a/grpc-gateway/gateway/main.go +++ b/grpc-gateway/gateway/main.go @@ -10,6 +10,7 @@ import ( "github.com/grpc-ecosystem/grpc-gateway/runtime" pb "github.com/jun06t/grpc-sample/grpc-gateway/proto" "google.golang.org/grpc" + "google.golang.org/grpc/credentials/insecure" ) var ( @@ -26,10 +27,10 @@ func init() { func newGateway(ctx context.Context, opts ...runtime.ServeMuxOption) (http.Handler, error) { mux := runtime.NewServeMux(opts...) - dialOpts := []grpc.DialOption{grpc.WithInsecure()} + dialOpts := []grpc.DialOption{grpc.WithTransportCredentials(insecure.NewCredentials())} fmt.Println("Endpoint: ", endpoint) - conn, err := grpc.Dial(endpoint, dialOpts...) + conn, err := grpc.NewClient(endpoint, dialOpts...) if err != nil { return nil, err }