feat: docs api design
This commit is contained in:
commit
084d0de8bc
4
.dockerignore
Normal file
4
.dockerignore
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
.idea
|
||||||
|
.vscode
|
||||||
|
logs
|
||||||
|
local.yaml
|
17
.editorconfig
Normal file
17
.editorconfig
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
# http://editorconfig.org
|
||||||
|
root = true
|
||||||
|
|
||||||
|
[*]
|
||||||
|
max_line_length = 180
|
||||||
|
indent_style = tab
|
||||||
|
indent_size = 4
|
||||||
|
end_of_line = lf
|
||||||
|
charset = utf-8
|
||||||
|
trim_trailing_whitespace = true
|
||||||
|
insert_final_newline = true
|
||||||
|
|
||||||
|
[*.md]
|
||||||
|
trim_trailing_whitespace = false
|
||||||
|
|
||||||
|
[Makefile]
|
||||||
|
indent_style = tab
|
45
.gitignore
vendored
Normal file
45
.gitignore
vendored
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
__debug_bin
|
||||||
|
go.work
|
||||||
|
go.work.sum
|
||||||
|
|
||||||
|
# Reference https://github.com/github/gitignore/blob/master/Go.gitignore
|
||||||
|
# Binaries for programs and plugins
|
||||||
|
*.exe
|
||||||
|
*.exe~
|
||||||
|
*.dll
|
||||||
|
*.so
|
||||||
|
*.dylib
|
||||||
|
|
||||||
|
# Test binary, built with `go test -c`
|
||||||
|
*.test
|
||||||
|
|
||||||
|
# Output of the go coverage tool, specifically when used with LiteIDE
|
||||||
|
*.out
|
||||||
|
|
||||||
|
# Dependency directories (remove the comment below to include it)
|
||||||
|
vendor/
|
||||||
|
|
||||||
|
# Compiled Object files, Static and Dynamic libs (Shared Objects)
|
||||||
|
*.o
|
||||||
|
*.a
|
||||||
|
*.so
|
||||||
|
|
||||||
|
# OS General
|
||||||
|
Thumbs.db
|
||||||
|
.DS_Store
|
||||||
|
|
||||||
|
# project
|
||||||
|
*.cert
|
||||||
|
*.key
|
||||||
|
*.log
|
||||||
|
bin/
|
||||||
|
|
||||||
|
# Develop tools
|
||||||
|
.vscode/
|
||||||
|
.idea/
|
||||||
|
.fleet/
|
||||||
|
*.swp
|
||||||
|
|
||||||
|
# local config file
|
||||||
|
local.yaml
|
||||||
|
local_*
|
7
.gitlab-ci.yml
Normal file
7
.gitlab-ci.yml
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
include:
|
||||||
|
- project: "rcrai/rdm"
|
||||||
|
file: "gitlab-ci-common/common.yaml"
|
||||||
|
ref: main
|
||||||
|
- project: "rcrai/rdm"
|
||||||
|
file: "gitlab-ci-common/voc-deploy.yaml"
|
||||||
|
ref: main
|
21
.pre-commit-config.yaml
Normal file
21
.pre-commit-config.yaml
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
repos:
|
||||||
|
- repo: https://github.com/pre-commit/pre-commit-hooks.git
|
||||||
|
rev: v4.4.0
|
||||||
|
hooks:
|
||||||
|
- id: check-json
|
||||||
|
- id: check-yaml
|
||||||
|
- id: check-merge-conflict
|
||||||
|
- id: detect-private-key
|
||||||
|
- id: check-added-large-files
|
||||||
|
|
||||||
|
- repo: https://github.com/dnephin/pre-commit-golang
|
||||||
|
rev: v0.5.1
|
||||||
|
hooks:
|
||||||
|
- id: go-imports
|
||||||
|
- id: go-mod-tidy
|
||||||
|
- id: golangci-lint
|
||||||
|
|
||||||
|
# - repo: https://github.com/golangci/golangci-lint
|
||||||
|
# rev: v1.51.2
|
||||||
|
# hooks:
|
||||||
|
# - id: golangci-lint
|
37
Dockerfile
Normal file
37
Dockerfile
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
############################
|
||||||
|
# STEP 1 build the binary
|
||||||
|
############################
|
||||||
|
FROM golang:1.19 AS builder
|
||||||
|
|
||||||
|
# Set necessary environmet variables needed for our image
|
||||||
|
ENV GO111MODULE=on CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GOPROXY=https://goproxy.cn,direct
|
||||||
|
|
||||||
|
# Move to working directory /build
|
||||||
|
WORKDIR /build
|
||||||
|
|
||||||
|
# # Copy and download dependency using go mod
|
||||||
|
COPY ["go.mod", "go.sum", "./"]
|
||||||
|
RUN go mod download
|
||||||
|
|
||||||
|
# Copy the code into the container
|
||||||
|
COPY . .
|
||||||
|
|
||||||
|
# Build the application and debugger
|
||||||
|
RUN make build
|
||||||
|
|
||||||
|
############################
|
||||||
|
# STEP 2 build a small image
|
||||||
|
############################
|
||||||
|
FROM debian:stable-slim
|
||||||
|
|
||||||
|
ENV TZ=Asia/Shanghai
|
||||||
|
|
||||||
|
RUN sed -i 's/deb.debian.org/mirrors.tencentyun.com/g' /etc/apt/sources.list \
|
||||||
|
&& sed -i 's/security.debian.org/mirrors.tencentyun.com/g' /etc/apt/sources.list \
|
||||||
|
&& apt-get update && apt-get install --no-install-recommends -y ca-certificates tzdata \
|
||||||
|
&& apt-get autoremove -y && apt-get autoclean -y && rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
COPY --from=builder /build/bin/octopus /bin/octopus-cli
|
||||||
|
|
||||||
|
# Command to run the executable
|
||||||
|
CMD ["octopus-cli", "run"]
|
52
Makefile
Normal file
52
Makefile
Normal file
@ -0,0 +1,52 @@
|
|||||||
|
DATE ?= $(shell TZ=Asia/Shanghai date +%FT%T%z)
|
||||||
|
VERSION ?= $(shell git rev-parse HEAD)
|
||||||
|
GO_VERSION ?= $(shell go version | cut -d ' ' -f 3-)
|
||||||
|
|
||||||
|
# show help
|
||||||
|
help:
|
||||||
|
@echo ''
|
||||||
|
@echo 'Usage:'
|
||||||
|
@echo ' make [target]'
|
||||||
|
@echo ''
|
||||||
|
@echo 'Targets:'
|
||||||
|
@awk '/^[a-zA-Z\-\_0-9]+:/ { \
|
||||||
|
helpMessage = match(lastLine, /^# (.*)/); \
|
||||||
|
if (helpMessage) { \
|
||||||
|
helpCommand = substr($$1, 0, index($$1, ":")-1); \
|
||||||
|
helpMessage = substr(lastLine, RSTART + 2, RLENGTH); \
|
||||||
|
printf "\033[36m%-22s\033[0m %s\n", helpCommand,helpMessage; \
|
||||||
|
} \
|
||||||
|
} \
|
||||||
|
{ lastLine = $$0 }' $(MAKEFILE_LIST)
|
||||||
|
|
||||||
|
|
||||||
|
.PHONY: build
|
||||||
|
# build
|
||||||
|
build:
|
||||||
|
@ mkdir -p bin/
|
||||||
|
@ go build -v -ldflags "-s -w -X octopus.BuildTime=${DATE} -X octopus.Version=${VERSION} -X 'octopus.GoVersion=${GO_VERSION}'" -o ./bin/octopus ./cmd/octopus
|
||||||
|
|
||||||
|
.PHONY: run
|
||||||
|
# run server
|
||||||
|
run:
|
||||||
|
@ go run -ldflags "-s -w -X octopus.BuildTime=${DATE} -X octopus.Version=${VERSION} -X 'octopus.GoVersion=${GO_VERSION}'" ./cmd/octopus run
|
||||||
|
|
||||||
|
|
||||||
|
.PHONY: test
|
||||||
|
# test
|
||||||
|
test:
|
||||||
|
@ go test ./... -coverprofile=coverage.out
|
||||||
|
|
||||||
|
|
||||||
|
.PHONY: gen
|
||||||
|
# gen gorm-gen
|
||||||
|
gen:
|
||||||
|
@ rm -rf ./internal/dal/query
|
||||||
|
@ go run ./cmd/gen/main.go
|
||||||
|
|
||||||
|
lint:
|
||||||
|
golines -m 180 -w --reformat-tags .
|
||||||
|
|
||||||
|
clear-tag:
|
||||||
|
@ git tag | grep t- | tail -r | tail -n +2 | tail -r | xargs git push --delete origin
|
||||||
|
@ git tag | grep t- | tail -r | tail -n +2 | tail -r | xargs git tag -d
|
23
cmd/octopus/main.go
Normal file
23
cmd/octopus/main.go
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"octopus/cmd/octopus/scripts"
|
||||||
|
"octopus/cmd/octopus/server"
|
||||||
|
|
||||||
|
"github.com/rs/zerolog/log"
|
||||||
|
|
||||||
|
"github.com/spf13/cobra"
|
||||||
|
)
|
||||||
|
|
||||||
|
var rootCmd = &cobra.Command{
|
||||||
|
Use: "octopus-cli",
|
||||||
|
Short: "The `octopus` CLI",
|
||||||
|
}
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
rootCmd.AddCommand(server.CmdRun)
|
||||||
|
rootCmd.AddCommand(scripts.CmdScripts)
|
||||||
|
if err := rootCmd.Execute(); err != nil {
|
||||||
|
log.Fatal().Err(err).Msg("Failed to execute root command")
|
||||||
|
}
|
||||||
|
}
|
10
cmd/octopus/scripts/cmd.go
Normal file
10
cmd/octopus/scripts/cmd.go
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
package scripts
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/spf13/cobra"
|
||||||
|
)
|
||||||
|
|
||||||
|
var CmdScripts = &cobra.Command{
|
||||||
|
Use: "scripts",
|
||||||
|
Short: "执行定制化脚本",
|
||||||
|
}
|
74
cmd/octopus/server/app.go
Normal file
74
cmd/octopus/server/app.go
Normal file
@ -0,0 +1,74 @@
|
|||||||
|
package server
|
||||||
|
|
||||||
|
import (
|
||||||
|
"net/http"
|
||||||
|
"time"
|
||||||
|
|
||||||
|
"octopus"
|
||||||
|
"octopus/internal/config"
|
||||||
|
"octopus/internal/router"
|
||||||
|
"octopus/pkg/tools"
|
||||||
|
"octopus/statics"
|
||||||
|
|
||||||
|
"github.com/getkin/kin-openapi/openapi3"
|
||||||
|
"github.com/gofiber/fiber/v2"
|
||||||
|
"github.com/neo-f/soda"
|
||||||
|
)
|
||||||
|
|
||||||
|
var innerURLs = tools.NewSet(
|
||||||
|
config.URL_MONITOR,
|
||||||
|
config.URL_HEALTH,
|
||||||
|
config.URL_VERSION,
|
||||||
|
config.URL_OPENAPI,
|
||||||
|
config.URL_REDOC,
|
||||||
|
config.URL_SWAGGER,
|
||||||
|
config.URL_RAPIDOC,
|
||||||
|
config.URL_ELEMENTS,
|
||||||
|
config.URL_GATEWAY_CONFIG,
|
||||||
|
config.URL_METRICS,
|
||||||
|
)
|
||||||
|
|
||||||
|
var ROUTES = []func(app *soda.Soda){
|
||||||
|
RegisterBase,
|
||||||
|
router.RegisterDebuggerRouter,
|
||||||
|
router.RegisterDocRouter,
|
||||||
|
}
|
||||||
|
|
||||||
|
// startHttpServer starts configures and starts an HTTP server on the given URL.
|
||||||
|
// It shuts down the server if any error is received in the error channel.
|
||||||
|
func InitApp() *soda.Soda {
|
||||||
|
app := soda.New("Octopus", octopus.Version,
|
||||||
|
soda.EnableValidateRequest(),
|
||||||
|
soda.WithOpenAPISpec(config.URL_OPENAPI),
|
||||||
|
soda.WithStoplightElements(config.URL_ELEMENTS),
|
||||||
|
soda.WithRapiDoc(config.URL_RAPIDOC),
|
||||||
|
soda.WithRedoc(config.URL_REDOC),
|
||||||
|
soda.WithSwagger(config.URL_SWAGGER),
|
||||||
|
soda.WithFiberConfig(
|
||||||
|
fiber.Config{
|
||||||
|
ReadTimeout: time.Second * 10,
|
||||||
|
EnablePrintRoutes: true,
|
||||||
|
ErrorHandler: func(c *fiber.Ctx, err error) error {
|
||||||
|
if err == nil {
|
||||||
|
return c.Next()
|
||||||
|
}
|
||||||
|
status := http.StatusInternalServerError //default error status
|
||||||
|
if e, ok := err.(*fiber.Error); ok { // it's a custom error, so use the status in the error
|
||||||
|
status = e.Code
|
||||||
|
}
|
||||||
|
msg := map[string]interface{}{"code": status, "message": err.Error()}
|
||||||
|
return c.Status(status).JSON(msg)
|
||||||
|
},
|
||||||
|
},
|
||||||
|
),
|
||||||
|
)
|
||||||
|
app.OpenAPI().Info.Contact = &openapi3.Contact{Name: "NEO", Email: "tmpgfw@gmail.com"}
|
||||||
|
app.OpenAPI().Info.Description = statics.GenDescription()
|
||||||
|
for _, env := range config.ENVS {
|
||||||
|
app.OpenAPI().AddServer(&openapi3.Server{URL: env[1], Description: env[0]})
|
||||||
|
}
|
||||||
|
for _, route := range ROUTES {
|
||||||
|
route(app)
|
||||||
|
}
|
||||||
|
return app
|
||||||
|
}
|
106
cmd/octopus/server/base.go
Normal file
106
cmd/octopus/server/base.go
Normal file
@ -0,0 +1,106 @@
|
|||||||
|
package server
|
||||||
|
|
||||||
|
import (
|
||||||
|
"octopus"
|
||||||
|
"octopus/internal/config"
|
||||||
|
"octopus/pkg/logger"
|
||||||
|
"octopus/pkg/middlewares/metrics"
|
||||||
|
"octopus/pkg/middlewares/uniform"
|
||||||
|
"runtime"
|
||||||
|
"time"
|
||||||
|
|
||||||
|
"github.com/gofiber/fiber/v2"
|
||||||
|
"github.com/gofiber/fiber/v2/middleware/compress"
|
||||||
|
"github.com/gofiber/fiber/v2/middleware/cors"
|
||||||
|
flogger "github.com/gofiber/fiber/v2/middleware/logger"
|
||||||
|
"github.com/gofiber/fiber/v2/middleware/monitor"
|
||||||
|
"github.com/gofiber/fiber/v2/middleware/pprof"
|
||||||
|
"github.com/gofiber/fiber/v2/middleware/recover"
|
||||||
|
"github.com/gofiber/fiber/v2/middleware/requestid"
|
||||||
|
"github.com/neo-f/soda"
|
||||||
|
"github.com/rs/xid"
|
||||||
|
"github.com/rs/zerolog/log"
|
||||||
|
)
|
||||||
|
|
||||||
|
type SystemHealth struct {
|
||||||
|
MySQL bool `json:"mysql" oai:"description=mysql 连接状态"`
|
||||||
|
Redis bool `json:"redis" oai:"description=redis 连接状态"`
|
||||||
|
AntsPool interface{} `json:"ants_pool" oai:"description=协程池状态"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func HealthProbe(c *fiber.Ctx) error {
|
||||||
|
return c.Status(200).SendString("OK")
|
||||||
|
}
|
||||||
|
|
||||||
|
type SystemVersion struct {
|
||||||
|
Version string `json:"version" oai:"description=版本"`
|
||||||
|
BuildTime string `json:"build_time" oai:"description=构建时间"`
|
||||||
|
GoVersion string `json:"go_version" oai:"description=go 版本"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func version(c *fiber.Ctx) error {
|
||||||
|
return c.JSON(SystemVersion{
|
||||||
|
Version: octopus.Version,
|
||||||
|
BuildTime: octopus.BuildTime,
|
||||||
|
GoVersion: octopus.GoVersion,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
func defaultNextFunc(c *fiber.Ctx) bool {
|
||||||
|
return innerURLs.Has(c.Path())
|
||||||
|
}
|
||||||
|
|
||||||
|
func RegisterBase(app *soda.Soda) {
|
||||||
|
app.Use(
|
||||||
|
// CORS 跨域
|
||||||
|
cors.New(),
|
||||||
|
// Compress 压缩
|
||||||
|
compress.New(),
|
||||||
|
// recover 异常恢复
|
||||||
|
recover.New(recover.Config{
|
||||||
|
EnableStackTrace: true,
|
||||||
|
StackTraceHandler: func(c *fiber.Ctx, e interface{}) {
|
||||||
|
buf := make([]byte, 1024)
|
||||||
|
buf = buf[:runtime.Stack(buf, false)]
|
||||||
|
log.Ctx(c.UserContext()).Error().Interface("err", e).Msg(string(buf))
|
||||||
|
},
|
||||||
|
}),
|
||||||
|
// uniform 统一返回结构
|
||||||
|
uniform.New(uniform.Config{Next: defaultNextFunc}),
|
||||||
|
// requestid 请求增加trace_id
|
||||||
|
requestid.New(
|
||||||
|
requestid.Config{
|
||||||
|
Generator: func() string { return xid.New().String() },
|
||||||
|
ContextKey: "trace_id",
|
||||||
|
},
|
||||||
|
),
|
||||||
|
// kylin ball 麒麟球实现
|
||||||
|
logger.NewKylinMiddleware(),
|
||||||
|
// logger 请求日志
|
||||||
|
flogger.New(flogger.Config{
|
||||||
|
Next: func(c *fiber.Ctx) bool { return innerURLs.Has(c.Path()) },
|
||||||
|
TimeFormat: time.RFC3339,
|
||||||
|
Format: "${time} [${locals:trace_id}] ${status} - ${latency} ${method} ${path}\n",
|
||||||
|
}),
|
||||||
|
// Prometheus
|
||||||
|
metrics.NewMiddleware(metrics.Config{Next: defaultNextFunc}),
|
||||||
|
)
|
||||||
|
|
||||||
|
if config.Get().Debug {
|
||||||
|
app.Use(pprof.New())
|
||||||
|
app.Get(config.URL_MONITOR, monitor.New()).
|
||||||
|
SetSummary("系统监视器").
|
||||||
|
AddTags("System").OK()
|
||||||
|
}
|
||||||
|
app.Get(config.URL_HEALTH, HealthProbe).
|
||||||
|
SetSummary("健康检查").
|
||||||
|
SetDescription("\n - 一切正常的时候返回状态码200\n - 任意一项不成功的时候返回状态码400").
|
||||||
|
AddJSONResponse(200, SystemHealth{}).
|
||||||
|
AddJSONResponse(400, SystemHealth{}).
|
||||||
|
AddTags("System").OK()
|
||||||
|
|
||||||
|
app.Get(config.URL_VERSION, version).
|
||||||
|
SetSummary("版本信息").
|
||||||
|
AddJSONResponse(200, SystemVersion{}).
|
||||||
|
AddTags("System").OK()
|
||||||
|
}
|
76
cmd/octopus/server/cmd.go
Normal file
76
cmd/octopus/server/cmd.go
Normal file
@ -0,0 +1,76 @@
|
|||||||
|
package server
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"fmt"
|
||||||
|
"net/http"
|
||||||
|
"os"
|
||||||
|
"os/signal"
|
||||||
|
"sync"
|
||||||
|
"syscall"
|
||||||
|
|
||||||
|
"octopus/internal/config"
|
||||||
|
"octopus/pkg/logger"
|
||||||
|
|
||||||
|
"github.com/prometheus/client_golang/prometheus/promhttp"
|
||||||
|
"github.com/rs/zerolog/log"
|
||||||
|
"github.com/spf13/cobra"
|
||||||
|
)
|
||||||
|
|
||||||
|
var CmdRun = &cobra.Command{
|
||||||
|
Use: "run",
|
||||||
|
Short: "Run the octopus server",
|
||||||
|
Run: func(*cobra.Command, []string) {
|
||||||
|
////////////////SETTING LOGS && Sentry ///////////////////
|
||||||
|
logger.Setup()
|
||||||
|
//////////////////////////////////////////////////////////
|
||||||
|
app := InitApp()
|
||||||
|
log.Info().Msg("starting http server")
|
||||||
|
go app.Listen(fmt.Sprintf(":%d", config.Get().HTTPPort)) //nolint:errcheck
|
||||||
|
|
||||||
|
ctx, cancel := context.WithCancel(context.Background())
|
||||||
|
wg := &sync.WaitGroup{}
|
||||||
|
// Start the app
|
||||||
|
wg.Add(1)
|
||||||
|
go func() {
|
||||||
|
defer wg.Done()
|
||||||
|
<-ctx.Done()
|
||||||
|
if err := app.Shutdown(); err != nil {
|
||||||
|
log.Fatal().Err(err).Msg("failed to shutdown")
|
||||||
|
}
|
||||||
|
}()
|
||||||
|
|
||||||
|
prometheusAddr := fmt.Sprintf(":%d", config.Get().PrometheusPort)
|
||||||
|
mux := http.NewServeMux()
|
||||||
|
mux.Handle("/metrics", promhttp.Handler())
|
||||||
|
server := &http.Server{Addr: prometheusAddr, Handler: mux}
|
||||||
|
|
||||||
|
wg.Add(1)
|
||||||
|
go func() {
|
||||||
|
defer wg.Done()
|
||||||
|
if err := server.ListenAndServe(); err != nil && err != http.ErrServerClosed {
|
||||||
|
log.Fatal().Err(err).Msg("failed to start prometheus server")
|
||||||
|
}
|
||||||
|
}()
|
||||||
|
|
||||||
|
wg.Add(1)
|
||||||
|
go func() {
|
||||||
|
defer wg.Done()
|
||||||
|
<-ctx.Done()
|
||||||
|
if err := server.Shutdown(ctx); err != nil {
|
||||||
|
log.Fatal().Err(err).Msg("failed to shutdown prometheus server")
|
||||||
|
}
|
||||||
|
}()
|
||||||
|
|
||||||
|
sigs := make(chan os.Signal, 1)
|
||||||
|
signal.Notify(sigs, syscall.SIGINT, syscall.SIGTERM)
|
||||||
|
|
||||||
|
log.Info().Msg("initialize complete")
|
||||||
|
<-sigs // Blocks here until interrupted
|
||||||
|
// Handle shutdown
|
||||||
|
fmt.Println("Shutdown signal received")
|
||||||
|
cancel()
|
||||||
|
wg.Wait()
|
||||||
|
fmt.Println("All workers done, shutting down!")
|
||||||
|
},
|
||||||
|
}
|
23
cmd/octopus/version.go
Normal file
23
cmd/octopus/version.go
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
|
||||||
|
"octopus"
|
||||||
|
|
||||||
|
"github.com/spf13/cobra"
|
||||||
|
)
|
||||||
|
|
||||||
|
var cmdVersion = &cobra.Command{
|
||||||
|
Use: "version",
|
||||||
|
Short: "print the version info",
|
||||||
|
Run: func(*cobra.Command, []string) {
|
||||||
|
fmt.Println("version:", octopus.Version)
|
||||||
|
fmt.Println("build time:", octopus.BuildTime)
|
||||||
|
fmt.Println("build go version:", octopus.GoVersion)
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
func init() { // nolint
|
||||||
|
rootCmd.AddCommand(cmdVersion)
|
||||||
|
}
|
7
configs/config.yaml
Normal file
7
configs/config.yaml
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
debug: true
|
||||||
|
http_port: 8080
|
||||||
|
prometheus_port: 18090
|
||||||
|
databases:
|
||||||
|
oss: minio://admin:uh8Cz62LKFDe9tBHg2PVyDVX7XKqE584xP@10.16.129.140:31141/pangu2-demo
|
||||||
|
postgresql: postgres://postgres:TvpHKxDhXzMsVkXWdzwiwUw9KmaLuGdRJo@10.16.129.140:31258/octopus
|
||||||
|
qdrant: 10.16.129.104:32352
|
98
go.mod
Normal file
98
go.mod
Normal file
@ -0,0 +1,98 @@
|
|||||||
|
module octopus
|
||||||
|
|
||||||
|
go 1.19
|
||||||
|
|
||||||
|
require (
|
||||||
|
github.com/casdoor/casdoor-go-sdk v0.20.1
|
||||||
|
github.com/getkin/kin-openapi v0.115.0
|
||||||
|
github.com/getsentry/sentry-go v0.19.0
|
||||||
|
github.com/go-playground/validator v9.31.0+incompatible
|
||||||
|
github.com/gofiber/fiber/v2 v2.42.0
|
||||||
|
github.com/minio/minio-go/v7 v7.0.49
|
||||||
|
github.com/neo-f/soda v0.2.6
|
||||||
|
github.com/prometheus/client_golang v1.14.0
|
||||||
|
github.com/rs/xid v1.4.0
|
||||||
|
github.com/rs/zerolog v1.29.0
|
||||||
|
github.com/spf13/cast v1.5.0
|
||||||
|
github.com/spf13/cobra v1.6.1
|
||||||
|
github.com/spf13/viper v1.15.0
|
||||||
|
github.com/tidwall/gjson v1.14.4
|
||||||
|
github.com/tidwall/sjson v1.2.5
|
||||||
|
gorm.io/driver/postgres v1.5.0
|
||||||
|
gorm.io/driver/sqlite v1.4.4
|
||||||
|
gorm.io/gorm v1.24.7-0.20230306060331-85eaf9eeda11
|
||||||
|
)
|
||||||
|
|
||||||
|
require (
|
||||||
|
github.com/andybalholm/brotli v1.0.4 // indirect
|
||||||
|
github.com/beorn7/perks v1.0.1 // indirect
|
||||||
|
github.com/cespare/xxhash/v2 v2.1.2 // indirect
|
||||||
|
github.com/dustin/go-humanize v1.0.1 // indirect
|
||||||
|
github.com/fsnotify/fsnotify v1.6.0 // indirect
|
||||||
|
github.com/go-openapi/jsonpointer v0.19.5 // indirect
|
||||||
|
github.com/go-openapi/swag v0.22.3 // indirect
|
||||||
|
github.com/go-playground/locales v0.14.1 // indirect
|
||||||
|
github.com/go-playground/universal-translator v0.18.1 // indirect
|
||||||
|
github.com/go-playground/validator/v10 v10.11.2 // indirect
|
||||||
|
github.com/golang-jwt/jwt/v4 v4.1.0 // indirect
|
||||||
|
github.com/golang/protobuf v1.5.2 // indirect
|
||||||
|
github.com/google/uuid v1.3.0 // indirect
|
||||||
|
github.com/gorilla/schema v1.2.0 // indirect
|
||||||
|
github.com/hashicorp/hcl v1.0.0 // indirect
|
||||||
|
github.com/inconshreveable/mousetrap v1.0.1 // indirect
|
||||||
|
github.com/invopop/yaml v0.2.0 // indirect
|
||||||
|
github.com/jackc/pgpassfile v1.0.0 // indirect
|
||||||
|
github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a // indirect
|
||||||
|
github.com/jackc/pgx/v5 v5.3.0 // indirect
|
||||||
|
github.com/jinzhu/inflection v1.0.0 // indirect
|
||||||
|
github.com/jinzhu/now v1.1.5 // indirect
|
||||||
|
github.com/josharian/intern v1.0.0 // indirect
|
||||||
|
github.com/json-iterator/go v1.1.12 // indirect
|
||||||
|
github.com/klauspost/compress v1.15.15 // indirect
|
||||||
|
github.com/klauspost/cpuid/v2 v2.2.3 // indirect
|
||||||
|
github.com/leodido/go-urn v1.2.1 // indirect
|
||||||
|
github.com/magiconair/properties v1.8.7 // indirect
|
||||||
|
github.com/mailru/easyjson v0.7.7 // indirect
|
||||||
|
github.com/mattn/go-colorable v0.1.13 // indirect
|
||||||
|
github.com/mattn/go-isatty v0.0.17 // indirect
|
||||||
|
github.com/mattn/go-runewidth v0.0.14 // indirect
|
||||||
|
github.com/mattn/go-sqlite3 v1.14.15 // indirect
|
||||||
|
github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect
|
||||||
|
github.com/minio/md5-simd v1.1.2 // indirect
|
||||||
|
github.com/minio/sha256-simd v1.0.0 // indirect
|
||||||
|
github.com/mitchellh/mapstructure v1.5.0 // indirect
|
||||||
|
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
|
||||||
|
github.com/modern-go/reflect2 v1.0.2 // indirect
|
||||||
|
github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 // indirect
|
||||||
|
github.com/pelletier/go-toml/v2 v2.0.6 // indirect
|
||||||
|
github.com/perimeterx/marshmallow v1.1.4 // indirect
|
||||||
|
github.com/philhofer/fwd v1.1.1 // indirect
|
||||||
|
github.com/pkg/errors v0.9.1 // indirect
|
||||||
|
github.com/prometheus/client_model v0.3.0 // indirect
|
||||||
|
github.com/prometheus/common v0.37.0 // indirect
|
||||||
|
github.com/prometheus/procfs v0.8.0 // indirect
|
||||||
|
github.com/rivo/uniseg v0.4.3 // indirect
|
||||||
|
github.com/savsgio/dictpool v0.0.0-20221023140959-7bf2e61cea94 // indirect
|
||||||
|
github.com/savsgio/gotils v0.0.0-20220530130905-52f3993e8d6d // indirect
|
||||||
|
github.com/sirupsen/logrus v1.9.0 // indirect
|
||||||
|
github.com/spf13/afero v1.9.3 // indirect
|
||||||
|
github.com/spf13/jwalterweatherman v1.1.0 // indirect
|
||||||
|
github.com/spf13/pflag v1.0.5 // indirect
|
||||||
|
github.com/subosito/gotenv v1.4.2 // indirect
|
||||||
|
github.com/tidwall/match v1.1.1 // indirect
|
||||||
|
github.com/tidwall/pretty v1.2.0 // indirect
|
||||||
|
github.com/tinylib/msgp v1.1.6 // indirect
|
||||||
|
github.com/valyala/bytebufferpool v1.0.0 // indirect
|
||||||
|
github.com/valyala/fasthttp v1.44.0 // indirect
|
||||||
|
github.com/valyala/tcplisten v1.0.0 // indirect
|
||||||
|
golang.org/x/crypto v0.6.0 // indirect
|
||||||
|
golang.org/x/net v0.7.0 // indirect
|
||||||
|
golang.org/x/oauth2 v0.0.0-20221014153046-6fdb5e3db783 // indirect
|
||||||
|
golang.org/x/sys v0.5.0 // indirect
|
||||||
|
golang.org/x/text v0.7.0 // indirect
|
||||||
|
google.golang.org/appengine v1.6.7 // indirect
|
||||||
|
google.golang.org/protobuf v1.28.1 // indirect
|
||||||
|
gopkg.in/go-playground/assert.v1 v1.2.1 // indirect
|
||||||
|
gopkg.in/ini.v1 v1.67.0 // indirect
|
||||||
|
gopkg.in/yaml.v3 v3.0.1 // indirect
|
||||||
|
)
|
771
go.sum
Normal file
771
go.sum
Normal file
@ -0,0 +1,771 @@
|
|||||||
|
cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
|
||||||
|
cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
|
||||||
|
cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU=
|
||||||
|
cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU=
|
||||||
|
cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY=
|
||||||
|
cloud.google.com/go v0.44.3/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY=
|
||||||
|
cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc=
|
||||||
|
cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0=
|
||||||
|
cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To=
|
||||||
|
cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO4=
|
||||||
|
cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M=
|
||||||
|
cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc=
|
||||||
|
cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKVk=
|
||||||
|
cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs=
|
||||||
|
cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc=
|
||||||
|
cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY=
|
||||||
|
cloud.google.com/go v0.72.0/go.mod h1:M+5Vjvlc2wnp6tjzE102Dw08nGShTscUx2nZMufOKPI=
|
||||||
|
cloud.google.com/go v0.74.0/go.mod h1:VV1xSbzvo+9QJOxLDaJfTjx5e+MePCpCWwvftOeQmWk=
|
||||||
|
cloud.google.com/go v0.75.0/go.mod h1:VGuuCn7PG0dwsd5XPVm2Mm3wlh3EL55/79EKB6hlPTY=
|
||||||
|
cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o=
|
||||||
|
cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE=
|
||||||
|
cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc=
|
||||||
|
cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg=
|
||||||
|
cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc=
|
||||||
|
cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ=
|
||||||
|
cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE=
|
||||||
|
cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk=
|
||||||
|
cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I=
|
||||||
|
cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw=
|
||||||
|
cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA=
|
||||||
|
cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU=
|
||||||
|
cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw=
|
||||||
|
cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos=
|
||||||
|
cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk=
|
||||||
|
cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs=
|
||||||
|
cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0=
|
||||||
|
cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3fOKtUw0Xmo=
|
||||||
|
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
|
||||||
|
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
|
||||||
|
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
|
||||||
|
github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
|
||||||
|
github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
|
||||||
|
github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
|
||||||
|
github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
|
||||||
|
github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho=
|
||||||
|
github.com/andybalholm/brotli v1.0.4 h1:V7DdXeJtZscaqfNuAdSRuRFzuiKlHSC/Zh3zl9qY3JY=
|
||||||
|
github.com/andybalholm/brotli v1.0.4/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig=
|
||||||
|
github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q=
|
||||||
|
github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8=
|
||||||
|
github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
|
||||||
|
github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
|
||||||
|
github.com/casdoor/casdoor-go-sdk v0.20.1 h1:kb1Yuzlky8ogLMpOgJQ7pkwyqs8bf2T1vsFuUo+/9/A=
|
||||||
|
github.com/casdoor/casdoor-go-sdk v0.20.1/go.mod h1:MBed3ISHQfXTtoOCAk5T8l5lt4wFvsyynrw0awggydY=
|
||||||
|
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
|
||||||
|
github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
|
||||||
|
github.com/cespare/xxhash/v2 v2.1.2 h1:YRXhKfTDauu4ajMg1TPgFO5jnlC2HCbmLXMcTG5cbYE=
|
||||||
|
github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
|
||||||
|
github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI=
|
||||||
|
github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI=
|
||||||
|
github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU=
|
||||||
|
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
|
||||||
|
github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc=
|
||||||
|
github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk=
|
||||||
|
github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk=
|
||||||
|
github.com/coreos/go-systemd/v22 v22.3.3-0.20220203105225-a9a7ef127534/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc=
|
||||||
|
github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
|
||||||
|
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
|
||||||
|
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||||
|
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
|
||||||
|
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||||
|
github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY=
|
||||||
|
github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto=
|
||||||
|
github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
|
||||||
|
github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
|
||||||
|
github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98=
|
||||||
|
github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5ynNVH9qI8YYLbd1fK2po=
|
||||||
|
github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk=
|
||||||
|
github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
|
||||||
|
github.com/frankban/quicktest v1.14.3 h1:FJKSZTDHjyhriyC81FLQ0LY93eSai0ZyR/ZIkd3ZUKE=
|
||||||
|
github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY=
|
||||||
|
github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw=
|
||||||
|
github.com/getkin/kin-openapi v0.115.0 h1:c8WHRLVY3G8m9jQTy0/DnIuljgRwTCB5twZytQS4JyU=
|
||||||
|
github.com/getkin/kin-openapi v0.115.0/go.mod h1:l5e9PaFUo9fyLJCPGQeXI2ML8c3P8BHOEV2VaAVf/pc=
|
||||||
|
github.com/getsentry/sentry-go v0.19.0 h1:BcCH3CN5tXt5aML+gwmbFwVptLLQA+eT866fCO9wVOM=
|
||||||
|
github.com/getsentry/sentry-go v0.19.0/go.mod h1:y3+lGEFEFexZtpbG1GUE2WD/f9zGyKYwpEqryTOC/nE=
|
||||||
|
github.com/go-errors/errors v1.4.2 h1:J6MZopCL4uSllY1OfXM374weqZFFItUbrImctkmUxIA=
|
||||||
|
github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU=
|
||||||
|
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
|
||||||
|
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
|
||||||
|
github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=
|
||||||
|
github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=
|
||||||
|
github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY=
|
||||||
|
github.com/go-kit/log v0.2.0/go.mod h1:NwTd00d/i8cPZ3xOwwiv2PO5MOcx78fFErGNcVmBjv0=
|
||||||
|
github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE=
|
||||||
|
github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk=
|
||||||
|
github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A=
|
||||||
|
github.com/go-logfmt/logfmt v0.5.1/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs=
|
||||||
|
github.com/go-openapi/jsonpointer v0.19.5 h1:gZr+CIYByUqjcgeLXnQu2gHYQC9o73G2XUeOFYEICuY=
|
||||||
|
github.com/go-openapi/jsonpointer v0.19.5/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg=
|
||||||
|
github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk=
|
||||||
|
github.com/go-openapi/swag v0.22.3 h1:yMBqmnQ0gyZvEb/+KzuWZOXgllrXT4SADYbvDaXHv/g=
|
||||||
|
github.com/go-openapi/swag v0.22.3/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14=
|
||||||
|
github.com/go-playground/assert/v2 v2.2.0 h1:JvknZsQTYeFEAhQwI4qEt9cyV5ONwRHC+lYKSsYSR8s=
|
||||||
|
github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA=
|
||||||
|
github.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY=
|
||||||
|
github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY=
|
||||||
|
github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY=
|
||||||
|
github.com/go-playground/validator v9.31.0+incompatible h1:UA72EPEogEnq76ehGdEDp4Mit+3FDh548oRqwVgNsHA=
|
||||||
|
github.com/go-playground/validator v9.31.0+incompatible/go.mod h1:yrEkQXlcI+PugkyDjY2bRrL/UBU4f3rvrgkN3V8JEig=
|
||||||
|
github.com/go-playground/validator/v10 v10.11.2 h1:q3SHpufmypg+erIExEKUmsgmhDTyhcJ38oeKGACXohU=
|
||||||
|
github.com/go-playground/validator/v10 v10.11.2/go.mod h1:NieE624vt4SCTJtD87arVLvdmjPAeV8BQlHtMnw9D7s=
|
||||||
|
github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY=
|
||||||
|
github.com/go-test/deep v1.0.8 h1:TDsG77qcSprGbC6vTN8OuXp5g+J+b5Pcguhf7Zt61VM=
|
||||||
|
github.com/go-test/deep v1.0.8/go.mod h1:5C2ZWiW0ErCdrYzpqxLbTX7MG14M9iiw8DgHncVwcsE=
|
||||||
|
github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
|
||||||
|
github.com/gofiber/fiber/v2 v2.42.0 h1:Fnp7ybWvS+sjNQsFvkhf4G8OhXswvB6Vee8hM/LyS+8=
|
||||||
|
github.com/gofiber/fiber/v2 v2.42.0/go.mod h1:3+SGNjqMh5VQH5Vz2Wdi43zTIV16ktlFd3x3R6O1Zlc=
|
||||||
|
github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
|
||||||
|
github.com/golang-jwt/jwt/v4 v4.1.0 h1:XUgk2Ex5veyVFVeLm0xhusUTQybEbexJXrvPNOKkSY0=
|
||||||
|
github.com/golang-jwt/jwt/v4 v4.1.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg=
|
||||||
|
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
|
||||||
|
github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
|
||||||
|
github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
|
||||||
|
github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
|
||||||
|
github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
|
||||||
|
github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
|
||||||
|
github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y=
|
||||||
|
github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw=
|
||||||
|
github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw=
|
||||||
|
github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw=
|
||||||
|
github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4=
|
||||||
|
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
|
||||||
|
github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
|
||||||
|
github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
|
||||||
|
github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw=
|
||||||
|
github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw=
|
||||||
|
github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk=
|
||||||
|
github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8=
|
||||||
|
github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA=
|
||||||
|
github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs=
|
||||||
|
github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w=
|
||||||
|
github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0=
|
||||||
|
github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8=
|
||||||
|
github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
|
||||||
|
github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
|
||||||
|
github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
|
||||||
|
github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw=
|
||||||
|
github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
|
||||||
|
github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
|
||||||
|
github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
|
||||||
|
github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
|
||||||
|
github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
|
||||||
|
github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
|
||||||
|
github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||||
|
github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||||
|
github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||||
|
github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||||
|
github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||||
|
github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||||
|
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||||
|
github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
|
||||||
|
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
|
||||||
|
github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs=
|
||||||
|
github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0=
|
||||||
|
github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0=
|
||||||
|
github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc=
|
||||||
|
github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc=
|
||||||
|
github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM=
|
||||||
|
github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM=
|
||||||
|
github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM=
|
||||||
|
github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM=
|
||||||
|
github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM=
|
||||||
|
github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
|
||||||
|
github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
|
||||||
|
github.com/google/pprof v0.0.0-20201218002935-b9804c9f04c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
|
||||||
|
github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI=
|
||||||
|
github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
||||||
|
github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I=
|
||||||
|
github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
||||||
|
github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg=
|
||||||
|
github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk=
|
||||||
|
github.com/googleapis/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8/go.mod h1:dvDLG8qkwmyD9a/MJJN3XJcT3xFxOKAvTZGvuZmac9g=
|
||||||
|
github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So=
|
||||||
|
github.com/gorilla/schema v1.2.0 h1:YufUaxZYCKGFuAq3c96BOhjgd5nmXiOY9NGzF247Tsc=
|
||||||
|
github.com/gorilla/schema v1.2.0/go.mod h1:kgLaKoK1FELgZqMAVxx/5cbj0kT+57qxUrAlIO2eleU=
|
||||||
|
github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
|
||||||
|
github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
|
||||||
|
github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4=
|
||||||
|
github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ=
|
||||||
|
github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
|
||||||
|
github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
|
||||||
|
github.com/inconshreveable/mousetrap v1.0.1 h1:U3uMjPSQEBMNp1lFxmllqCPM6P5u/Xq7Pgzkat/bFNc=
|
||||||
|
github.com/inconshreveable/mousetrap v1.0.1/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw=
|
||||||
|
github.com/invopop/yaml v0.1.0/go.mod h1:2XuRLgs/ouIrW3XNzuNj7J3Nvu/Dig5MXvbCEdiBN3Q=
|
||||||
|
github.com/invopop/yaml v0.2.0 h1:7zky/qH+O0DwAyoobXUqvVBwgBFRxKoQ/3FjcVpjTMY=
|
||||||
|
github.com/invopop/yaml v0.2.0/go.mod h1:2XuRLgs/ouIrW3XNzuNj7J3Nvu/Dig5MXvbCEdiBN3Q=
|
||||||
|
github.com/jackc/pgpassfile v1.0.0 h1:/6Hmqy13Ss2zCq62VdNG8tM1wchn8zjSGOBJ6icpsIM=
|
||||||
|
github.com/jackc/pgpassfile v1.0.0/go.mod h1:CEx0iS5ambNFdcRtxPj5JhEz+xB6uRky5eyVu/W2HEg=
|
||||||
|
github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a h1:bbPeKD0xmW/Y25WS6cokEszi5g+S0QxI/d45PkRi7Nk=
|
||||||
|
github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a/go.mod h1:5TJZWKEWniPve33vlWYSoGYefn3gLQRzjfDlhSJ9ZKM=
|
||||||
|
github.com/jackc/pgx/v5 v5.3.0 h1:/NQi8KHMpKWHInxXesC8yD4DhkXPrVhmnwYkjp9AmBA=
|
||||||
|
github.com/jackc/pgx/v5 v5.3.0/go.mod h1:t3JDKnCBlYIc0ewLF0Q7B8MXmoIaBOZj/ic7iHozM/8=
|
||||||
|
github.com/jackc/puddle/v2 v2.2.0/go.mod h1:vriiEXHvEE654aYKXXjOvZM39qJ0q+azkZFrfEOc3H4=
|
||||||
|
github.com/jinzhu/inflection v1.0.0 h1:K317FqzuhWc8YvSVlFMCCUb36O/S9MCKRDI7QkRKD/E=
|
||||||
|
github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc=
|
||||||
|
github.com/jinzhu/now v1.1.4/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8=
|
||||||
|
github.com/jinzhu/now v1.1.5 h1:/o9tlHleP7gOFmsnYNz3RGnqzefHA47wQpKrrdTIwXQ=
|
||||||
|
github.com/jinzhu/now v1.1.5/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8=
|
||||||
|
github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY=
|
||||||
|
github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y=
|
||||||
|
github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4=
|
||||||
|
github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU=
|
||||||
|
github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
|
||||||
|
github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
|
||||||
|
github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM=
|
||||||
|
github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo=
|
||||||
|
github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU=
|
||||||
|
github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk=
|
||||||
|
github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w=
|
||||||
|
github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM=
|
||||||
|
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
|
||||||
|
github.com/klauspost/compress v1.15.9/go.mod h1:PhcZ0MbTNciWF3rruxRgKxI5NkcHHrHUDtV4Yw2GlzU=
|
||||||
|
github.com/klauspost/compress v1.15.15 h1:EF27CXIuDsYJ6mmvtBRlEuB2UVOqHG1tAXgZ7yIO+lw=
|
||||||
|
github.com/klauspost/compress v1.15.15/go.mod h1:ZcK2JAFqKOpnBlxcLsJzYfrS9X1akm9fHZNnD9+Vo/4=
|
||||||
|
github.com/klauspost/cpuid/v2 v2.0.1/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg=
|
||||||
|
github.com/klauspost/cpuid/v2 v2.0.4/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg=
|
||||||
|
github.com/klauspost/cpuid/v2 v2.2.3 h1:sxCkb+qR91z4vsqw4vGGZlDgPz3G7gjaLyK3V8y70BU=
|
||||||
|
github.com/klauspost/cpuid/v2 v2.2.3/go.mod h1:RVVoqg1df56z8g3pUjL/3lE5UfnlrJX8tyFgg4nqhuY=
|
||||||
|
github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
|
||||||
|
github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
|
||||||
|
github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg=
|
||||||
|
github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc=
|
||||||
|
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
|
||||||
|
github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
|
||||||
|
github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0=
|
||||||
|
github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk=
|
||||||
|
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
|
||||||
|
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
|
||||||
|
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
|
||||||
|
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
|
||||||
|
github.com/leodido/go-urn v1.2.1 h1:BqpAaACuzVSgi/VLzGZIobT2z4v53pjosyNd9Yv6n/w=
|
||||||
|
github.com/leodido/go-urn v1.2.1/go.mod h1:zt4jvISO2HfUBqxjfIshjdMTYS56ZS/qv49ictyFfxY=
|
||||||
|
github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY=
|
||||||
|
github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0=
|
||||||
|
github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
|
||||||
|
github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
|
||||||
|
github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0=
|
||||||
|
github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc=
|
||||||
|
github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4=
|
||||||
|
github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA=
|
||||||
|
github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg=
|
||||||
|
github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94=
|
||||||
|
github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM=
|
||||||
|
github.com/mattn/go-isatty v0.0.17 h1:BTarxUcIeDqL27Mc+vyvdWYSL28zpIhv3RoTdsLMPng=
|
||||||
|
github.com/mattn/go-isatty v0.0.17/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM=
|
||||||
|
github.com/mattn/go-runewidth v0.0.14 h1:+xnbZSEeDbOIg5/mE6JF0w6n9duR1l3/WmbinWVwUuU=
|
||||||
|
github.com/mattn/go-runewidth v0.0.14/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w=
|
||||||
|
github.com/mattn/go-sqlite3 v1.14.15 h1:vfoHhTN1af61xCRSWzFIWzx2YskyMTwHLrExkBOjvxI=
|
||||||
|
github.com/mattn/go-sqlite3 v1.14.15/go.mod h1:2eHXhiwb8IkHr+BDWZGa96P6+rkvnG63S2DGjv9HUNg=
|
||||||
|
github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU=
|
||||||
|
github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0=
|
||||||
|
github.com/minio/md5-simd v1.1.2 h1:Gdi1DZK69+ZVMoNHRXJyNcxrMA4dSxoYHZSQbirFg34=
|
||||||
|
github.com/minio/md5-simd v1.1.2/go.mod h1:MzdKDxYpY2BT9XQFocsiZf/NKVtR7nkE4RoEpN+20RM=
|
||||||
|
github.com/minio/minio-go/v7 v7.0.49 h1:dE5DfOtnXMXCjr/HWI6zN9vCrY6Sv666qhhiwUMvGV4=
|
||||||
|
github.com/minio/minio-go/v7 v7.0.49/go.mod h1:UI34MvQEiob3Cf/gGExGMmzugkM/tNgbFypNDy5LMVc=
|
||||||
|
github.com/minio/sha256-simd v1.0.0 h1:v1ta+49hkWZyvaKwrQB8elexRqm6Y0aMLjCNsrYxo6g=
|
||||||
|
github.com/minio/sha256-simd v1.0.0/go.mod h1:OuYzVNI5vcoYIAmbIvHPl3N3jUzVedXbKy5RFepssQM=
|
||||||
|
github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY=
|
||||||
|
github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
|
||||||
|
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
|
||||||
|
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg=
|
||||||
|
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
|
||||||
|
github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
|
||||||
|
github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
|
||||||
|
github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M=
|
||||||
|
github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=
|
||||||
|
github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 h1:RWengNIwukTxcDr9M+97sNutRR1RKhG96O6jWumTTnw=
|
||||||
|
github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826/go.mod h1:TaXosZuwdSHYgviHp1DAtfrULt5eUgsSMsZf+YrPgl8=
|
||||||
|
github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
|
||||||
|
github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
|
||||||
|
github.com/neo-f/soda v0.2.6 h1:F5AlSOTwNiS1te9muEHAyQc1CwWw9IV22K3TsDsL7vU=
|
||||||
|
github.com/neo-f/soda v0.2.6/go.mod h1:1NZ4OiuFMauwyP4Z46JUuv2kisom9rRllq8QYwkYjoY=
|
||||||
|
github.com/pelletier/go-toml/v2 v2.0.6 h1:nrzqCb7j9cDFj2coyLNLaZuJTLjWjlaz6nvTvIwycIU=
|
||||||
|
github.com/pelletier/go-toml/v2 v2.0.6/go.mod h1:eumQOmlWiOPt5WriQQqoM5y18pDHwha2N+QD+EUNTek=
|
||||||
|
github.com/perimeterx/marshmallow v1.1.4 h1:pZLDH9RjlLGGorbXhcaQLhfuV0pFMNfPO55FuFkxqLw=
|
||||||
|
github.com/perimeterx/marshmallow v1.1.4/go.mod h1:dsXbUu8CRzfYP5a87xpp0xq9S3u0Vchtcl8we9tYaXw=
|
||||||
|
github.com/philhofer/fwd v1.1.1 h1:GdGcTjf5RNAxwS4QLsiMzJYj5KEvPJD3Abr261yRQXQ=
|
||||||
|
github.com/philhofer/fwd v1.1.1/go.mod h1:gk3iGcWd9+svBvR0sR+KPcfE+RNWozjowpeBVG3ZVNU=
|
||||||
|
github.com/pingcap/errors v0.11.4 h1:lFuQV/oaUMGcD2tqt+01ROSmJs75VG1ToEOkZIZ4nE4=
|
||||||
|
github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
|
||||||
|
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
|
||||||
|
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
|
||||||
|
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
|
||||||
|
github.com/pkg/sftp v1.13.1/go.mod h1:3HaPG6Dq1ILlpPZRO0HVMrsydcdLt6HRDccSgb87qRg=
|
||||||
|
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
|
||||||
|
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||||
|
github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw=
|
||||||
|
github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo=
|
||||||
|
github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M=
|
||||||
|
github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0=
|
||||||
|
github.com/prometheus/client_golang v1.12.1/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY=
|
||||||
|
github.com/prometheus/client_golang v1.14.0 h1:nJdhIvne2eSX/XRAFV9PcvFFRbrjbcTUj0VP62TMhnw=
|
||||||
|
github.com/prometheus/client_golang v1.14.0/go.mod h1:8vpkKitgIVNcqrRBWh1C4TIUQgYNtG/XQE4E/Zae36Y=
|
||||||
|
github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo=
|
||||||
|
github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
|
||||||
|
github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
|
||||||
|
github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
|
||||||
|
github.com/prometheus/client_model v0.3.0 h1:UBgGFHqYdG/TPFD1B1ogZywDqEkwp3fBMvqdiQ7Xew4=
|
||||||
|
github.com/prometheus/client_model v0.3.0/go.mod h1:LDGWKZIo7rky3hgvBe+caln+Dr3dPggB5dvjtD7w9+w=
|
||||||
|
github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4=
|
||||||
|
github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo=
|
||||||
|
github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc=
|
||||||
|
github.com/prometheus/common v0.32.1/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls=
|
||||||
|
github.com/prometheus/common v0.37.0 h1:ccBbHCgIiT9uSoFY0vX8H3zsNR5eLt17/RQLUvn8pXE=
|
||||||
|
github.com/prometheus/common v0.37.0/go.mod h1:phzohg0JFMnBEFGxTDbfu3QyL5GI8gTQJFhYO5B3mfA=
|
||||||
|
github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
|
||||||
|
github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA=
|
||||||
|
github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU=
|
||||||
|
github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA=
|
||||||
|
github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA=
|
||||||
|
github.com/prometheus/procfs v0.8.0 h1:ODq8ZFEaYeCaZOJlZZdJA2AbQR98dSHSM1KW/You5mo=
|
||||||
|
github.com/prometheus/procfs v0.8.0/go.mod h1:z7EfXMXOkbkqb9IINtpCn86r/to3BnA0uaxHdg830/4=
|
||||||
|
github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
|
||||||
|
github.com/rivo/uniseg v0.4.3 h1:utMvzDsuh3suAEnhH0RdHmoPbU648o6CvXxTx4SBMOw=
|
||||||
|
github.com/rivo/uniseg v0.4.3/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88=
|
||||||
|
github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
|
||||||
|
github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc=
|
||||||
|
github.com/rogpeppe/go-internal v1.8.0 h1:FCbCCtXNOY3UtUuHUYaghJg4y7Fd14rXifAYUAtL9R8=
|
||||||
|
github.com/rs/xid v1.4.0 h1:qd7wPTDkN6KQx2VmMBLrpHkiyQwgFXRnkOLacUiaSNY=
|
||||||
|
github.com/rs/xid v1.4.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg=
|
||||||
|
github.com/rs/zerolog v1.29.0 h1:Zes4hju04hjbvkVkOhdl2HpZa+0PmVwigmo8XoORE5w=
|
||||||
|
github.com/rs/zerolog v1.29.0/go.mod h1:NILgTygv/Uej1ra5XxGf82ZFSLk58MFGAUS2o6usyD0=
|
||||||
|
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
|
||||||
|
github.com/savsgio/dictpool v0.0.0-20221023140959-7bf2e61cea94 h1:rmMl4fXJhKMNWl+K+r/fq4FbbKI+Ia2m9hYBLm2h4G4=
|
||||||
|
github.com/savsgio/dictpool v0.0.0-20221023140959-7bf2e61cea94/go.mod h1:90zrgN3D/WJsDd1iXHT96alCoN2KJo6/4x1DZC3wZs8=
|
||||||
|
github.com/savsgio/gotils v0.0.0-20220530130905-52f3993e8d6d h1:Q+gqLBOPkFGHyCJxXMRqtUgUbTjI8/Ze8vu8GGyNFwo=
|
||||||
|
github.com/savsgio/gotils v0.0.0-20220530130905-52f3993e8d6d/go.mod h1:Gy+0tqhJvgGlqnTF8CVGP0AaGRjwBtXs/a5PA0Y3+A4=
|
||||||
|
github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo=
|
||||||
|
github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE=
|
||||||
|
github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88=
|
||||||
|
github.com/sirupsen/logrus v1.9.0 h1:trlNQbNUG3OdDrDil03MCb1H2o9nJ1x4/5LYw7byDE0=
|
||||||
|
github.com/sirupsen/logrus v1.9.0/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=
|
||||||
|
github.com/spf13/afero v1.9.3 h1:41FoI0fD7OR7mGcKE/aOiLkGreyf8ifIOQmJANWogMk=
|
||||||
|
github.com/spf13/afero v1.9.3/go.mod h1:iUV7ddyEEZPO5gA3zD4fJt6iStLlL+Lg4m2cihcDf8Y=
|
||||||
|
github.com/spf13/cast v1.5.0 h1:rj3WzYc11XZaIZMPKmwP96zkFEnnAmV8s6XbB2aY32w=
|
||||||
|
github.com/spf13/cast v1.5.0/go.mod h1:SpXXQ5YoyJw6s3/6cMTQuxvgRl3PCJiyaX9p6b155UU=
|
||||||
|
github.com/spf13/cobra v1.6.1 h1:o94oiPyS4KD1mPy2fmcYYHHfCxLqYjJOhGsCHFZtEzA=
|
||||||
|
github.com/spf13/cobra v1.6.1/go.mod h1:IOw/AERYS7UzyrGinqmz6HLUo219MORXGxhbaJUqzrY=
|
||||||
|
github.com/spf13/jwalterweatherman v1.1.0 h1:ue6voC5bR5F8YxI5S67j9i582FU4Qvo2bmqnqMYADFk=
|
||||||
|
github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo=
|
||||||
|
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
|
||||||
|
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
|
||||||
|
github.com/spf13/viper v1.15.0 h1:js3yy885G8xwJa6iOISGFwd+qlUo5AvyXb7CiihdtiU=
|
||||||
|
github.com/spf13/viper v1.15.0/go.mod h1:fFcTBJxvhhzSJiZy8n+PeW6t8l+KeT/uTARa0jHOQLA=
|
||||||
|
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||||
|
github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||||
|
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
|
||||||
|
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
|
||||||
|
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
|
||||||
|
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
|
||||||
|
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
|
||||||
|
github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA=
|
||||||
|
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||||
|
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||||
|
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||||
|
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
|
||||||
|
github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk=
|
||||||
|
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
|
||||||
|
github.com/subosito/gotenv v1.4.2 h1:X1TuBLAMDFbaTAChgCBLu3DU3UPyELpnF2jjJ2cz/S8=
|
||||||
|
github.com/subosito/gotenv v1.4.2/go.mod h1:ayKnFf/c6rvx/2iiLrJUk1e6plDbT3edrFNGqEflhK0=
|
||||||
|
github.com/tidwall/gjson v1.14.2/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk=
|
||||||
|
github.com/tidwall/gjson v1.14.4 h1:uo0p8EbA09J7RQaflQ1aBRffTR7xedD2bcIVSYxLnkM=
|
||||||
|
github.com/tidwall/gjson v1.14.4/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk=
|
||||||
|
github.com/tidwall/match v1.1.1 h1:+Ho715JplO36QYgwN9PGYNhgZvoUSc9X2c80KVTi+GA=
|
||||||
|
github.com/tidwall/match v1.1.1/go.mod h1:eRSPERbgtNPcGhD8UCthc6PmLEQXEWd3PRB5JTxsfmM=
|
||||||
|
github.com/tidwall/pretty v1.2.0 h1:RWIZEg2iJ8/g6fDDYzMpobmaoGh5OLl4AXtGUGPcqCs=
|
||||||
|
github.com/tidwall/pretty v1.2.0/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU=
|
||||||
|
github.com/tidwall/sjson v1.2.5 h1:kLy8mja+1c9jlljvWTlSazM7cKDRfJuR/bOJhcY5NcY=
|
||||||
|
github.com/tidwall/sjson v1.2.5/go.mod h1:Fvgq9kS/6ociJEDnK0Fk1cpYF4FIW6ZF7LAe+6jwd28=
|
||||||
|
github.com/tinylib/msgp v1.1.6 h1:i+SbKraHhnrf9M5MYmvQhFnbLhAXSDWF8WWsuyRdocw=
|
||||||
|
github.com/tinylib/msgp v1.1.6/go.mod h1:75BAfg2hauQhs3qedfdDZmWAPcFMAvJE5b9rGOMufyw=
|
||||||
|
github.com/ugorji/go v1.2.7 h1:qYhyWUUd6WbiM+C6JZAUkIJt/1WrjzNHY9+KCIjVqTo=
|
||||||
|
github.com/ugorji/go v1.2.7/go.mod h1:nF9osbDWLy6bDVv/Rtoh6QgnvNDpmCalQV5urGCCS6M=
|
||||||
|
github.com/ugorji/go/codec v1.2.7 h1:YPXUKf7fYbp/y8xloBqZOw2qaVggbfwMlI8WM3wZUJ0=
|
||||||
|
github.com/ugorji/go/codec v1.2.7/go.mod h1:WGN1fab3R1fzQlVQTkfxVtIBhWDRqOviHU95kRgeqEY=
|
||||||
|
github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw=
|
||||||
|
github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc=
|
||||||
|
github.com/valyala/fasthttp v1.44.0 h1:R+gLUhldIsfg1HokMuQjdQ5bh9nuXHPIfvkYUu9eR5Q=
|
||||||
|
github.com/valyala/fasthttp v1.44.0/go.mod h1:f6VbjjoI3z1NDOZOv17o6RvtRSWxC77seBFc2uWtgiY=
|
||||||
|
github.com/valyala/tcplisten v1.0.0 h1:rBHj/Xf+E1tRGZyWIWwJDiRY0zc1Js+CV5DqwacVSA8=
|
||||||
|
github.com/valyala/tcplisten v1.0.0/go.mod h1:T0xQ8SeCZGxckz9qRXTfG43PvQ/mcWh7FwZEA7Ioqkc=
|
||||||
|
github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
|
||||||
|
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
|
||||||
|
github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
|
||||||
|
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
|
||||||
|
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
|
||||||
|
go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU=
|
||||||
|
go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8=
|
||||||
|
go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
|
||||||
|
go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
|
||||||
|
go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
|
||||||
|
go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk=
|
||||||
|
golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
|
||||||
|
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
||||||
|
golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
||||||
|
golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
||||||
|
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
||||||
|
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
||||||
|
golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4=
|
||||||
|
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
|
||||||
|
golang.org/x/crypto v0.0.0-20211108221036-ceb1ce70b4fa/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
|
||||||
|
golang.org/x/crypto v0.0.0-20220214200702-86341886e292/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
|
||||||
|
golang.org/x/crypto v0.6.0 h1:qfktjS5LUO+fFKeJXZ+ikTRijMmljikvG68fpMMruSc=
|
||||||
|
golang.org/x/crypto v0.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58=
|
||||||
|
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
|
||||||
|
golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
|
||||||
|
golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8=
|
||||||
|
golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek=
|
||||||
|
golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY=
|
||||||
|
golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4=
|
||||||
|
golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4=
|
||||||
|
golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4=
|
||||||
|
golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM=
|
||||||
|
golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU=
|
||||||
|
golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js=
|
||||||
|
golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
|
||||||
|
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
|
||||||
|
golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU=
|
||||||
|
golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
|
||||||
|
golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
|
||||||
|
golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
|
||||||
|
golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
|
||||||
|
golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
|
||||||
|
golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs=
|
||||||
|
golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY=
|
||||||
|
golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY=
|
||||||
|
golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY=
|
||||||
|
golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE=
|
||||||
|
golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o=
|
||||||
|
golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc=
|
||||||
|
golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY=
|
||||||
|
golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg=
|
||||||
|
golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg=
|
||||||
|
golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
|
||||||
|
golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
|
||||||
|
golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
|
||||||
|
golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
|
||||||
|
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
|
||||||
|
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||||
|
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||||
|
golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||||
|
golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||||
|
golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||||
|
golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
||||||
|
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
||||||
|
golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
||||||
|
golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
||||||
|
golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks=
|
||||||
|
golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||||
|
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||||
|
golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||||
|
golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||||
|
golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||||
|
golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||||
|
golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||||
|
golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||||
|
golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||||
|
golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||||
|
golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
|
||||||
|
golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
|
||||||
|
golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
|
||||||
|
golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
|
||||||
|
golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
|
||||||
|
golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
|
||||||
|
golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
|
||||||
|
golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
|
||||||
|
golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
|
||||||
|
golang.org/x/net v0.0.0-20201031054903-ff519b6c9102/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
|
||||||
|
golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
|
||||||
|
golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
|
||||||
|
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
|
||||||
|
golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
|
||||||
|
golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
|
||||||
|
golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
|
||||||
|
golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
|
||||||
|
golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
|
||||||
|
golang.org/x/net v0.0.0-20220906165146-f3363e06e74c/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk=
|
||||||
|
golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
|
||||||
|
golang.org/x/net v0.7.0 h1:rJrUqqhjsgNp7KqAIc25s9pZnjU7TUcSY7HcVZjdn1g=
|
||||||
|
golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
|
||||||
|
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
|
||||||
|
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
|
||||||
|
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
|
||||||
|
golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
|
||||||
|
golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
|
||||||
|
golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
|
||||||
|
golang.org/x/oauth2 v0.0.0-20201109201403-9fd604954f58/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
|
||||||
|
golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
|
||||||
|
golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
|
||||||
|
golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
|
||||||
|
golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc=
|
||||||
|
golang.org/x/oauth2 v0.0.0-20221014153046-6fdb5e3db783 h1:nt+Q6cXKz4MosCSpnbMtqiQ8Oz0pxTef2B4Vca2lvfk=
|
||||||
|
golang.org/x/oauth2 v0.0.0-20221014153046-6fdb5e3db783/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg=
|
||||||
|
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||||
|
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||||
|
golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||||
|
golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||||
|
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||||
|
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||||
|
golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||||
|
golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||||
|
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||||
|
golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||||
|
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||||
|
golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||||
|
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||||
|
golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||||
|
golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||||
|
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||||
|
golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
|
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
|
golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
|
golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
|
golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
|
golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
|
golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
|
golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
|
golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
|
golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
|
golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
|
golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
|
golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
|
golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
|
golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
|
golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
|
golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
|
golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
|
golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
|
golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
|
golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
|
golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
|
golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
|
golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
|
golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
|
golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
|
golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
|
golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
|
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
|
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
|
golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
|
golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
|
golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
|
golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
|
golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
|
golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
|
golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
|
golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
|
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
|
golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
|
golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
|
golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
|
golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
|
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
|
golang.org/x/sys v0.0.0-20220704084225-05e143d24a9e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
|
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
|
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
|
golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
|
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
|
golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
|
golang.org/x/sys v0.5.0 h1:MUK/U/4lj1t1oPg0HfuXDN/Z1wv31ZJ/YcPiGccS4DU=
|
||||||
|
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
|
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
|
||||||
|
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
|
||||||
|
golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k=
|
||||||
|
golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||||
|
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||||
|
golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||||
|
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
|
||||||
|
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||||
|
golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||||
|
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||||
|
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
|
||||||
|
golang.org/x/text v0.7.0 h1:4BRB4x83lYWy72KwLD/qYDuTu7q9PjSagHvijDw7cLo=
|
||||||
|
golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
|
||||||
|
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
||||||
|
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
||||||
|
golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
||||||
|
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||||
|
golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||||
|
golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY=
|
||||||
|
golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
|
||||||
|
golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
|
||||||
|
golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
|
||||||
|
golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
|
||||||
|
golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
|
||||||
|
golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
|
||||||
|
golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
|
||||||
|
golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
|
||||||
|
golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
|
||||||
|
golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||||
|
golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||||
|
golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||||
|
golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||||
|
golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||||
|
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||||
|
golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||||
|
golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||||
|
golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
|
||||||
|
golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
|
||||||
|
golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
|
||||||
|
golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
|
||||||
|
golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
|
||||||
|
golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
|
||||||
|
golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
|
||||||
|
golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
|
||||||
|
golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
|
||||||
|
golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
|
||||||
|
golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw=
|
||||||
|
golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw=
|
||||||
|
golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8=
|
||||||
|
golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
|
||||||
|
golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
|
||||||
|
golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
|
||||||
|
golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
|
||||||
|
golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA=
|
||||||
|
golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA=
|
||||||
|
golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA=
|
||||||
|
golang.org/x/tools v0.0.0-20200904185747-39188db58858/go.mod h1:Cj7w3i3Rnn0Xh82ur9kSqwfTHTeVxaDqrfMjpcNT6bE=
|
||||||
|
golang.org/x/tools v0.0.0-20201022035929-9cf592e881e9/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
|
||||||
|
golang.org/x/tools v0.0.0-20201110124207-079ba7bd75cd/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
|
||||||
|
golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
|
||||||
|
golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
|
||||||
|
golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
|
||||||
|
golang.org/x/tools v0.0.0-20210108195828-e2f9c7f1fc8e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
|
||||||
|
golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0=
|
||||||
|
golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=
|
||||||
|
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||||
|
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||||
|
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||||
|
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||||
|
google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE=
|
||||||
|
google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M=
|
||||||
|
google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg=
|
||||||
|
google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg=
|
||||||
|
google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI=
|
||||||
|
google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI=
|
||||||
|
google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI=
|
||||||
|
google.golang.org/api v0.17.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE=
|
||||||
|
google.golang.org/api v0.18.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE=
|
||||||
|
google.golang.org/api v0.19.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE=
|
||||||
|
google.golang.org/api v0.20.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE=
|
||||||
|
google.golang.org/api v0.22.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE=
|
||||||
|
google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE=
|
||||||
|
google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE=
|
||||||
|
google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM=
|
||||||
|
google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc=
|
||||||
|
google.golang.org/api v0.35.0/go.mod h1:/XrVsuzM0rZmrsbjJutiuftIzeuTQcEeaYcSk/mQ1dg=
|
||||||
|
google.golang.org/api v0.36.0/go.mod h1:+z5ficQTmoYpPn8LCUNVpK5I7hwkpjbcgqA7I34qYtE=
|
||||||
|
google.golang.org/api v0.40.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjRCQ8=
|
||||||
|
google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
|
||||||
|
google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
|
||||||
|
google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
|
||||||
|
google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0=
|
||||||
|
google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc=
|
||||||
|
google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc=
|
||||||
|
google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c=
|
||||||
|
google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc=
|
||||||
|
google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
|
||||||
|
google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
|
||||||
|
google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
|
||||||
|
google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
|
||||||
|
google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
|
||||||
|
google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc=
|
||||||
|
google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc=
|
||||||
|
google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8=
|
||||||
|
google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
|
||||||
|
google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
|
||||||
|
google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
|
||||||
|
google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
|
||||||
|
google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
|
||||||
|
google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
|
||||||
|
google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA=
|
||||||
|
google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
|
||||||
|
google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
|
||||||
|
google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
|
||||||
|
google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
|
||||||
|
google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
|
||||||
|
google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
|
||||||
|
google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
|
||||||
|
google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
|
||||||
|
google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U=
|
||||||
|
google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo=
|
||||||
|
google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA=
|
||||||
|
google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
|
||||||
|
google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
|
||||||
|
google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
|
||||||
|
google.golang.org/genproto v0.0.0-20200904004341-0bd0a958aa1d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
|
||||||
|
google.golang.org/genproto v0.0.0-20201109203340-2640f1f9cdfb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
|
||||||
|
google.golang.org/genproto v0.0.0-20201201144952-b05cb90ed32e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
|
||||||
|
google.golang.org/genproto v0.0.0-20201210142538-e3217bee35cc/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
|
||||||
|
google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
|
||||||
|
google.golang.org/genproto v0.0.0-20210108203827-ffc7fda8c3d7/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
|
||||||
|
google.golang.org/genproto v0.0.0-20210226172003-ab064af71705/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
|
||||||
|
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
|
||||||
|
google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38=
|
||||||
|
google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM=
|
||||||
|
google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg=
|
||||||
|
google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY=
|
||||||
|
google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk=
|
||||||
|
google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk=
|
||||||
|
google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk=
|
||||||
|
google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60=
|
||||||
|
google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk=
|
||||||
|
google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak=
|
||||||
|
google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak=
|
||||||
|
google.golang.org/grpc v1.31.1/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak=
|
||||||
|
google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc=
|
||||||
|
google.golang.org/grpc v1.34.0/go.mod h1:WotjhfgOW/POjDeRt8vscBtXq+2VjORFy659qA51WJ8=
|
||||||
|
google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU=
|
||||||
|
google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
|
||||||
|
google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0=
|
||||||
|
google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM=
|
||||||
|
google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE=
|
||||||
|
google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo=
|
||||||
|
google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
|
||||||
|
google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
|
||||||
|
google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
|
||||||
|
google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4=
|
||||||
|
google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c=
|
||||||
|
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
|
||||||
|
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
|
||||||
|
google.golang.org/protobuf v1.28.1 h1:d0NfwRgPtno5B1Wa6L2DAG+KivqkdutMf1UhdNx175w=
|
||||||
|
google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
|
||||||
|
gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw=
|
||||||
|
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||||
|
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||||
|
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||||
|
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
|
||||||
|
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
|
||||||
|
gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI=
|
||||||
|
gopkg.in/go-playground/assert.v1 v1.2.1 h1:xoYuJVE7KT85PYWrN730RguIQO0ePzVRfFMXadIrXTM=
|
||||||
|
gopkg.in/go-playground/assert.v1 v1.2.1/go.mod h1:9RXL0bg/zibRAgZUYszZSwO/z8Y/a8bDuhia5mkpMnE=
|
||||||
|
gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA=
|
||||||
|
gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k=
|
||||||
|
gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||||
|
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||||
|
gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||||
|
gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||||
|
gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||||
|
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
|
||||||
|
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||||
|
gopkg.in/yaml.v3 v3.0.0/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||||
|
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
|
||||||
|
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||||
|
gorm.io/driver/postgres v1.5.0 h1:u2FXTy14l45qc3UeCJ7QaAXZmZfDDv0YrthvmRq1l0U=
|
||||||
|
gorm.io/driver/postgres v1.5.0/go.mod h1:FUZXzO+5Uqg5zzwzv4KK49R8lvGIyscBOqYrtI1Ce9A=
|
||||||
|
gorm.io/driver/sqlite v1.4.4 h1:gIufGoR0dQzjkyqDyYSCvsYR6fba1Gw5YKDqKeChxFc=
|
||||||
|
gorm.io/driver/sqlite v1.4.4/go.mod h1:0Aq3iPO+v9ZKbcdiz8gLWRw5VOPcBOPUQJFLq5e2ecI=
|
||||||
|
gorm.io/gorm v1.24.0/go.mod h1:DVrVomtaYTbqs7gB/x2uVvqnXzv0nqjB396B8cG4dBA=
|
||||||
|
gorm.io/gorm v1.24.7-0.20230306060331-85eaf9eeda11 h1:9qNbmu21nNThCNnF5i2R3kw2aL27U8ZwbzccNjOmW0g=
|
||||||
|
gorm.io/gorm v1.24.7-0.20230306060331-85eaf9eeda11/go.mod h1:L4uxeKpfBml98NYqVqwAdmV1a2nBtAec/cf3fpucW/k=
|
||||||
|
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
|
||||||
|
honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
|
||||||
|
honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
|
||||||
|
honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
|
||||||
|
honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg=
|
||||||
|
honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k=
|
||||||
|
honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k=
|
||||||
|
rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8=
|
||||||
|
rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0=
|
||||||
|
rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA=
|
106
internal/config/config.go
Normal file
106
internal/config/config.go
Normal file
@ -0,0 +1,106 @@
|
|||||||
|
package config
|
||||||
|
|
||||||
|
import (
|
||||||
|
"net/url"
|
||||||
|
"os"
|
||||||
|
"path/filepath"
|
||||||
|
"runtime"
|
||||||
|
"sync"
|
||||||
|
"time"
|
||||||
|
|
||||||
|
"github.com/go-playground/validator"
|
||||||
|
"github.com/rs/zerolog"
|
||||||
|
"github.com/rs/zerolog/log"
|
||||||
|
"github.com/spf13/cast"
|
||||||
|
"github.com/spf13/viper"
|
||||||
|
)
|
||||||
|
|
||||||
|
var ENVS = [][2]string{
|
||||||
|
{"本地测试环境", "http://localhost:8080"},
|
||||||
|
}
|
||||||
|
|
||||||
|
type Config struct {
|
||||||
|
IsLocal bool
|
||||||
|
Debug bool `mapstructure:"debug"`
|
||||||
|
HTTPPort int `mapstructure:"http_port" validate:"required"`
|
||||||
|
PrometheusPort int `mapstructure:"prometheus_port" validate:"required"`
|
||||||
|
|
||||||
|
Databases struct {
|
||||||
|
OSS string `mapstructure:"oss" validate:"required"`
|
||||||
|
PostgreSQL string `mapstructure:"postgresql" validate:"required"`
|
||||||
|
Qdrant string `mapstructure:"qdrant" validate:"required"`
|
||||||
|
} `mapstructure:"databases"`
|
||||||
|
Sentry struct {
|
||||||
|
Environment string
|
||||||
|
DSN string
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
type ossConfig struct {
|
||||||
|
Schema string
|
||||||
|
Endpoint string
|
||||||
|
AccessID string
|
||||||
|
AccessSecret string
|
||||||
|
Region string
|
||||||
|
Bucket string
|
||||||
|
Secure bool
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *Config) GetOSSConfig() *ossConfig {
|
||||||
|
oss, err := url.Parse(c.Databases.OSS)
|
||||||
|
if err != nil {
|
||||||
|
log.Fatal().Err(err).Msg("parse oss config error")
|
||||||
|
}
|
||||||
|
accessSecret, _ := oss.User.Password()
|
||||||
|
return &ossConfig{
|
||||||
|
Schema: oss.Scheme,
|
||||||
|
Endpoint: oss.Host,
|
||||||
|
AccessID: oss.User.Username(),
|
||||||
|
AccessSecret: accessSecret,
|
||||||
|
Region: oss.Query().Get("region"),
|
||||||
|
Bucket: oss.Query().Get("bucket"),
|
||||||
|
Secure: cast.ToBool(oss.Query().Get("secure")),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
var (
|
||||||
|
c *Config
|
||||||
|
once sync.Once
|
||||||
|
)
|
||||||
|
|
||||||
|
func Get() *Config {
|
||||||
|
once.Do(setup)
|
||||||
|
return c
|
||||||
|
}
|
||||||
|
|
||||||
|
func setup() {
|
||||||
|
_, b, _, _ := runtime.Caller(0)
|
||||||
|
projectRoot := filepath.Join(filepath.Dir(b), "../..")
|
||||||
|
|
||||||
|
viper.SetConfigName("config")
|
||||||
|
viper.AddConfigPath(projectRoot + "/configs")
|
||||||
|
viper.AddConfigPath("/etc/octopus/")
|
||||||
|
viper.AddConfigPath(projectRoot)
|
||||||
|
err := viper.ReadInConfig()
|
||||||
|
if _, ok := err.(viper.ConfigFileNotFoundError); ok {
|
||||||
|
log.Info().Msg("config files not found, ignoring")
|
||||||
|
} else if err != nil {
|
||||||
|
log.Warn().Err(err).Msg("read config failed")
|
||||||
|
}
|
||||||
|
|
||||||
|
// unmarshal it
|
||||||
|
if err := viper.Unmarshal(&c); err != nil {
|
||||||
|
log.Fatal().Err(err).Msg("unmarshal config failed")
|
||||||
|
}
|
||||||
|
|
||||||
|
if c.Debug {
|
||||||
|
log.Logger = log.Output(zerolog.ConsoleWriter{Out: os.Stderr, TimeFormat: time.RFC3339})
|
||||||
|
}
|
||||||
|
|
||||||
|
// and validate it
|
||||||
|
v := validator.New()
|
||||||
|
if err := v.Struct(c); err != nil {
|
||||||
|
log.Fatal().Err(err).Msg("validate config failed")
|
||||||
|
}
|
||||||
|
log.Info().Msg("load configs success")
|
||||||
|
}
|
25
internal/config/const.go
Normal file
25
internal/config/const.go
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
package config
|
||||||
|
|
||||||
|
const (
|
||||||
|
URL_HEALTH = "/healthz"
|
||||||
|
URL_MONITOR = "/sys/monitor"
|
||||||
|
URL_VERSION = "/sys/version"
|
||||||
|
URL_OPENAPI = "/openapi.json"
|
||||||
|
URL_REDOC = "/redoc"
|
||||||
|
URL_SWAGGER = "/swagger"
|
||||||
|
URL_GATEWAY_CONFIG = "/v1/global-config/api-gateway"
|
||||||
|
URL_METRICS = "/metrics"
|
||||||
|
URL_RAPIDOC = "/rapidoc"
|
||||||
|
URL_ELEMENTS = "/"
|
||||||
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
LogTagURL = "url"
|
||||||
|
LogTagMethod = "method"
|
||||||
|
LogTagHeaders = "headers"
|
||||||
|
LogTagData = "data"
|
||||||
|
LogTagAuthorization = "authorization"
|
||||||
|
LogTagBID = "bid"
|
||||||
|
LogTagStaffID = "staff_id"
|
||||||
|
LogTagTraceID = "trace_id"
|
||||||
|
)
|
77
internal/dal/gorm_logger.go
Normal file
77
internal/dal/gorm_logger.go
Normal file
@ -0,0 +1,77 @@
|
|||||||
|
package dal
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"errors"
|
||||||
|
"time"
|
||||||
|
|
||||||
|
"github.com/rs/zerolog/log"
|
||||||
|
"gorm.io/gorm"
|
||||||
|
"gorm.io/gorm/logger"
|
||||||
|
"gorm.io/gorm/utils"
|
||||||
|
)
|
||||||
|
|
||||||
|
type GormLogger struct {
|
||||||
|
SourceField string
|
||||||
|
SlowThreshold time.Duration
|
||||||
|
SkipErrRecordNotFound bool
|
||||||
|
}
|
||||||
|
|
||||||
|
// Error implements logger.Interface
|
||||||
|
func (l *GormLogger) Error(ctx context.Context, s string, args ...interface{}) {
|
||||||
|
log.Ctx(ctx).Error().Msgf(s, args...)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Warn implements logger.Interface
|
||||||
|
func (*GormLogger) Warn(ctx context.Context, s string, args ...interface{}) {
|
||||||
|
log.Ctx(ctx).Warn().Msgf(s, args...)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Info implements logger.Interface
|
||||||
|
func (*GormLogger) Info(ctx context.Context, s string, args ...interface{}) {
|
||||||
|
log.Ctx(ctx).Info().Msgf(s, args...)
|
||||||
|
}
|
||||||
|
|
||||||
|
// LogMode implements logger.Interface
|
||||||
|
func (l *GormLogger) LogMode(logger.LogLevel) logger.Interface {
|
||||||
|
return l
|
||||||
|
}
|
||||||
|
|
||||||
|
// Trace implements logger.Interface
|
||||||
|
func (l *GormLogger) Trace(
|
||||||
|
ctx context.Context,
|
||||||
|
begin time.Time,
|
||||||
|
fc func() (string, int64),
|
||||||
|
err error,
|
||||||
|
) {
|
||||||
|
elapsed := time.Since(begin)
|
||||||
|
sql, rows := fc()
|
||||||
|
log := log.Ctx(ctx).
|
||||||
|
With().
|
||||||
|
Str("sql", sql).
|
||||||
|
Str("elapsed", elapsed.String()).
|
||||||
|
Int64("rows", rows).
|
||||||
|
Logger()
|
||||||
|
|
||||||
|
if l.SourceField != "" {
|
||||||
|
log = log.With().Str(l.SourceField, utils.FileWithLineNum()).Logger()
|
||||||
|
}
|
||||||
|
if err != nil && (!errors.Is(err, gorm.ErrRecordNotFound) || !l.SkipErrRecordNotFound) {
|
||||||
|
log.Error().Err(err).Msg("[GORM] query error")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if l.SlowThreshold != 0 && elapsed > l.SlowThreshold {
|
||||||
|
log.Warn().Msg("[GORM] slow query")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
log.Debug().Msg("[GORM] query")
|
||||||
|
}
|
||||||
|
|
||||||
|
var _ logger.Interface = &GormLogger{}
|
||||||
|
|
||||||
|
var DefaultGormLogger = &GormLogger{
|
||||||
|
SlowThreshold: time.Second * 3,
|
||||||
|
SourceField: "source",
|
||||||
|
SkipErrRecordNotFound: true,
|
||||||
|
}
|
18
internal/dal/migrations/migrations.go
Normal file
18
internal/dal/migrations/migrations.go
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
package migrations
|
||||||
|
|
||||||
|
import (
|
||||||
|
"octopus/internal/dal/model"
|
||||||
|
|
||||||
|
"github.com/rs/zerolog/log"
|
||||||
|
|
||||||
|
"gorm.io/gorm"
|
||||||
|
)
|
||||||
|
|
||||||
|
func Migrate(db *gorm.DB) {
|
||||||
|
if err := db.AutoMigrate(
|
||||||
|
new(model.Doc),
|
||||||
|
new(model.DocFolder),
|
||||||
|
); err != nil {
|
||||||
|
log.Fatal().Err(err).Msg("failed to migrate database")
|
||||||
|
}
|
||||||
|
}
|
10
internal/dal/model/base.go
Normal file
10
internal/dal/model/base.go
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
package model
|
||||||
|
|
||||||
|
import "time"
|
||||||
|
|
||||||
|
type Base struct {
|
||||||
|
OrgID string `gorm:"column:org_id;type:varchar;primaryKey;comment:组织ID"` // 组织ID
|
||||||
|
ID string `gorm:"column:id;type:varchar;primaryKey;comment:ID"` // ID
|
||||||
|
CreatedAt time.Time `gorm:"column:created_at;comment:创建时间"`
|
||||||
|
UpdatedAt time.Time `gorm:"column:updated_at;comment:更新时间"`
|
||||||
|
}
|
57
internal/dal/model/docs.go
Normal file
57
internal/dal/model/docs.go
Normal file
@ -0,0 +1,57 @@
|
|||||||
|
package model
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"net/url"
|
||||||
|
"octopus/internal/config"
|
||||||
|
"octopus/internal/dal"
|
||||||
|
"time"
|
||||||
|
|
||||||
|
"github.com/rs/xid"
|
||||||
|
"gorm.io/gorm"
|
||||||
|
)
|
||||||
|
|
||||||
|
const TableNameDocFolder = "doc_folders"
|
||||||
|
const TableNameDoc = "docs"
|
||||||
|
|
||||||
|
type DocFolder struct {
|
||||||
|
Base
|
||||||
|
Name string `gorm:"column:name;type:varchar;not null"` // 文件夹名称
|
||||||
|
IsDeletable bool `gorm:"column:is_deletable;type:boolean;not null;default:true"` // 是否允许被删除
|
||||||
|
IsEditable bool `gorm:"column:is_editable;type:boolean;not null;default:true"` // 是否允许被修改
|
||||||
|
Path string `gorm:"column:path;type:varchar;index:idx_path"` // 路径索引
|
||||||
|
CreatedBy string `gorm:"column:created_by;type:varchar;not null"` // 创建人
|
||||||
|
}
|
||||||
|
|
||||||
|
func (*DocFolder) TableName() string {
|
||||||
|
return TableNameDocFolder
|
||||||
|
}
|
||||||
|
func (df *DocFolder) BeforeCreate(*gorm.DB) error {
|
||||||
|
df.ID = xid.New().String()
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
type Doc struct {
|
||||||
|
Base
|
||||||
|
Name string `gorm:"column:name;type:varchar;not null"` // 文件夹名称
|
||||||
|
IsDeletable bool `gorm:"column:is_deletable;type:boolean;not null;default:true"` // 是否允许被删除
|
||||||
|
IsEditable bool `gorm:"column:is_editable;type:boolean;not null;default:true"` // 是否允许编辑名称
|
||||||
|
FolderID string `gorm:"column:folder_id;type:varchar;index:idx_folder_id"` // 文件夹ID
|
||||||
|
OSSObjectID string `gorm:"column:oss_object_id;type:varchar"` // OSS Object ID
|
||||||
|
CreatedBy string `gorm:"column:created_by;type:varchar;not null"` // 创建人
|
||||||
|
|
||||||
|
Folder *DocFolder `gorm:"foreignKey:FolderID;references:ID"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func (df *Doc) PresignedURL(ctx context.Context) (*url.URL, error) {
|
||||||
|
bucket := config.Get().GetOSSConfig().Bucket
|
||||||
|
return dal.GetMinio().PresignedGetObject(ctx, bucket, df.OSSObjectID, time.Hour, nil)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (*Doc) TableName() string {
|
||||||
|
return TableNameDocFolder
|
||||||
|
}
|
||||||
|
func (df *Doc) BeforeCreate(*gorm.DB) error {
|
||||||
|
df.ID = xid.New().String()
|
||||||
|
return nil
|
||||||
|
}
|
50
internal/dal/oss.go
Normal file
50
internal/dal/oss.go
Normal file
@ -0,0 +1,50 @@
|
|||||||
|
package dal
|
||||||
|
|
||||||
|
import (
|
||||||
|
"net/url"
|
||||||
|
"octopus/internal/config"
|
||||||
|
"sync"
|
||||||
|
|
||||||
|
"github.com/minio/minio-go/v7"
|
||||||
|
"github.com/minio/minio-go/v7/pkg/credentials"
|
||||||
|
"github.com/rs/zerolog/log"
|
||||||
|
// pb "github.com/qdrant/go-client/qdrant"
|
||||||
|
)
|
||||||
|
|
||||||
|
var (
|
||||||
|
ossOnce sync.Once
|
||||||
|
ossInstance *minio.Client
|
||||||
|
)
|
||||||
|
|
||||||
|
func GetMinio() *minio.Client {
|
||||||
|
ossOnce.Do(initMinio)
|
||||||
|
return ossInstance
|
||||||
|
}
|
||||||
|
|
||||||
|
func initMinio() {
|
||||||
|
log.Info().Msg("loading minio configs")
|
||||||
|
|
||||||
|
ossConfig, err := url.Parse(config.Get().Databases.OSS)
|
||||||
|
if err != nil {
|
||||||
|
log.Fatal().Err(err).Msg("parse oss config error")
|
||||||
|
}
|
||||||
|
accessSecret, _ := ossConfig.User.Password()
|
||||||
|
// defaultConfig := &model.StorageConfig{
|
||||||
|
// Schema: ossConfig.Scheme,
|
||||||
|
// Endpoint: ossConfig.Host,
|
||||||
|
// AccessID: ossConfig.User.Username(),
|
||||||
|
// AccessSecret: accessSecret,
|
||||||
|
// Bucket: ossConfig.Query().Get("bucket"),
|
||||||
|
// Region: ossConfig.Query().Get("region"),
|
||||||
|
// Secure: cast.ToBool(ossConfig.Query().Get("secure")),
|
||||||
|
// }
|
||||||
|
minioClient, err := minio.New(ossConfig.Host, &minio.Options{
|
||||||
|
Creds: credentials.NewStaticV4(ossConfig.User.Username(), accessSecret, ""),
|
||||||
|
Secure: false,
|
||||||
|
})
|
||||||
|
if err != nil {
|
||||||
|
log.Fatal().Msgf("minio client init error: %v", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
ossInstance = minioClient
|
||||||
|
}
|
75
internal/dal/postgres.go
Normal file
75
internal/dal/postgres.go
Normal file
@ -0,0 +1,75 @@
|
|||||||
|
package dal
|
||||||
|
|
||||||
|
import (
|
||||||
|
slog "log"
|
||||||
|
"os"
|
||||||
|
"sync"
|
||||||
|
"time"
|
||||||
|
|
||||||
|
"octopus/internal/config"
|
||||||
|
|
||||||
|
"github.com/rs/zerolog/log"
|
||||||
|
"gorm.io/driver/postgres"
|
||||||
|
"gorm.io/driver/sqlite"
|
||||||
|
"gorm.io/gorm"
|
||||||
|
"gorm.io/gorm/logger"
|
||||||
|
)
|
||||||
|
|
||||||
|
var (
|
||||||
|
sqlOnce sync.Once
|
||||||
|
sqlInstance *gorm.DB
|
||||||
|
)
|
||||||
|
|
||||||
|
func GetpostgresTest() *gorm.DB {
|
||||||
|
l := logger.Default
|
||||||
|
l = l.LogMode(logger.Info)
|
||||||
|
db, _ := gorm.Open(sqlite.Open("file::memory:?parseTime=True&loc=Local"), &gorm.Config{Logger: l})
|
||||||
|
return db
|
||||||
|
}
|
||||||
|
|
||||||
|
func GetPostgres() *gorm.DB {
|
||||||
|
sqlOnce.Do(initPostgres)
|
||||||
|
return sqlInstance
|
||||||
|
}
|
||||||
|
|
||||||
|
func initPostgres() {
|
||||||
|
log.Info().Msg("loading postgres configs")
|
||||||
|
dsn := config.Get().Databases.PostgreSQL
|
||||||
|
db, err := gorm.Open(
|
||||||
|
postgres.Open(dsn),
|
||||||
|
&gorm.Config{
|
||||||
|
DisableForeignKeyConstraintWhenMigrating: true,
|
||||||
|
Logger: logger.New(
|
||||||
|
slog.New(os.Stdout, "\r\n", slog.LstdFlags), logger.Config{
|
||||||
|
SlowThreshold: 200 * time.Millisecond,
|
||||||
|
LogLevel: logger.Info,
|
||||||
|
IgnoreRecordNotFoundError: false,
|
||||||
|
Colorful: true,
|
||||||
|
},
|
||||||
|
),
|
||||||
|
},
|
||||||
|
)
|
||||||
|
if err != nil {
|
||||||
|
log.Fatal().Str("dsn", dsn).Err(err).Msg("connected to postgres failed")
|
||||||
|
}
|
||||||
|
sqlDB, err := db.DB()
|
||||||
|
if err != nil {
|
||||||
|
log.Fatal().Str("dsn", dsn).Err(err).Msg("connected to postgres failed")
|
||||||
|
}
|
||||||
|
// SetMaxIdleConns sets the maximum number of connections in the idle connection pool.
|
||||||
|
sqlDB.SetMaxIdleConns(50)
|
||||||
|
|
||||||
|
// SetMaxOpenConns sets the maximum number of open connections to the database.
|
||||||
|
sqlDB.SetMaxOpenConns(50)
|
||||||
|
|
||||||
|
// SetConnMaxLifetime sets the maximum amount of time a connection may be reused.
|
||||||
|
sqlDB.SetConnMaxLifetime(time.Minute * 2)
|
||||||
|
if err != nil {
|
||||||
|
log.Fatal().Str("dsn", dsn).Err(err).Msg("connected to postgres failed")
|
||||||
|
}
|
||||||
|
if config.Get().Debug {
|
||||||
|
db = db.Debug()
|
||||||
|
}
|
||||||
|
sqlInstance = db
|
||||||
|
log.Info().Msg("connected to postgres")
|
||||||
|
}
|
23
internal/dal/repo/docs.go
Normal file
23
internal/dal/repo/docs.go
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
package repo
|
||||||
|
|
||||||
|
import (
|
||||||
|
"octopus/internal/dal/model"
|
||||||
|
|
||||||
|
"gorm.io/gorm"
|
||||||
|
)
|
||||||
|
|
||||||
|
type DocFolderRepo struct {
|
||||||
|
db *gorm.DB
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewDocFolderRepo(db *gorm.DB) *DocFolderRepo {
|
||||||
|
return &DocFolderRepo{db}
|
||||||
|
}
|
||||||
|
|
||||||
|
type DocFolderRepoInterface interface {
|
||||||
|
CreateFolder(folder *model.DocFolder) error
|
||||||
|
}
|
||||||
|
|
||||||
|
// func (r *DocFolderRepo) CreateFolder(folder *model.DocFolder) error {
|
||||||
|
// return r.db.Create(folder).Error
|
||||||
|
// }
|
23
internal/router/base.go
Normal file
23
internal/router/base.go
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
package router
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/casdoor/casdoor-go-sdk/casdoorsdk"
|
||||||
|
"github.com/gofiber/fiber/v2"
|
||||||
|
"github.com/rs/zerolog/log"
|
||||||
|
)
|
||||||
|
|
||||||
|
var userClaimsKey = struct{}{}
|
||||||
|
|
||||||
|
func JWTRequired(c *fiber.Ctx) error {
|
||||||
|
jwt := c.Get("Authorization")
|
||||||
|
if jwt == "" {
|
||||||
|
return c.Status(401).JSON(fiber.Map{"msg": "Unauthorized"})
|
||||||
|
}
|
||||||
|
claims, err := casdoorsdk.ParseJwtToken(jwt)
|
||||||
|
if err != nil {
|
||||||
|
log.Ctx(c.UserContext()).Error().Err(err).Msg("Unauthorized user")
|
||||||
|
return c.Status(401).JSON(fiber.Map{"msg": "Unauthorized"})
|
||||||
|
}
|
||||||
|
c.Locals(userClaimsKey, claims)
|
||||||
|
return nil
|
||||||
|
}
|
82
internal/router/debug.go
Normal file
82
internal/router/debug.go
Normal file
@ -0,0 +1,82 @@
|
|||||||
|
package router
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"fmt"
|
||||||
|
"octopus/statics"
|
||||||
|
"sort"
|
||||||
|
|
||||||
|
"github.com/gofiber/fiber/v2"
|
||||||
|
"github.com/gofiber/fiber/v2/middleware/basicauth"
|
||||||
|
"github.com/neo-f/soda"
|
||||||
|
)
|
||||||
|
|
||||||
|
func RegisterDebuggerRouter(app *soda.Soda) {
|
||||||
|
app.App.Get("/debugger", basicAuth, func(c *fiber.Ctx) error {
|
||||||
|
c.Set(fiber.HeaderContentType, fiber.MIMETextHTML)
|
||||||
|
return c.SendString(statics.DebuggerHTML)
|
||||||
|
})
|
||||||
|
app.App.Get("/debugger/functions", basicAuth, func(c *fiber.Ctx) error {
|
||||||
|
sort.Slice(debugFunctions, func(i, j int) bool {
|
||||||
|
return debugFunctions[i].Title < debugFunctions[j].Title
|
||||||
|
})
|
||||||
|
return c.JSON(debugFunctions)
|
||||||
|
})
|
||||||
|
app.App.Post("/debugger/execute", basicAuth, func(c *fiber.Ctx) error {
|
||||||
|
var params struct {
|
||||||
|
Func string `json:"func"`
|
||||||
|
Params map[string]string `json:"params"`
|
||||||
|
}
|
||||||
|
if err := c.BodyParser(¶ms); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
var fn *DebugFunction
|
||||||
|
for _, f := range debugFunctions {
|
||||||
|
if f.Name == params.Func {
|
||||||
|
fn = &f
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if fn == nil {
|
||||||
|
return fmt.Errorf("function not found")
|
||||||
|
}
|
||||||
|
resp, err := fn.Do(c.UserContext(), params.Params)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
return c.JSON(resp)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
var basicAuth = basicauth.New(basicauth.Config{
|
||||||
|
Users: map[string]string{"neo": "whosyourdaddy"},
|
||||||
|
})
|
||||||
|
|
||||||
|
type DebugFunctionParameter struct {
|
||||||
|
Name string `json:"name"`
|
||||||
|
Description string `json:"description"`
|
||||||
|
Required bool `json:"required"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type DebugFunction struct {
|
||||||
|
Name string `json:"name"`
|
||||||
|
Title string `json:"title"`
|
||||||
|
Description string `json:"description"`
|
||||||
|
Parameters []DebugFunctionParameter `json:"parameters"`
|
||||||
|
Do func(context.Context, map[string]string) (interface{}, error) `json:"-"`
|
||||||
|
}
|
||||||
|
|
||||||
|
var debugFunctions = []DebugFunction{
|
||||||
|
{
|
||||||
|
Name: "echo",
|
||||||
|
Title: "demo debugger",
|
||||||
|
Description: "echo the parameters",
|
||||||
|
Parameters: []DebugFunctionParameter{
|
||||||
|
{Name: "param-a", Description: "param-a", Required: true},
|
||||||
|
{Name: "param-b", Description: "param-b", Required: true},
|
||||||
|
},
|
||||||
|
Do: func(ctx context.Context, params map[string]string) (interface{}, error) {
|
||||||
|
return params, nil
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
81
internal/router/doc.go
Normal file
81
internal/router/doc.go
Normal file
@ -0,0 +1,81 @@
|
|||||||
|
package router
|
||||||
|
|
||||||
|
import (
|
||||||
|
"octopus/internal/schema"
|
||||||
|
|
||||||
|
"github.com/neo-f/soda"
|
||||||
|
)
|
||||||
|
|
||||||
|
func RegisterDocRouter(app *soda.Soda) {
|
||||||
|
app.Get("/docs", nil).
|
||||||
|
AddTags("文档管理").
|
||||||
|
SetSummary("获取文档列表").
|
||||||
|
AddJWTSecurity(JWTRequired).
|
||||||
|
SetParameters(schema.ListDocQuery{}).
|
||||||
|
AddJSONResponse(200, schema.DocList{}).OK()
|
||||||
|
|
||||||
|
app.Post("/docs", nil).
|
||||||
|
AddTags("文档管理").
|
||||||
|
SetSummary("新建文档").
|
||||||
|
AddJWTSecurity(JWTRequired).
|
||||||
|
SetJSONRequestBody(schema.CreateDoc{}).
|
||||||
|
AddJSONResponse(200, schema.Doc{}).OK()
|
||||||
|
|
||||||
|
app.Put("/docs/:id", nil).
|
||||||
|
AddTags("文档管理").
|
||||||
|
SetSummary("更新文档").
|
||||||
|
AddJWTSecurity(JWTRequired).
|
||||||
|
SetParameters(schema.DocID{}).
|
||||||
|
SetJSONRequestBody(schema.ListDocQuery{}).
|
||||||
|
AddJSONResponse(200, schema.Doc{}).OK()
|
||||||
|
|
||||||
|
app.Delete("/docs/:id", nil).
|
||||||
|
AddTags("文档管理").
|
||||||
|
SetSummary("获取文档列表").
|
||||||
|
AddJWTSecurity(JWTRequired).
|
||||||
|
SetParameters(schema.DocID{}).
|
||||||
|
AddJSONResponse(200, nil).OK()
|
||||||
|
|
||||||
|
app.Post("/docs/batch/delete", nil).
|
||||||
|
AddTags("文档管理").
|
||||||
|
SetSummary("批量-文件删除").
|
||||||
|
AddJWTSecurity(JWTRequired).
|
||||||
|
SetJSONRequestBody(schema.DocsBatchDelete{}).
|
||||||
|
AddJSONResponse(200, schema.DocsBatchResults{}).OK()
|
||||||
|
|
||||||
|
app.Post("/docs/batch/update", nil).
|
||||||
|
AddTags("文档管理").
|
||||||
|
SetSummary("批量-文件删除").
|
||||||
|
AddJWTSecurity(JWTRequired).
|
||||||
|
SetJSONRequestBody(schema.DocsBatchUpdate{}).
|
||||||
|
AddJSONResponse(200, schema.DocsBatchResults{}).OK()
|
||||||
|
|
||||||
|
app.Get("/doc-folders", nil).
|
||||||
|
AddTags("文档管理").
|
||||||
|
SetSummary("获取文件夹树").
|
||||||
|
AddJWTSecurity(JWTRequired).
|
||||||
|
SetParameters(schema.GetDocFolderTree{}).
|
||||||
|
AddJSONResponse(200, schema.DocFolderWithChildren{}).OK()
|
||||||
|
|
||||||
|
app.Post("/doc-folders", nil).
|
||||||
|
AddTags("文档管理").
|
||||||
|
SetSummary("新建文件夹").
|
||||||
|
AddJWTSecurity(JWTRequired).
|
||||||
|
SetJSONRequestBody(schema.CreateDocFolder{}).
|
||||||
|
AddJSONResponse(200, schema.DocFolder{}).OK()
|
||||||
|
|
||||||
|
app.Put("/doc-folders/:id", nil).
|
||||||
|
AddTags("文档管理").
|
||||||
|
SetSummary("更新文件夹").
|
||||||
|
AddJWTSecurity(JWTRequired).
|
||||||
|
SetParameters(schema.DocFolderID{}).
|
||||||
|
SetJSONRequestBody(schema.UpdateDocFolder{}).
|
||||||
|
AddJSONResponse(200, schema.DocFolder{}).OK()
|
||||||
|
|
||||||
|
app.Delete("/doc-folders/:id", nil).
|
||||||
|
AddTags("文档管理").
|
||||||
|
SetSummary("删除文件夹").
|
||||||
|
AddJWTSecurity(JWTRequired).
|
||||||
|
SetParameters(schema.DocFolderID{}).
|
||||||
|
AddJSONResponse(200, nil).OK()
|
||||||
|
}
|
106
internal/schema/base.go
Normal file
106
internal/schema/base.go
Normal file
@ -0,0 +1,106 @@
|
|||||||
|
package schema
|
||||||
|
|
||||||
|
const (
|
||||||
|
maxPageSize = 1000
|
||||||
|
defaultPageSize = 10
|
||||||
|
)
|
||||||
|
|
||||||
|
type PageableQuery struct {
|
||||||
|
Size *int `query:"size" oai:"description=返回数据数量;default=10;maximum=1000"`
|
||||||
|
Offset *int `query:"offset" oai:"description=数据偏移量;default=0"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *PageableQuery) GetLimit() int {
|
||||||
|
if p.Size == nil {
|
||||||
|
return defaultPageSize
|
||||||
|
}
|
||||||
|
if *p.Size >= maxPageSize {
|
||||||
|
return maxPageSize
|
||||||
|
}
|
||||||
|
return *p.Size
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *PageableQuery) GetOffset() int {
|
||||||
|
if p.Offset == nil {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
return *p.Offset
|
||||||
|
}
|
||||||
|
|
||||||
|
type SortField struct {
|
||||||
|
Field string
|
||||||
|
Asc bool
|
||||||
|
}
|
||||||
|
type SortableQuery struct {
|
||||||
|
SortBy *[]string `query:"sort_by" oai:"description=排序字段, 如: +id,-created_at,test 表示依次按照id正序,created_at倒序,test正序"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func (s *SortableQuery) GetOrderField() []SortField {
|
||||||
|
if s.SortBy == nil {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
fields := make([]SortField, 0, len(*s.SortBy))
|
||||||
|
for _, v := range *s.SortBy {
|
||||||
|
if v == "" {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
switch v[0] {
|
||||||
|
case '+':
|
||||||
|
fields = append(fields, SortField{Field: v[1:], Asc: true})
|
||||||
|
case '-':
|
||||||
|
fields = append(fields, SortField{Field: v[1:], Asc: false})
|
||||||
|
default:
|
||||||
|
fields = append(fields, SortField{Field: v, Asc: true})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return fields
|
||||||
|
}
|
||||||
|
|
||||||
|
type SortableBody struct {
|
||||||
|
SortBy *[]string `json:"sort_by" oai:"description=排序字段, 如: id desc/asc"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func (s *SortableBody) GetOrderField() []SortField {
|
||||||
|
if s.SortBy == nil {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
fields := make([]SortField, 0, len(*s.SortBy))
|
||||||
|
for _, v := range *s.SortBy {
|
||||||
|
if v == "" {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
switch v[0] {
|
||||||
|
case '+':
|
||||||
|
fields = append(fields, SortField{Field: v[1:], Asc: true})
|
||||||
|
case '-':
|
||||||
|
fields = append(fields, SortField{Field: v[1:], Asc: false})
|
||||||
|
default:
|
||||||
|
fields = append(fields, SortField{Field: v, Asc: true})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return fields
|
||||||
|
}
|
||||||
|
|
||||||
|
type PageableBody struct {
|
||||||
|
Size *int `json:"size" oai:"description=返回数据数量;default=10;maximum=1000"`
|
||||||
|
Offset *int `json:"offset" oai:"description=数据偏移量;default=0"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *PageableBody) GetLimit() int {
|
||||||
|
if p.Size == nil {
|
||||||
|
return defaultPageSize
|
||||||
|
}
|
||||||
|
if *p.Size >= maxPageSize {
|
||||||
|
return maxPageSize
|
||||||
|
}
|
||||||
|
return *p.Size
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *PageableBody) GetOffset() int {
|
||||||
|
if p.Offset == nil {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
return *p.Offset
|
||||||
|
}
|
106
internal/schema/docs.go
Normal file
106
internal/schema/docs.go
Normal file
@ -0,0 +1,106 @@
|
|||||||
|
package schema
|
||||||
|
|
||||||
|
import (
|
||||||
|
"octopus/pkg/tools"
|
||||||
|
"time"
|
||||||
|
|
||||||
|
"github.com/gofiber/fiber/v2"
|
||||||
|
)
|
||||||
|
|
||||||
|
type DocFolder struct {
|
||||||
|
ID string `json:"id" oai:"description=文件夹ID"`
|
||||||
|
IsDeletable bool `json:"is_deletable" oai:"description=文件夹是否允许被删除"`
|
||||||
|
IsEditable bool `json:"is_editable" oai:"description=文件夹是否允许被修改"`
|
||||||
|
CreatedAt time.Time `json:"created_at" oai:"description=创建时间"`
|
||||||
|
UpdatedAt time.Time `json:"updated_at" oai:"description=更新时间"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type DocFolderID struct {
|
||||||
|
ID string `path:"id" oai:"description=文件夹ID"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type CreateDocFolder struct {
|
||||||
|
Name string `json:"name" validate:"required" oai:"description=文件夹名称"`
|
||||||
|
ParentID string `json:"parent_id" oai:"description=父文件夹ID,空表示在根路径创建"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type UpdateDocFolder struct {
|
||||||
|
Name *string `json:"name" oai:"description=修改文件夹名称"`
|
||||||
|
ParentID *string `json:"parent_id" oai:"description=修改文件夹父级ID"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type GetDocFolderTree struct {
|
||||||
|
ParentID *string `query:"parent_id" oai:"description=父文件夹ID,空表示获取根路径"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type DocFolderWithChildren struct {
|
||||||
|
ID string `json:"id" oai:"description=文件夹ID,**根文件夹无ID**"`
|
||||||
|
IsDeletable bool `json:"is_deletable" oai:"description=文件夹是否允许被删除"`
|
||||||
|
IsEditable bool `json:"is_editable" oai:"description=文件夹是否允许被修改"`
|
||||||
|
CreatedAt time.Time `json:"created_at" oai:"description=创建时间"`
|
||||||
|
UpdatedAt time.Time `json:"updated_at" oai:"description=更新时间"`
|
||||||
|
Children []*DocFolderWithChildren `json:"children" oai:"description=子文件夹"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type Doc struct {
|
||||||
|
ID string `json:"id" oai:"description=文档ID"`
|
||||||
|
Folder DocFolder `json:"folder" oai:"description=归属文件夹信息"`
|
||||||
|
PresignedURL string `json:"presigned_url" oai:"description=文档预签名下载URL(临时下载URL)"`
|
||||||
|
IsDeletable bool `json:"is_deletable" oai:"description=文件夹是否允许被删除"`
|
||||||
|
IsEditable bool `json:"is_editable" oai:"description=文件夹是否允许被修改"`
|
||||||
|
UploadedAt time.Time `json:"uploaded_at" oai:"description=上传时间"`
|
||||||
|
CreatedAt time.Time `json:"created_at" oai:"description=创建时间"`
|
||||||
|
UpdatedAt time.Time `json:"updated_at" oai:"description=更新时间"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type DocList struct {
|
||||||
|
Items []*Doc `json:"items" oai:"description=文档列表"`
|
||||||
|
Total int64 `json:"total" oai:"description=文档总数"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type DocID struct {
|
||||||
|
ID string `path:"id" oai:"description=文档ID"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type CreateDoc struct {
|
||||||
|
Name string `json:"name" validate:"required" oai:"description=文档名称"`
|
||||||
|
FolderID string `json:"folder_id" validate:"required" oai:"description=归属文件夹ID"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type UpdateDoc struct {
|
||||||
|
Name *string `json:"name" oai:"description=更新文档名称"`
|
||||||
|
FolderID *string `json:"folder_id" oai:"description=更新归属文件夹ID"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type ListDocQuery struct {
|
||||||
|
PageableQuery
|
||||||
|
SortableQuery
|
||||||
|
FolderIDs *[]string `query:"folder_ids" validate:"required" oai:"description=归属文件夹ID"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type DocsBatchDelete struct {
|
||||||
|
IDs []string `query:"ids" validate:"required" oai:"description=批量选择文件ID列表"`
|
||||||
|
FolderID string ` validate:"required" oai:"description=更新归属文件夹ID" json:"folder_id"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type DocsBatchUpdate struct {
|
||||||
|
IDs []string `query:"ids" validate:"required" oai:"description=批量选择文件ID列表"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type DocActionResult struct {
|
||||||
|
ID string `json:"id" oai:"description=文档ID"`
|
||||||
|
Success bool `json:"success" oai:"description=操作是否成功"`
|
||||||
|
Message *string `json:"message,omitempty" oai:"description=操作失败信息"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type DocsBatchResults []DocActionResult
|
||||||
|
|
||||||
|
func (q *ListDocQuery) Validate() error {
|
||||||
|
sortable := tools.NewSet("uploaded_at")
|
||||||
|
for _, s := range q.GetOrderField() {
|
||||||
|
if !sortable.Has(s.Field) {
|
||||||
|
return fiber.NewError(fiber.StatusBadRequest, "unsupported order field")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
48
pkg/logger/kylin.go
Normal file
48
pkg/logger/kylin.go
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
package logger
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"strings"
|
||||||
|
"time"
|
||||||
|
|
||||||
|
"octopus/internal/config"
|
||||||
|
|
||||||
|
"github.com/gofiber/fiber/v2"
|
||||||
|
"github.com/rs/zerolog"
|
||||||
|
"github.com/rs/zerolog/log"
|
||||||
|
)
|
||||||
|
|
||||||
|
var (
|
||||||
|
CtxDebug = struct{}{}
|
||||||
|
CtxTimezone = struct{}{}
|
||||||
|
)
|
||||||
|
|
||||||
|
func NewKylinMiddleware() fiber.Handler {
|
||||||
|
return func(c *fiber.Ctx) error {
|
||||||
|
ctxLogger := log.With().Interface(config.LogTagTraceID, c.Locals("trace_id"))
|
||||||
|
|
||||||
|
if authorization := c.Get(fiber.HeaderAuthorization); authorization != "" {
|
||||||
|
ctxLogger.Str(config.LogTagAuthorization, authorization)
|
||||||
|
}
|
||||||
|
if bid := c.Get("Rcrai-Bid"); bid != "" {
|
||||||
|
ctxLogger.Str(config.LogTagBID, bid)
|
||||||
|
}
|
||||||
|
if staffID := c.Get("Rcrai-StaffId"); staffID != "" {
|
||||||
|
ctxLogger.Str(config.LogTagStaffID, staffID)
|
||||||
|
}
|
||||||
|
ctx := c.UserContext()
|
||||||
|
logger := ctxLogger.Logger()
|
||||||
|
logger = logger.Level(zerolog.InfoLevel)
|
||||||
|
if lv := c.Get("Debug_Kylin"); strings.ToLower(lv) == "true" {
|
||||||
|
ctx = context.WithValue(ctx, CtxDebug, struct{}{})
|
||||||
|
logger = logger.Level(zerolog.DebugLevel)
|
||||||
|
}
|
||||||
|
if tz := c.Get("R-Timezone"); tz != "" {
|
||||||
|
if loc, err := time.LoadLocation(tz); err == nil {
|
||||||
|
ctx = context.WithValue(ctx, CtxTimezone, loc)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
c.SetUserContext(logger.WithContext(ctx))
|
||||||
|
return c.Next()
|
||||||
|
}
|
||||||
|
}
|
269
pkg/logger/sentry_writer.go
Normal file
269
pkg/logger/sentry_writer.go
Normal file
@ -0,0 +1,269 @@
|
|||||||
|
package logger
|
||||||
|
|
||||||
|
import (
|
||||||
|
"io"
|
||||||
|
"time"
|
||||||
|
|
||||||
|
"octopus/internal/config"
|
||||||
|
|
||||||
|
// "github.com/buger/jsonparser"
|
||||||
|
"github.com/getsentry/sentry-go"
|
||||||
|
"github.com/rs/zerolog"
|
||||||
|
"github.com/tidwall/gjson"
|
||||||
|
)
|
||||||
|
|
||||||
|
var levelsMapping = map[zerolog.Level]sentry.Level{
|
||||||
|
zerolog.DebugLevel: sentry.LevelDebug,
|
||||||
|
zerolog.InfoLevel: sentry.LevelInfo,
|
||||||
|
zerolog.WarnLevel: sentry.LevelWarning,
|
||||||
|
zerolog.ErrorLevel: sentry.LevelError,
|
||||||
|
zerolog.FatalLevel: sentry.LevelFatal,
|
||||||
|
zerolog.PanicLevel: sentry.LevelFatal,
|
||||||
|
}
|
||||||
|
|
||||||
|
var _ = io.WriteCloser(new(SentryWriter))
|
||||||
|
|
||||||
|
var now = time.Now
|
||||||
|
|
||||||
|
// SentryWriter is a sentry events writer with std io.SentryWriter iface.
|
||||||
|
type SentryWriter struct {
|
||||||
|
client *sentry.Client
|
||||||
|
|
||||||
|
levels map[zerolog.Level]struct{}
|
||||||
|
flushTimeout time.Duration
|
||||||
|
}
|
||||||
|
|
||||||
|
// Write handles zerolog's json and sends events to sentry.
|
||||||
|
func (w *SentryWriter) Write(data []byte) (int, error) {
|
||||||
|
event, ok := w.parseLogEvent(data)
|
||||||
|
if ok {
|
||||||
|
w.client.CaptureEvent(event, nil, nil)
|
||||||
|
// should flush before os.Exit
|
||||||
|
if event.Level == sentry.LevelFatal {
|
||||||
|
w.client.Flush(w.flushTimeout)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return len(data), nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// Close forces client to flush all pending events.
|
||||||
|
// Can be useful before application exits.
|
||||||
|
func (w *SentryWriter) Close() error {
|
||||||
|
w.client.Flush(w.flushTimeout)
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (w *SentryWriter) parseLogEvent(data []byte) (*sentry.Event, bool) {
|
||||||
|
const logger = "zerolog"
|
||||||
|
lvlStr := gjson.GetBytes(data, zerolog.LevelFieldName)
|
||||||
|
lvl, err := zerolog.ParseLevel(lvlStr.String())
|
||||||
|
if err != nil {
|
||||||
|
return nil, false
|
||||||
|
}
|
||||||
|
|
||||||
|
_, enabled := w.levels[lvl]
|
||||||
|
if !enabled {
|
||||||
|
return nil, false
|
||||||
|
}
|
||||||
|
|
||||||
|
sentryLvl, ok := levelsMapping[lvl]
|
||||||
|
if !ok {
|
||||||
|
return nil, false
|
||||||
|
}
|
||||||
|
|
||||||
|
event := sentry.Event{
|
||||||
|
Timestamp: now(),
|
||||||
|
Level: sentryLvl,
|
||||||
|
Logger: logger,
|
||||||
|
Tags: make(map[string]string, 6),
|
||||||
|
Request: &sentry.Request{},
|
||||||
|
}
|
||||||
|
|
||||||
|
gjson.ParseBytes(data).ForEach(func(key, value gjson.Result) bool {
|
||||||
|
switch key.String() {
|
||||||
|
// case zerolog.LevelFieldName, zerolog.TimestampFieldName:
|
||||||
|
case zerolog.MessageFieldName:
|
||||||
|
event.Message = value.String()
|
||||||
|
case zerolog.ErrorFieldName:
|
||||||
|
event.Exception = append(event.Exception, sentry.Exception{
|
||||||
|
Value: value.String(),
|
||||||
|
Stacktrace: newStacktrace(),
|
||||||
|
})
|
||||||
|
case config.LogTagURL:
|
||||||
|
event.Request.URL = value.String()
|
||||||
|
case config.LogTagMethod:
|
||||||
|
event.Request.Method = value.String()
|
||||||
|
case config.LogTagHeaders:
|
||||||
|
headers := make(map[string]string)
|
||||||
|
value.ForEach(func(key, value gjson.Result) bool {
|
||||||
|
headers[key.String()] = value.String()
|
||||||
|
return true
|
||||||
|
})
|
||||||
|
event.Request.Headers = headers
|
||||||
|
case config.LogTagData:
|
||||||
|
event.Request.Data = value.String()
|
||||||
|
case config.LogTagAuthorization:
|
||||||
|
event.Tags["Authorization"] = value.String()
|
||||||
|
case config.LogTagBID:
|
||||||
|
event.Tags["bid"] = value.String()
|
||||||
|
case config.LogTagStaffID:
|
||||||
|
event.Tags["staff_id"] = value.String()
|
||||||
|
case config.LogTagTraceID:
|
||||||
|
event.Tags["trace_id"] = value.String()
|
||||||
|
default:
|
||||||
|
event.Tags[key.String()] = value.String()
|
||||||
|
}
|
||||||
|
return true
|
||||||
|
})
|
||||||
|
|
||||||
|
return &event, true
|
||||||
|
}
|
||||||
|
|
||||||
|
func newStacktrace() *sentry.Stacktrace {
|
||||||
|
const (
|
||||||
|
module = "github.com/archdx/zerolog-sentry"
|
||||||
|
loggerModule = "github.com/rs/zerolog"
|
||||||
|
)
|
||||||
|
|
||||||
|
st := sentry.NewStacktrace()
|
||||||
|
|
||||||
|
threshold := len(st.Frames) - 1
|
||||||
|
// drop current module frames
|
||||||
|
for ; threshold > 0 && st.Frames[threshold].Module == module; threshold-- {
|
||||||
|
}
|
||||||
|
|
||||||
|
outer:
|
||||||
|
// try to drop zerolog module frames after logger call point
|
||||||
|
for i := threshold; i > 0; i-- {
|
||||||
|
if st.Frames[i].Module == loggerModule {
|
||||||
|
for j := i - 1; j >= 0; j-- {
|
||||||
|
if st.Frames[j].Module != loggerModule {
|
||||||
|
threshold = j
|
||||||
|
break outer
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
st.Frames = st.Frames[:threshold+1]
|
||||||
|
|
||||||
|
return st
|
||||||
|
}
|
||||||
|
|
||||||
|
// WriterOption configures sentry events writer.
|
||||||
|
type WriterOption interface {
|
||||||
|
apply(*options)
|
||||||
|
}
|
||||||
|
|
||||||
|
type optionFunc func(*options)
|
||||||
|
|
||||||
|
func (fn optionFunc) apply(c *options) { fn(c) }
|
||||||
|
|
||||||
|
type options struct {
|
||||||
|
release string
|
||||||
|
environment string
|
||||||
|
serverName string
|
||||||
|
levels []zerolog.Level
|
||||||
|
ignoreErrors []string
|
||||||
|
sampleRate float64
|
||||||
|
flushTimeout time.Duration
|
||||||
|
debug bool
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithLevels configures zerolog levels that have to be sent to Sentry.
|
||||||
|
// Default levels are: error, fatal, panic.
|
||||||
|
func WithLevels(levels ...zerolog.Level) WriterOption {
|
||||||
|
return optionFunc(func(cfg *options) {
|
||||||
|
cfg.levels = levels
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithSampleRate configures the sample rate as a percentage of events to be sent in the range of 0.0 to 1.0.
|
||||||
|
func WithSampleRate(rate float64) WriterOption {
|
||||||
|
return optionFunc(func(cfg *options) {
|
||||||
|
cfg.sampleRate = rate
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithRelease configures the release to be sent with events.
|
||||||
|
func WithRelease(release string) WriterOption {
|
||||||
|
return optionFunc(func(cfg *options) {
|
||||||
|
cfg.release = release
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithEnvironment configures the environment to be sent with events.
|
||||||
|
func WithEnvironment(environment string) WriterOption {
|
||||||
|
return optionFunc(func(cfg *options) {
|
||||||
|
cfg.environment = environment
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithServerName configures the server name field for events. Default value is OS hostname.
|
||||||
|
func WithServerName(serverName string) WriterOption {
|
||||||
|
return optionFunc(func(cfg *options) {
|
||||||
|
cfg.serverName = serverName
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithIgnoreErrors configures the list of regexp strings that will be used to match against event's message
|
||||||
|
// and if applicable, caught errors type and value. If the match is found, then a whole event will be dropped.
|
||||||
|
func WithIgnoreErrors(reList []string) WriterOption {
|
||||||
|
return optionFunc(func(cfg *options) {
|
||||||
|
cfg.ignoreErrors = reList
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithDebug enables sentry client debug logs.
|
||||||
|
func WithDebug(debug bool) WriterOption {
|
||||||
|
return optionFunc(func(cfg *options) {
|
||||||
|
cfg.debug = debug
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewSentryWriter creates writer with provided DSN and options.
|
||||||
|
func NewSentryWriter(dsn string, opts ...WriterOption) (*SentryWriter, error) {
|
||||||
|
cfg := newDefaultConfig()
|
||||||
|
for _, opt := range opts {
|
||||||
|
opt.apply(&cfg)
|
||||||
|
}
|
||||||
|
|
||||||
|
client, err := sentry.NewClient(sentry.ClientOptions{
|
||||||
|
Dsn: dsn,
|
||||||
|
SampleRate: cfg.sampleRate,
|
||||||
|
Release: cfg.release,
|
||||||
|
Environment: cfg.environment,
|
||||||
|
ServerName: cfg.serverName,
|
||||||
|
IgnoreErrors: cfg.ignoreErrors,
|
||||||
|
Debug: cfg.debug,
|
||||||
|
})
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
levels := make(map[zerolog.Level]struct{}, len(cfg.levels))
|
||||||
|
for _, lvl := range cfg.levels {
|
||||||
|
levels[lvl] = struct{}{}
|
||||||
|
}
|
||||||
|
|
||||||
|
return &SentryWriter{
|
||||||
|
client: client,
|
||||||
|
levels: levels,
|
||||||
|
flushTimeout: cfg.flushTimeout,
|
||||||
|
}, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func newDefaultConfig() options {
|
||||||
|
return options{
|
||||||
|
levels: []zerolog.Level{
|
||||||
|
zerolog.ErrorLevel,
|
||||||
|
zerolog.FatalLevel,
|
||||||
|
zerolog.PanicLevel,
|
||||||
|
},
|
||||||
|
sampleRate: 1.0,
|
||||||
|
flushTimeout: 3 * time.Second,
|
||||||
|
}
|
||||||
|
}
|
38
pkg/logger/setup.go
Normal file
38
pkg/logger/setup.go
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
package logger
|
||||||
|
|
||||||
|
import (
|
||||||
|
"io"
|
||||||
|
"os"
|
||||||
|
|
||||||
|
"octopus"
|
||||||
|
"octopus/internal/config"
|
||||||
|
|
||||||
|
"github.com/rs/zerolog"
|
||||||
|
"github.com/rs/zerolog/log"
|
||||||
|
"github.com/rs/zerolog/pkgerrors"
|
||||||
|
)
|
||||||
|
|
||||||
|
func Setup() {
|
||||||
|
cfg := config.Get()
|
||||||
|
zerolog.ErrorStackMarshaler = pkgerrors.MarshalStack
|
||||||
|
|
||||||
|
writers := []io.Writer{}
|
||||||
|
if config.Get().IsLocal {
|
||||||
|
writers = append(writers, zerolog.NewConsoleWriter())
|
||||||
|
} else {
|
||||||
|
writers = append(writers, os.Stderr)
|
||||||
|
}
|
||||||
|
if dsn := cfg.Sentry.DSN; dsn != "" {
|
||||||
|
sentryWriter, err := NewSentryWriter(
|
||||||
|
cfg.Sentry.DSN,
|
||||||
|
WithDebug(cfg.Debug),
|
||||||
|
WithEnvironment(cfg.Sentry.Environment),
|
||||||
|
WithRelease(octopus.Version),
|
||||||
|
WithServerName("octopus-service"),
|
||||||
|
)
|
||||||
|
if err == nil {
|
||||||
|
writers = append(writers, sentryWriter)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
log.Logger = zerolog.New(io.MultiWriter(writers...)).With().Stack().Timestamp().Logger()
|
||||||
|
}
|
29
pkg/middlewares/metrics/config.go
Normal file
29
pkg/middlewares/metrics/config.go
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
package metrics
|
||||||
|
|
||||||
|
import "github.com/gofiber/fiber/v2"
|
||||||
|
|
||||||
|
// Config defines the config for middleware.
|
||||||
|
type Config struct {
|
||||||
|
// Next defines a function to skip this middleware when returned true.
|
||||||
|
//
|
||||||
|
// Optional. Default: nil
|
||||||
|
Next func(c *fiber.Ctx) bool
|
||||||
|
}
|
||||||
|
|
||||||
|
// ConfigDefault is the default config
|
||||||
|
var ConfigDefault = Config{
|
||||||
|
Next: nil,
|
||||||
|
}
|
||||||
|
|
||||||
|
// Helper function to set default values
|
||||||
|
func configDefault(config ...Config) Config {
|
||||||
|
// Return default config if nothing provided
|
||||||
|
if len(config) < 1 {
|
||||||
|
return ConfigDefault
|
||||||
|
}
|
||||||
|
|
||||||
|
// Override default config
|
||||||
|
cfg := config[0]
|
||||||
|
|
||||||
|
return cfg
|
||||||
|
}
|
135
pkg/middlewares/metrics/middleware.go
Normal file
135
pkg/middlewares/metrics/middleware.go
Normal file
@ -0,0 +1,135 @@
|
|||||||
|
package metrics
|
||||||
|
|
||||||
|
import (
|
||||||
|
"strconv"
|
||||||
|
"time"
|
||||||
|
|
||||||
|
"github.com/gofiber/fiber/v2"
|
||||||
|
"github.com/prometheus/client_golang/prometheus"
|
||||||
|
"github.com/prometheus/client_golang/prometheus/promauto"
|
||||||
|
)
|
||||||
|
|
||||||
|
const serviceName = "cp-service"
|
||||||
|
|
||||||
|
var (
|
||||||
|
labels = prometheus.Labels{"service": serviceName}
|
||||||
|
|
||||||
|
KafkaConsumeSuccessCounter = promauto.NewCounterVec(
|
||||||
|
prometheus.CounterOpts{
|
||||||
|
Name: prometheus.BuildFQName("cp", "kafka", "consume_success"),
|
||||||
|
Help: "记录kafka消息消费成功的次数",
|
||||||
|
ConstLabels: labels,
|
||||||
|
}, []string{"topic", "bid"},
|
||||||
|
)
|
||||||
|
KafkaConsumeErrorCounter = promauto.NewCounterVec(
|
||||||
|
prometheus.CounterOpts{
|
||||||
|
Name: prometheus.BuildFQName("cp", "kafka", "consume_error"),
|
||||||
|
Help: "记录kafka消息消费失败的次数",
|
||||||
|
ConstLabels: labels,
|
||||||
|
}, []string{"topic", "bid"},
|
||||||
|
)
|
||||||
|
KafkaConsumeProcessingCounter = promauto.NewGaugeVec(prometheus.GaugeOpts{
|
||||||
|
Name: prometheus.BuildFQName("cp", "kafka", "consume_processing"),
|
||||||
|
Help: "当前正在处理的kafka消息个数",
|
||||||
|
ConstLabels: labels,
|
||||||
|
}, []string{"topic", "bid"},
|
||||||
|
)
|
||||||
|
|
||||||
|
requestInProgressTotal = promauto.NewGaugeVec(prometheus.GaugeOpts{
|
||||||
|
Name: prometheus.BuildFQName("cp", "http", "requests_in_progress_total"),
|
||||||
|
Help: "All the requests in progress",
|
||||||
|
ConstLabels: labels,
|
||||||
|
}, []string{"method"})
|
||||||
|
|
||||||
|
requestsTotal = promauto.NewCounterVec(prometheus.CounterOpts{
|
||||||
|
Name: prometheus.BuildFQName("cp", "http", "requests_total"),
|
||||||
|
Help: "Count all http requests by status code, method and path.",
|
||||||
|
ConstLabels: labels,
|
||||||
|
},
|
||||||
|
[]string{"status_code", "method", "path"},
|
||||||
|
)
|
||||||
|
requestDuration = promauto.NewHistogramVec(prometheus.HistogramOpts{
|
||||||
|
Name: prometheus.BuildFQName("cp", "http", "request_duration_seconds"),
|
||||||
|
Help: "Duration of all HTTP requests by status code, method and path.",
|
||||||
|
ConstLabels: labels,
|
||||||
|
Buckets: []float64{
|
||||||
|
0.000000001, // 1ns
|
||||||
|
0.000000002,
|
||||||
|
0.000000005,
|
||||||
|
0.00000001, // 10ns
|
||||||
|
0.00000002,
|
||||||
|
0.00000005,
|
||||||
|
0.0000001, // 100ns
|
||||||
|
0.0000002,
|
||||||
|
0.0000005,
|
||||||
|
0.000001, // 1µs
|
||||||
|
0.000002,
|
||||||
|
0.000005,
|
||||||
|
0.00001, // 10µs
|
||||||
|
0.00002,
|
||||||
|
0.00005,
|
||||||
|
0.0001, // 100µs
|
||||||
|
0.0002,
|
||||||
|
0.0005,
|
||||||
|
0.001, // 1ms
|
||||||
|
0.002,
|
||||||
|
0.005,
|
||||||
|
0.01, // 10ms
|
||||||
|
0.02,
|
||||||
|
0.05,
|
||||||
|
0.1, // 100 ms
|
||||||
|
0.2,
|
||||||
|
0.5,
|
||||||
|
1.0, // 1s
|
||||||
|
2.0,
|
||||||
|
5.0,
|
||||||
|
10.0, // 10s
|
||||||
|
15.0,
|
||||||
|
20.0,
|
||||||
|
30.0,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
[]string{"status_code", "method", "path"},
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
func NewMiddleware(cfgs ...Config) fiber.Handler {
|
||||||
|
cfg := configDefault(cfgs...)
|
||||||
|
return func(ctx *fiber.Ctx) error {
|
||||||
|
if cfg.Next != nil && cfg.Next(ctx) {
|
||||||
|
return ctx.Next()
|
||||||
|
}
|
||||||
|
start := time.Now()
|
||||||
|
method := ctx.Route().Method
|
||||||
|
|
||||||
|
if ctx.Route().Path == "/metrics" {
|
||||||
|
return ctx.Next()
|
||||||
|
}
|
||||||
|
|
||||||
|
requestInProgressTotal.WithLabelValues(method).Inc()
|
||||||
|
defer requestInProgressTotal.WithLabelValues(method).Dec()
|
||||||
|
|
||||||
|
err := ctx.Next()
|
||||||
|
// initialize with default error code
|
||||||
|
// https://docs.gofiber.io/guide/error-handling
|
||||||
|
status := fiber.StatusInternalServerError
|
||||||
|
if err != nil {
|
||||||
|
if e, ok := err.(*fiber.Error); ok {
|
||||||
|
// Get correct error code from fiber.Error type
|
||||||
|
status = e.Code
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
status = ctx.Response().StatusCode()
|
||||||
|
}
|
||||||
|
|
||||||
|
path := ctx.Route().Path
|
||||||
|
|
||||||
|
statusCode := strconv.Itoa(status)
|
||||||
|
requestsTotal.WithLabelValues(statusCode, method, path).Inc()
|
||||||
|
|
||||||
|
elapsed := float64(time.Since(start).Nanoseconds()) / 1e9
|
||||||
|
requestDuration.WithLabelValues(statusCode, method, path).Observe(elapsed)
|
||||||
|
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
60
pkg/middlewares/uniform/uniform.go
Normal file
60
pkg/middlewares/uniform/uniform.go
Normal file
@ -0,0 +1,60 @@
|
|||||||
|
package uniform
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/gofiber/fiber/v2"
|
||||||
|
"github.com/rs/zerolog/log"
|
||||||
|
"github.com/tidwall/gjson"
|
||||||
|
"github.com/tidwall/sjson"
|
||||||
|
)
|
||||||
|
|
||||||
|
// 调整JSON结果返回为公司要求的统一格式
|
||||||
|
|
||||||
|
// New creates a new middleware handler
|
||||||
|
func New(cfgs ...Config) fiber.Handler {
|
||||||
|
// Set default config
|
||||||
|
cfg := configDefault(cfgs...)
|
||||||
|
|
||||||
|
// Return new handler
|
||||||
|
return func(ctx *fiber.Ctx) error {
|
||||||
|
// Don't execute middleware if Next returns true
|
||||||
|
if cfg.Next != nil && cfg.Next(ctx) {
|
||||||
|
return ctx.Next()
|
||||||
|
}
|
||||||
|
|
||||||
|
uniformedResp := []byte{}
|
||||||
|
_ = ctx.Next()
|
||||||
|
code := ctx.Response().StatusCode()
|
||||||
|
if code >= 200 && code < 300 {
|
||||||
|
if string(ctx.Response().Header.ContentType()) == "application/json" {
|
||||||
|
uniformedResp, _ = sjson.SetBytes(uniformedResp, "code", 0)
|
||||||
|
uniformedResp, _ = sjson.SetRawBytes(uniformedResp, "data", ctx.Response().Body())
|
||||||
|
ctx.Response().SetBodyRaw(uniformedResp)
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
if code == 422 {
|
||||||
|
uniformedResp, _ = sjson.SetBytes(uniformedResp, "code", 422)
|
||||||
|
uniformedResp, _ = sjson.SetBytes(uniformedResp, "message", "参数校验失败")
|
||||||
|
uniformedResp, _ = sjson.SetRawBytes(uniformedResp, "details", ctx.Response().Body())
|
||||||
|
ctx.Response().SetBodyRaw(uniformedResp)
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
if code >= 400 {
|
||||||
|
log.Ctx(ctx.UserContext()).Error().
|
||||||
|
Int("status", code).
|
||||||
|
Str("request", ctx.String()).
|
||||||
|
Bytes("body", uniformedResp).
|
||||||
|
Msg("error occurred")
|
||||||
|
uniformedResp, _ = sjson.SetBytes(uniformedResp, "code", code)
|
||||||
|
|
||||||
|
resp := ctx.Context().Response.Body()
|
||||||
|
if msg := gjson.GetBytes(resp, "message"); msg.Exists() {
|
||||||
|
uniformedResp, _ = sjson.SetBytes(uniformedResp, "message", msg.String())
|
||||||
|
} else {
|
||||||
|
uniformedResp, _ = sjson.SetBytes(uniformedResp, "message", resp)
|
||||||
|
}
|
||||||
|
ctx.Response().SetBodyRaw(uniformedResp)
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
}
|
29
pkg/middlewares/uniform/uniform_config.go
Normal file
29
pkg/middlewares/uniform/uniform_config.go
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
package uniform
|
||||||
|
|
||||||
|
import "github.com/gofiber/fiber/v2"
|
||||||
|
|
||||||
|
// Config defines the config for middleware.
|
||||||
|
type Config struct {
|
||||||
|
// Next defines a function to skip this middleware when returned true.
|
||||||
|
//
|
||||||
|
// Optional. Default: nil
|
||||||
|
Next func(c *fiber.Ctx) bool
|
||||||
|
}
|
||||||
|
|
||||||
|
// ConfigDefault is the default config
|
||||||
|
var ConfigDefault = Config{
|
||||||
|
Next: nil,
|
||||||
|
}
|
||||||
|
|
||||||
|
// Helper function to set default values
|
||||||
|
func configDefault(config ...Config) Config {
|
||||||
|
// Return default config if nothing provided
|
||||||
|
if len(config) < 1 {
|
||||||
|
return ConfigDefault
|
||||||
|
}
|
||||||
|
|
||||||
|
// Override default config
|
||||||
|
cfg := config[0]
|
||||||
|
|
||||||
|
return cfg
|
||||||
|
}
|
1
pkg/s3/s3.go
Normal file
1
pkg/s3/s3.go
Normal file
@ -0,0 +1 @@
|
|||||||
|
package s3
|
65
pkg/tools/generics.go
Normal file
65
pkg/tools/generics.go
Normal file
@ -0,0 +1,65 @@
|
|||||||
|
package tools
|
||||||
|
|
||||||
|
// Map returns a new slice where each element is the result of fn for the corresponding element in the original slice
|
||||||
|
func Map[T any, U any](slice []T, fn func(T) U) []U {
|
||||||
|
result := make([]U, len(slice))
|
||||||
|
for i, t := range slice {
|
||||||
|
result[i] = fn(t)
|
||||||
|
}
|
||||||
|
|
||||||
|
return result
|
||||||
|
}
|
||||||
|
|
||||||
|
// Contains returns true if find appears in slice
|
||||||
|
func Contains[T comparable](slice []T, find T) bool {
|
||||||
|
for _, t := range slice {
|
||||||
|
if t == find {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// IndexOf returns the index of find if it appears in slice. If find is not in slice, -1 will be returned.
|
||||||
|
func IndexOf[T comparable](slice []T, find T) int {
|
||||||
|
for i, t := range slice {
|
||||||
|
if t == find {
|
||||||
|
return i
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return -1
|
||||||
|
}
|
||||||
|
|
||||||
|
// GroupBy returns a map that is keyed by keySelector and contains a slice of elements returned by valSelector
|
||||||
|
func GroupBy[T any, K comparable, V any](slice []T, keySelector func(T) K, valSelector func(T) V) map[K][]V {
|
||||||
|
grouping := make(map[K][]V)
|
||||||
|
for _, t := range slice {
|
||||||
|
key := keySelector(t)
|
||||||
|
grouping[key] = append(grouping[key], valSelector(t))
|
||||||
|
}
|
||||||
|
|
||||||
|
return grouping
|
||||||
|
}
|
||||||
|
|
||||||
|
// ToSet returns a map keyed by keySelector and contains a value of an empty struct
|
||||||
|
func ToSet[T any, K comparable](slice []T, keySelector func(T) K) *Set[K] {
|
||||||
|
set := NewSetWithCapacity[K](len(slice))
|
||||||
|
for _, t := range slice {
|
||||||
|
set.Add(keySelector(t))
|
||||||
|
}
|
||||||
|
|
||||||
|
return set
|
||||||
|
}
|
||||||
|
|
||||||
|
// ToMap return a map that is keyed keySelector and has the value of valSelector for each element in slice.
|
||||||
|
// If multiple elements return the same key the element that appears later in slice will be chosen.
|
||||||
|
func ToMap[T any, K comparable, V any](slice []T, keySelector func(T) K, valSelector func(T) V) map[K]V {
|
||||||
|
m := make(map[K]V)
|
||||||
|
for _, t := range slice {
|
||||||
|
m[keySelector(t)] = valSelector(t)
|
||||||
|
}
|
||||||
|
|
||||||
|
return m
|
||||||
|
}
|
101
pkg/tools/set.go
Normal file
101
pkg/tools/set.go
Normal file
@ -0,0 +1,101 @@
|
|||||||
|
package tools
|
||||||
|
|
||||||
|
import (
|
||||||
|
"sync"
|
||||||
|
)
|
||||||
|
|
||||||
|
type Set[T comparable] struct {
|
||||||
|
mu sync.RWMutex
|
||||||
|
set map[T]struct{}
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewSetWithCapacity[T comparable](c int) *Set[T] {
|
||||||
|
set := make(map[T]struct{}, c)
|
||||||
|
return &Set[T]{set: set}
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewSet[T comparable](elems ...T) *Set[T] {
|
||||||
|
set := make(map[T]struct{}, len(elems))
|
||||||
|
for _, elem := range elems {
|
||||||
|
set[elem] = struct{}{}
|
||||||
|
}
|
||||||
|
return &Set[T]{set: set}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (s *Set[T]) Add(ele ...T) *Set[T] {
|
||||||
|
s.mu.Lock()
|
||||||
|
defer s.mu.Unlock()
|
||||||
|
for _, e := range ele {
|
||||||
|
s.set[e] = struct{}{}
|
||||||
|
}
|
||||||
|
return s
|
||||||
|
}
|
||||||
|
|
||||||
|
func (s *Set[T]) Del(ele ...T) *Set[T] {
|
||||||
|
s.mu.Lock()
|
||||||
|
defer s.mu.Unlock()
|
||||||
|
for _, e := range ele {
|
||||||
|
delete(s.set, e)
|
||||||
|
}
|
||||||
|
return s
|
||||||
|
}
|
||||||
|
|
||||||
|
func (s *Set[T]) Has(ele T) bool {
|
||||||
|
s.mu.RLock()
|
||||||
|
defer s.mu.RUnlock()
|
||||||
|
_, exists := s.set[ele]
|
||||||
|
return exists
|
||||||
|
}
|
||||||
|
|
||||||
|
// 取交集.
|
||||||
|
func (s *Set[T]) Intersect(other *Set[T]) *Set[T] {
|
||||||
|
s.mu.RLock()
|
||||||
|
defer s.mu.RUnlock()
|
||||||
|
ret := NewSet[T]()
|
||||||
|
for ele := range s.set {
|
||||||
|
if other.Has(ele) {
|
||||||
|
ret.Add(ele)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return ret
|
||||||
|
}
|
||||||
|
|
||||||
|
func (s *Set[T]) Len() int {
|
||||||
|
return len(s.set)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (s *Set[T]) Set() map[T]struct{} {
|
||||||
|
return s.set
|
||||||
|
}
|
||||||
|
|
||||||
|
func (s *Set[T]) Values() []T {
|
||||||
|
s.mu.RLock()
|
||||||
|
defer s.mu.RUnlock()
|
||||||
|
ret := make([]T, 0, len(s.set))
|
||||||
|
for ele := range s.set {
|
||||||
|
ret = append(ret, ele)
|
||||||
|
}
|
||||||
|
return ret
|
||||||
|
}
|
||||||
|
|
||||||
|
func (s *Set[T]) Compare(other *Set[T]) (less, more *Set[T]) {
|
||||||
|
less = NewSet[T]()
|
||||||
|
more = NewSet[T]()
|
||||||
|
// less: s - other
|
||||||
|
s.mu.RLock()
|
||||||
|
other.mu.RLock()
|
||||||
|
defer s.mu.RUnlock()
|
||||||
|
defer other.mu.RUnlock()
|
||||||
|
for ele := range other.set {
|
||||||
|
if !s.Has(ele) {
|
||||||
|
less.Add(ele)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// more: other - s
|
||||||
|
for ele := range s.set {
|
||||||
|
if !other.Has(ele) {
|
||||||
|
more.Add(ele)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return less, more
|
||||||
|
}
|
21
pkg/tools/times.go
Normal file
21
pkg/tools/times.go
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
package tools
|
||||||
|
|
||||||
|
import "time"
|
||||||
|
|
||||||
|
func FirstDayOfISOWeek(year int, week int, timezone *time.Location) time.Time {
|
||||||
|
date := time.Date(year, 0, 0, 0, 0, 0, 0, timezone)
|
||||||
|
isoYear, isoWeek := date.ISOWeek()
|
||||||
|
for date.Weekday() != time.Monday { // iterate back to Monday
|
||||||
|
date = date.AddDate(0, 0, -1)
|
||||||
|
isoYear, isoWeek = date.ISOWeek()
|
||||||
|
}
|
||||||
|
for isoYear < year { // iterate forward to the first day of the first week
|
||||||
|
date = date.AddDate(0, 0, 1)
|
||||||
|
isoYear, isoWeek = date.ISOWeek()
|
||||||
|
}
|
||||||
|
for isoWeek < week { // iterate forward to the first day of the given week
|
||||||
|
date = date.AddDate(0, 0, 1)
|
||||||
|
_, isoWeek = date.ISOWeek()
|
||||||
|
}
|
||||||
|
return date
|
||||||
|
}
|
50
pkg/utils/cache.go
Normal file
50
pkg/utils/cache.go
Normal file
@ -0,0 +1,50 @@
|
|||||||
|
package utils
|
||||||
|
|
||||||
|
import (
|
||||||
|
"sync"
|
||||||
|
"time"
|
||||||
|
)
|
||||||
|
|
||||||
|
type Cache[T any] struct {
|
||||||
|
storage map[string]T
|
||||||
|
ttl map[string]time.Time
|
||||||
|
mu sync.RWMutex
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewCache[T any]() *Cache[T] {
|
||||||
|
return &Cache[T]{
|
||||||
|
storage: make(map[string]T),
|
||||||
|
ttl: make(map[string]time.Time),
|
||||||
|
mu: sync.RWMutex{},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *Cache[T]) Get(key string, ttl time.Duration, fn func() (T, error)) (T, error) {
|
||||||
|
c.mu.RLock()
|
||||||
|
if v, ok := c.storage[key]; ok {
|
||||||
|
if time.Now().Before(c.ttl[key]) {
|
||||||
|
c.mu.RUnlock()
|
||||||
|
return v, nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
c.mu.RUnlock()
|
||||||
|
|
||||||
|
c.mu.Lock()
|
||||||
|
defer c.mu.Unlock()
|
||||||
|
|
||||||
|
if v, ok := c.storage[key]; ok {
|
||||||
|
if time.Now().Before(c.ttl[key]) {
|
||||||
|
return v, nil
|
||||||
|
}
|
||||||
|
delete(c.storage, key)
|
||||||
|
delete(c.ttl, key)
|
||||||
|
}
|
||||||
|
|
||||||
|
v, err := fn()
|
||||||
|
if err != nil {
|
||||||
|
return v, err
|
||||||
|
}
|
||||||
|
c.storage[key] = v
|
||||||
|
c.ttl[key] = time.Now().Add(ttl)
|
||||||
|
return v, nil
|
||||||
|
}
|
19
pkg/utils/collections.go
Normal file
19
pkg/utils/collections.go
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
package utils
|
||||||
|
|
||||||
|
func Any[T any](items []T, predicate func(T) bool) bool {
|
||||||
|
for _, item := range items {
|
||||||
|
if predicate(item) {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
func All[T any](items []T, predicate func(T) bool) bool {
|
||||||
|
for _, item := range items {
|
||||||
|
if !predicate(item) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true
|
||||||
|
}
|
39
pkg/utils/date.go
Normal file
39
pkg/utils/date.go
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
package utils
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
"time"
|
||||||
|
|
||||||
|
"github.com/spf13/cast"
|
||||||
|
)
|
||||||
|
|
||||||
|
var parseLayouts = []string{
|
||||||
|
"2006-01-02 15:04:05",
|
||||||
|
"2006-1-2 15:04:05",
|
||||||
|
"2006-1-2 15:4:5",
|
||||||
|
"2006/01/02 15:04:05",
|
||||||
|
"2006/1/2 15:04:05",
|
||||||
|
"2006/1/2 15:4:5",
|
||||||
|
"2006年01月02日 15时04分05秒",
|
||||||
|
"2006年1月2日 15时04分05秒",
|
||||||
|
"2006年1月2日 15时4分5秒",
|
||||||
|
"2006年01月02日 15时04分",
|
||||||
|
"2006年1月2日 15时04分",
|
||||||
|
"2006年1月2日 15时4分",
|
||||||
|
"2006年01月02日 15:04:05",
|
||||||
|
"2006年1月2日 15:04:05",
|
||||||
|
"2006年1月2日 15:4:5",
|
||||||
|
}
|
||||||
|
|
||||||
|
func ToDateE(v interface{}) (time.Time, error) {
|
||||||
|
beijing, _ := time.LoadLocation("Asia/Shanghai")
|
||||||
|
for _, layout := range parseLayouts {
|
||||||
|
if t, err := time.ParseInLocation(layout, cast.ToString(v), beijing); err == nil {
|
||||||
|
return t, nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if t, err := cast.ToTimeE(v); err == nil {
|
||||||
|
return t, nil
|
||||||
|
}
|
||||||
|
return time.Time{}, fmt.Errorf("不能被识别的时间%s", cast.ToString(v))
|
||||||
|
}
|
26
pkg/utils/dbg.go
Normal file
26
pkg/utils/dbg.go
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
package utils
|
||||||
|
|
||||||
|
import (
|
||||||
|
"encoding/json"
|
||||||
|
"fmt"
|
||||||
|
)
|
||||||
|
|
||||||
|
func DBG(v interface{}, msg ...string) {
|
||||||
|
bv, err := json.MarshalIndent(v, "", " ")
|
||||||
|
if len(msg) == 0 {
|
||||||
|
fmt.Println("===========DBG===========")
|
||||||
|
} else {
|
||||||
|
fmt.Printf("===========%s===========\n", msg[0])
|
||||||
|
}
|
||||||
|
if err != nil {
|
||||||
|
fmt.Println(err.Error())
|
||||||
|
} else {
|
||||||
|
fmt.Println(string(bv))
|
||||||
|
}
|
||||||
|
fmt.Println("=========================")
|
||||||
|
}
|
||||||
|
|
||||||
|
func DbgE(v interface{}, err error) {
|
||||||
|
bv, _ := json.Marshal(v)
|
||||||
|
fmt.Println(string(bv))
|
||||||
|
}
|
11
pkg/utils/hash.go
Normal file
11
pkg/utils/hash.go
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
package utils
|
||||||
|
|
||||||
|
import (
|
||||||
|
"crypto/md5"
|
||||||
|
"encoding/hex"
|
||||||
|
)
|
||||||
|
|
||||||
|
func MD5(d []byte) string {
|
||||||
|
hash := md5.Sum(d)
|
||||||
|
return hex.EncodeToString(hash[:])
|
||||||
|
}
|
14
pkg/utils/ptr.go
Normal file
14
pkg/utils/ptr.go
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
package utils
|
||||||
|
|
||||||
|
import "reflect"
|
||||||
|
|
||||||
|
func Ptr[T any](v T) *T {
|
||||||
|
return &v
|
||||||
|
}
|
||||||
|
|
||||||
|
func Unptr[T any](v *T) T {
|
||||||
|
if v == nil {
|
||||||
|
return reflect.Zero(reflect.TypeOf(v).Elem()).Interface().(T)
|
||||||
|
}
|
||||||
|
return *v
|
||||||
|
}
|
203
statics/debugger.html
Normal file
203
statics/debugger.html
Normal file
@ -0,0 +1,203 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8" />
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
|
<title>DEBUGGER</title>
|
||||||
|
<script src="https://cdn.tailwindcss.com/"></script>
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
<div id="app">
|
||||||
|
<nav class="fixed z-30 w-full bg-white border-b-2 border-indigo-600">
|
||||||
|
<div class="py-3 px-6">
|
||||||
|
<div class="flex justify-between items-center">
|
||||||
|
<div class="flex justify-start items-center">
|
||||||
|
<span class="flex items-center text-xl font-bold text-blue-800">DEBUGGER</span>
|
||||||
|
</div>
|
||||||
|
<div class="flex items-center">
|
||||||
|
<div class="hidden relative mt-1 mr-6 lg:block lg:w-64">
|
||||||
|
<div class="flex absolute inset-y-0 left-0 items-center pl-3">
|
||||||
|
<svg class="w-5 h-5 text-gray-500" fill="currentColor" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<path
|
||||||
|
fill-rule="evenodd"
|
||||||
|
d="M8 4a4 4 0 100 8 4 4 0 000-8zM2 8a6 6 0 1110.89 3.476l4.817 4.817a1 1 0 01-1.414 1.414l-4.816-4.816A6 6 0 012 8z"
|
||||||
|
clip-rule="evenodd"
|
||||||
|
></path>
|
||||||
|
</svg>
|
||||||
|
</div>
|
||||||
|
<input
|
||||||
|
type="text"
|
||||||
|
name="name"
|
||||||
|
class="block p-2.5 pl-10 w-full text-gray-900 rounded-lg border sm:text-sm focus:ring-1 focus:outline-none"
|
||||||
|
v-model="filter"
|
||||||
|
placeholder="搜索"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</nav>
|
||||||
|
<div class="pt-12 lg:flex">
|
||||||
|
<div class="flex overflow-y-auto flex-col py-8 px-4 border-b lg:h-screen lg:border-r w-128">
|
||||||
|
<div class="flex flex-col justify-between mt-6">
|
||||||
|
<aside>
|
||||||
|
<ul>
|
||||||
|
<li v-for="func in filterdFuncs">
|
||||||
|
<a
|
||||||
|
@click="handleClickFunc(func)"
|
||||||
|
:class="{ 'bg-indigo-600 text-white': func === selectedFunc }"
|
||||||
|
class="flex items-center py-2 px-4 text-gray-700 bg-gray-100 rounded-md"
|
||||||
|
href="#"
|
||||||
|
>
|
||||||
|
<span class="mx-4 font-medium">{{ func.title }}</span>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</aside>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="overflow-y-auto p-8 w-full h-full">
|
||||||
|
<p class="flex flex-col mb-8 text-xl">{{ selectedFunc.description }}</p>
|
||||||
|
<form @submit="handleClickSubmit">
|
||||||
|
<div class="grid gap-6 mb-6 md:grid-cols-2">
|
||||||
|
<div v-for="param in selectedParameters">
|
||||||
|
<label :for="selectedFuncName+param.name" class="block mb-2 text-sm font-medium text-gray-900"> {{ param.description }}</label>
|
||||||
|
<input
|
||||||
|
type="text"
|
||||||
|
:id="selectedFuncName+param.name"
|
||||||
|
class="block p-2.5 w-full text-sm text-gray-900 bg-gray-50 rounded-lg border border-gray-300 focus:border-blue-500 focus:ring-blue-500"
|
||||||
|
v-model="currentParameters[param.name]"
|
||||||
|
:placeholder="param.description"
|
||||||
|
:required="param.required"
|
||||||
|
required
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<button
|
||||||
|
type="submit"
|
||||||
|
class="py-2.5 px-5 w-full text-sm font-medium text-center text-white bg-blue-700 rounded-lg sm:w-auto hover:bg-blue-800 focus:ring-4 focus:ring-blue-300 focus:outline-none"
|
||||||
|
>
|
||||||
|
执行
|
||||||
|
</button>
|
||||||
|
</form>
|
||||||
|
<div class="p-4 mt-8 border-2">
|
||||||
|
<div>
|
||||||
|
<input
|
||||||
|
class="px-5 my-4 w-full h-10 text-gray-900 rounded-lg border sm:text-sm focus:ring-1 focus:outline-none"
|
||||||
|
type="text"
|
||||||
|
name="dynamicfilter"
|
||||||
|
v-model="jsonFilter"
|
||||||
|
placeholder="Javascript Query, use 'it' to refer to the response"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<pre @click="copyResponse"> {{ JSON.stringify(filteredResult, null, 2) }} </pre>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
<script type="module" lang="js">
|
||||||
|
import { createApp } from "https://unpkg.com/vue@3/dist/vue.esm-browser.js";
|
||||||
|
const unsecuredCopyToClipboard = (text) => {
|
||||||
|
const textArea = document.createElement("textarea");
|
||||||
|
textArea.value = text;
|
||||||
|
document.body.appendChild(textArea);
|
||||||
|
textArea.focus();
|
||||||
|
textArea.select();
|
||||||
|
try {
|
||||||
|
document.execCommand("copy");
|
||||||
|
} catch (err) {
|
||||||
|
console.error("Unable to copy to clipboard", err);
|
||||||
|
}
|
||||||
|
document.body.removeChild(textArea);
|
||||||
|
};
|
||||||
|
|
||||||
|
createApp({
|
||||||
|
data: () => {
|
||||||
|
return {
|
||||||
|
jsonFilter: "",
|
||||||
|
funcs: [],
|
||||||
|
selectedFuncName: undefined,
|
||||||
|
filter: "",
|
||||||
|
currentParameters: {},
|
||||||
|
result: undefined,
|
||||||
|
};
|
||||||
|
},
|
||||||
|
async mounted() {
|
||||||
|
const functionsUrl = window.location.href.replace("debugger", "debugger/functions");
|
||||||
|
let resp = await fetch(functionsUrl);
|
||||||
|
this.funcs = (await resp.json()).data;
|
||||||
|
},
|
||||||
|
|
||||||
|
computed: {
|
||||||
|
selectedFunc() {
|
||||||
|
let filterd = this.funcs.filter((f) => f.name == this.selectedFuncName) || [];
|
||||||
|
return (filterd && filterd[0]) || {};
|
||||||
|
},
|
||||||
|
filterdFuncs() {
|
||||||
|
return this.funcs.filter((f) => f.name.includes(this.filter) || f.title.includes(this.filter) || f.description.includes(this.filter));
|
||||||
|
},
|
||||||
|
selectedParameters() {
|
||||||
|
return this.selectedFunc.parameters;
|
||||||
|
},
|
||||||
|
|
||||||
|
filteredResult() {
|
||||||
|
if (this.jsonFilter) {
|
||||||
|
try {
|
||||||
|
return eval(this.jsonFilter);
|
||||||
|
} catch {
|
||||||
|
return this.result;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return this.result;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
handleClickFunc(message, event) {
|
||||||
|
event && event.preventDefault();
|
||||||
|
this.selectedFuncName = message.name;
|
||||||
|
this.currentParameters = {};
|
||||||
|
for (let param of this.selectedParameters) {
|
||||||
|
this.currentParameters[param.name] = window.localStorage.getItem(`debugger_${param.name}`) || "";
|
||||||
|
}
|
||||||
|
},
|
||||||
|
async copyResponse() {
|
||||||
|
if (this.result) {
|
||||||
|
const content = JSON.stringify(this.filteredResult, null, 2);
|
||||||
|
if (window.isSecureContext && navigator.clipboard) {
|
||||||
|
navigator.clipboard.writeText(content);
|
||||||
|
} else {
|
||||||
|
unsecuredCopyToClipboard(content);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
async handleClickSubmit(event) {
|
||||||
|
this.result = undefined;
|
||||||
|
event && event.preventDefault();
|
||||||
|
for (let key in this.currentParameters) {
|
||||||
|
window.localStorage.setItem(`debugger_${key}`, this.currentParameters[key]);
|
||||||
|
}
|
||||||
|
let executeUrl = window.location.href.replace("debugger", "debugger/execute");
|
||||||
|
let resp = await fetch(executeUrl, {
|
||||||
|
method: "POST",
|
||||||
|
headers: {
|
||||||
|
"Content-Type": "application/json",
|
||||||
|
Debug_Kylin: "true",
|
||||||
|
},
|
||||||
|
body: JSON.stringify({
|
||||||
|
func: this.selectedFuncName,
|
||||||
|
params: this.currentParameters,
|
||||||
|
}),
|
||||||
|
});
|
||||||
|
this.result = await resp.json();
|
||||||
|
const obj = JSON.parse(JSON.stringify(this.result.data));
|
||||||
|
console.log(obj);
|
||||||
|
window.it = obj;
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}).mount("#app");
|
||||||
|
</script>
|
||||||
|
</html>
|
23
statics/description.md
Normal file
23
statics/description.md
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
<!-- markdownlint-configure-file { "MD013": { "line_length": 180 } } -->
|
||||||
|
|
||||||
|
# octopus服务说明
|
||||||
|
|
||||||
|
- Build Time: {build_time}
|
||||||
|
- Go Version: {go_version}
|
||||||
|
|
||||||
|
> **NOTE**
|
||||||
|
|
||||||
|
- 本服务所有接口的返回值均遵循Rcrai前端组件规范,如
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"code": 0,
|
||||||
|
"data": {},
|
||||||
|
"message": "",
|
||||||
|
"details": {}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
但为使文档更加简洁,所有该文档中涉及的JSON Response均只展示data内部的数据结构(特殊情况除外).
|
||||||
|
|
||||||
|
如果有疑问请联系本服务维护者 :D
|
18
statics/static.go
Normal file
18
statics/static.go
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
package statics
|
||||||
|
|
||||||
|
import (
|
||||||
|
_ "embed"
|
||||||
|
"octopus"
|
||||||
|
"strings"
|
||||||
|
)
|
||||||
|
|
||||||
|
//go:embed description.md
|
||||||
|
var description string
|
||||||
|
|
||||||
|
//go:embed debugger.html
|
||||||
|
var DebuggerHTML string
|
||||||
|
|
||||||
|
func GenDescription() string {
|
||||||
|
replacer := strings.NewReplacer("{build_time}", octopus.BuildTime, "{go_version}", octopus.GoVersion)
|
||||||
|
return replacer.Replace(description)
|
||||||
|
}
|
10
version.go
Normal file
10
version.go
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
package octopus
|
||||||
|
|
||||||
|
var (
|
||||||
|
// Version build version.
|
||||||
|
Version = "unknown"
|
||||||
|
// BuildTime build time.
|
||||||
|
BuildTime string
|
||||||
|
// GoVersion build by go version.
|
||||||
|
GoVersion string
|
||||||
|
)
|
Loading…
x
Reference in New Issue
Block a user