Questions tagged [Go] (1062)

3
answers

The best way to pass data between scripts within a VPC?

We have two scripts, one in php (laravel), another on the GO, they are both on the same network. Sometimes you want to send data from php to GO, or Vice versa, as the best thing to do, preferably not losing much time ? The most banal that came up is to let php send post request to go, but then lose a lot of time.
Vince_Hintz asked March 30th 20 at 01:27
1
answer

How to make pgx/pgtype with sqlx?

Good day! Asking for your help. Try to use github.com/jackc/pgx/pgtype with github.com/jmoiron/sqlx but when saving get the error `pdateRubrica failed: sql: converting argument $1 type: unsupported type pgtype.Varchar, a struct`. If you replace pgtype on normal then everything works. How can I make it work ? Here is an exam...
Idella_Stroman asked March 30th 20 at 01:12
0
answer

How to find the parameters (a, h) elliptic curve?

Use Go, and there beneath the curve is elliptic.P256() from crypto/elliptic, the implied secp256r1 Recommended settings for this elliptic curve can be checked by comparing with https://www.secg.org/sec2-v2.pdf#page=13&zoom=100,0,884 But CurveParams curve contain all the parameterstype CurveParams struct { P *big.Int //...
Sydni asked March 30th 20 at 00:54
1
answer

How to GO to make a regular subscription to a channel in Redis?

Hello, actually a subjectpackage main import ( "fmt" "github.com/go-redis/redis" ) func main() { client := redis.NewClient(&redis.Options{ Addr: "localhost:6379", Password: "", DB: 0, }) pubsub := client.Subscribe("test") defer pubsub.Close() msg, err := pubsub.ReceiveMessage() if err != nil { panic(err) } ...
jovanny asked March 30th 20 at 00:43
1
answer

How to forward a tcp connection through the reverse proxy to keep the tcp session?

There is such a scheme As can be seen from the scheme of the problem is high latency on the satellite channel. If the client requests via http\s http'and caching data, I found enough time to study and writing a proxy server for tcp connections found very little, I am interested in the question of how to forward tcp or udp c...
delta asked March 30th 20 at 00:26
1
answer

As using golang imap to download the email and attachment?

Good day, maybe someone did tell me maybe there is Liba which does what you need. You need to get the last n messages from your mailbox - from each letter to get the title, recipient, sender, time and date and any attachments(the attachments to save to the server). Or who did the saving investment? By reading messages and...
Beaulah.Dani asked March 30th 20 at 00:09
1
answer

How to specify CORS for http.FileServer in GO?

Hello, please tell me how to specify header headers for http.FileServer? ie understand that you need to register it:w.Header().Set("Access-Control-Allow-Origin", "*") but where I do not understand... here is the whole code: func initServer(pathToStatic string, c chan <- string ){ port := "46424" http.Handle("/static/...
Alaina.Nitzsche asked March 29th 20 at 23:50
1
answer

How to remove all the text which contains 32 characters?

There is a file with a large amount of data must be done so that all of the text in which 32 characters have been deleted, for example if the file is text, containing 32 characters, then it needs to be removed, that is, the text 12345678901234567890123456789012 after running the script needs to be removed (As the text conta...
gabriella_Goyet asked March 29th 20 at 23:44
0
answer

Encodes how the data in the dump utility in Flow-tools?

At the moment that this utility is now on the server and writes the dump Netflow v5, I would like to know how it is possible to decode this dump of code GO, although I know that is possible from C code to call using CGO, I'm not asking to look for me in a ton of this code this feature, just wondering can those who have ex...
Celestine asked March 29th 20 at 23:41
2
answers

Does it make sense to increase performance using multiple connections to the same database?

Will I have the optiondb, err := sql.Open("mysql", "root:password@/productdb") // many threads pinging the db queries.Query a similar performance this option:db, err := sql.Open("mysql", "root:password@/productdb") db1, err := sql.Open("mysql", "root:password@/productdb") // many threads, half of which pull requests db, t...
tatyana_McLaughlin asked March 29th 20 at 23:24