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

Gofiber ctx download []byte file

I am generating files in my backend and keep them in memory. I want to send the files with the ctx.Download method but it only accepts a String file path in disk. How can I trigger a file download like Download method sending a []byte file in memory
0
votes
0 answers

Passing html value as function parameter on golang fiber

i was searching for passing html value as a parameter on golang fiber but still got no answers. javascript: function monthPicker() { console.log(document.getElementById("datePicker").value); var date =…
Beruangs
  • 9
  • 3
0
votes
0 answers

Is it possible to read streaming response body using fiber?

I have a streaming server(ffmpeg) that send data through HTTP. I sent the stream to my fiber backend but I only have access to c.body() when the stream server(ffmpeg) is terminated. Is there any way to capture streamed data in real-time in…
MHM
  • 194
  • 1
  • 9
0
votes
1 answer

Golang can't get data from db because of types

I'm trying to get data from a MongoDB (previously saved using JS) and I unfortunately get empty _id and wrong format of the dates (saved as epoch). Here's the data in MongoDB: Here is the model I'm using in my Go code and here is what I get as…
Lassaad
  • 29
  • 5
0
votes
1 answer

How to create post method GORM Many2Many with nested/unmarshal data?

I am using GoFiber, GORM and mysql database. I am writing POST METHOD to write product data to DB. I see the data type I'm trying to write is "nested data" or "unmarshal data", but there's not much documentation for golang or specifically GORM…
0
votes
1 answer

How to create one to one relationship and foreign key in gorm?

What is the difference between Has One, Has Many and Belong To I have 3 Models User Profile Where profile and user should have one to one relationship Category Where category should be foreign key to user type User struct { gorm.Model Email…
Luqman Jr
  • 69
  • 1
  • 5
0
votes
1 answer

How do I share type definitions between frontend and a Golang backend?

I was using typescript for both forntend(Angular) and backend(Express). So to share type definition, I was doing: shared-type-file.ts interface Kid{ name: string; age: number; } Then npm install it in both frontend and backend. Thus my data…
Wajahath
  • 2,827
  • 2
  • 28
  • 37
0
votes
0 answers

how to interact go-rest-api & go-ipfs on the docker

docker-compose.yaml is like this version: '3' volumes: peer.hyperism.com: server.hyperism.com: networks: hyperism_net: ipam: config: - subnet: ${PUBLIC_DATA_NETWORKS} services: # MongoDB mongo_db: container_name:…
spartty
  • 11
  • 1
0
votes
1 answer
0
votes
2 answers

How to parse POST request body with arbitrary number of parameters in Go Fiber/ fasthttp

type Person struct { Name string `json:"name" xml:"name" form:"name"` Pass string `json:"pass" xml:"pass" form:"pass"` } app.Post("/", func(c *fiber.Ctx) error { p := new(Person) if err := c.BodyParser(p); err != nil { …
AH.
  • 741
  • 1
  • 12
  • 27
0
votes
1 answer

How do I convert post request body to query string format on go fasthttp/gofiber?

This is what I'm doing with Get requests app.Get("/", func(c *fiber.Ctx) error { fmt.Println(string(c.Request().URI().QueryString())) return c.SendString("Ok!") }) I'm getting the following output hello=12&sdsdf=324 I want to do…
AH.
  • 741
  • 1
  • 12
  • 27
0
votes
2 answers

Check if any variable conforms any interface using generics in Go

I am writing an API using go-fiber, and I want to check, if passed JSON conforms an interface that I want to see. So I decided to use 1.18's feature - generics. Here is what I did, but it does not work due to type problem. func…
Ivan
  • 316
  • 3
  • 15
0
votes
3 answers

How to reload Go Fiber in the terminal?

I am completely new to this community but would really appreciate if someone can help me with this problem I am facing. I am currently following the basic tutorial of the simple Hello World app but how can we update the code to say something else…
Usama Ahmed
  • 21
  • 1
  • 4
0
votes
1 answer

Error:interface must be a pointer to struct Error Returned in fiber (golang), how to solve this?

I'm new in Golang Programming I'm Faceing an issue.. I'm trying to acces my sent body data by "BodyParser"functtion But I got an error schema: interface must be a pointer to struct I'm Giving the Function Bellow func CreateService(c *fiber.Ctx)…
Fahim Ahmed
  • 43
  • 1
  • 7
0
votes
1 answer

How to Compare Hashed Passwords in Golang?

I was trying to build a login system on Golang's Fiber Farmework and am using Mysql as a database. I can easily Hash my password but cannot compare if the given password and the stored password is same or not I've used…
Fahim Ahmed
  • 43
  • 1
  • 7