Skip to content

Instantly share code, notes, and snippets.

View jeffotoni's full-sized avatar

Jefferson Otoni Lima jeffotoni

View GitHub Profile
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";
version: '2'
services:
rethinkdb:
build: /rethinkdb
ports:
- "28015"
volumes:
- /data:/data
command: rethinkdb --bind all --data /data
app:
package main
import (
"context"
"fmt"
"log"
"net/http"
"time"
)
/*
* 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
package main
import (
"fmt"
"strings"
)
func Substr(value string, leni, lenf int) string {
if len(value) < leni {
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 {
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;
#################################################
# 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
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"`
package main
import (
"fmt"
)
type familia interface {
dados() string
}