Skip to content

kmacoskey/taos

Repository files navigation

TAOS

Getting Started

Installation

If this is your first time with golang, please follow the instructions to install (requires golang 1.8 or above).

After installing golang:

# Install taos
go get github.com/kmacoskey/taos

Configuration

Copy the example configuration file:

cp config.example.yml config.yml

Next, create a PostgreSQL database (not covered here) and set connection information in the configuration file config.yaml:

conn_str: "postgres://<role>:<password>@<host>:<port>/<database>?sslmode=disable"

Refer to the pq package GoDoc for supported connection paramaters.

Test

Ensure successfull installation by running the tests:

make test

Run the Server

make
make run

The application starts an HTTP server at the default port of 8080.

Code Structure

  • app: Various components around server functionality, such as configuration and database connections
  • middlerware: Contains routing middleware between client request on handler interaction
  • handlers: The HTTP response layer for communication with clients
  • services: Server logic for servicing requests and interactions amongst other layers
  • terraform: Shells out to perform Terraform CLI actions
  • daos: The DAO (Data Access Object) layer that interacts with persistent storage
  • models: Data structures used through the different layers
  • reaper: Background functionality for reaping expired clusters

Flow of a request through the application layers:

app <-> middleware <-> handlers <-> services <-> daos
                                             <-> terraform <-> daos

The main entry of the application is in the taos.go file. It does the following work:

  • load configuration
  • start logging
  • establish database connection
  • start looking for expired clusters to reap
  • instantiate restful components
  • start the HTTP server

How to Contribute

We accept contributions via Github Pull requests only.

Follow the steps below to contribute:

  1. Clone the project’s repository.
  2. Create your own feature branch (e.g. git checkout -b awesome-feature) and make changes on this branch.
    • Follow the previous sections on this page to setup, make your change, and verify the change works
  3. Push your local branch to the repo and submit a pull request.

Your contribution will be analyzed for product fit and engineering quality prior to merging. Note: All contributions must be sent using GitHub Pull Requests.

Your pull request is much more likely to be accepted if it is small and focused with a clear message that conveys the intent of your change.

Overall we follow GPDB's comprehensive contribution policy. Please refer to it here for details.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages