New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use gRPC over websocket #100

Merged
merged 27 commits into from Dec 13, 2017
Commits
File filter...
Filter file types
Jump to file or symbol
Failed to load files and symbols.
+1,755 −415
Diff settings

Always

Just for now

Copy path View file
@@ -4,3 +4,5 @@ dist/
build/
*.pyc
*.swp
/fx
tmp/
Copy path View file

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
Copy path View file
@@ -45,3 +45,9 @@
[[constraint]]
name = "github.com/jteeuwen/go-bindata"
version = "3.0.7"

[[constraint]]
name = "github.com/golang/protobuf"

[[constraint]]
name = "github.com/grpc-ecosystem/grpc-gateway"
Copy path View file
@@ -3,7 +3,9 @@ DIST_DIR=./dist

install-deps:
@dep ensure
build:
generate:
@go generate ./api/fx.go
build: generate
go build -o ${OUTPUT_DIR}/fx fx.go
cross:
goreleaser --snapshot --skip-publish --skip-validate
@@ -14,4 +16,4 @@ clean:
rm -rf ${DIST_DIR}
zip:
zip -r images.zip images/
.PHONY: test build start list clean
.PHONY: test build start list clean generate
Copy path View file
@@ -185,6 +185,7 @@ end
##### Requirements
* Docker: make sure [Docker](https://docs.docker.com/engine/installation/) installed and running on your server.
* dep: fx project uses [dep](https://github.com/golang/dep) to do the golang dependency management.
* protoc / grpc: Used for RPC and types definition (See a [setup script](https://gist.github.com/muka/4cc42c478b2699f0969450a1ec1ce44c) example)

##### Build and Run

Copy path View file
@@ -0,0 +1,21 @@
package api

import (
"google.golang.org/grpc"
)

func NewClient(grpcEndpoint string) (FxServiceClient, *grpc.ClientConn, error) {

var opts []grpc.DialOption

//TODO review options
opts = append(opts, grpc.WithInsecure())

conn, err := grpc.Dial(grpcEndpoint, opts...)
if err != nil {
return nil, nil, err
}

client := NewFxServiceClient(conn)
return client, conn, nil
}
Copy path View file
@@ -0,0 +1,3 @@
//go:generate sh gen.sh

package api
Oops, something went wrong.
ProTip! Use n and p to navigate between commits in a pull request.