Skip to content

Commit

Permalink
Sample client
Browse files Browse the repository at this point in the history
  • Loading branch information
owulveryck committed Sep 12, 2017
1 parent b7dc9e2 commit 4a5e358
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,4 @@ vendor/

# End of https://www.gitignore.io/api/go
example-client
bin/
24 changes: 24 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
LINUX=bin/nhite-sample-cli-linux-amd64
WINDOWS64=bin/nhite-sample-cli-amd64.exe
DARWIN=bin/nhite-sample-cli-darwin64

# These are the values we want to pass for VERSION and BUILD
# # git tag 1.0.1
# # git commit -am "One more change after the tags"
VERSION=`git describe --tags`
BUILD=`date +%FT%T%z`

LDFLAGS=-ldflags "-w -s -X main.Version=${VERSION} -X main.Build=${BUILD}"

all: $(LINUX) $(WINDOWS64) $(WINDOWS32) $(DARWIN)

$(LINUX): *.go
GOOS=linux GOARCH=amd64 go build ${LDFLAGS} -o $(LINUX) *.go

$(WINDOWS64): *.go
GOOS=windows GOARCH=amd64 go build ${LDFLAGS} -o $(WINDOWS64) *.go

$(DARWIN): *.go
GOOS=darwin GOARCH=amd64 go build ${LDFLAGS} -o $(DARWIN) *.go


4 changes: 2 additions & 2 deletions env.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export TAAS_CLIENT_CERT_FILE="../out/test.crt"
export TAAS_CLIENT_TAAS_ADDRESS="127.0.0.1:1234"
export NHITE_CLIENT_CERT_FILE="../out/test.crt"
export NHITE_CLIENT_TAAS_ADDRESS="127.0.0.1:1234"
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (
"google.golang.org/grpc/credentials"
)

const envPrefix = "TAAS_CLIENT"
const envPrefix = "NHITE_CLIENT"

type configuration struct {
CertFile string `envconfig:"CERT_FILE" required:"true"`
Expand Down

0 comments on commit 4a5e358

Please sign in to comment.