Questions tagged [go-fiber]

Fiber is an Express inspired web framework built on top of Fasthttp, the fastest HTTP engine for Go.

Fiber is an Express inspired web framework built on top of Fasthttp, the fastest HTTP engine for Go.

167 questions
1
vote
1 answer

How to register new websocket connections gofiber

I'm trying to set up a simple websocket server that should serve the client some content at unknown intervals. My code currently looks like this: router.go func SetupRoutes(app *fiber.App) error { app.Get("/whop/validate",…
1
vote
1 answer

Golang Boolean not detecting on PATCH

I am and application where I am trying to indicate if a client is active or not. If I manually set the ClientActive boolean to False, I can successfully convert it to True. But if it is True, it will not set to False. I am using GoFiber and…
RyanAK
  • 13
  • 3
1
vote
0 answers

go fibe auth error: sasl conversation error: unable to authenticate using mechanism "SCRAM-SHA-1"

i am trying to run go fiber mongo db example provided by line below : https://github.com/gofiber/recipes/blob/master/mongodb and i have dockerized the mongo like this : mongo: container_name: mongo image: mongo restart: always …
Farshad
  • 1,830
  • 6
  • 38
  • 70
1
vote
0 answers

why am i getting method not allowed when trying to POST in Go Fiber?

I have a simple app that is using Go fiber. The DELETE, and both GET routes work but when i try to POST a json in postman, i get hit with a Method Not Allowed.. I'm also storing the data in postgres. I am trying to POST the json below to…
RedRum
  • 902
  • 1
  • 13
  • 26
1
vote
1 answer

Container exits after running after running

I have a Golang Fiber server that exits automatically with the following message when running on Google Cloud Run: Container called exit(0). I am running it with the following Dockerfile # Use the offical golang image to create a binary. FROM…
mikegross
  • 1,674
  • 2
  • 12
  • 27
1
vote
0 answers

Role of Mutiple "layout" arguments to go-fiber html Render

I want to understand how go-fiber Render works with multiple layout arguments. It is quite clear how a single layout argument works (the first argument is executed and inserted into the {{embed}} tag inside the first layout argument). I looked at…
Gurunandan Bhat
  • 3,544
  • 3
  • 31
  • 43
1
vote
0 answers

Is there a way to solve this error for pion/stun package ?? Error : //go:build comment without // +build comment

I'm trying to build a docker image of a video conferencing platform written in Go using the pion package. Below is the error I'm facing > [stage-0 6/6] RUN CGO_ENABLED=0 go build -o /bin/app ./cmd: #13 0.446…
1
vote
1 answer

How to access Database if function in different module?

I try to atuhorize with jwt, but I get the problem which is when I check email with value email from claims I get the Error 500. That problem because the db is not ready. This is the code package route package route import ( …
leo
  • 139
  • 9
1
vote
0 answers

How do i access the Access Token from the spotify web api in Go?

I need to access my access token from the CompleteAuth function, so i can use in my other endpoints. func CompleteAuth(w http.ResponseWriter, r *http.Request) { tok, err := auth.Token(r.Context(), state, r) if err != nil { …
1
vote
1 answer

Golang Struct for Nested Objects

I am currently creating a golang api using GoFiber V2. I have the following document structure for a music track in a Mongo database: { "_id" : ObjectId("63cc26cb86ae1611380e1206"), "active" : 1, "exclusive" : "false", "track_title"…
Jamie_D
  • 979
  • 6
  • 13
1
vote
1 answer

how to remove some elements from the response in golang

I am studying gofiber, I am using GORM and github.com/morkid/paginate, I want to remove the child element from the response. this is the response { "data": { "items": [ { "ID": 1, "CreatedAt":…
1
vote
2 answers

How to create association only if it doesn't exist? (GORM)

I am looping through an array of strings to create an document with that property ONLY if it doesn't exist: (dbi: my GORM database instance) var postTags []models.Tag for _, tagSlug := range tagsArray { tag := models.Tag{ Slug:…
gabefgonc
  • 11
  • 3
1
vote
0 answers

How to use custom fonts in gocv library

I want to add a text on an given co-ordinates of an image using the gocv library (also the text should expand from the co-ordinates; not from left to right). Using the below command I was able to achieve both requirements. How can I load a custom…
1
vote
1 answer

packets.go:123: closing bad idle connection: connection reset by peer

I am using Go, Fiber web framework, mariadb 10.6, debian 11 and github.com/go-sql-driver/mysql to connection to mariadb. I have played with these settings db.SetMaxOpenConns(25) db.SetMaxIdleConns(25) db.SetConnMaxLifetime(5 * time.Minute) ie I…
1
vote
0 answers

Global variable changed when reading other value from html

I have defined global variable of universitySelected and domain at the top of my code, however, the universitySelected value was overwritten after email := c.FormValue("email"). For example, the universitySelected was "Harvard University" but after…
cyw
  • 63
  • 6