Questions tagged [revel]

A high-productivity web framework for the Go language.

Features

Hot Code Reload

Edit, save, and refresh. Revel compiles your code and templates for you, so you don't miss a beat. Code doesn't compile? It gives you a helpful description. Run-time code panic? Revel has you covered.

Comprehensive

Revel provides routing, parameter parsing, validation, session/flash, templating, caching, job running, a testing framework, and even internationalization.

High Performance

Revel builds on top of the Go HTTP server, which was recently benchmarked to serve three to ten times as many requests as Rails across a variety of loads.

Framework Design

Synchronous

The Go HTTP server runs each request in its own goroutine. Write simple callback-free code without guilt.

Stateless

Revel provides primitives that keep the web tier stateless for predictable scaling. For example, session data is stored in the user cookie, and the cache is backed by a memcached cluster.

Modular

Revel is built around composable middleware called filters, which implement nearly all request-processing functionality. Developers have the freedom to replace the default filters with custom implementations (e.g. a custom router).

Source: project home page

206 questions
2
votes
1 answer

How to get client IP address in Go/Revel

Howto get the client's IP Address in Revel? In Beego: func (this *baseController) getClientIp() string { s := strings.Split(this.Ctx.Request.RemoteAddr, ":") return s[0] }
Nilton OS
  • 31
  • 1
  • 5
2
votes
2 answers

Revel - Storing an object in session

I'm using the oauth package "code.google.com/p/goauth2/oauth" with revel and the it creates a few structures with quite a bit of information in it. I need this information to be persistent throughout the session but sessions can only be type string.…
vinniyo
  • 787
  • 2
  • 8
  • 21
2
votes
1 answer

Getting Revel controller to return a cookie

I've been able to store a custom cookie but I'm trying to save it for a session the store it in the database when a form is submitted. I use: func (c Application) Index(id string) revel.Result { cookie := http.Cookie{Name: "id", Value: id, Domain:…
vinniyo
  • 787
  • 2
  • 8
  • 21
2
votes
1 answer

Go + Revel: How to import custom package?

I am following tutorial of chat room covered here I changed it to import a local package instead of using the sample from ravel's github. I changed it into something like this in one of the controllers (refresh.go in the tuts): import ( …
user2002495
  • 2,126
  • 8
  • 31
  • 61
2
votes
1 answer

Invalid memory address or nil pointer dereference when database returns empty set

When I pass event id in to DisplayScanMembers(23), if the event_id does not appear in the database, it returns an empty set. However, apparently an empty set is equivalent a nil pointer(I guess). Therefore I cannot assign the value(nil pointer) to…
WarrenV
  • 230
  • 1
  • 2
  • 9
2
votes
1 answer

Testing post method with csrf

I am trying to write a test method for sign up on my revel application. Look at the following code package tests import "github.com/revel/revel" import "github.com/PuerkitoBio/goquery" import "bytes" import "net/url" //import "net/http" var csrf…
softshipper
  • 32,463
  • 51
  • 192
  • 400
2
votes
2 answers

Deploying Revel (Golang) Using Dokku

Has anyone tried deploying a Revel app using Dokku? I tried "https://www.digitalocean.com/community/tutorials/how-to-use-the-dokku-one-click-digitalocean-image-to-run-a-go-app" and it deployed successfully. However, when I try a new Revel app, it…
2
votes
2 answers

View source for Golang packages in LiteIDE

What's the easiest way to view source code of golang packages in LiteIDE? for example, when there are code like this: import "github.com/revel/revel" func init() { // Filters is the default set of global filters. revel.Filters =…
Kokizzu
  • 24,974
  • 37
  • 137
  • 233
2
votes
1 answer

Form input Validation in Revel

Im learning Revel and using the Validation package to do some checks on input. I want to see if there already exists a record with a "name" in DB (i get a input from user through a form) and if true return error else create a record. Im am able to…
broun
  • 2,483
  • 5
  • 40
  • 55
2
votes
1 answer

Read environment variables in revel app.conf

Revel uses app.conf for storing configuration. I want my configuration to get value from environment variable using os.Getenv(key) How can I do it? Should I use revel.Config to make changes? if so where do I place it? Or is there another way? I use…
pveyes
  • 413
  • 2
  • 12
2
votes
1 answer

How to build mgo queries?

I'm doing a tiny project(practice) with revel and mgo, but I got something wrong with search function when I build the queries. The code seems like this: conditions := make(bson.M, 0) conditions["status"] = bson.M{"$ne": "delete"} if item, ok :=…
Vincent
  • 23
  • 3
2
votes
1 answer

Revel framework caching static files?

I am trying to build a simple web app on the revel go web framework. For some reason, files in the public directory are not loaded correctly when I open their URLs in the browser. For example, an older version of the file may appear (even after…
user1094206
  • 920
  • 1
  • 12
  • 24
1
vote
0 answers

How do I generate a model scaffold in golang-revel?

I read the documentation and spent 2-3 hours playing around with revel. However I wasnt able to generate a model controller view similar to the booking example in https://github.com/revel/examples, which is awesome but hard to reproduce from…
Riccardo
  • 1,104
  • 13
  • 22
1
vote
0 answers

How to handling multiple files upload golang revel

I'm trying to handle multiple files upload in golang-revel. Here is the documentation that i follow. This is what i've tried HTML GO var ( …
Michael Halim
  • 262
  • 2
  • 20
1
vote
0 answers

How to run multiple migrations on multiple databases in golang-revel

I have a project that use golang-revel and use GORM to connect to DB. I don't know how to migrate multiple databases. I have successfuly migrate with one database but struggling to migrate more than 1 database routes conf GET /:db/migrate …
Michael Halim
  • 262
  • 2
  • 20