Questions tagged [google-app-engine-golang]

37 questions
1
vote
1 answer

Golang Mongodb insertOne returns empty ID ObjectID("000000000000000000000000")

I am using Go with MongoDB and creating a New Record but when I convert the insertedID to string it returns ObjectID("000000000000000000000000"). client := connect() db := client.Database("godb") // fmt.Println(db) usersCollection :=…
Khanakia
  • 723
  • 1
  • 8
  • 20
0
votes
1 answer

Content written to response writer shows erratic behaviour

File: main.go import ( "github.com/gorilla/mux" ) func setupRouting(pBus *bus.Bus) *mux.Router { log.Debug("Setting up routing") r := mux.NewRouter() pInvoiceHandler := handlers.NewInvoiceHandler(pBus) …
deb
  • 631
  • 1
  • 5
  • 15
0
votes
1 answer

googleapi: Error 404: No bot associated with this project., notFound

msgService := chat.NewSpacesMessagesService(service) msg := ChatCard("Title", "Subtitle", data) // msg := "hello" fmt.Print("Now ChatCard Method called\n") _, err = msgService.Create("spaces/AAAAwlgqHZg", msg).Do() if err != nil…
0
votes
1 answer

Golang: convert custom type (alias to [32]byte) to string

This is related to GOLANG language. I can't find out how to convert a value that is of a custom type: type Hash [32]byte into a string representation of that hash: myHash := CreateHash("This is an example text to be hashed") fmt.Printf("This is the…
Eduardo G.R.
  • 377
  • 3
  • 18
0
votes
1 answer

GO / Golang run project on Docker issues - Cannot find packages (internal folders)

I'm trying to run my first Golang project on Docker. While I succeeded with a simple "hello world" application, I'm facing some difficulties with a slightly more structured project. The project has some folders inside which I imported in the main.go…
Roberto Rizzi
  • 1,525
  • 5
  • 26
  • 39
0
votes
1 answer

how to Extracting data from XML

I am working on extracting data from a xml output. I have written the below code. I just need to extract dept number from the below xml. On running the below code getting a null output. Can someone let me how to extract the dept number from the xml…
0
votes
2 answers

GetAll() in a cloud.google.com/go/datastore Transaction{}?

I need to run an equivalent of this, but in a transaction: db.GetAll(ctx, datastore.NewQuery("Items").Ancestor(pkey), &itemContainers) But the Transaction{} type does not seem to have a GetAll() method. How can I get this done?
0
votes
1 answer

How to use cloud.google.com/go/datastore with AppEngine?

I'm migrating my Golang AppEngine app to 1.12+, and I need to switch to cloud.google.com/go/datastore. It's not clear to me how to use it with AppEngine, could someone please verify my assumptions? My assumption is that somewhere inside main() I can…
0
votes
1 answer

Find the 2nd and 4th saturday for a month to check for bank holiday in go

I want to find the 2nd and 4th saturday for a month to check bank holiday. I have added check for sundays for now. Currently this how my function looks with date as input in implemented in Go func IsHoliday(date time.Time) bool { return…
0
votes
1 answer

How to run App Engine Standard apps locally (for development/testing) in 2021 without `dev_appserver.py`?

There have been a lot of changes to App Engine Standard. Is it still possible to have a local instance of the app runnable with something similar to dev_appserver.py and to use the new cloud.google.com/... APIs? Previously, you could emulate the…
0
votes
1 answer

Is it possible to pass an array of json object as parameters of a URL?

I am working on unit test for a restAPI implementation in Golang. I need to pass an array of object into url. Here is an example of struct I have: type version struct { Name string `json:"name"` Ver string `json:"ver"` } …
Ashkanxy
  • 2,380
  • 2
  • 6
  • 17
0
votes
1 answer

Replacement for Go App Engine "google.golang.org/appengine/log" package, with log levels?

I noticed this package is deprecated, per the documentation here: https://cloud.google.com/appengine/docs/standard/go/go-differences What is the correct way to log on Go 1.12+ without losing log levels by simply printing?…
0
votes
0 answers

Go API on Google App Engine with Postgres

I am trying to connect to my GAE Postgres SQL db using Go+Gin+PGX. I have the Postgres SQL api activated and this program runs on my local machine but does not run on GAE. I think it is not connecting the db via pgx but I am not sure. main.go works…
Bryce Wayne
  • 351
  • 5
  • 17
0
votes
0 answers

How to add permission "view all with link" when you upload files to google drive

I have the possibility to upload file to google drive (it's a teamdrive) with the code below. But how to create with Permission when files are available for anyone with a link? I am planning to show them on a website, so they must be public. func…
0
votes
1 answer

Modify Datastore Admin Backup Built-in Task Queue

I'm new to Datastore. Currently, I'm using datastore admin to backup my data but I'm wondering if we can modify or override the built-in task queue on datastore admin /_ah/datastore_admin/backup.create? What I want to do when exporting the data from…