Skip to content

Commit

Permalink
Merge branch 'master' into backend-error
Browse files Browse the repository at this point in the history
  • Loading branch information
PierreF committed Feb 11, 2021
2 parents dc1edd8 + 2cfa50c commit 4be4a08
Show file tree
Hide file tree
Showing 30 changed files with 1,794 additions and 990 deletions.
8 changes: 6 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,12 @@ RUN tar xzvf mosquitto-${MOSQUITTO_VERSION}.tar.gz && rm mosquitto-${MOSQUITTO_V
RUN cd mosquitto-${MOSQUITTO_VERSION} && make WITH_WEBSOCKETS=yes && make install && cd ..

#Get Go.
RUN wget https://dl.google.com/go/go${GO_VERSION}.linux-amd64.tar.gz && tar -C /usr/local -xzf go${GO_VERSION}.linux-amd64.tar.gz
RUN export PATH=$PATH:/usr/local/go/bin && go version && rm go${GO_VERSION}.linux-amd64.tar.gz
RUN export GO_ARCH=$(uname -m | sed -es/x86_64/amd64/ -es/armv7l/armv6l/ -es/aarch64/arm64/) && \
wget https://dl.google.com/go/go${GO_VERSION}.linux-${GO_ARCH}.tar.gz && \
tar -C /usr/local -xzf go${GO_VERSION}.linux-${GO_ARCH}.tar.gz && \
export PATH=$PATH:/usr/local/go/bin && \
go version && \
rm go${GO_VERSION}.linux-${GO_ARCH}.tar.gz

#Build the plugin from local source
COPY ./ ./
Expand Down
74 changes: 0 additions & 74 deletions Gopkg.toml

This file was deleted.

37 changes: 27 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,18 +1,35 @@
CFLAGS := -I/usr/local/include -fPIC
LDFLAGS := -shared

UNAME_S := $(shell uname -s)

ifeq ($(UNAME_S),Darwin)
LDFLAGS += -undefined dynamic_lookup
endif

all:
go build -buildmode=c-archive go-auth.go
go build -buildmode=c-shared -o go-auth.so
@echo "Bulding for $(UNAME_S)"
env CGO_CFLAGS="$(CFLAGS)" go build -buildmode=c-archive go-auth.go
env CGO_LDFLAGS="$(LDFLAGS)" go build -buildmode=c-shared -o go-auth.so
go build pw-gen/pw.go

dev-requirements:
go get -u github.com/golang/dep/cmd/dep
go get -u github.com/smartystreets/goconvey

test:
go test ./backends ./cache ./hashing -v -bench=none -count=1
go test ./backends ./cache ./hashing -v -count=1

benchmark:
go test ./backends -v -bench=. -run=^a
test-backends:
go test ./backends -v -failfast -count=1

test-cache:
go test ./cache -v -failfast -count=1

test-hashing:
go test ./hashing -v -failfast -count=1

service:
@echo "Generating gRPC code from .proto files"
@go generate grpc/grpc.go
@go generate grpc/grpc.go

clean:
rm -f go-auth.h
rm -f go-auth.so
rm -f pw
Loading

0 comments on commit 4be4a08

Please sign in to comment.