Questions tagged [revel]
A high-productivity web framework for the Go language.
206
questions
0
votes
0
answers
32
views
Signal Kill on Amazon ec2 User
When I am running my application on EC2-user sever, which is related to S3 bucket. I am getting the below error. The RAM size of server is 450MB and free space is 72MB. What can be the issue? Is this ...
1
vote
0
answers
56
views
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, ...
1
vote
0
answers
59
views
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
<input id="file" type="file" name="file&...
1
vote
0
answers
183
views
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 ...
2
votes
1
answer
53
views
How to get dynamic app conf in golang revel
I have project that use golang-revel and in my project, i need to connect to 2 databases. Currently, i can migrate the database one by one, but if this project is getting bigger i need to be able to ...
1
vote
0
answers
74
views
How to reverse for loop in golang-revel
i'm aware that you can do for loop in revel like this
{{range $index, $element := .foo }}
{{end}}
but is there any way to reverse a for loop so that it can iterating from behind in revel-template, i'...
1
vote
1
answer
65
views
How to change dynamic variable in Revel Template
In my revel project, i have a select option that need to get selected after clicking submit button.
If i do it like this it works because .OptionType is a string so i need to compare it with string
&...
0
votes
1
answer
55
views
Is it possible to access value in a list in Revel Template [duplicate]
{{ range .foo }}
{{end}}
.
{{range $index, $element := .foo }}
{{end}}
I'm aware that you can use this like for loop, but is there any other way to access a value in array directly ...
-1
votes
1
answer
1k
views
Go mod tidy find module but it's not getting to go.sum
i have a Revel project and i can't start it because everytime i run go mod tidy, it looks like finding module but it's not putting the found module in go.sum
here's my go env
GOENV = C:\Users\mycomp\...
0
votes
1
answer
893
views
How to encode utf-8 request body to windows 1251 in go
My task is to get a json string from request body in utf-8 and encode it to win1251, so i could save it the db in win1251.
data, err := io.ReadAll(c.Request.GetBody())
if err != nil {
panic(err)
}
...
1
vote
1
answer
96
views
Trying to start an app after build, but getting "router initialize error". How to fix it?
This is what i get in terminal, looks like problem in first hook, but what's that?
Same app is working fine if just use revel run, but for some reason, when i try execute builded .exe i got that error(...
0
votes
1
answer
263
views
Running my revel application on windows 10 fail
I had problem when run my revel app on windows
it create fine but don't run when I try so only get this. any idea?
C:\Desarrollo\Web\webpro>revel run -a webpro
Revel executing: run a Revel ...
-1
votes
2
answers
688
views
Passing a URL as URL param
I have this route that was written with route params
/properties/configurations/:name/:value
and when I call with with a URL as value like that
/properties/configurations/app.url/http://test.test
it ...
0
votes
1
answer
1k
views
App couldn't connect to Postgresql Database with docker-compose
I'm trying to get my web application running using docker-compose.
My Dockerfile
FROM golang:1.15
WORKDIR /goprojects/vnlist
COPY . .
RUN go get github.com/revel/revel
RUN go get github.com/revel/...
1
vote
1
answer
298
views
Cloud Run and Revel Container
I have a simple site built using revel containerized in a docker image. I'm trying to run this image in Cloud Run. Unfortunately when I go to the URL for the site, I see a 502 in the browser and this ...
0
votes
0
answers
40
views
how do I start creating a web service?webix+js+revel
everybody. I am a novice developer and would like to ask for advice.At the moment, I am doing an internship at the company and I need to create an assessment Manager project.Technologies that I should ...
0
votes
0
answers
91
views
Revel cli won't create a new project
I am trying to start a new project with the revel's CLI revel new revelApp1 and its giving me some errors:
C:\Users\myUserame\go\src>revel new revelApp1
Revel executing: create a skeleton Revel ...
0
votes
2
answers
301
views
How to run angular build under golang revel framework
I have one angular build files in public folder in revel appplication.
I want to run those html and js files under revel application.
GET / Static.Serve("public")
I gave the above code in ...
0
votes
0
answers
164
views
How to set "Transfer-Encoding" in go-revel response header?
We are using revel for HLS streaming; while streaming the master playlist, need to set the Transfer-Encoding as "chunked".
With below line, we are able to set the Content-Type header;
c.Response....
0
votes
1
answer
71
views
How index starts with 1 in revel Framework
<tr>
<td>rank</td>
<td>abc</td>
</tr>
{{ range $index,$abc := .abc }}
<tr>
<td>{{$index}}</td> // 0
<td>{{$...
-2
votes
1
answer
133
views
Why not all key from Revel JSON response are capitalized?
I'm trying to understand how to implement POST request using Revel framework.
models/login.go
package models
type LoginParam struct {
Username string `form:"username" json:"username"`
...
0
votes
1
answer
108
views
Entirely clear session for Revel framework
I'm looking for a way to clear a session using the Revel framework. I've tried c.Session["REVEL_SESSION"] = "" and a few other things to reset it but I have not been successful.
0
votes
1
answer
253
views
go install revel cmd after dep ensure not work
I want to solve a problem about vendoring.
After dep ensure, the packages are installed under the vendor folder
But go install github.com/revel/cmd/revel doens't work unlike the revel document says
...
1
vote
2
answers
2k
views
Go migration doesn't create a foreign key
My first day with Go. I try to develop a migration mechanism with GORM within Revel.
These are my model structs:
type Role struct {
gorm.Model
Name string
}
type User struct {
gorm....
1
vote
0
answers
783
views
"Import error database/sql" for sql package
"Import error database/sql" for sql package.
I wanna use connect method on the controller.
I think need to install sql package.
controllers/gorm.go
import (
"database/sql"
_ "github.com/go-sql-...
0
votes
0
answers
447
views
go revel undefined: sql or Txn
mac highsierra
use mysql
https://paiza.hatenablog.com/entry/2018/03/23/paizacloud_golang_revel)
I'm trying to use the Revel framework for mysql.
It's revel Tutorial booking.
what is error?
ERROR ...
0
votes
1
answer
1k
views
What causes eventSource to stay on readyState 0?
I have a go app on azure that generates SSE connections depending on an id sent in the url as the event source '.co/stream/{id}'.
One of those ids has been used more frequently than others and has ...
0
votes
1
answer
1k
views
How to get http.ResponseWriter and http.Request in Revel controller
I am trying to implement an oauth server and the package I am using needs the complete http.ResponseWriter and http.Request types.
c.Response does not contain all the methods that http....
0
votes
2
answers
369
views
revel flash messages are not displayed
I have created a revel web application with default skelton.
I have created a new route/action/view:
Controller action:
func (c Ctrl1) Action3() revel.Result {
variable1 := "test1"
...
0
votes
0
answers
48
views
revel Controller declaration syntax
I am new to golang revel framework.
I have read revel tutorials and i see this lines at the top of each controller file:
type App struct {
*revel.Controller
}
I suppose this mean my App class ...
2
votes
1
answer
1k
views
Revel and Docker container
I am attempting to create a docker container that contains the revel skeleton app. Everything seems to build OK and the container is created but when I go to localhost:9000 in my browser nothing ...
0
votes
1
answer
113
views
How to create this JSON with Go
I am trying to create the go code that will output JSON. The JSON string represents an invoice and its line items. There are two main parts and that is the header record and the item list. The item ...
0
votes
1
answer
1k
views
Handle preflight request with Golang, Revel
I made API application with Golang + Revel framework
Now I tried to send http request from front end application, made by vue.js.
But because of cors, PUT method cannot be handled.(POST method ...
2
votes
2
answers
543
views
Revel Dependency Injection
I'm looking to have my revel controllers use various services, which I mock out for unit tests. I'm new to Go; in C# I'd inject them using dependency injection. Is there a common way to do this in ...
0
votes
1
answer
59
views
Revel session clustering with redis
while in crystal#kemal, i have before_all method that will be a gateway of request (and for auth check)
before_all do |env|
# go to /login if user doesn't have cookie (set cookie on login)
if env....
0
votes
0
answers
219
views
Error while get revel framework with go get
I want to install Revel framework with
go get github.com/revel/revel
I run it and I got error:
C:/Users/User/go>go get github.com/revel/revel
github.com revel/revel
src\github.com\revel\revel\...
0
votes
2
answers
4k
views
How to get initial timestamp of a http request in golang?
I am writing a golang program using revel framework, in which i need to check the initial timestamp of a http request.
I know how to do it in C# :
HttpContextWrapper context = Request.Properties["...
2
votes
1
answer
2k
views
Cannot install revel framework form Go
I tried to install Revel Framework. I followed all the steps as given in the documentation but whenever I tried to run the Revel command it throws panic error.
Following are the steps which I am ...
-1
votes
1
answer
58
views
could not parse line #126: mongo.database = mongo_db_test
I'm following this tutorial Golang + Revel web framework + Mongodb RESTFul generator for (revel_mgo) step by step, but when I finally end it and try to run it, it throw this error
CRIT 16:11:18 ...
0
votes
1
answer
392
views
run.sh binary file thru 'revel build <testapp>' not running inside docker container
As I've recently started using revel framework to build go web app. I created a testapp (orpat), compiled it 'revel build orpat prod' and changed conf PORT->8084 for publishing the app. Files ...
0
votes
1
answer
230
views
Choosing a template from a ViewArg in Revel
Using the Revel framework, is it possible to chose a template based on the value of a ViewArg?
I defined a base controller which provides a method that renders content within views/Layout.html
type ...
1
vote
1
answer
684
views
rendering html templates golang revel
I am hoping someone will be able to help me out. I have started building a web app and decided to go with GO and Revel. So far I've learnt quite a few things but there is this one functionality I can'...
2
votes
1
answer
7k
views
How to query a GORM Model
I'm attempting to query a database given a model, and I'm getting a blank model as a response. I'm using Revel framework and GORM to create the model and query the database.
app.go
package ...
0
votes
0
answers
164
views
Revel App accessible in browser, returns 502 when hit in terminal via curl
The Revel site I'm working on works fine in the browser, but when hit it in the terminal via a curl, it returns a 502. Checking the error log for Revel, it throws a long panic error when hit by curl, ...
0
votes
0
answers
242
views
Using revel with dep for dependency management
I'm trying to create a production system with revel and go.
I found dep as the version and dependency management tool.
Since this is going to be a production system, I wanted to lock down the ...
50
votes
4
answers
111k
views
How to add variable to string variable in golang
I'm trying to add a value to a variable string in golang, without use printf because I'm using revel framework and this is for a web enviroment instead of console, this is the case:
data := 14
...
1
vote
1
answer
485
views
Can't install Revel on MacOS "package gopkg.in/fsnotify.v1: unrecognized import path"
Following "Getting Started" directions:
$ go get -v github.com/revel/revel
Fetching https://gopkg.in/fsnotify.v1?go-get=1
Parsing meta tags from https://gopkg.in/fsnotify.v1?go-get=1 (status code 404)...
1
vote
1
answer
736
views
How to mock service from controller using revel framework in golang?
I am writing unit test for project written in revel framework. Revel itself provides testing framework but its more towards BDD test type. So I started with go test.
The MyController.go file looks ...
0
votes
1
answer
883
views
Standard Output was not what was expected in REVEL
I'm frustrated with this error I'm getting on my assignment. The code I have is clearly correct and running, but I'm still getting this error that the Standard Output was not what was expected. This ...
1
vote
1
answer
347
views
How to disable debug logs (app and revel both) in app.conf file of revel framework?
I want to disable debug logs and want other logs to put in a file(logfile). I have tried following two snippets. But it doesnt work as expected.
log.all.filter.module.app = logfile
log.all.filter....