Qiita Teams that are logged in
You are not logged in to any team

Log in to Qiita Team
Community
OrganizationEventAdvent CalendarQiitadon (β)
Service
Qiita JobsQiita ZineQiita Blog
1
Help us understand the problem. What are the problem?

More than 3 years have passed since last update.

@B1nj0y

go-on-rails: A Rails generator to develop or generate a Go application

The project's repo: https://github.com/railstack/go-on-rails

go-on-rails is a Rails generator aims to:

  • Integrate some APIs written in Golang to existed Rails app for high performance
  • Use your farmiliar Rails tools to develope and manage a Golang app project
  • Convert a not very complicated Rails app to Golang equivalent

Here's a simple example(tutorial) shows the basic usage of go-on-rails generator, and another example shows how to integrate Go APIs in a Rails project.

Prerequisites

  • Rails 4.2+
  • Golang 1.7+

Installation

Add this line to your application's Gemfile:

gem 'go-on-rails', '~> 0.3.0'

And then execute:

$ bundle

Or install it yourself as:

$ gem install go-on-rails

Usage

You must have a Rails app or to create one before you can try go-on-rails generator to convert a Rails app to Golang codes.

After that you can just run the command to convert the application:

rails g gor [dev(elopment) | pro(duction) | test] [-m model_a model_b model_c ...]

Then a directory named "go_app" with Golang codes will be generated under your Rails app root path.

Install the dependent Golang packages:

rails gor:deps

Then change to the go_app directory and run:

go run main.go

You can visit the page in http://localhost:4000 by default.

More command details about go-on-rails generator:

rails g gor --help

More details to visit the project's repo: https://github.com/railstack/go-on-rails

Issues and PRs are very Welcome !!

Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
1
Help us understand the problem. What are the problem?