Questions tagged [go-echo]

Echo is a high performance, extensible, minimalist Go web framework. This tag should be used with general questions concerning the Echo framework or any related middleware,

The Echo web framework by LabStack is designed to be minimalist yet high performing.

You can get started by looking at:

144 questions
0
votes
1 answer

How to override DefaultHTTPErrorHandler format message

I'm using the Echo framework. How can I change this format response to my own format its error from JWT Library https://github.com/dgrijalva/jwt-go { "message": "invalid or expired jwt" } i want to change something like this { "meta": { …
Putra Fajar Hasanuddin
  • 1,101
  • 3
  • 13
  • 25
0
votes
1 answer

How to retrieve form.Value of []string type from echo.Context.MultipartForm()

I'm parsing a Multipart form from echo.Context. I retrieve the value of a slice ([]string) using form.Value. This returns a value with double braces. (eg. [["this","something"]]). I tried reading from a non-slice (string) value and it returns…
jazz
  • 27
  • 1
  • 10
0
votes
2 answers

Is it possible to bind to map object of custom struct type?

my question is, how to bind(auto binding?) custom structure type in a map object(variable)? this is my custom struct type type Tetris struct { ... ... NowBlock map[string]int `form:"nowBlock" json:"nowBlock"` ...…
gdk
  • 89
  • 1
  • 2
  • 11
0
votes
1 answer

can't parse JSON from a post requests

I built an echo microservice api, with two routings: post and get. The get method works fine, but the get method can't parse the JSON, meaning the struct is empty after the Bind() func. It must be a very stupid and tiny thing I am missing... any…
Nyta
  • 557
  • 1
  • 7
  • 18
0
votes
2 answers

Storing html template as text field in DB using golang

I'm a beginner in Go and Echo. I am required to store a html template(email template) , which will also have some details passed as context. So that it can be stored into body column (text in MySQL) and will be triggered later. if user.Email…
arundeepak
  • 564
  • 2
  • 12
0
votes
1 answer

Are static URL paths valid after parameters in labstack/echo

I’m chasing an odd pattern matching issue in labstack/echo and would like your thoughts. Would the route /first/:parameter/second match the url http://hostname/first or http://hostname/first/ ? What…
0
votes
3 answers

Serving files with Echo

I'm trying to serve multiple files with Echo, but it doesn't work every time. The api code looks like this: package main import ( "github.com/labstack/echo" "net/http" ) func main() { e := echo.New(); e.GET("/", home); …
0
votes
1 answer

echo c.Get("user") does not work in testing env

I am attempting to test a golang API built on the echo framework/router. I have the following test..... func TestLogout(t *testing.T) { loadConfig() db := stubDBs(t) Convey("When you post to /logout", t, func() { Convey("with a valid token, you…
Chris L
  • 1,051
  • 1
  • 7
  • 20
0
votes
1 answer

Serving large Videofiles fails

I'm using the Echo Framework's static filehandler for serving uploaded files out of my upload directory. e := echo.New() e.Static("/uploads","uploads") This works fine for smaller video files. I've tested it with a 20MB videofile, which works…
zeroc8
  • 853
  • 1
  • 10
  • 20
-1
votes
1 answer

Can 2 fields in struct have same struct tags in Go

I have Struct Type for binding SQL data to my struct variable. It has 2 Feilds as CenterCode and ActualCenterCode type LearnerModel struct { CenterCode dbr.NullString `json:"centerCode" db:"LEARNINGCENTERCODE"` ActualCenterCode…
-1
votes
1 answer

Golang Get all POST Form data using PostParams and get values as string

I want to get all the post form data and get the values as string, however using PostParams I am able to get all the post data, but the values are as array key: [value], how can I get all the form data as string values? [Edit] I may not stated…
Charas
  • 1,753
  • 4
  • 21
  • 53
-1
votes
1 answer

How can i change the Delim in echo Render?

i am trying to change the delimiter for go in an html template. Unfortunately, it does not work in the render function, nor in the main function. See https://pkg.go.dev/text/template#Template.Delims package main import ( "html/template" …
Sienael
  • 69
  • 8
-1
votes
1 answer

How to pass a golang variables( can contain any character) to echo binary in linux?

so my code looks like this , i have a function defined as the following : func shellOut(command string) (string, string, error) { var stdout bytes.Buffer var stderr bytes.Buffer cmd := exec.Command("bash", "-c", command) cmd.Stdout =…
-1
votes
1 answer

How can I check the data generated by gorm raw statement?

I created data with golang gorm, I need to form a relationship in another table based on the generated data id, but I don't know how to check the generated data, how can I check the generated data? func DefaultMapCreate(userId uint) *model.Map { …
Choi yun seok
  • 309
  • 2
  • 15
-1
votes
1 answer

Not enough arguments for impl function

// user.go package models type User struct { Id int `db:"id" json:"id"` CreatedAt time.Time `db:"created_at" json:"created_at"` UpdatedAt time.Time `db:"updated_at" json:"updated_at"` } func (User) GetById(c echo.Context,…
jeyraof
  • 863
  • 9
  • 28
1 2 3
9
10