[go-nuts] marshalling array of bson.M

2023-01-11 Thread RiSi
Is there a possibility to marshal array of bson.M? I get the error: WriteArray can only write a Array while positioned on a Element or Value but is positioned on a TopLevel My wish is to marshall array ob bason.M objects. Regards -- You received this message because you are subscribed to the Go

Re: [go-nuts] Re: notify a server about changes in client side

2021-12-07 Thread RiSi
It means in the body of func/handler responsible for this POST Endpoint I pack the necessary actions and each time client calls this endpoint those actions will be also executed. Then I do not need to check regularly when called this endpoint of server. Sorry for my naivety Am Di., 7. Dez. 2021

Re: [go-nuts] Re: notify a server about changes in client side

2021-12-07 Thread RiSi
And this POST endpoint should be checked regularly to see when the changes happened? As by each change the server does some action. As the server immediately after each POST request from client, need to do some action. How guarantee this in Go? Am Di., 7. Dez. 2021 um 14:11 Uhr schrieb Brian Candl

[go-nuts] notify a server about changes in client side

2021-12-07 Thread RiSi
Hi, having a server written in Go: this server provides an endpoint. The client(or consumer) calls this endpoint to notify server about the changes by him. My question is: How this server can check the notifications received from client? Available implementation approaches are unknown to me. Thank

Re: [go-nuts] sending server response to a client by w responseWriter

2021-10-07 Thread RiSi
if error happens by io.Copy, can I set the status Code of w after io.Copy? Am Do., 7. Okt. 2021 um 13:41 Uhr schrieb RiSi : > > *w.Header().Set("Content-Type", "application/xml")* > > *_, err:=io.Copy(w,src) * > > *if err!=nil{* > *re := &res{ M

Re: [go-nuts] sending server response to a client by w responseWriter

2021-10-07 Thread RiSi
*w.Header().Set("Content-Type", "application/xml")* *_, err:=io.Copy(w,src) * *if err!=nil{* *re := &res{ Message: "Error happened",}* *w.Header().Set("Content-Type", "application/json")w.WriteHeader(599) //sample status codeerr = json.NewEncoder(w).Encode(re)* *}//if* *the part after err!=ni