[go-nuts] Re: Send a mail with a service account using Gmail API

2020-07-27 Thread Vincent Jouglard
..which is working like a charm. Thanks a lot again, Le vendredi 24 juillet 2020 à 22:54:33 UTC+2, Vincent Jouglard a écrit : > Hi John, > > Thanks for your message. > The main difference with my implementation is that I use a service account > which is authorized to send messages on

[go-nuts] Send a mail with a service account using Gmail API

2020-07-24 Thread Vincent Jouglard
Hi John, Thanks for your message. The main difference with my implementation is that I use a service account which is authorized to send messages on my behalf...and I think that this is where lies the problem. As i understand OAuth and the implementation from your exemple, a token is generated

[go-nuts] Send a mail with a service account using Gmail API

2020-07-24 Thread Vincent Jouglard
Hi there, I have been trying for quite some time to get over an error while trying to send an email using a service account, via the Gmail API. I get: > googleapi: Error 400: Precondition check failed., failedPrecondition Code is: package gmailApi import ( "encoding/base64" "fmt" "ne

[go-nuts] Re: One way - Unexported json field

2017-09-07 Thread Vincent Jouglard
Hi ascarter, This sounds like a great way to do it (even if I don't totally understand how it works, you gave me homework :D ), but, as I understand it, this would'nt work on slices ; i.e. []Player . Or I am mistaken ? Moreover, the regular rule is that the CustomField is not sent and the except

[go-nuts] Re: One way - Unexported json field

2017-09-06 Thread Vincent Jouglard
(player Player) Frontend() Player { > player.CustomField = "" > return player > } > > On Wednesday, 6 September 2017 00:36:56 UTC+3, Vincent Jouglard wrote: >> >> Hi guys, >> >> I would like to have fields in a custom type that : >> - are not

[go-nuts] One way - Unexported json field

2017-09-05 Thread Vincent Jouglard
Hi guys, I would like to have fields in a custom type that : - are not exported when I mashall them (to send to front) - are imported when I decode them (from the from) This is the type : type Player struct { Id bson.ObjectId `json:"id,omitempty" bson:"_id,omitempty"` CustomField stri

Re: [go-nuts] Re: Json-ifying map[bson.ObjectId] is not as expected

2016-12-26 Thread Vincent Jouglard
ed to change the > underlying type of bson.ObjectID to [12]byte instead. This would still work > as a map key and would cause json.Marshaller to use the MarshalText method, > giving you the results you were looking for automatically. > > On Thu, Dec 22, 2016 at 8:20 AM Vincent Jou

[go-nuts] Re: Json-ifying map[bson.ObjectId] is not as expected

2016-12-22 Thread Vincent Jouglard
Hi Jon, Thanks for the explanation ; i already used strings as indexes to make this work; but I was wondering if I was doing something wrong :) Still, I wonder if this behavior is wanted and if so, why that ? Regards, -- You received this message because you are subscribed to the Google Group

[go-nuts] Json-ifying map[bson.ObjectId] is not as expected

2016-12-21 Thread Vincent Jouglard
Hi, I am sending a map of elements indexed by a bson.ObjecId(), coming from the bdd. type Stats struct { A bson.ObjectId `json:"a,omitempty" bson:"a,omitempty"` B map[bson.ObjectId]CustomType `json:"b,omitempty" bson:"b,omitempty"` } // t is of type Stats if err = c.Write