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 ( | |
"github.com/aws/aws-sdk-go/aws" | |
"github.com/aws/aws-sdk-go/aws/session" | |
"github.com/aws/aws-sdk-go/service/s3" | |
"log" | |
"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
Filipe Braga, [20.05.21 09:57] | |
ID Guia Data no PAGE Data para Atualizar | |
9510 202105/99510 05/05/2021 27/04/2021 | |
9508 202105/99508 05/05/2021 27/04/2021 | |
9530 202105/99510 05/05/2021 27/04/2021 | |
9528 202105/99528 05/05/2021 27/04/2021 | |
9573 202105/99573 14/04/2021 17/04/2021 | |
9575 202105/99575 05/05/2021 17/04/2021 | |
9578 202105/99578 05/05/2021 17/04/2021 | |
9576 202105/99576 05/05/2021 17/04/2021 |
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
Mafê | |
Jefferson Otoni (via zoom) e Raphael Rossi (presencial) | |
zoom | |
https://us02web.zoom.us/j/89048168371 | |
Princípio: |
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 ( | |
"encoding/gob" | |
"fmt" | |
"log" | |
"net" | |
) | |
type CabecalhoServidor struct { |
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
// Em Go a formatação de tempo é única e diferente. | |
// Em vez de ter um formato convencional para imprimir a data | |
// Go usa a data de referência 20060102150405 que parece sem sentido | |
// mas na verdade tem um motivo, pois é 1 2 3 4 5 6 no comando Posix date: | |
// Mon Jan 2 15:04:05 -0700 MST 2006 | |
// 0 1 2 3 4 5 6 | |
// O fuso horário é 7, mas fica no meio, então, no final, o formato é | |
// semelhante a 1 2 3 4 5 7 6 |
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 handler | |
import ( | |
"bytes" | |
"encoding/json" | |
"net/http" | |
"net/http/httptest" | |
"strings" | |
"testing" |
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
func createMultipartFormData(t *testing.T, fieldName, fileName string) (bytes.Buffer, *multipart.Writer) { | |
var b bytes.Buffer | |
var err error | |
w := multipart.NewWriter(&b) | |
var fw io.Writer | |
file := mustOpen(fileName) | |
if fw, err = w.CreateFormFile(fieldName, file.Name()); err != nil { | |
t.Errorf("Error creating writer: %v", err) | |
} | |
if _, err = io.Copy(fw, file); 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
FROM golang:1.14 as builder | |
WORKDIR /go/src/upnid-api | |
COPY . . | |
ENV GO111MODULE=on | |
RUN GOSUMDB=off CGO_ENABLED=0 GOOS=linux go build -trimpath -ldflags="-s -w" -o upnid-api main.go | |
RUN cp upnid-api /go/bin/upnid-api | |
# Now copy it into our base image. | |
FROM gcr.io/distroless/base | |
COPY --from=builder /go/bin/upnid-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
package handler | |
import ( | |
"net/http" | |
"testing" | |
) | |
func TestScore(t *testing.T) { | |
type args struct { | |
w http.ResponseWriter |
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 ( | |
"encoding/json" | |
"log" | |
"math/rand" | |
"net/http" | |
"time" | |
) |