perscorecal

command module
v0.0.0-...-c7ad020 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2019 License: Apache-2.0 Imports: 1 Imported by: 0

README

perScoreCal

Getting Started

Dependencies
  1. Go Lang - installed and Go path set

  2. PostgreSQL - installed and running

  3. Clone this project to $GOPATH/src

  4. A .env file in the root of the project with the following keys

export DEV_DB_DRIVER=
export DEV_HOST=
export DEV_DBNAME=
export DEV_SSLMODE=
export DEV_USERNAME=
export DEV_PASSWORD=

export TEST_DB_DRIVER=
export TEST_HOST=
export TEST_DBNAME=
export TEST_SSLMODE=
export TEST_USERNAME=
export TEST_PASSWORD=

  1. From the root of the project execute source .env

  2. Install the godep package with go get github.com/tools/godep

  3. Install package dependencies with godep restore

Build and run this project
  1. Give privilege to the setupPostgres.sh file

    chmod +x setupPostgres.sh

  2. Execute setupPostgres.sh to create Postgres role and database

    ./setupPostgres.sh

  3. Run command to migrate database

    go run main.go setupdb

  4. Start the server

    go run main.go serve

Code structure and details

Directory structure
perScoreCal
- .git
- cmd
- Godeps
- models
- perScoreProto
- server
- vendor
-- main.go
-- setupPostgres.sh
Description

The cmd directory holds the code for the CLI commands created by Cobra. The project itself was created using the Cobra Generator.

The Godeps directory contains the Godeps.json file which is where all the package dependencies for the project is saved.

The models directory holds all the business logic and data operations using the Gorm package.

The perScoreProto directory holds the Proto definition files as well the compiled Go files generated by the protoc command.

The server directory has two files - one for bringing up the GRPC server and another to route the requests to methods/functions.

The main.go file is what we use to fire the commands, including bringing up the server. It is the entry point to the application.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
perScoreProto
question
Package question is a generated protocol buffer package.
Package question is a generated protocol buffer package.
user
Package user is a generated protocol buffer package.
Package user is a generated protocol buffer package.

Jump to

Keyboard shortcuts

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