This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
listen 443 ssl; | |
server_name wss.your-domain.com.br; | |
access_log /var/log/nginx/wss.your-domain.com.br; | |
location / { | |
proxy_pass http://localhost:3000; | |
proxy_http_version 1.1; | |
proxy_set_header Upgrade $http_upgrade; | |
proxy_set_header Connection "Upgrade"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '2' | |
services: | |
rethinkdb: | |
build: /rethinkdb | |
ports: | |
- "28015" | |
volumes: | |
- /data:/data | |
command: rethinkdb --bind all --data /data | |
app: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"context" | |
"fmt" | |
"log" | |
"net/http" | |
"time" | |
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Example Worker | |
* @package main | |
* @author @jeffotoni | |
*/ | |
// In this example we'll look at how to implement | |
// a _worker pool_ using goroutines and channels. | |
package main |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"strings" | |
) | |
func Substr(value string, leni, lenf int) string { | |
if len(value) < leni { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
func UploadPost1(uqueue mfqueue.Queue) (*MessageJson, bool, string) { | |
var mJson = MessageJson{} | |
//u := User{Id: "US123", Balance: 8} | |
b := new(bytes.Buffer) | |
json.NewEncoder(b).Encode(uqueue) | |
res, err := http.Post("http://apiphp.projeto1.local/apiphp/sqs/queue", "application/json; charset=utf-8", b) | |
if err != nil { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
listen 80 default_server; | |
listen [::]:80 default_server; | |
server_name apiphp.projeto1.local; | |
root /var/www/gitvirtualhosts/producao/projeto1; | |
index index index.php index.html index.htm index.nginx-debian.html; | |
access_log /var/log/nginx/apiphp.projeto1.local.log; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
################################################# | |
# Dockerfile distroless | |
################################################# | |
FROM golang:1.12.0 as builder | |
WORKDIR /go/src/main | |
ENV GO111MODULE=on | |
COPY . . | |
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags "-s -w" -o api | |
RUN cp api /go/bin/api |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type MeliReturn struct { | |
ID string `json:"id"` | |
SiteID string `json:"site_id"` | |
Title string `json:"title"` | |
Subtitle interface{} `json:"subtitle"` | |
SellerID int `json:"seller_id"` | |
CategoryID string `json:"category_id"` | |
OfficialStoreID interface{} `json:"official_store_id"` | |
Price int `json:"price"` | |
BasePrice int `json:"base_price"` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
) | |
type familia interface { | |
dados() string | |
} |