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

BodyParser snake_case payload best practice

I want to do something ordinary payload { "first_name": "name", "last_name": "last name", "email": "email", "password": "123" } struct type Register struct { FirstName string `json:"first_name" validate:"required" min=1…
-1
votes
1 answer

Run a background task in a SINGLE gofiber process

I have a background task (cleanUp) that deletes outdated files. func main() { // 4 procs/childs max runtime.GOMAXPROCS(4) // start a cleanup cron-job go cleanUp() app := fiber.New(fiber.Config{ Prefork: true, }) …
Eziz Durdyyev
  • 1,110
  • 2
  • 16
  • 34
-1
votes
1 answer

Go: How do I pass a JSON response without unmarshalling it

Using Go, I'm attempting to fetch a few JSON responses concurrently from multiple endpoints. I'd like to attach each of these responses to fields in a struct or map and return this struct/map as a JSON object. (Backend for Frontend pattern). So I…
Jim Wharton
  • 1,375
  • 3
  • 18
  • 41
-1
votes
2 answers

How do we log to stdout with gofiber golang framework?

I am looking for a way to log some data to stdout with gofiber golang framework as the framework is very quiet and does not log errors mostly I was thinking i could just use fmf.Print but even that does not get picked up at all How do you guys…
uberrebu
  • 3,597
  • 9
  • 38
  • 73
-1
votes
1 answer

Why aren't arrays bound in golang fiber?

Send json data to golang fiber, try to bind data received from fiber to struct but it fails, type MapTag struct { Id uint `json:"id" form:"tag_name" xorm:"bigint unsigned pk autoincr"` TagName string `json:"tag_name"…
Choi yun seok
  • 309
  • 2
  • 15
-1
votes
1 answer

How to resize FormFile image and save to "/public/images/" folder in GoFiber

I am using Gofiber as a RestAPI. I send a post request with a FormData format to the Gofiber server. file,fileError := c.FormFile("image") But from this file, I cannot resize that file. How can I resize and save that file to my folder?
-1
votes
2 answers

What can I use in place of DB.Where

In Gorm we can use DB.Where to check the data of the user from the database for authentication. But I have to use Go Fiber so what can I use in place of DB.Where to check if the user is present in the database. var user models.User …
S H A S H A N K
  • 118
  • 2
  • 23
-1
votes
1 answer

How can i get the issuer or footer or any additional data in GO paseto v2(public)

func GetToken(user int) (string, error) { v2 := paseto.NewV2() b, _ := hex.DecodeString(PrivateKey) privateKey := ed25519.PrivateKey(b) jsonToken := paseto.JSONToken{ Expiration: time.Now().Add(24 * time.Hour), …
-1
votes
2 answers

How to configure Login auth in GoLang with Go-Fiber & MongoDb Database

In the below code my Register function is working well but the login function is showing an error with goroutines. panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x2f0…
S H A S H A N K
  • 118
  • 2
  • 23
-1
votes
1 answer

go fiber slice append changes all items

seems like go slice append (string) changes all items when I render it to the template (also when I log the slice to the terminal) I think this is a golang thing but I am not sure with Django template Updated the code, but I still have the same…
-2
votes
0 answers

Is it not possible to call one go-fiber endpoint function from another?

I'm getting my way around web development with Go's Fiber and I can't seem to get this one thing straight. I have 3 handler functions that are defined in the same package and I'm trying to call 2 of them from inside the 3rd one but without success.…
-2
votes
1 answer

how to parse json to struct with field named "type"

i can't seem to get the following code working. The commented lines are sample request bodies, they always come in an array and with a parameter called "type" if i try to parse them i always end up with: error = json: cannot unmarshal array into Go…
JRSmile
  • 25
  • 4
-2
votes
1 answer

How to access below json values in go fiber?

This is the code I wrote. When I used token.Claims method it returns below result. And I need to access email value also for check whether who is the user. When I used token.Claims.Email it throws an error. func User(c *fiber.Ctx) error { cookie…
-2
votes
1 answer

Trying to write a post request to create a database with fiber and gorm and it gives me an error

trying to oupt a post (create) request using gorm as my database and fiber as my golang framewor but it seems like it is not working sometimes it returns "json: unmarshal(non-pointer, main.AcctDetails)" someone should please help me out i have been…
-3
votes
1 answer

How to share a server context between packages

I am very new to go and fiber and am struggling with creating a server in a package and then sharing the context in another package. // package main func init() { // Init server globs.InitServer() } func main() { …
Rishav Sharan
  • 2,763
  • 8
  • 39
  • 55
1 2 3
11
12