platform

module
v0.0.1-alpha.10 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 21, 2016 License: BSD-3-Clause

README

Platform

The Tidepool Platform API.

Build Status Code Climate Issue Count

Setup

  1. Install Go version 1.6 or later.
  2. Create a brand new Go directory.
  3. Set the GOPATH environment variable to the newly created Go directory.
  4. Add $GOPATH/bin to the PATH environment variable.
  5. Execute go get github.com/tidepool-org/platform to pull down the project. You may ignore a "no buildable Go source files" warning.
  6. Change directory to $GOPATH/src/github.com/tidepool-org/platform.
  7. Source the .env file.
  8. Execute make editable to install the various Go tools needed for building and editing the project.
  9. If you are going to use the test, ci-test, or watch Makefile targets or the ginkgo executable, add $GOPATH/src/github.com/tidepool-org/platform/Godeps/_workspace/bin to the PATH environment variable. (Consider using the direnv tool via homebrew to automatically update the GOPATH and PATH environment variables when in certain directories).

For example:

brew install go
mkdir ~/go
export GOPATH=~/go
export PATH=$GOPATH/bin:$PATH
go get github.com/tidepool-org/platform
cd $GOPATH/src/github.com/tidepool-org/platform
source .env
make editable

For reuse, you may want to include the following lines in your shell config (e.g., .bashrc) or use a tool like direnv:

export GOPATH=~/go
export PATH=$GOPATH/bin:$PATH

Execute

  1. Setup the environment, as above.
  2. Build the project.
  3. Execute the dataservices executable.

In addition to the setup above, for example:

make build
_bin/dataservices

Use Ctrl-C to stop the dataservices executable. It may take up to 60 seconds to stop.

Makefile

  • To setup your GO environment for building and editing the project:
make editable
  • To build the executables:
make build

All executables are built in the _bin directory.

  • To run all of the tests manually:
make test

The environment variable TEST indicates which test to execute. If not specified, then all tests are executed. For example,

TEST=user make test
  • To run all of the tests automatically after any changes are made, in a separate terminal window:
make watch

The environment variable WATCH indicates which test to execute. If not specified, then all tests are executed. For example,

WATCH=user make watch
  • To run go fmt, goimports, and golint all at once:
make pre-commit
  • To clean the project of all build files:
make clean
  • To add the required git hooks:
make git-hooks

Sublime Text

If you use the Sublime Text editor with the GoSublime plugin, open the platform.sublime-project project to ensure the GOPATH and PATH environment variables are set correctly within Sublime Text. In addition, the recommended user settings are:

{
  "autocomplete_builtins": true,
  "autocomplete_closures": true,
  "autoinst": false,
  "fmt_cmd": [
    "goimports"
  ],
  "fmt_enabled": true,
  "fmt_tab_width": 4,
  "use_named_imports": true
}

Directories

Path Synopsis
Godeps
_workspace/src/github.com/Sirupsen/logrus
Package logrus is a structured logger for Go, completely API compatible with the standard library logger.
Package logrus is a structured logger for Go, completely API compatible with the standard library logger.
_workspace/src/github.com/ant0ine/go-json-rest/rest
A quick and easy way to setup a RESTful JSON API http://ant0ine.github.io/go-json-rest/ Go-Json-Rest is a thin layer on top of net/http that helps building RESTful JSON APIs easily.
A quick and easy way to setup a RESTful JSON API http://ant0ine.github.io/go-json-rest/ Go-Json-Rest is a thin layer on top of net/http that helps building RESTful JSON APIs easily.
_workspace/src/github.com/ant0ine/go-json-rest/rest/trie
Special Trie implementation for HTTP routing.
Special Trie implementation for HTTP routing.
_workspace/src/github.com/golang/protobuf/proto
Package proto converts data structures to and from the wire format of protocol buffers.
Package proto converts data structures to and from the wire format of protocol buffers.
_workspace/src/github.com/onsi/ginkgo
Ginkgo is a BDD-style testing framework for Golang The godoc documentation describes Ginkgo's API.
Ginkgo is a BDD-style testing framework for Golang The godoc documentation describes Ginkgo's API.
_workspace/src/github.com/onsi/ginkgo/config
Ginkgo accepts a number of configuration options.
Ginkgo accepts a number of configuration options.
_workspace/src/github.com/onsi/ginkgo/ginkgo
The Ginkgo CLI The Ginkgo CLI is fully documented [here](http://onsi.github.io/ginkgo/#the_ginkgo_cli) You can also learn more by running: ginkgo help Here are some of the more commonly used commands: To install: go install github.com/onsi/ginkgo/ginkgo To run tests: ginkgo To run tests in all subdirectories: ginkgo -r To run tests in particular packages: ginkgo <flags> /path/to/package /path/to/another/package To pass arguments/flags to your tests: ginkgo <flags> <packages> -- <pass-throughs> To run tests in parallel ginkgo -p this will automatically detect the optimal number of nodes to use.
The Ginkgo CLI The Ginkgo CLI is fully documented [here](http://onsi.github.io/ginkgo/#the_ginkgo_cli) You can also learn more by running: ginkgo help Here are some of the more commonly used commands: To install: go install github.com/onsi/ginkgo/ginkgo To run tests: ginkgo To run tests in all subdirectories: ginkgo -r To run tests in particular packages: ginkgo <flags> /path/to/package /path/to/another/package To pass arguments/flags to your tests: ginkgo <flags> <packages> -- <pass-throughs> To run tests in parallel ginkgo -p this will automatically detect the optimal number of nodes to use.
_workspace/src/github.com/onsi/ginkgo/internal/remote
Aggregator is a reporter used by the Ginkgo CLI to aggregate and present parallel test output coherently as tests complete.
Aggregator is a reporter used by the Ginkgo CLI to aggregate and present parallel test output coherently as tests complete.
_workspace/src/github.com/onsi/ginkgo/reporters
Ginkgo's Default Reporter A number of command line flags are available to tweak Ginkgo's default output.
Ginkgo's Default Reporter A number of command line flags are available to tweak Ginkgo's default output.
_workspace/src/github.com/onsi/gomega
Gomega is the Ginkgo BDD-style testing framework's preferred matcher library.
Gomega is the Ginkgo BDD-style testing framework's preferred matcher library.
_workspace/src/github.com/onsi/gomega/format
Gomega's format package pretty-prints objects.
Gomega's format package pretty-prints objects.
_workspace/src/github.com/onsi/gomega/ghttp
Package ghttp supports testing HTTP clients by providing a test server (simply a thin wrapper around httptest's server) that supports registering multiple handlers.
Package ghttp supports testing HTTP clients by providing a test server (simply a thin wrapper around httptest's server) that supports registering multiple handlers.
_workspace/src/github.com/onsi/gomega/matchers
Gomega matchers This package implements the Gomega matchers and does not typically need to be imported.
Gomega matchers This package implements the Gomega matchers and does not typically need to be imported.
_workspace/src/github.com/satori/go.uuid
Package uuid provides implementation of Universally Unique Identifier (UUID).
Package uuid provides implementation of Universally Unique Identifier (UUID).
_workspace/src/golang.org/x/net/netutil
Package netutil provides network utility functions, complementing the more common ones in the net package.
Package netutil provides network utility functions, complementing the more common ones in the net package.
_workspace/src/golang.org/x/sys/unix
Package unix contains an interface to the low-level operating system primitives.
Package unix contains an interface to the low-level operating system primitives.
_workspace/src/gopkg.in/mgo.v2
Package mgo offers a rich MongoDB driver for Go.
Package mgo offers a rich MongoDB driver for Go.
_workspace/src/gopkg.in/mgo.v2/bson
Package bson is an implementation of the BSON specification for Go: http://bsonspec.org It was created as part of the mgo MongoDB driver for Go, but is standalone and may be used on its own without the driver.
Package bson is an implementation of the BSON specification for Go: http://bsonspec.org It was created as part of the mgo MongoDB driver for Go, but is standalone and may be used on its own without the driver.
_workspace/src/gopkg.in/mgo.v2/internal/scram
Pacakage scram implements a SCRAM-{SHA-1,etc} client per RFC5802.
Pacakage scram implements a SCRAM-{SHA-1,etc} client per RFC5802.
_workspace/src/gopkg.in/yaml.v2
Package yaml implements YAML support for the Go language.
Package yaml implements YAML support for the Go language.
userservices

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL