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
4
votes
1 answer

golang API with echo framework

I'm using a light framework web framework named echo (https://github.com/labstack/echo) and I am trying to build a very simple API with it. this is one of my routes e.Get("/v1/:channel/:username", getData) this is the getData function it does a…
gempir
  • 1,791
  • 4
  • 22
  • 46
4
votes
1 answer

Websocket send all clients a message in Echo Framework

I believe that this question is almost the same with this. But I use websocket in Echo framework instead of Gorilla. So I think the approach will be different. Echo does provide the example. But it only shows how to connect with single client. When…
asubanovsky
  • 1,608
  • 3
  • 19
  • 36
3
votes
1 answer

Getting No 'Access-Control-Allow-Origin' header... even though using middleware.CORS()

My API is served using the Echo framework. When I do a fetch call from my React app, I get Access to fetch at 'http://localhost:8080/myAPI' from origin 'http://localhost:3000' has been blocked by CORS policy: Response to preflight request doesn't…
user2233706
  • 6,148
  • 5
  • 44
  • 86
3
votes
1 answer

Does Set() method of echo.Context saves the value to the underlying context.Context?

I am using Echo framework and want to pass the Go's built-in context.Context underlying echo.Context after setting some custom values. To achieve it, I think I could first apply Set(key string, val interface{}) method of echo.Context and then…
vahdet
  • 6,357
  • 9
  • 51
  • 106
3
votes
2 answers

How to allow zero(0) value

AgreementNo int`json:"agreement_no" validate:"required"` I want get zero value from agreement_no request. still required but get zero value so json request null not allow. but validate in echo not allowed zero value. How can I get this value…
3
votes
1 answer

Golang img from base64 ZgotmplZ

So i try to put image in from base64 but i'm gettin ZgotmplZ i try to use template.URL(s) like this: e := echo.New() funcMap := template.FuncMap{ "safe": func(s string) template.URL { return template.URL(s) }, } t := &Template{ …
dekros
  • 59
  • 1
  • 8
3
votes
2 answers

golang print echo.Context values

I'm brand new to Go and trying to inspect a method argument. I've got the following code func (c *controller) OrderNew(ctx echo.Context) error { When I try either: fmt.println(ctx) fmt.Printf("%v \n", ctx) I get &{0xc4200f21e0…
jj1111
  • 607
  • 2
  • 10
  • 20
2
votes
1 answer

Form variables not available in testing

I am a Go newbie. I have written an API server built on the Echo server, using the DeepMap OpenAPI generator and Postgres using pgxpool. It is working well enough and has been in use for a year, but that's not to say it's written properly…
Drew
  • 111
  • 1
  • 4
2
votes
1 answer

Resume a download when Echo server is restarted

I'm trying to make a proxy to download server files with an authentication layer. I'm using Golang (1.21.0) and Echo (4.11.1) Problem description When a user is downloading a big file, if I kill the Echo server (Ctrl+C), the download is just marked…
Doubidou
  • 1,573
  • 3
  • 18
  • 35
2
votes
2 answers

How to prevent "+" from escaping in go-echo

I am using https://github.com/labstack/echo in one of the projects. I am using c.QueryParam to parse the query parameter and its values. One of the values contains a + symbol in it and it converts them to a space character (which is correct).…
Arun Code
  • 1,548
  • 1
  • 13
  • 18
2
votes
0 answers

Limit route groups HTTP methods in Echo

I'm using groups in Echo to pack some routes with a common prefix but when I get the list of routes, it returns routes for all HTTP methods. main.go e := echo.New() adminGroup := e.Group("/admin") adminGroup.GET("/", adminIndex) I use this to get…
2
votes
0 answers

File download status and connection abortion using Golang and Echo

I'm currently trying to use a golang and echo app as both a web server and a reverse proxy and running into some issues. The main goal of this app is to allow a client to download files of various sizes (kbs - gbs). The problem I've run into is that…
2
votes
1 answer

How can i use a json object in golang template

My goal is to load an object from the database as a json object into a vue application that is rendered in a golang template. The data should be loaded directly into the web page. Does anyone have an idea how to do this? template.html …
Sienael
  • 69
  • 8
2
votes
1 answer

How to Add/Set Header after next() in Golang Echo Middleware?

Main Purpose: I want to simply count the execution time for any API / route, and add it into the Response Header with key: ExecutionTime. I am very open to another alternative, since my method may wrong as I am still new in Go-Echo framework. What I…
Jacky Supit
  • 469
  • 3
  • 15
2
votes
0 answers

How can I redirect from a middleware in go?

I have the following case. how can i address from handlev1 to handle2, using middleware? that depends on IsActiveBypass Or what do you suggest? func Handlev1(sw echoswagger.ApiRoot, itemUseCase usecase.ItemFileUseCase) { g := sw.Group("V2",…
Goku
  • 21
  • 1
1
2
3
9 10