-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🔥 feat: Add Support for Removing Routes (#3230)
* Add new methods named RemoveRoute and RemoveRouteByName. * Update register method to prevent duplicate routes. * Clean up tests * Update docs * Add Dockerfile
- Loading branch information
Showing
5 changed files
with
439 additions
and
11 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
# Usage: | ||
# | ||
## Linux: | ||
# ``` | ||
### To utilize the BuildKit cache use: | ||
# DOCKER_BUILDKIT=1 docker build -t fiber . | ||
# | ||
# docker run -it --rm fiber make lint && make test | ||
# ``` | ||
# | ||
## Windows: | ||
# ``` | ||
### To utilize the BuildKit cache use: | ||
# docker build -t fiber . | ||
# | ||
# docker run -it --rm fiber make lint && make test | ||
# ``` | ||
# | ||
# Note: BuildKit is the default builder for users on Docker Desktop. | ||
|
||
|
||
# Use the official Golang image to create a build artifact. | ||
FROM golang:latest AS builder | ||
|
||
RUN <<EOF | ||
apt-get update && \ | ||
apt-get install -y bsdmainutils && \ | ||
rm -rf /var/lib/apt/lists/* | ||
EOF | ||
|
||
ARG TARGETOS | ||
ARG TARGETARCH | ||
|
||
ENV CGO_ENABLED 0 | ||
ENV GOPATH /go | ||
ENV GOCACHE /go-build | ||
|
||
# Create and change to the app directory. | ||
WORKDIR /app | ||
|
||
# Create and change to the app directory. | ||
# Cache go modules | ||
# TODO use this? | ||
#go mod tidy && \ | ||
RUN --mount=type=cache,target=/go/pkg/mod/cache | ||
go mod download -x | ||
|
||
COPY . . | ||
|
||
# Build the binary. | ||
RUN --mount=type=cache,target=/go/pkg/mod/cache \ | ||
--mount=type=cache,target=/go/go-build \ | ||
GO_ENABLED=0 GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build -v -o bin/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
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
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
Oops, something went wrong.