初始化项目

This commit is contained in:
zxb 2023-11-01 20:26:27 +08:00
commit 035ebb150b
7 changed files with 112 additions and 0 deletions

42
.air.linux.toml Normal file
View File

@ -0,0 +1,42 @@
root = "."
testdata_dir = "testdata"
tmp_dir = "tmp"
[build]
args_bin = []
bin = "tmp\\main.exe"
cmd = "go build -o ./tmp/main ."
delay = 1500
exclude_dir = ["assets", "tmp", "vendor", "testdata"]
exclude_file = []
exclude_regex = ["_test.go"]
exclude_unchanged = false
follow_symlink = false
full_bin = ""
include_dir = []
include_ext = ["go", "tpl", "tmpl", "html"]
include_file = []
kill_delay = "0s"
log = "build-errors.log"
rerun = false
rerun_delay = 500
send_interrupt = true
stop_on_error = false
[color]
app = ""
build = "yellow"
main = "magenta"
runner = "green"
watcher = "cyan"
[log]
main_only = false
time = false
[misc]
clean_on_exit = false
[screen]
clear_on_rebuild = false
keep_scroll = true

42
.air.toml Normal file
View File

@ -0,0 +1,42 @@
root = "."
testdata_dir = "testdata"
tmp_dir = "tmp"
[build]
args_bin = []
bin = "tmp\\main.exe"
cmd = "go build -o ./tmp/main.exe ."
delay = 1500
exclude_dir = ["assets", "tmp", "vendor", "testdata"]
exclude_file = []
exclude_regex = ["_test.go"]
exclude_unchanged = false
follow_symlink = false
full_bin = ""
include_dir = []
include_ext = ["go", "tpl", "tmpl", "html"]
include_file = []
kill_delay = "0s"
log = "build-errors.log"
rerun = false
rerun_delay = 500
send_interrupt = true
stop_on_error = false
[color]
app = ""
build = "yellow"
main = "magenta"
runner = "green"
watcher = "cyan"
[log]
main_only = false
time = false
[misc]
clean_on_exit = false
[screen]
clear_on_rebuild = false
keep_scroll = true

5
README.MD Normal file
View File

@ -0,0 +1,5 @@
### 初始化项目
```shell
go generate -x init.go
```

3
go.mod Normal file
View File

@ -0,0 +1,3 @@
module iptables-helper
go 1.18

0
go.sum Normal file
View File

8
init.go Normal file
View File

@ -0,0 +1,8 @@
package main
//go:generate go version
//go:generate go env -w GO111MODULE=on
//go:generate go env -w GOPROXY=https://goproxy.cn,direct
//go:generate go install github.com/cosmtrek/air@latest
//go:generate go install github.com/swaggo/swag/cmd/swag@latest
//go:generate go mod tidy

12
pkg/constants/const.go Normal file
View File

@ -0,0 +1,12 @@
package constants
const (
ConfigFileName = "config"
ConfigType = "toml"
)
var ConfigPaths = []string{
".",
"./conf",
"/config",
}