This file contains 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 ( | |
"bufio" | |
"crypto/tls" | |
"fmt" | |
"log" | |
"os" | |
gremlingo "github.com/apache/tinkerpop/gremlin-go/v3/driver" |
This file contains 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
# Build stage | |
FROM golang:1.19.3-alpine AS build | |
ENV CGO_ENABLED=0 | |
ENV GO111MODULE=on | |
WORKDIR /app | |
COPY go.mod . | |
COPY go.sum . | |
RUN go mod download | |
COPY . . | |
RUN go build -o /server |
This file contains 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 ( | |
"io" | |
"io/ioutil" | |
"log" | |
"mime/multipart" | |
"net/http" | |
"runtime" | |
) |
This file contains 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 (s *Server) uploadFileHandler(w http.ResponseWriter, r *http.Request) { | |
// Get the file from the request | |
err := r.ParseMultipartForm(10 << 20) | |
if err != nil { | |
log.Println(err) | |
http.Error(w, err.Error(), http.StatusBadRequest) | |
return | |
} |
This file contains 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 ( | |
"bytes" | |
"fmt" | |
"io" | |
"io/ioutil" | |
"net/http" | |
"runtime" | |
"sync" |
This file contains 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
CREATE TABLE batches( | |
id NUMBER(19) GENERATED BY DEFAULT ON NULL AS IDENTITY PRIMARY KEY, | |
user_id VARCHAR2(50) NOT NULL, | |
bId VARCHAR2(50) UNIQUE NOT NULL, | |
actionType NUMBER(3) NOT NULL, | |
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP | |
); |
This file contains 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" | |
"io/ioutil" | |
"log" | |
"net" | |
"net/http" | |
"sync" |
This file contains 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-alpine | |
ENV GO111MODULE=on | |
ENV PORT=8090 | |
WORKDIR /app/server | |
COPY go.mod . | |
RUN go mod download | |
COPY . . |
This file contains 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.12 | |
ENV GO111MODULE=on | |
ENV PORT=9000 | |
WORKDIR /app/server | |
COPY go.mod . | |
COPY go.sum . | |
RUN go mod download | |
COPY . . |
This file contains 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.12 | |
ENV PORT=9000 | |
WORKDIR /app/server | |
COPY . . | |
RUN go get ./... | |
RUN go build | |
CMD ["./server"] |
NewerOlder