2020-02-06 14:37:43 -08:00
2019-12-10 11:49:27 -08:00
2020-02-05 19:46:54 -08:00
2020-02-04 12:23:52 -08:00
2020-02-06 14:37:43 -08:00
2020-02-06 14:37:43 -08:00
2020-01-28 21:09:36 -08:00
2020-02-06 14:37:43 -08:00
2020-01-17 10:38:25 -08:00
2020-01-17 10:37:58 -08:00
2020-02-05 13:14:09 -08:00
2020-02-05 13:14:09 -08:00
2020-02-02 11:06:43 -08:00
2020-01-29 16:39:35 -08:00

Database migrations

Install goose:

go get -u github.com/pressly/goose/cmd/goose

Note: Up migration are automatically executed when the application is run.

goose -dir db create <name> sql                 # Create migration in db folder
goose -dir db postgres "${DB_DATASOURCE_NAME}" up    # Migrate the DB to the most recent version available
goose -dir db postgres "${DB_DATASOURCE_NAME}" down  # Roll back the version by 1
goose help                                      # See all available commands

gRPC installation

Install gRPC:

go get -u google.golang.org/grpc

Download pre-compiled binaries for your platform(protoc--.zip) from here: https://github.com/google/protobuf/releases

On macOS or Linux:

  • Unzip protoc-<version>-<platform>.zip
  • Move bin/protoc to /usr/local/bin/
  • Move include/google to /usr/local/include

Then use go get -u to download the following packages:

go get -u github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway
go get -u github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger
go get -u github.com/golang/protobuf/protoc-gen-go

This will place three binaries in your $GOBIN;

  • protoc-gen-grpc-gateway
  • protoc-gen-swagger
  • protoc-gen-go

Make sure that your $GOBIN is in your $PATH.

gRPC Code generation

Generate Go, HTTP reverse-proxy and Swagger files:

protoc -I/usr/local/include \
  -Iapi/third_party/googleapis \
  -Iapi/ \
  api/*.proto \
  --go_out=plugins=grpc:api \
  --grpc-gateway_out=logtostderr=true:api \
  --swagger_out=logtostderr=true:api
Description
The open source, end-to-end computer vision platform. Label, build, train, tune, deploy and automate in a unified platform that runs on any cloud and on-premises.
Readme Apache-2.0 31 MiB
Languages
Go 99.5%
Makefile 0.3%
Dockerfile 0.2%