Skip to content

Commit 05d439b

Browse files
committed
impl v2
1 parent 07dd4de commit 05d439b

15 files changed

+2177
-655
lines changed

.gitignore

+24-18
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,30 @@
1-
# Compiled Object files, Static and Dynamic libs (Shared Objects)
2-
*.o
3-
*.a
1+
# Created by https://www.toptal.com/developers/gitignore/api/go
2+
# Edit at https://www.toptal.com/developers/gitignore?templates=go
3+
4+
### Go ###
5+
# If you prefer the allow list template instead of the deny list, see community template:
6+
# https://github.com/github/gitignore/blob/main/community/Golang/Go.AllowList.gitignore
7+
#
8+
# Binaries for programs and plugins
9+
*.exe
10+
*.exe~
11+
*.dll
412
*.so
13+
*.dylib
14+
15+
# Test binary, built with `go test -c`
16+
*.test
517

6-
# Folders
7-
_obj
8-
_test
18+
# Output of the go coverage tool, specifically when used with LiteIDE
19+
*.out
920

10-
# Architecture specific extensions/prefixes
11-
*.[568vq]
12-
[568vq].out
21+
# Dependency directories (remove the comment below to include it)
22+
# vendor/
1323

14-
*.cgo1.go
15-
*.cgo2.c
16-
_cgo_defun.c
17-
_cgo_gotypes.go
18-
_cgo_export.*
24+
# Go workspace file
25+
go.work
1926

20-
_testmain.go
27+
# End of https://www.toptal.com/developers/gitignore/api/go
2128

22-
*.exe
23-
*.test
24-
*.prof
29+
# A files for testing TLS in local environment
30+
.tls

.vscode/settings.json

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"markdown.extension.toc.levels": "2..3"
3+
}

Dockerfile

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
1-
FROM golang:1.14 AS build-env
1+
ARG ARCH=amd64
2+
FROM golang:1.21 AS build
23

3-
MAINTAINER Mei Akizuru
4+
LABEL org.opencontainers.image.authors="Mei Akizuru <[email protected]>"
45

56
RUN mkdir -p /go/src/app
67
WORKDIR /go/src/app
78

89
# resolve dependency before copying whole source code
9-
COPY go.mod .
10-
COPY go.sum .
10+
COPY go.mod go.sum ./
1111
RUN go mod download
1212

1313
# copy other sources & build
1414
COPY . /go/src/app
15-
RUN GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -o /go/bin/app
15+
RUN GOOS=linux GOARCH=${ARCH} CGO_ENABLED=0 go build -o /go/bin/app
1616

17-
FROM alpine:3.11 AS runtime-env
18-
COPY --from=build-env /go/bin/app /usr/local/bin/app
19-
ENTRYPOINT ["/usr/local/bin/app"]
17+
FROM scratch
18+
COPY --from=build /go/bin/app /usr/local/bin/app
19+
ENTRYPOINT ["/usr/local/bin/app"]

LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Copyright (c) 2016 Mei Akizuru
3+
Copyright (c) 2023 Mei Akizuru
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

0 commit comments

Comments
 (0)