-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: use go embed for swagger (#1175)
* replace `statik` with built-in `embed`
- Loading branch information
Showing
19 changed files
with
18 additions
and
60 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 |
---|---|---|
|
@@ -5,5 +5,3 @@ runs: | |
steps: | ||
- run: make proto-swagger-gen | ||
shell: sh | ||
- run: make update-swagger-docs | ||
shell: sh |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package docs | ||
|
||
import "embed" | ||
|
||
//go:embed swagger-ui | ||
var SwaggerUI embed.FS |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -47,30 +47,23 @@ GITHUBDIR := $(GOPATH)$(FS)src$(FS)github.com | |
BUF_VERSION ?= 0.11.0 | ||
|
||
TOOLS_DESTDIR ?= $(GOPATH)/bin | ||
STATIK = $(TOOLS_DESTDIR)/statik | ||
RUNSIM = $(TOOLS_DESTDIR)/runsim | ||
|
||
tools: tools-stamp | ||
tools-stamp: statik runsim | ||
tools-stamp: runsim | ||
# Create dummy file to satisfy dependency and avoid | ||
# rebuilding when this Makefile target is hit twice | ||
# in a row. | ||
touch $@ | ||
|
||
# Install the runsim binary | ||
statik: $(STATIK) | ||
$(STATIK): | ||
@echo "Installing statik..." | ||
@go install github.com/rakyll/[email protected] | ||
|
||
# Install the runsim binary | ||
runsim: $(RUNSIM) | ||
$(RUNSIM): | ||
@echo "Installing runsim..." | ||
@go install github.com/cosmos/tools/cmd/[email protected] | ||
|
||
tools-clean: | ||
rm -f $(STATIK) $(GOLANGCI_LINT) $(RUNSIM) | ||
rm -f $(GOLANGCI_LINT) $(RUNSIM) | ||
rm -f tools-stamp | ||
|
||
.PHONY: tools-clean statik runsim | ||
.PHONY: tools-clean runsim |
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
This file was deleted.
Oops, something went wrong.
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