Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@ dist/
build/
*.pyc
*.swp
/fx
tmp/
42 changes: 30 additions & 12 deletions Gopkg.lock

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

6 changes: 6 additions & 0 deletions Gopkg.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
6 changes: 4 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
21 changes: 21 additions & 0 deletions api/client.go
Original file line number Diff line number Diff line change
@@ -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
}
3 changes: 3 additions & 0 deletions api/fx.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
//go:generate sh gen.sh

package api
Loading