mirror of
https://github.com/redhat-developer/odo.git
synced 2025-10-19 03:06:19 +03:00
use -mod=vendor with all go commands in Makefile and use vendoring to manage ginkgo (#4784)
* export GOFLAGS=-mod=vendor in Makefile * use go get instead of go install for installing test dependencies * use tools approach to manage testing dependencies When using this apporoach we can make sure that all dependencies in a proper version are vendored with the source code. * go mod vendor * add wwhrd expection for github.com/hinshun/vt10x
This commit is contained in:
@@ -38,4 +38,6 @@ exceptions:
|
||||
# BSD licence - wwhrd is not detecting it correctly
|
||||
- github.com/golang/protobuf/...
|
||||
# MIT licence - wwhrd is not detecting it correctly
|
||||
- sigs.k8s.io/yaml/...
|
||||
- sigs.k8s.io/yaml/...
|
||||
# MIT licence - wwhrd is not detecting it correctly
|
||||
- github.com/hinshun/vt10x
|
||||
118
Makefile
118
Makefile
@@ -4,10 +4,12 @@ ifdef GITCOMMIT
|
||||
else
|
||||
GITCOMMIT := $(shell git rev-parse --short HEAD 2>/dev/null)
|
||||
endif
|
||||
PKGS := $(shell go list ./... | grep -v $(PROJECT)/vendor | grep -v $(PROJECT)/tests)
|
||||
|
||||
COMMON_GOFLAGS := -mod=vendor
|
||||
COMMON_LDFLAGS := -X $(PROJECT)/pkg/version.GITCOMMIT=$(GITCOMMIT)
|
||||
BUILD_FLAGS := -mod=vendor -ldflags="$(COMMON_LDFLAGS)"
|
||||
CROSS_BUILD_FLAGS := -mod=vendor -ldflags="-s -w -X $(PROJECT)/pkg/segment.writeKey=R1Z79HadJIrphLoeONZy5uqOjusljSwN $(COMMON_LDFLAGS)"
|
||||
BUILD_FLAGS := $(COMMON_GOFLAGS) -ldflags="$(COMMON_LDFLAGS)"
|
||||
CROSS_BUILD_FLAGS := $(COMMON_GOFLAGS) -ldflags="-s -w -X $(PROJECT)/pkg/segment.writeKey=R1Z79HadJIrphLoeONZy5uqOjusljSwN $(COMMON_LDFLAGS)"
|
||||
PKGS := $(shell go list $(COMMON_GOFLAGS) ./... | grep -v $(PROJECT)/vendor | grep -v $(PROJECT)/tests)
|
||||
FILES := odo dist
|
||||
TIMEOUT ?= 14400s
|
||||
|
||||
@@ -42,6 +44,8 @@ GINKGO_FLAGS_SERIAL = $(GINKGO_FLAGS_ALL) -nodes=1
|
||||
GINKGO_FLAGS=$(GINKGO_FLAGS_ALL) -nodes=$(TEST_EXEC_NODES)
|
||||
|
||||
|
||||
RUN_GINKGO = go run $(COMMON_GOFLAGS) github.com/onsi/ginkgo/ginkgo
|
||||
|
||||
default: bin
|
||||
|
||||
.PHONY: help
|
||||
@@ -73,7 +77,7 @@ check-fit:
|
||||
|
||||
.PHONY: validate-vendor-licenses
|
||||
validate-vendor-licenses:
|
||||
wwhrd check -q
|
||||
go run $(COMMON_GOFLAGS) github.com/frapposelli/wwhrd check -q
|
||||
|
||||
.PHONY: golint
|
||||
golint:
|
||||
@@ -89,25 +93,21 @@ vet:
|
||||
|
||||
.PHONY: sec
|
||||
sec:
|
||||
@which gosec 2> /dev/null >&1 || { echo "gosec must be installed to lint code"; exit 1; }
|
||||
gosec -severity medium -confidence medium -exclude G304,G204 -quiet ./...
|
||||
go run $(COMMON_GOFLAGS) github.com/securego/gosec/v2/cmd/gosec -severity medium -confidence medium -exclude G304,G204 -quiet ./...
|
||||
|
||||
.PHONY: clean
|
||||
clean:
|
||||
@rm -rf $(FILES)
|
||||
|
||||
.PHONY: goget-tools
|
||||
goget-tools: goget-ginkgo ## install tools used for building, tests and validations
|
||||
goget-tools:
|
||||
mkdir -p $(shell go env GOPATH)/bin
|
||||
GOFLAGS='' go get github.com/frapposelli/wwhrd@v0.3.0
|
||||
GOFLAGS='' go get github.com/securego/gosec/v2/cmd/gosec@v2.4.0
|
||||
# It is not recomended to go get golangci-lint https://github.com/golangci/golangci-lint#go
|
||||
curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(shell go env GOPATH)/bin v1.30.0
|
||||
|
||||
.PHONY: goget-ginkgo
|
||||
goget-ginkgo:
|
||||
# https://go-review.googlesource.com/c/go/+/198438/
|
||||
GOFLAGS='' go get github.com/onsi/ginkgo/ginkgo@v1.14.0
|
||||
@echo "This is no longer used."
|
||||
@echo "Ginkgo can be executed directly from this repository using command '$(RUN_GINKGO)'"
|
||||
|
||||
.PHONY: test-coverage
|
||||
test-coverage: ## Run unit tests and collect coverage
|
||||
@@ -156,173 +156,173 @@ test-windows:
|
||||
|
||||
.PHONY: test-generic
|
||||
test-generic: ## Run generic integration tests
|
||||
ginkgo $(GINKGO_FLAGS) -focus="odo generic" tests/integration/
|
||||
$(RUN_GINKGO) $(GINKGO_FLAGS) -focus="odo generic" tests/integration/
|
||||
|
||||
.PHONY: test-cmd-login-logout
|
||||
test-cmd-login-logout: ## Run odo login and logout tests
|
||||
ginkgo $(GINKGO_FLAGS_SERIAL) -focus="odo login and logout command tests" tests/integration/loginlogout/
|
||||
$(RUN_GINKGO) $(GINKGO_FLAGS_SERIAL) -focus="odo login and logout command tests" tests/integration/loginlogout/
|
||||
|
||||
.PHONY: test-cmd-link-unlink-4-cluster
|
||||
test-cmd-link-unlink-4-cluster: ## Run link and unlink commnad tests against 4.x cluster
|
||||
ginkgo $(GINKGO_FLAGS) -focus="odo link and unlink commnad tests" tests/integration/
|
||||
$(RUN_GINKGO) $(GINKGO_FLAGS) -focus="odo link and unlink commnad tests" tests/integration/
|
||||
|
||||
.PHONY: test-cmd-link-unlink-311-cluster
|
||||
test-cmd-link-unlink-311-cluster: ## Run link and unlink command tests against 3.11 cluster
|
||||
ginkgo $(GINKGO_FLAGS) -focus="odo link and unlink command tests" tests/integration/servicecatalog/
|
||||
$(RUN_GINKGO) $(GINKGO_FLAGS) -focus="odo link and unlink command tests" tests/integration/servicecatalog/
|
||||
|
||||
.PHONY: test-cmd-service
|
||||
test-cmd-service: ## Run odo service command tests
|
||||
ginkgo $(GINKGO_FLAGS) -focus="odo service command tests" tests/integration/servicecatalog/
|
||||
$(RUN_GINKGO) $(GINKGO_FLAGS) -focus="odo service command tests" tests/integration/servicecatalog/
|
||||
|
||||
.PHONY: test-cmd-project
|
||||
test-cmd-project: ## Run odo project command tests
|
||||
ginkgo $(GINKGO_FLAGS_SERIAL) -focus="odo project command tests" tests/integration/project/
|
||||
$(RUN_GINKGO) $(GINKGO_FLAGS_SERIAL) -focus="odo project command tests" tests/integration/project/
|
||||
|
||||
.PHONY: test-cmd-app
|
||||
test-cmd-app: ## Run odo app command tests
|
||||
ginkgo $(GINKGO_FLAGS) -focus="odo app command tests" tests/integration/
|
||||
$(RUN_GINKGO) $(GINKGO_FLAGS) -focus="odo app command tests" tests/integration/
|
||||
|
||||
.PHONY: test-cmd-cmp
|
||||
test-cmd-cmp: ## Run odo component command tests
|
||||
ginkgo $(GINKGO_FLAGS) -focus="odo component command tests" tests/integration/
|
||||
$(RUN_GINKGO) $(GINKGO_FLAGS) -focus="odo component command tests" tests/integration/
|
||||
|
||||
.PHONY: test-cmd-cmp-sub
|
||||
test-cmd-cmp-sub: ## Run odo component subcommands tests
|
||||
ginkgo $(GINKGO_FLAGS) -focus="odo sub component command tests" tests/integration/
|
||||
$(RUN_GINKGO) $(GINKGO_FLAGS) -focus="odo sub component command tests" tests/integration/
|
||||
|
||||
.PHONY: test-cmd-pref-config
|
||||
test-cmd-pref-config: ## Run odo preference and config command tests
|
||||
ginkgo $(GINKGO_FLAGS) -focus="odo preference and config command tests" tests/integration/
|
||||
$(RUN_GINKGO) $(GINKGO_FLAGS) -focus="odo preference and config command tests" tests/integration/
|
||||
|
||||
.PHONY: test-cmd-push
|
||||
test-cmd-push: ## Run odo push command tests
|
||||
ginkgo $(GINKGO_FLAGS) -focus="odo push command tests" tests/integration/
|
||||
$(RUN_GINKGO) $(GINKGO_FLAGS) -focus="odo push command tests" tests/integration/
|
||||
|
||||
.PHONY: test-plugin-handler
|
||||
test-plugin-handler: ## Run odo plugin handler tests
|
||||
ginkgo $(GINKGO_FLAGS) -focus="odo plugin functionality" tests/integration/
|
||||
$(RUN_GINKGO) $(GINKGO_FLAGS) -focus="odo plugin functionality" tests/integration/
|
||||
|
||||
.PHONY: test-cmd-devfile-catalog
|
||||
test-cmd-devfile-catalog: ## Run odo catalog devfile command tests
|
||||
ginkgo $(GINKGO_FLAGS) -focus="odo devfile catalog command tests" tests/integration/devfile/
|
||||
$(RUN_GINKGO) $(GINKGO_FLAGS) -focus="odo devfile catalog command tests" tests/integration/devfile/
|
||||
|
||||
.PHONY: test-cmd-devfile-create
|
||||
test-cmd-devfile-create: ## Run odo create devfile command tests
|
||||
ginkgo $(GINKGO_FLAGS) -focus="odo devfile create command tests" tests/integration/devfile/
|
||||
$(RUN_GINKGO) $(GINKGO_FLAGS) -focus="odo devfile create command tests" tests/integration/devfile/
|
||||
|
||||
.PHONY: test-cmd-devfile-push
|
||||
test-cmd-devfile-push: ## Run odo push devfile command tests
|
||||
ginkgo $(GINKGO_FLAGS) -focus="odo devfile push command tests" tests/integration/devfile/
|
||||
$(RUN_GINKGO) $(GINKGO_FLAGS) -focus="odo devfile push command tests" tests/integration/devfile/
|
||||
|
||||
.PHONY: test-cmd-devfile-exec
|
||||
test-cmd-devfile-exec: ## Run odo exec devfile command tests
|
||||
ginkgo $(GINKGO_FLAGS) -focus="odo devfile exec command tests" tests/integration/devfile/
|
||||
$(RUN_GINKGO) $(GINKGO_FLAGS) -focus="odo devfile exec command tests" tests/integration/devfile/
|
||||
|
||||
.PHONY: test-cmd-devfile-status
|
||||
test-cmd-devfile-status: ## Run odo status devfile command tests
|
||||
ginkgo $(GINKGO_FLAGS) -focus="odo devfile status command tests" tests/integration/devfile/
|
||||
$(RUN_GINKGO) $(GINKGO_FLAGS) -focus="odo devfile status command tests" tests/integration/devfile/
|
||||
|
||||
.PHONY: test-cmd-devfile-watch
|
||||
test-cmd-devfile-watch: ## Run odo devfile watch command tests
|
||||
ginkgo $(GINKGO_FLAGS) -focus="odo devfile watch command tests" tests/integration/devfile/
|
||||
$(RUN_GINKGO) $(GINKGO_FLAGS) -focus="odo devfile watch command tests" tests/integration/devfile/
|
||||
|
||||
.PHONY: test-cmd-devfile-app
|
||||
test-cmd-devfile-app: ## Run odo devfile app command tests
|
||||
ginkgo $(GINKGO_FLAGS) -focus="odo devfile app command tests" tests/integration/devfile/
|
||||
$(RUN_GINKGO) $(GINKGO_FLAGS) -focus="odo devfile app command tests" tests/integration/devfile/
|
||||
|
||||
.PHONY: test-cmd-devfile-delete
|
||||
test-cmd-devfile-delete: ## Run odo devfile delete command tests
|
||||
ginkgo $(GINKGO_FLAGS) -focus="odo devfile delete command tests" tests/integration/devfile/
|
||||
$(RUN_GINKGO) $(GINKGO_FLAGS) -focus="odo devfile delete command tests" tests/integration/devfile/
|
||||
|
||||
.PHONY: test-cmd-devfile-registry
|
||||
test-cmd-devfile-registry: ## Run odo devfile registry command tests
|
||||
ginkgo $(GINKGO_FLAGS) -focus="odo devfile registry command tests" tests/integration/devfile/
|
||||
$(RUN_GINKGO) $(GINKGO_FLAGS) -focus="odo devfile registry command tests" tests/integration/devfile/
|
||||
|
||||
.PHONY: test-cmd-devfile-test
|
||||
test-cmd-devfile-test: ## Run odo devfile test command tests
|
||||
ginkgo $(GINKGO_FLAGS) -focus="odo devfile test command tests" tests/integration/devfile/
|
||||
$(RUN_GINKGO) $(GINKGO_FLAGS) -focus="odo devfile test command tests" tests/integration/devfile/
|
||||
|
||||
.PHONY: test-cmd-storage
|
||||
test-cmd-storage: ## Run odo storage command tests
|
||||
ginkgo $(GINKGO_FLAGS) -focus="odo storage command tests" tests/integration/
|
||||
$(RUN_GINKGO) $(GINKGO_FLAGS) -focus="odo storage command tests" tests/integration/
|
||||
|
||||
.PHONY: test-cmd-url
|
||||
test-cmd-url: ## Run odo url command tests
|
||||
ginkgo $(GINKGO_FLAGS) -focus="odo url command tests" tests/integration/
|
||||
$(RUN_GINKGO) $(GINKGO_FLAGS) -focus="odo url command tests" tests/integration/
|
||||
|
||||
.PHONY: test-cmd-devfile-url
|
||||
test-cmd-devfile-url: ## Run odo url devfile command tests
|
||||
ginkgo $(GINKGO_FLAGS) -focus="odo devfile url command tests" tests/integration/devfile/
|
||||
$(RUN_GINKGO) $(GINKGO_FLAGS) -focus="odo devfile url command tests" tests/integration/devfile/
|
||||
|
||||
.PHONY: test-cmd-devfile-debug
|
||||
test-cmd-devfile-debug: ## Run odo debug devfile command tests
|
||||
ginkgo $(GINKGO_FLAGS) -focus="odo devfile debug command tests" tests/integration/devfile/
|
||||
ginkgo $(GINKGO_FLAGS_SERIAL) -focus="odo devfile debug command serial tests" tests/integration/devfile/debug/
|
||||
$(RUN_GINKGO) $(GINKGO_FLAGS) -focus="odo devfile debug command tests" tests/integration/devfile/
|
||||
$(RUN_GINKGO) $(GINKGO_FLAGS_SERIAL) -focus="odo devfile debug command serial tests" tests/integration/devfile/debug/
|
||||
|
||||
.PHONY: test-cmd-devfile-storage
|
||||
test-cmd-devfile-storage: ## Run odo storage devfile command tests
|
||||
ginkgo $(GINKGO_FLAGS) -focus="odo devfile storage command tests" tests/integration/devfile/
|
||||
$(RUN_GINKGO) $(GINKGO_FLAGS) -focus="odo devfile storage command tests" tests/integration/devfile/
|
||||
|
||||
.PHONY: test-cmd-devfile-log
|
||||
test-cmd-devfile-log: ## Run odo log devfile command tests
|
||||
ginkgo $(GINKGO_FLAGS) -focus="odo devfile log command tests" tests/integration/devfile/
|
||||
$(RUN_GINKGO) $(GINKGO_FLAGS) -focus="odo devfile log command tests" tests/integration/devfile/
|
||||
|
||||
.PHONY: test-cmd-devfile-env
|
||||
test-cmd-devfile-env: ## Run odo env devfile command tests
|
||||
ginkgo $(GINKGO_FLAGS) -focus="odo devfile env command tests" tests/integration/devfile/
|
||||
$(RUN_GINKGO) $(GINKGO_FLAGS) -focus="odo devfile env command tests" tests/integration/devfile/
|
||||
|
||||
.PHONY: test-cmd-devfile-config
|
||||
test-cmd-devfile-config: ## Run odo config devfile command tests
|
||||
ginkgo $(GINKGO_FLAGS) -focus="odo devfile config command tests" tests/integration/devfile/
|
||||
$(RUN_GINKGO) $(GINKGO_FLAGS) -focus="odo devfile config command tests" tests/integration/devfile/
|
||||
|
||||
.PHONY: test-cmd-watch
|
||||
test-cmd-watch: ## Run odo watch command tests
|
||||
ginkgo $(GINKGO_FLAGS) -focus="odo watch command tests" tests/integration/
|
||||
$(RUN_GINKGO) $(GINKGO_FLAGS) -focus="odo watch command tests" tests/integration/
|
||||
|
||||
.PHONY: test-cmd-debug
|
||||
test-cmd-debug: ## Run odo debug command tests
|
||||
ginkgo $(GINKGO_FLAGS) -focus="odo debug command tests" tests/integration/
|
||||
ginkgo $(GINKGO_FLAGS_SERIAL) -focus="odo debug command serial tests" tests/integration/debug/
|
||||
$(RUN_GINKGO) $(GINKGO_FLAGS) -focus="odo debug command tests" tests/integration/
|
||||
$(RUN_GINKGO) $(GINKGO_FLAGS_SERIAL) -focus="odo debug command serial tests" tests/integration/debug/
|
||||
|
||||
# Service, link and login/logout command tests are not the part of this test run
|
||||
.PHONY: test-integration
|
||||
test-integration: ## Run command's integration tests irrespective of service catalog status in the cluster.
|
||||
ginkgo $(GINKGO_FLAGS) tests/integration/
|
||||
ginkgo $(GINKGO_FLAGS_SERIAL) tests/integration/debug/
|
||||
$(RUN_GINKGO) $(GINKGO_FLAGS) tests/integration/
|
||||
$(RUN_GINKGO) $(GINKGO_FLAGS_SERIAL) tests/integration/debug/
|
||||
|
||||
.PHONY: test-integration-devfile
|
||||
test-integration-devfile: ## Run devfile integration tests
|
||||
ginkgo $(GINKGO_FLAGS) tests/integration/devfile/
|
||||
ginkgo $(GINKGO_FLAGS_SERIAL) tests/integration/devfile/debug/
|
||||
$(RUN_GINKGO) $(GINKGO_FLAGS) tests/integration/devfile/
|
||||
$(RUN_GINKGO) $(GINKGO_FLAGS_SERIAL) tests/integration/devfile/debug/
|
||||
|
||||
# Only service and link command tests are the part of this test run
|
||||
.PHONY: test-integration-service-catalog
|
||||
test-integration-service-catalog: ## Run command's integration tests which are dependent on service catalog enabled cluster.
|
||||
ginkgo $(GINKGO_FLAGS) tests/integration/servicecatalog/
|
||||
$(RUN_GINKGO) $(GINKGO_FLAGS) tests/integration/servicecatalog/
|
||||
|
||||
.PHONY: test-e2e-beta
|
||||
test-e2e-beta: ## Run core beta flow e2e tests
|
||||
ginkgo $(GINKGO_FLAGS) -focus="odo core beta flow" tests/e2escenarios/
|
||||
$(RUN_GINKGO) $(GINKGO_FLAGS) -focus="odo core beta flow" tests/e2escenarios/
|
||||
|
||||
.PHONY: test-e2e-java
|
||||
test-e2e-java: ## Run java e2e tests
|
||||
ginkgo $(GINKGO_FLAGS) -focus="odo java e2e tests" tests/e2escenarios/
|
||||
$(RUN_GINKGO) $(GINKGO_FLAGS) -focus="odo java e2e tests" tests/e2escenarios/
|
||||
|
||||
.PHONY: test-e2e-source
|
||||
test-e2e-source: ## Run source e2e tests
|
||||
ginkgo $(GINKGO_FLAGS) -focus="odo source e2e tests" tests/e2escenarios/
|
||||
$(RUN_GINKGO) $(GINKGO_FLAGS) -focus="odo source e2e tests" tests/e2escenarios/
|
||||
|
||||
.PHONY: test-e2e-images
|
||||
test-e2e-images: ## Run supported images e2e tests
|
||||
ginkgo $(GINKGO_FLAGS) -focus="odo supported images e2e tests" tests/e2escenarios/
|
||||
$(RUN_GINKGO) $(GINKGO_FLAGS) -focus="odo supported images e2e tests" tests/e2escenarios/
|
||||
|
||||
.PHONY: test-e2e-devfile
|
||||
test-e2e-devfile: ## Run devfile e2e tests: odo devfile supported tests
|
||||
ginkgo $(GINKGO_FLAGS) -focus="odo devfile supported tests" tests/e2escenarios/
|
||||
$(RUN_GINKGO) $(GINKGO_FLAGS) -focus="odo devfile supported tests" tests/e2escenarios/
|
||||
|
||||
.PHONY: test-e2e-all
|
||||
test-e2e-all: ## Run all e2e test scenarios
|
||||
ginkgo $(GINKGO_FLAGS) tests/e2escenarios/
|
||||
$(RUN_GINKGO) $(GINKGO_FLAGS) tests/e2escenarios/
|
||||
|
||||
# run make cross before this!
|
||||
.PHONY: packages
|
||||
@@ -344,8 +344,8 @@ openshiftci-presubmit-unittests:
|
||||
|
||||
.PHONY: test-operator-hub
|
||||
test-operator-hub: ## Run OperatorHub tests
|
||||
ginkgo $(GINKGO_FLAGS_SERIAL) -focus="odo service command tests" tests/integration/operatorhub/
|
||||
$(RUN_GINKGO) $(GINKGO_FLAGS_SERIAL) -focus="odo service command tests" tests/integration/operatorhub/
|
||||
|
||||
.PHONY: test-cmd-devfile-describe
|
||||
test-cmd-devfile-describe:
|
||||
ginkgo $(GINKGO_FLAGS) -focus="odo devfile describe command tests" tests/integration/devfile/
|
||||
$(RUN_GINKGO) $(GINKGO_FLAGS) -focus="odo devfile describe command tests" tests/integration/devfile/
|
||||
|
||||
27
go.mod
27
go.mod
@@ -11,21 +11,24 @@ require (
|
||||
github.com/devfile/registry-support/registry-library v0.0.0-20210407161420-cd279527f873
|
||||
github.com/docker/docker v17.12.0-ce-rc1.0.20200916142827-bd33bbf0497b+incompatible
|
||||
github.com/docker/go-connections v0.4.1-0.20200120150455-7dc0a2d6ddce
|
||||
github.com/fatih/color v1.9.0
|
||||
github.com/fatih/color v1.10.0
|
||||
github.com/frapposelli/wwhrd v0.4.0
|
||||
github.com/fsnotify/fsnotify v1.4.9
|
||||
github.com/ghodss/yaml v1.0.1-0.20190212211648-25d852aebe32
|
||||
github.com/go-git/go-git/v5 v5.2.0
|
||||
github.com/gobwas/glob v0.2.3
|
||||
github.com/golang/mock v1.5.0
|
||||
github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7
|
||||
github.com/google/go-cmp v0.5.4 // indirect
|
||||
github.com/gregjones/httpcache v0.0.0-20190611155906-901d90724c79
|
||||
github.com/hashicorp/go-multierror v1.1.1 // indirect
|
||||
github.com/hinshun/vt10x v0.0.0-20180809195222-d55458df857c
|
||||
github.com/kubernetes-sigs/service-catalog v0.3.1
|
||||
github.com/kylelemons/godebug v0.0.0-20170820004349-d65d576e9348
|
||||
github.com/mattn/go-colorable v0.1.6
|
||||
github.com/kylelemons/godebug v1.1.0
|
||||
github.com/mattn/go-colorable v0.1.8
|
||||
github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d
|
||||
github.com/olekukonko/tablewriter v0.0.1
|
||||
github.com/onsi/ginkgo v1.14.1
|
||||
github.com/onsi/gomega v1.10.2
|
||||
github.com/olekukonko/tablewriter v0.0.5
|
||||
github.com/onsi/ginkgo v1.16.1
|
||||
github.com/onsi/gomega v1.11.0
|
||||
github.com/openshift/api v0.0.0-20201216151826-78a19e96f9eb
|
||||
github.com/openshift/client-go v0.0.0-20201214125552-e615e336eb49
|
||||
github.com/openshift/library-go v0.0.0-20210106214821-c4d0b9c8d55f
|
||||
@@ -36,18 +39,22 @@ require (
|
||||
github.com/pkg/errors v0.9.1
|
||||
github.com/posener/complete v1.1.1
|
||||
github.com/redhat-developer/service-binding-operator v0.7.1
|
||||
github.com/securego/gosec/v2 v2.8.0
|
||||
github.com/segmentio/backo-go v0.0.0-20200129164019-23eae7c10bd3 // indirect
|
||||
github.com/sirupsen/logrus v1.8.1 // indirect
|
||||
github.com/spf13/afero v1.2.2
|
||||
github.com/spf13/cobra v1.1.1
|
||||
github.com/spf13/cobra v1.1.3
|
||||
github.com/spf13/pflag v1.0.5
|
||||
github.com/stretchr/testify v1.6.1
|
||||
github.com/stretchr/testify v1.7.0
|
||||
github.com/tidwall/gjson v1.7.3
|
||||
github.com/xtgo/uuid v0.0.0-20140804021211-a0b114877d4c // indirect
|
||||
github.com/zalando/go-keyring v0.1.1
|
||||
golang.org/x/crypto v0.0.0-20210220033148-5ea612d1eb83 // indirect
|
||||
golang.org/x/term v0.0.0-20210317153231-de623e64d2a6
|
||||
golang.org/x/tools v0.1.2-0.20210512205948-8287d5da45e4 // indirect
|
||||
gopkg.in/AlecAivazis/survey.v1 v1.8.8
|
||||
gopkg.in/segmentio/analytics-go.v3 v3.1.0
|
||||
gopkg.in/yaml.v2 v2.3.0
|
||||
gopkg.in/yaml.v2 v2.4.0
|
||||
k8s.io/api v0.20.1
|
||||
k8s.io/apimachinery v0.20.1
|
||||
k8s.io/cli-runtime v0.20.1
|
||||
|
||||
247
go.sum
247
go.sum
@@ -1,4 +1,5 @@
|
||||
bazil.org/fuse v0.0.0-20160811212531-371fbbdaa898/go.mod h1:Xbm+BRKSBEpa4q4hTSxohYNQpsxXPbPry4JJWOB3LB8=
|
||||
bitbucket.org/creachadair/shell v0.0.6/go.mod h1:8Qqi/cYk7vPnsOePHroKXDJYmb5x7ENhtiFtfZq8K+M=
|
||||
bou.ke/monkey v1.0.1/go.mod h1:FgHuK96Rv2Nlf+0u1OOVDpCMdsWyOFmeeketDHE7LIg=
|
||||
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=
|
||||
@@ -13,18 +14,30 @@ cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO
|
||||
cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M=
|
||||
cloud.google.com/go v0.54.0 h1:3ithwDMr7/3vpAMXiH+ZQnYbuIsh+OPhUPMFC9enmn0=
|
||||
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.60.0 h1:R+tDlceO7Ss+zyvtsdhTxacDyZ1k99xwskQ4FT7ruoM=
|
||||
cloud.google.com/go v0.60.0/go.mod h1:yw2G51M9IfRboUH61Us8GqCeF1PzPblB823Mn2q2eAU=
|
||||
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/firestore v1.1.0/go.mod h1:ulACoGHTpvq5r8rxGJ4ddJZBZqakUQqClKRT5SZwBmk=
|
||||
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/pubsub v1.5.0/go.mod h1:ZEwJccE3z93Z2HWvstpri00jOg7oO4UZDtKhwDwqF0w=
|
||||
cloud.google.com/go/spanner v1.7.0/go.mod h1:sd3K2gZ9Fd0vMPLXzeCrF6fq4i63Q7aTLW/lBIfBkIk=
|
||||
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=
|
||||
contrib.go.opencensus.io/exporter/stackdriver v0.13.4/go.mod h1:aXENhDJ1Y4lIg4EUaVTwzvYETVNZk10Pu26tevFKLUc=
|
||||
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
|
||||
github.com/AaronO/go-git-http v0.0.0-20161214145340-1d9485b3a98f/go.mod h1:+6Yuq73F9068Na+mSBNXCvyuxvgw4f/g5ii40e3U8Sc=
|
||||
github.com/AlecAivazis/survey/v2 v2.0.5/go.mod h1:WYBhg6f0y/fNYUuesWQc0PKbJcEliGcYHB9sNT3Bg74=
|
||||
@@ -48,13 +61,19 @@ github.com/Azure/go-autorest/logger v0.2.0 h1:e4RVHVZKC5p6UANLJHkM4OfR1UKZPj8Wt8
|
||||
github.com/Azure/go-autorest/logger v0.2.0/go.mod h1:T9E3cAhj2VqvPOtCYAvby9aBXkZmbF5NWuPV8+WeEW8=
|
||||
github.com/Azure/go-autorest/tracing v0.6.0 h1:TYi4+3m5t6K48TGI9AUdb+IzbnSxvnvUMfuitfgcfuo=
|
||||
github.com/Azure/go-autorest/tracing v0.6.0/go.mod h1:+vhtPC754Xsa23ID7GlGsrdKBpUA79WCAKPPZVC2DeU=
|
||||
github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ=
|
||||
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/DataDog/zstd v1.4.0/go.mod h1:1jcaCB/ufaK+sKp1NBhlGmpz41jOoPQ35bpF36t7BBo=
|
||||
github.com/MakeNowJust/heredoc v0.0.0-20170808103936-bb23615498cd h1:sjQovDkwrZp8u+gxLtPgKGjk5hCxuy2hrRejBTA9xFU=
|
||||
github.com/MakeNowJust/heredoc v0.0.0-20170808103936-bb23615498cd/go.mod h1:64YHyfSL2R96J44Nlwm39UHepQbyR5q10x7iYa1ks2E=
|
||||
github.com/Masterminds/goutils v1.1.0/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU=
|
||||
github.com/Masterminds/semver v1.4.2/go.mod h1:MB6lktGJrhw8PrUyiEoblNEGEQ+RzHPF078ddwwvV3Y=
|
||||
github.com/Masterminds/semver v1.5.0 h1:H65muMkzWKEuNDnfl9d70GUjFniHKHRbFPGBuZ3QEww=
|
||||
github.com/Masterminds/semver v1.5.0/go.mod h1:MB6lktGJrhw8PrUyiEoblNEGEQ+RzHPF078ddwwvV3Y=
|
||||
github.com/Masterminds/semver/v3 v3.0.3/go.mod h1:VPu/7SZ7ePZ3QOrcuXROw5FAcLl4a0cBrbBpGY/8hQs=
|
||||
github.com/Masterminds/sprig v2.15.0+incompatible/go.mod h1:y6hNFY5UBTIWBxnzTeuNhlNS5hqE0NB0E6fgfo2Br3o=
|
||||
github.com/Masterminds/sprig v2.22.0+incompatible/go.mod h1:y6hNFY5UBTIWBxnzTeuNhlNS5hqE0NB0E6fgfo2Br3o=
|
||||
github.com/Masterminds/sprig/v3 v3.0.2/go.mod h1:oesJ8kPONMONaZgtiHNzUShJbksypC5kWczhZAf6+aU=
|
||||
github.com/Masterminds/vcs v1.13.1/go.mod h1:N09YCmOQr6RLxC6UNHzuVwAdodYbbnycGHSmwVJjcKA=
|
||||
github.com/Microsoft/go-winio v0.4.11/go.mod h1:VhR8bwka0BXejwEJY73c50VrPtXAaKcyvVC4A4RozmA=
|
||||
@@ -97,6 +116,7 @@ github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo
|
||||
github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239 h1:kFOfPq6dUM1hTo4JG6LR5AXSUEsOjtdm0kw0FtQtMJA=
|
||||
github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239/go.mod h1:2FmKhYUyUczH0OGQWaF5ceTx0UBShxjsH6f8oGKYe2c=
|
||||
github.com/antihax/optional v0.0.0-20180407024304-ca021399b1a6/go.mod h1:V8iCPQYkqmusNa815XgQio277wI47sdRh1dUOLdyC6Q=
|
||||
github.com/aokoli/goutils v1.0.1/go.mod h1:SijmP0QR8LtwsmDs8Yii5Z/S4trXFGFC2oO5g9DP+DQ=
|
||||
github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ=
|
||||
github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o=
|
||||
github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8=
|
||||
@@ -109,7 +129,10 @@ github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:l
|
||||
github.com/asaskevich/govalidator v0.0.0-20200108200545-475eaeb16496/go.mod h1:oGkLhpf+kjZl6xBf758TQhh5XrAeiJv/7FRz/2spLIg=
|
||||
github.com/aws/aws-sdk-go v1.15.11/go.mod h1:mFuSZ37Z9YOHbQEwBWztmVzqXrEkub65tZoCYDt7FT0=
|
||||
github.com/aws/aws-sdk-go v1.17.7/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo=
|
||||
github.com/aws/aws-sdk-go v1.23.20/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo=
|
||||
github.com/aws/aws-sdk-go v1.25.37/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo=
|
||||
github.com/aws/aws-sdk-go v1.35.24/go.mod h1:tlPOdRjfxPBpNIwqDj61rmsnA85v9jc0Ps9+muhnW+k=
|
||||
github.com/aws/aws-sdk-go v1.36.30/go.mod h1:hcU610XS61/+aQV88ixoOzUoG7v3b31pl2zKMmprdro=
|
||||
github.com/beorn7/perks v0.0.0-20160804104726-4c0e84591b9a/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q=
|
||||
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=
|
||||
@@ -186,10 +209,12 @@ github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3Ee
|
||||
github.com/coreos/go-systemd v0.0.0-20180511133405-39ca1b05acc7/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4=
|
||||
github.com/coreos/go-systemd v0.0.0-20181012123002-c6f51f82210d/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4=
|
||||
github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4=
|
||||
github.com/coreos/go-systemd v0.0.0-20190620071333-e64a0ec8b42a/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4=
|
||||
github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA=
|
||||
github.com/coreos/pkg v0.0.0-20180108230652-97fdf19511ea/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA=
|
||||
github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA=
|
||||
github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE=
|
||||
github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
|
||||
github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
|
||||
github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY=
|
||||
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
|
||||
@@ -207,6 +232,7 @@ github.com/cznic/zappy v0.0.0-20160723133515-2533cb5b45cc/go.mod h1:Y1SNZ4dRUOKX
|
||||
github.com/danieljoos/wincred v1.1.0 h1:3RNcEpBg4IhIChZdFRSdlQt1QjCp1sMAPIrOnm7Yf8g=
|
||||
github.com/danieljoos/wincred v1.1.0/go.mod h1:XYlo+eRTsVA9aHGp7NGjFkPla4m+DCL7hqDjlFjiygg=
|
||||
github.com/davecgh/go-spew v0.0.0-20151105211317-5215b55f46b2/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/davecgh/go-spew v0.0.0-20161028175848-04cdfd42973b/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
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=
|
||||
@@ -269,6 +295,8 @@ github.com/elazarl/goproxy v0.0.0-20190911111923-ecfe977594f1 h1:yY9rWGoXv1U5pl4
|
||||
github.com/elazarl/goproxy v0.0.0-20190911111923-ecfe977594f1/go.mod h1:Ro8st/ElPeALwNFlcTpWmkr6IoMFfkjXAvTHpevnDsM=
|
||||
github.com/elazarl/goproxy/ext v0.0.0-20190711103511-473e67f1d7d2 h1:dWB6v3RcOy03t/bUadywsbyrQwCqZeNIEX6M1OtSZOM=
|
||||
github.com/elazarl/goproxy/ext v0.0.0-20190711103511-473e67f1d7d2/go.mod h1:gNh8nYJoAm43RfaxurUnxr+N1PwuFV3ZMl/efxlIlY8=
|
||||
github.com/emicklei/dot v0.15.0 h1:XDBW0Xco1QNyRb33cqLe10cT04yMWL1XpCZfa98Q6Og=
|
||||
github.com/emicklei/dot v0.15.0/go.mod h1:DeV7GvQtIw4h2u73RKBkkFdvVAz0D9fzeJrgPW6gy/s=
|
||||
github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs=
|
||||
github.com/emicklei/go-restful v2.9.5+incompatible h1:spTtZBk5DYEvbxMVutUuTyh1Ao2r4iyvLdACqsl/Ljk=
|
||||
github.com/emicklei/go-restful v2.9.5+incompatible/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs=
|
||||
@@ -277,6 +305,7 @@ github.com/emirpasic/gods v1.12.0/go.mod h1:YfzfFFoVP/catgzJb4IKIqXjX78Ha8FMSDh3
|
||||
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/protoc-gen-validate v0.0.14/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
|
||||
github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
|
||||
github.com/evanphx/json-patch v4.2.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk=
|
||||
github.com/evanphx/json-patch v4.5.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk=
|
||||
@@ -289,15 +318,20 @@ github.com/fatih/camelcase v1.0.0/go.mod h1:yN2Sb0lFhZJUdVvtELVWefmrXpuZESvPmqwo
|
||||
github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4=
|
||||
github.com/fatih/color v1.9.0 h1:8xPHl4/q1VyqGIPif1F+1V3Y3lSmrq01EabUW3CoW5s=
|
||||
github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU=
|
||||
github.com/fatih/color v1.10.0 h1:s36xzo75JdqLaaWoiEHk767eHiwo0598uUxyfiPkDsg=
|
||||
github.com/fatih/color v1.10.0/go.mod h1:ELkj/draVOlAH/xkhN6mQ50Qd0MPOk5AAr3maGEBuJM=
|
||||
github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568 h1:BHsljHzVlRcyQhjrss6TZTdY2VfCqZPbv5k3iBFa2ZQ=
|
||||
github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI435gkrCt3MPfRiAkVrwSbHsst4LCFVfpJc=
|
||||
github.com/form3tech-oss/jwt-go v3.2.2+incompatible h1:TcekIExNqud5crz4xD2pavyTgWiPvpYe4Xau31I0PRk=
|
||||
github.com/form3tech-oss/jwt-go v3.2.2+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k=
|
||||
github.com/frapposelli/wwhrd v0.4.0 h1:Vn4hjT/tHNeOnTxFBO0ys1NBH8/Inxqqi1Q0eJmCImo=
|
||||
github.com/frapposelli/wwhrd v0.4.0/go.mod h1:Bzwvr3hY1yoBsBbIMkckeHUI6jf1cLRueaaMxZ3N9FY=
|
||||
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
|
||||
github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4=
|
||||
github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ=
|
||||
github.com/fsouza/fake-gcs-server v1.7.0/go.mod h1:5XIRs4YvwNbNoz+1JF8j6KLAyDh7RHGAyAK3EP2EsNk=
|
||||
github.com/fsouza/go-dockerclient v0.0.0-20171004212419-da3951ba2e9e/go.mod h1:KpcjM623fQYE9MZiTGzKhjfxXAV9wbyX2C1cyRHfhl0=
|
||||
github.com/fullstorydev/grpcurl v1.6.0/go.mod h1:ZQ+ayqbKMJNhzLmbpCiurTVlaK2M/3nqZCxaQ2Ze/sM=
|
||||
github.com/fvbommel/sortorder v1.0.1/go.mod h1:uk88iVf1ovNn1iLfgUVU2F9o5eO30ui720w+kxuqRs0=
|
||||
github.com/garyburd/redigo v0.0.0-20150301180006-535138d7bcd7/go.mod h1:NR3MbYisc3/PwhQ00EMzDiPmrwpPxAn5GI05/YaO1SY=
|
||||
github.com/garyburd/redigo v1.6.0 h1:0VruCpn7yAIIu7pWVClQC8wxCJEcG3nyzpMSHKi1PQc=
|
||||
@@ -383,8 +417,12 @@ github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh
|
||||
github.com/go-openapi/validate v0.18.0/go.mod h1:Uh4HdOzKt19xGIGm1qHf/ofbX1YQ4Y+MYsct2VUrAJ4=
|
||||
github.com/go-openapi/validate v0.19.2/go.mod h1:1tRCw7m3jtI8eNWEEliiAqUIcBztB2KDnRCRMUi7GTA=
|
||||
github.com/go-openapi/validate v0.19.5/go.mod h1:8DJv2CVJQ6kGNpFW6eV9N3JviE1C85nY1c2z52x1Gk4=
|
||||
github.com/go-redis/redis v6.15.8+incompatible/go.mod h1:NAIEuMOZ/fxfXJIrKDQDz8wamY7mA7PouImQ2Jvg6kA=
|
||||
github.com/go-sql-driver/mysql v1.4.1/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w=
|
||||
github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg=
|
||||
github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY=
|
||||
github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0 h1:p104kn46Q8WdvHunIJ9dAyjPVtrBPhSr3KT2yUst43I=
|
||||
github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE=
|
||||
github.com/gobuffalo/flect v0.2.0/go.mod h1:W3K3X9ksuZfir8f/LrfVtWmCDQFfayuylOJ7sz/Fj80=
|
||||
github.com/gobwas/glob v0.2.3 h1:A4xDbljILXROh+kObIiy5kIaPYD8e96x1tgBhUI5J+Y=
|
||||
github.com/gobwas/glob v0.2.3/go.mod h1:d3Ez4x06l9bZtSvzIay5+Yzi0fmZzPgnTbPcKjJAkT8=
|
||||
@@ -401,6 +439,7 @@ github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7a
|
||||
github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
|
||||
github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4=
|
||||
github.com/gogo/protobuf v1.2.2-0.20190723190241-65acae22fc9d/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o=
|
||||
github.com/gogo/protobuf v1.3.0/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o=
|
||||
github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o=
|
||||
github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=
|
||||
github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q=
|
||||
@@ -417,14 +456,18 @@ github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfb
|
||||
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/mock v1.5.0 h1:jlYHihg//f7RRwuPfptm04yp4s7O6Kw8EZiVYIGcH0g=
|
||||
github.com/golang/mock v1.5.0/go.mod h1:CWnOUgYIOo4TcNZ0wHX3YZCqsaM1I1Jvs6v3mP3KVu8=
|
||||
github.com/golang/protobuf v0.0.0-20161109072736-4bd1920723d7/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
|
||||
github.com/golang/protobuf v1.1.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
|
||||
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=
|
||||
@@ -453,6 +496,8 @@ github.com/gonum/stat v0.0.0-20181125101827-41a0da705a5b/go.mod h1:Z4GIJBJO3Wa4g
|
||||
github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
|
||||
github.com/google/btree v1.0.0 h1:0udJVsspx3VBr5FwtLhQQtuAsVc79tTq0ocGIPAU6qo=
|
||||
github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
|
||||
github.com/google/certificate-transparency-go v1.0.21/go.mod h1:QeJfpSbVSfYc7RgB3gJFj9cbuQMMchQxrWXz8Ruopmg=
|
||||
github.com/google/certificate-transparency-go v1.1.1/go.mod h1:FDKqPvSXawb2ecErVRrD+nfy23RCzyl7eqVCEmlT1Zs=
|
||||
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=
|
||||
@@ -460,6 +505,8 @@ github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/
|
||||
github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||
github.com/google/go-cmp v0.5.2 h1:X2ev0eStA3AbceY54o37/0PQ/UWqKEiiO2dKL5OPaFM=
|
||||
github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||
github.com/google/go-cmp v0.5.4 h1:L8R9j+yAqZuZjsqh/z+F1NCffTKKLShY6zXTItVIZ8M=
|
||||
github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||
github.com/google/go-github v17.0.0+incompatible/go.mod h1:zLgOLi98H3fifZn+44m+umXrS52loVEgC2AApnigrVQ=
|
||||
github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck=
|
||||
github.com/google/gofuzz v0.0.0-20161122191042-44d81051d367/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI=
|
||||
@@ -467,13 +514,19 @@ github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/
|
||||
github.com/google/gofuzz v1.1.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
|
||||
github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0=
|
||||
github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
|
||||
github.com/google/licensecheck v0.3.1 h1:QoxgoDkaeC4nFrtGN1jV7IPmDCHFNIVh54e5hSt6sPs=
|
||||
github.com/google/licensecheck v0.3.1/go.mod h1:ORkR35t/JjW+emNKtfJDII0zlciG9JgbT7SmsohlHmY=
|
||||
github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs=
|
||||
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-20200507031123-427632fa3b1c/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM=
|
||||
github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI=
|
||||
github.com/google/trillian v1.3.11/go.mod h1:0tPraVHrSDkA3BO6vKX67zgLXs6SsOAbHEivX+9mPgw=
|
||||
github.com/google/uuid v0.0.0-20161128191214-064e2069ce9c/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
||||
github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
||||
github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
||||
github.com/google/uuid v1.1.2 h1:EVhdT+1Kseyi1/pUmXKaFxYsDNy9RQYkMWRH68J/W7Y=
|
||||
@@ -486,7 +539,12 @@ github.com/googleapis/gnostic v0.2.0/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTV
|
||||
github.com/googleapis/gnostic v0.3.1/go.mod h1:on+2t9HRStVgn95RSsFWFz+6Q0Snyqv1awfrALZdbtU=
|
||||
github.com/googleapis/gnostic v0.4.1 h1:DLJCy1n/vrD4HPjOvYcT8aYQXpPIzoRZONaYwyycI+I=
|
||||
github.com/googleapis/gnostic v0.4.1/go.mod h1:LRhVm6pbyptWbWbuZ38d1eyptfvIytN3ir6b65WBswg=
|
||||
github.com/gookit/color v1.4.2 h1:tXy44JFSFkKnELV6WaMo/lLfu/meqITX3iAV52do7lk=
|
||||
github.com/gookit/color v1.4.2/go.mod h1:fqRyamkC1W8uxl+lxCQxOT09l/vYfZ+QeiX3rKQHCoQ=
|
||||
github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1 h1:EGx4pi6eqNxGaHF6qqu48+N2wcFQ5qg5FXgOdqsJ5d8=
|
||||
github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY=
|
||||
github.com/gordonklaus/ineffassign v0.0.0-20200309095847-7953dde2c7bf/go.mod h1:cuNKsD1zp2v6XfE/orVX2QE1LC+i254ceGcVeDT3pTU=
|
||||
github.com/gorhill/cronexpr v0.0.0-20180427100037-88b0669f7d75/go.mod h1:g2644b03hfBX9Ov0ZBDgXXens4rxSxmqFBbhvKv2yVA=
|
||||
github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg=
|
||||
github.com/gorilla/handlers v0.0.0-20150720190736-60c7bfde3e33/go.mod h1:Qkdc/uu4tH4g6mTK6auzZ766c4CA0Ng8+o/OAirnOIQ=
|
||||
github.com/gorilla/handlers v1.4.2 h1:0QniY0USkHQ1RGCLfKxeNHK9bkDHGRYGNDFBCS+YARg=
|
||||
@@ -498,19 +556,26 @@ github.com/gorilla/mux v1.7.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2z
|
||||
github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs=
|
||||
github.com/gorilla/mux v1.7.4 h1:VuZ8uybHlWmqV03+zRzdwKL4tUnIp1MAQtp1mIFE1bc=
|
||||
github.com/gorilla/mux v1.7.4/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So=
|
||||
github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI=
|
||||
github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So=
|
||||
github.com/gorilla/websocket v0.0.0-20170926233335-4201258b820c/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ=
|
||||
github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ=
|
||||
github.com/gorilla/websocket v1.4.1/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
|
||||
github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
|
||||
github.com/gosuri/uitable v0.0.4/go.mod h1:tKR86bXuXPZazfOTG1FIzvjIdXzd0mo4Vtn16vt0PJo=
|
||||
github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7 h1:pdN6V1QBWetyv/0+wjACpqVH+eVULgEjkurDLq3goeM=
|
||||
github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA=
|
||||
github.com/gregjones/httpcache v0.0.0-20190611155906-901d90724c79 h1:+ngKgrYPPJrOjhax5N+uePQ0Fh1Z7PheYoUI/0nzkPA=
|
||||
github.com/gregjones/httpcache v0.0.0-20190611155906-901d90724c79/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA=
|
||||
github.com/grpc-ecosystem/go-grpc-middleware v0.0.0-20190222133341-cfaf5686ec79/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs=
|
||||
github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs=
|
||||
github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs=
|
||||
github.com/grpc-ecosystem/go-grpc-middleware v1.2.2/go.mod h1:EaizFBKfUKtMIF5iaDEhniwNedqGo9FuLFzppDr3uwI=
|
||||
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk=
|
||||
github.com/grpc-ecosystem/grpc-gateway v1.3.0/go.mod h1:RSKVYQBd5MCa4OVpNdGskqpgL2+G+NZTnrVHpWWfpdw=
|
||||
github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY=
|
||||
github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY=
|
||||
github.com/grpc-ecosystem/grpc-gateway v1.12.1/go.mod h1:8XEsbTttt/W+VvjtQhLACqCisSPWTxCZ7sBRjU6iH9c=
|
||||
github.com/grpc-ecosystem/grpc-health-probe v0.2.1-0.20181220223928-2bf0a5b182db/go.mod h1:uBKkC2RbarFsvS5jMJHpVhTLvGlGQj9JJwkaePE3FWI=
|
||||
github.com/grpc-ecosystem/grpc-health-probe v0.3.2/go.mod h1:izVOQ4RWbjUR6lm4nn+VLJyQ+FyaiGmprEYgI04Gs7U=
|
||||
github.com/hailocab/go-hostpool v0.0.0-20160125115350-e80d13ce29ed/go.mod h1:tMWxXQ9wFIaZeTI9F+hmhFiGpFmhOHzyShyFUhRm0H4=
|
||||
@@ -526,6 +591,8 @@ github.com/hashicorp/go-multierror v0.0.0-20161216184304-ed905158d874/go.mod h1:
|
||||
github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk=
|
||||
github.com/hashicorp/go-multierror v1.1.0 h1:B9UzwGQJehnUY1yNrnwREHc3fGbC2xefo8g4TbElacI=
|
||||
github.com/hashicorp/go-multierror v1.1.0/go.mod h1:spPvp8C1qA32ftKqdAHm4hHTbPw+vmowP0z+KUhOZdA=
|
||||
github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo=
|
||||
github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM=
|
||||
github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU=
|
||||
github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU=
|
||||
github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4=
|
||||
@@ -536,6 +603,7 @@ github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ
|
||||
github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
|
||||
github.com/hashicorp/golang-lru v0.5.4 h1:YDjusn29QI/Das2iO9M0BHnIbxPeyuCHsjMW+lJfyTc=
|
||||
github.com/hashicorp/golang-lru v0.5.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4=
|
||||
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/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64=
|
||||
github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ=
|
||||
@@ -546,8 +614,10 @@ github.com/hinshun/vt10x v0.0.0-20180809195222-d55458df857c h1:kp3AxgXgDOmIJFR7b
|
||||
github.com/hinshun/vt10x v0.0.0-20180809195222-d55458df857c/go.mod h1:DqJ97dSdRW1W22yXSB90986pcOyQ7r45iio1KN2ez1A=
|
||||
github.com/hokaccha/go-prettyjson v0.0.0-20190818114111-108c894c2c0e/go.mod h1:pFlLw2CfqZiIBOx6BuCeRLCrfxBJipTY0nIOF/VbGcI=
|
||||
github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
|
||||
github.com/huandu/xstrings v1.0.0/go.mod h1:4qWG/gcEcfX4z/mBDHJ++3ReCw9ibxbsNJbcucJdbSo=
|
||||
github.com/huandu/xstrings v1.2.0/go.mod h1:DvyZB1rfVYsBIigL8HwpZgxHwXozlTgGqn63UyNX5k4=
|
||||
github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
|
||||
github.com/imdario/mergo v0.3.4/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA=
|
||||
github.com/imdario/mergo v0.3.5/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA=
|
||||
github.com/imdario/mergo v0.3.6/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA=
|
||||
github.com/imdario/mergo v0.3.7/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA=
|
||||
@@ -566,7 +636,9 @@ github.com/jackc/pgx v3.2.0+incompatible/go.mod h1:0ZGrqGqkRlliWnWB4zKnWtjbSWbGk
|
||||
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 h1:BQSFePA1RWJOlocH6Fxy8MmwDt+yVQYULKfN0RoTN8A=
|
||||
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99/go.mod h1:1lJo3i6rXxKeerYnT8Nvf0QmHCRC1n8sfWVwXF2Frvo=
|
||||
github.com/jehiah/go-strftime v0.0.0-20171201141054-1d33003b3869/go.mod h1:cJ6Cj7dQo+O6GJNiMx+Pa94qKj+TG8ONdKHgMNIyyag=
|
||||
github.com/jessevdk/go-flags v1.4.0 h1:4IU2WS7AumrZ/40jfhf4QVDMsQwqA7VEHozFRrGARJA=
|
||||
github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI=
|
||||
github.com/jhump/protoreflect v1.6.1/go.mod h1:RZQ/lnuN+zqeRVpQigTwO6o0AJUkxbnSnpuG7toUTG4=
|
||||
github.com/jmespath/go-jmespath v0.0.0-20160202185014-0b12d6b521d8/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k=
|
||||
github.com/jmespath/go-jmespath v0.0.0-20160803190731-bd40a432e4c7/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k=
|
||||
github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k=
|
||||
@@ -574,6 +646,7 @@ github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHW
|
||||
github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U=
|
||||
github.com/joefitzgerald/rainbow-reporter v0.1.0/go.mod h1:481CNgqmVHQZzdIbN52CupLJyoVwB10FQ/IQlF1pdL8=
|
||||
github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo=
|
||||
github.com/jonboulle/clockwork v0.2.0/go.mod h1:Pkfl5aHPm1nk2H9h0bjmnJD/BcgbGXUBGnn1kMkgxc8=
|
||||
github.com/json-iterator/go v0.0.0-20180612202835-f2b4162afba3/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU=
|
||||
github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU=
|
||||
github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
|
||||
@@ -582,8 +655,11 @@ github.com/json-iterator/go v1.1.10 h1:Kz6Cvnvv2wGdaG/V8yMvfkmNiXq9Ya2KUv4rouJJr
|
||||
github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
|
||||
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/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo=
|
||||
github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU=
|
||||
github.com/juju/ratelimit v1.0.1/go.mod h1:qapgC/Gy+xNh9UxzV13HGGl/6UXNN+ct+vwSgWNm/qk=
|
||||
github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w=
|
||||
github.com/k0kubun/colorstring v0.0.0-20150214042306-9440f1994b88/go.mod h1:3w7q1U84EfirKl04SVQ/s7nPm1ZPhiXd34z40TNz36k=
|
||||
github.com/kardianos/osext v0.0.0-20190222173326-2bc1f35cddc0 h1:iQTw/8FWTuc7uiaSepXwyf3o52HaUYcV+Tu66S3F5GA=
|
||||
github.com/kardianos/osext v0.0.0-20190222173326-2bc1f35cddc0/go.mod h1:1NbS8ALrpOvjt0rHPNLyCIeMtbizbir8U//inJ+zuB8=
|
||||
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 h1:Z9n2FFNUXsshfwJMBgNA0RU6/i7WVaAegv3PtuIHPMs=
|
||||
@@ -593,6 +669,7 @@ github.com/kevinburke/ssh_config v0.0.0-20190725054713-01f96b0aa0cd/go.mod h1:CT
|
||||
github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q=
|
||||
github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00=
|
||||
github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8=
|
||||
github.com/kisielk/gotool v1.0.0 h1:AV2c/EiW3KqPNT9ZKl07ehoAGi4C5/01Cfbblndcapg=
|
||||
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
|
||||
github.com/klauspost/compress v1.7.2/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A=
|
||||
github.com/klauspost/cpuid v1.2.1/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek=
|
||||
@@ -618,13 +695,19 @@ github.com/kubernetes-sigs/service-catalog v0.3.1 h1:jgE7b16OqBjxG3BScxqQYl5zkx7
|
||||
github.com/kubernetes-sigs/service-catalog v0.3.1/go.mod h1:MUAf+rdT06kiNpLXRAIqtPHC3Kgkw63YziVj1VMu3HM=
|
||||
github.com/kylelemons/godebug v0.0.0-20170820004349-d65d576e9348 h1:MtvEpTB6LX3vkb4ax0b5D2DHbNAUsen0Gx5wZoq3lV4=
|
||||
github.com/kylelemons/godebug v0.0.0-20170820004349-d65d576e9348/go.mod h1:B69LEHPfb2qLo0BaaOLcbitczOKLWTsrBG9LczfCD4k=
|
||||
github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc=
|
||||
github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw=
|
||||
github.com/lestrrat-go/envload v0.0.0-20180220234015-a3eb8ddeffcc/go.mod h1:kopuH9ugFRkIXf3YoqHKyrJ9YfUFsckUU9S7B+XP+is=
|
||||
github.com/lestrrat-go/strftime v1.0.1/go.mod h1:E1nN3pCbtMSu1yjSVeyuRFVm/U0xoR76fd03sz+Qz4g=
|
||||
github.com/letsencrypt/pkcs11key/v4 v4.0.0/go.mod h1:EFUvBDay26dErnNb70Nd0/VW3tJiIbETBPTl9ATXQag=
|
||||
github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
|
||||
github.com/lib/pq v1.8.0/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o=
|
||||
github.com/lib/pq v1.9.0/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o=
|
||||
github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de h1:9TO3cAIGXtEhnIaL+V+BEER86oLrvS+kWobKpbJuye0=
|
||||
github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de/go.mod h1:zAbeS9B/r2mtpb6U+EI2rYA5OAXxsYw6wTamcNW+zcE=
|
||||
github.com/lithammer/dedent v1.1.0/go.mod h1:jrXYCQtgg0nJiN+StA2KgR7w6CiQNv9Fd/Z9BP0jIOc=
|
||||
github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ=
|
||||
github.com/magiconair/properties v1.8.1 h1:ZC2Vc7/ZFkGmsVC9KvOjumD+G5lXy2RtTKyzRKO2BQ4=
|
||||
github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ=
|
||||
github.com/mailru/easyjson v0.0.0-20160728113105-d5b7844b561a/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
|
||||
github.com/mailru/easyjson v0.0.0-20180823135443-60711f1a8329/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
|
||||
@@ -639,14 +722,19 @@ github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVc
|
||||
github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE=
|
||||
github.com/mattn/go-colorable v0.1.6 h1:6Su7aK7lXmJ/U79bYtBjLNaha4Fs1Rg9plHpcH+vvnE=
|
||||
github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc=
|
||||
github.com/mattn/go-colorable v0.1.8 h1:c1ghPdyEDarC70ftn0y+A/Ee++9zz8ljHG1b13eJ0s8=
|
||||
github.com/mattn/go-colorable v0.1.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc=
|
||||
github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4=
|
||||
github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4=
|
||||
github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s=
|
||||
github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcMEpPG5Rm84=
|
||||
github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE=
|
||||
github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY=
|
||||
github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU=
|
||||
github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU=
|
||||
github.com/mattn/go-runewidth v0.0.3/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU=
|
||||
github.com/mattn/go-runewidth v0.0.4/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU=
|
||||
github.com/mattn/go-runewidth v0.0.6/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI=
|
||||
github.com/mattn/go-runewidth v0.0.9 h1:Lm995f3rfxdpd6TSmuVCHVb/QhupuXlYr8sCI/QdE+0=
|
||||
github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI=
|
||||
github.com/mattn/go-shellwords v1.0.5/go.mod h1:3xCvwCdWdlDJUrvuMn7Wuy9eWs4pE8vqg+NOMyg4B2o=
|
||||
@@ -660,6 +748,9 @@ github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b/go.mod h1:01TrycV0kFyex
|
||||
github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d h1:5PJl274Y63IEHC+7izoQE9x6ikvDFZS2mDVS3drnohI=
|
||||
github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d/go.mod h1:01TrycV0kFyexm33Z7vhZRXopbI8J3TDReVlkTgMUxE=
|
||||
github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg=
|
||||
github.com/miekg/dns v1.1.35/go.mod h1:KNUDUusw/aVsxyTYZM1oqvCicbwhgbNgztCETuNZ7xM=
|
||||
github.com/miekg/pkcs11 v1.0.2/go.mod h1:XsNlhZGX73bx86s2hdc/FuaLm2CPZJemRLMA+WTFxgs=
|
||||
github.com/miekg/pkcs11 v1.0.3/go.mod h1:XsNlhZGX73bx86s2hdc/FuaLm2CPZJemRLMA+WTFxgs=
|
||||
github.com/mikefarah/yaml/v2 v2.4.0/go.mod h1:ahVqZF4n1W4NqwvVnZzC4es67xsW9uR/RRf2RRxieJU=
|
||||
github.com/mikefarah/yq/v2 v2.4.1/go.mod h1:i8SYf1XdgUvY2OFwSqGAtWOOgimD2McJ6iutoxRm4k0=
|
||||
github.com/mistifyio/go-zfs v2.1.1+incompatible/go.mod h1:8AuVvqP/mXw1px98n46wfvcGfQ4ci2FwoAjKYxuo3Z4=
|
||||
@@ -675,6 +766,7 @@ github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS4
|
||||
github.com/mitchellh/hashstructure v1.0.0/go.mod h1:QjSHrPWS+BGUVBYkbTZWEnOh3G1DutKwClXU/ABz6AQ=
|
||||
github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY=
|
||||
github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y=
|
||||
github.com/mitchellh/mapstructure v1.1.2 h1:fmNYVwqnSfB9mZU6OS2O6GsXM+wcskZDuKQzvN1EDeE=
|
||||
github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y=
|
||||
github.com/mitchellh/osext v0.0.0-20151018003038-5e2d6d41470f/go.mod h1:OkQIRizQZAeMln+1tSwduZz7+Af5oFlKirV/MSYes2A=
|
||||
github.com/mitchellh/reflectwalk v1.0.0/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw=
|
||||
@@ -690,34 +782,50 @@ github.com/modern-go/reflect2 v0.0.0-20180320133207-05fbef0ca5da/go.mod h1:bx2lN
|
||||
github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
|
||||
github.com/modern-go/reflect2 v1.0.1 h1:9f412s+6RmYXLWZSEzVVgPGK7C2PphHj5RJrvfx9AWI=
|
||||
github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
|
||||
github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826/go.mod h1:TaXosZuwdSHYgviHp1DAtfrULt5eUgsSMsZf+YrPgl8=
|
||||
github.com/morikuni/aec v0.0.0-20170113033406-39771216ff4c/go.mod h1:BbKIizmSmc5MMPqRYbxO4ZU0S0+P200+tUnFx7PXmsc=
|
||||
github.com/morikuni/aec v1.0.0 h1:nP9CBfwrvYnBRgY6qfDQkygYDmYwOilePFkwzv4dU8A=
|
||||
github.com/morikuni/aec v1.0.0/go.mod h1:BbKIizmSmc5MMPqRYbxO4ZU0S0+P200+tUnFx7PXmsc=
|
||||
github.com/mozilla/scribe v0.0.0-20180711195314-fb71baf557c1/go.mod h1:FIczTrinKo8VaLxe6PWTPEXRXDIHz2QAwiaBaP5/4a8=
|
||||
github.com/mozilla/tls-observatory v0.0.0-20210209181001-cf43108d6880/go.mod h1:FUqVoUPHSEdDR0MnFM3Dh8AU0pZHLXUD127SAJGER/s=
|
||||
github.com/mtrmac/gpgme v0.1.2/go.mod h1:GYYHnGSuS7HK3zVS2n3y73y0okK/BeKzwnn5jgiVFNI=
|
||||
github.com/munnerz/goautoneg v0.0.0-20120707110453-a547fc61f48d/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ=
|
||||
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ=
|
||||
github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
|
||||
github.com/mwitkow/go-proto-validators v0.0.0-20180403085117-0950a7990007/go.mod h1:m2XC9Qq0AlmmVksL6FktJCdTYyLk7V3fKyp0sl1yWQo=
|
||||
github.com/mwitkow/go-proto-validators v0.2.0/go.mod h1:ZfA1hW+UH/2ZHOWvQ3HnQaU0DtnpXu850MZiy+YUgcc=
|
||||
github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw=
|
||||
github.com/nakagami/firebirdsql v0.0.0-20190310045651-3c02a58cfed8/go.mod h1:86wM1zFnC6/uDBfZGNwB65O+pR2OFi5q/YQaEUid1qA=
|
||||
github.com/nbutton23/zxcvbn-go v0.0.0-20210217022336-fa2cb2858354 h1:4kuARK6Y6FxaNu/BnU2OAaLF86eTVhP2hjTB6iMvItA=
|
||||
github.com/nbutton23/zxcvbn-go v0.0.0-20210217022336-fa2cb2858354/go.mod h1:KSVJerMDfblTH7p5MZaTt+8zaT2iEk3AkVb9PQdZuE8=
|
||||
github.com/ncw/swift v1.0.47/go.mod h1:23YIA4yWVnGwv2dQlN4bB7egfYX6YLn0Yo/S6zZO/ZM=
|
||||
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs=
|
||||
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno=
|
||||
github.com/nishanths/predeclared v0.0.0-20190419143655-18a43bb90ffc/go.mod h1:62PewwiQTlm/7Rj+cxVYqZvDIUc+JjZq6GHAC1fsObQ=
|
||||
github.com/nxadm/tail v1.4.4 h1:DQuhQpB1tVlglWS2hLQ5OV6B5r8aGxSrPc5Qo6uTN78=
|
||||
github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A=
|
||||
github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE=
|
||||
github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU=
|
||||
github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U=
|
||||
github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo=
|
||||
github.com/olekukonko/tablewriter v0.0.1 h1:b3iUnf1v+ppJiOfNX4yxxqfWKMQPZR5yoh8urCTFX88=
|
||||
github.com/olekukonko/tablewriter v0.0.1/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo=
|
||||
github.com/olekukonko/tablewriter v0.0.2/go.mod h1:rSAaSIOAGT9odnlyGlUfAJaoc5w2fSBUmeGDbRWPxyQ=
|
||||
github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec=
|
||||
github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY=
|
||||
github.com/onsi/ginkgo v0.0.0-20170829012221-11459a886d9c/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
|
||||
github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
|
||||
github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
|
||||
github.com/onsi/ginkgo v1.8.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
|
||||
github.com/onsi/ginkgo v1.10.1/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
|
||||
github.com/onsi/ginkgo v1.10.3/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
|
||||
github.com/onsi/ginkgo v1.11.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
|
||||
github.com/onsi/ginkgo v1.12.0/go.mod h1:oUhWkIvk5aDxtKvDDuw8gItl8pKl42LzjC9KZE0HfGg=
|
||||
github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk=
|
||||
github.com/onsi/ginkgo v1.14.1 h1:jMU0WaQrP0a/YAEq8eJmJKjBoMs+pClEr1vDMlM/Do4=
|
||||
github.com/onsi/ginkgo v1.14.1/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY=
|
||||
github.com/onsi/ginkgo v1.16.1 h1:foqVmeWDD6yYpK+Yz3fHyNIxFYNxswxqNFjSKe+vI54=
|
||||
github.com/onsi/ginkgo v1.16.1/go.mod h1:CObGmKUOKaSC0RjmoAK7tKyn4Azo5P2IWuoMnvwxz1E=
|
||||
github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA=
|
||||
github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
|
||||
github.com/onsi/gomega v1.5.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
|
||||
@@ -728,6 +836,8 @@ github.com/onsi/gomega v1.9.0/go.mod h1:Ho0h+IUsWyvy1OpqCwxlQ/21gkhVunqlU8fDGcoT
|
||||
github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo=
|
||||
github.com/onsi/gomega v1.10.2 h1:aY/nuoWlKJud2J6U0E3NWsjlg+0GtwXxgEqthRdzlcs=
|
||||
github.com/onsi/gomega v1.10.2/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo=
|
||||
github.com/onsi/gomega v1.11.0 h1:+CqWgvj0OZycCaqclBD1pxKHAU+tOkHmQIWvDHq2aug=
|
||||
github.com/onsi/gomega v1.11.0/go.mod h1:azGKhqFUon9Vuj0YmTfLSmx0FUwqXYSTl5re8lQLTUg=
|
||||
github.com/opencontainers/go-digest v0.0.0-20170106003457-a6d0ee40d420/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s=
|
||||
github.com/opencontainers/go-digest v0.0.0-20180430190053-c9281466c8b2/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s=
|
||||
github.com/opencontainers/go-digest v1.0.0-rc1/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s=
|
||||
@@ -773,6 +883,7 @@ github.com/openshift/library-go v0.0.0-20210106214821-c4d0b9c8d55f h1:z/uvzHF8bK
|
||||
github.com/openshift/library-go v0.0.0-20210106214821-c4d0b9c8d55f/go.mod h1:udseDnqxn5ON8i+NBjDp00fBTK0JRu1/6Y6tf6EivDE=
|
||||
github.com/openshift/oc v0.0.0-alpha.0.0.20210325095525-2513fdbb36e2 h1:kOx9qE1klb6QDS/vBjMsaLU4BUdGNHf7Mr93QewQq4I=
|
||||
github.com/openshift/oc v0.0.0-alpha.0.0.20210325095525-2513fdbb36e2/go.mod h1:Wu2vgww8YV0VRPJ9pwoqgtpYBjoOiLncbvghi0/vaaA=
|
||||
github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o=
|
||||
github.com/openzipkin/zipkin-go v0.1.6/go.mod h1:QgAqvLzwWbR/WpD4A3cGpPtJrZXNIiJc5AZX7/PBEpw=
|
||||
github.com/operator-framework/api v0.1.1/go.mod h1:yzNYR7qyJqRGOOp+bT6Z/iYSbSPNxeh3Si93Gx/3OBY=
|
||||
github.com/operator-framework/api v0.3.7-0.20200602203552-431198de9fc2/go.mod h1:Xbje9x0SHmh0nihE21kpesB38vk3cyxnE6JdDS8Jo1Q=
|
||||
@@ -800,6 +911,7 @@ github.com/pbnjay/strptime v0.0.0-20140226051138-5c05b0d668c9/go.mod h1:6Hr+C/ol
|
||||
github.com/pborman/uuid v1.2.0 h1:J7Q5mO4ysT1dv8hyrUGHb9+ooztCXu1D8MY8DZYsu3g=
|
||||
github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k=
|
||||
github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic=
|
||||
github.com/pelletier/go-toml v1.6.0 h1:aetoXYr0Tv7xRU/V4B4IZJ2QcbtMUFoNb3ORp7TzIK4=
|
||||
github.com/pelletier/go-toml v1.6.0/go.mod h1:5N711Q9dKgbdkxHL+MEfF31hpT7l0S0s/t2kKREewys=
|
||||
github.com/peterbourgon/diskv v2.0.1+incompatible h1:UBdAOUP5p4RWqPBg048CAvpKN+vxiaj6gdUUzhl4XmI=
|
||||
github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU=
|
||||
@@ -862,14 +974,18 @@ github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4O
|
||||
github.com/prometheus/procfs v0.2.0 h1:wH4vA7pcjKuZzjF7lM8awk4fnuJO6idemZXoKnULUx4=
|
||||
github.com/prometheus/procfs v0.2.0/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU=
|
||||
github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU=
|
||||
github.com/pseudomuto/protoc-gen-doc v1.3.2/go.mod h1:y5+P6n3iGrbKG+9O04V5ld71in3v/bX88wUwgt+U8EA=
|
||||
github.com/pseudomuto/protokit v0.2.0/go.mod h1:2PdH30hxVHsup8KpBTOXTBeMVhJZVio3Q8ViKSAXT0Q=
|
||||
github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4=
|
||||
github.com/redhat-developer/service-binding-operator v0.7.1 h1:oFB0m3iHaFf8bRotao+shKx8BmbWPE4krGvgmJF1wjI=
|
||||
github.com/redhat-developer/service-binding-operator v0.7.1/go.mod h1:Z3fFouJGqy08JVWBFgb9ZyDcddcqx+AUIuMOeMFU8pQ=
|
||||
github.com/remyoudompheng/bigfft v0.0.0-20170806203942-52369c62f446/go.mod h1:uYEyJGbgTkfkS4+E/PavXkNJcbFIpEtjt2B0KDQ5+9M=
|
||||
github.com/robfig/cron v1.2.0/go.mod h1:JGuDeoQd7Z6yL4zQhZ3OPEVHB7fL6Ka6skscFHfmt2k=
|
||||
github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg=
|
||||
github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ=
|
||||
github.com/rogpeppe/go-charset v0.0.0-20180617210344-2471d30d28b4/go.mod h1:qgYeAmZ5ZIpBWTGllZSQnw97Dj+woV0toclVaRGI8pc=
|
||||
github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
|
||||
github.com/rs/cors v1.7.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU=
|
||||
github.com/russross/blackfriday v1.5.2 h1:HyvC0ARfnZBqnXwABFeSZHpKvJHJJfPz81GNueLj0oo=
|
||||
github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g=
|
||||
github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
|
||||
@@ -878,6 +994,8 @@ github.com/santhosh-tekuri/jsonschema v1.2.4/go.mod h1:TEAUOeZSmIxTTuHatJzrvARHi
|
||||
github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0=
|
||||
github.com/sclevine/spec v1.2.0/go.mod h1:W4J29eT/Kzv7/b9IWLB055Z+qvVC9vt0Arko24q7p+U=
|
||||
github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc=
|
||||
github.com/securego/gosec/v2 v2.8.0 h1:iHg9cVmHWf5n6/ijUJ4F10h5bKlNtvXmcWzRw0lxiKE=
|
||||
github.com/securego/gosec/v2 v2.8.0/go.mod h1:hJZ6NT5TqoY+jmOsaxAV4cXoEdrMRLVaNPnSpUCvCZs=
|
||||
github.com/segmentio/backo-go v0.0.0-20200129164019-23eae7c10bd3 h1:ZuhckGJ10ulaKkdvJtiAqsLTiPrLaXSdnVgXJKJkTxE=
|
||||
github.com/segmentio/backo-go v0.0.0-20200129164019-23eae7c10bd3/go.mod h1:9/Rh6yILuLysoQnZ2oNooD2g7aBnvM7r/fNVxRNWfBc=
|
||||
github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo=
|
||||
@@ -891,8 +1009,13 @@ github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMB
|
||||
github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE=
|
||||
github.com/sirupsen/logrus v1.6.0 h1:UBcNElsrwanuuMsnGSlYmtmgbb23qDR5dG+6X6Oo89I=
|
||||
github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88=
|
||||
github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0=
|
||||
github.com/sirupsen/logrus v1.8.1 h1:dJKuHgqk1NNQlqoA6BTlM1Wf9DOH3NBjQyu0h9+AZZE=
|
||||
github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0=
|
||||
github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d h1:zE9ykElWQ6/NYmHa3jpm/yHnI4xSofP+UP6SpjHcSeM=
|
||||
github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc=
|
||||
github.com/smartystreets/goconvey v0.0.0-20190330032615-68dc04aab96a/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA=
|
||||
github.com/smartystreets/goconvey v1.6.4 h1:fv0U8FUIMPNf1L9lnHLvLhgicrIVChEkdzIKYqbNC9s=
|
||||
github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA=
|
||||
github.com/soheilhy/cmux v0.1.3/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM=
|
||||
github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM=
|
||||
@@ -900,6 +1023,7 @@ github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasO
|
||||
github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ=
|
||||
github.com/spf13/afero v1.2.2 h1:5jhuqJyZCZf2JRofRvN/nIFgIWNzPa3/Vz8mYylgbWc=
|
||||
github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk=
|
||||
github.com/spf13/cast v1.3.0 h1:oget//CVOEoFewqQxwr0Ej5yjygnqGkvggSE/gB35Q8=
|
||||
github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE=
|
||||
github.com/spf13/cobra v0.0.2-0.20171109065643-2da4a54c5cee/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ=
|
||||
github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ=
|
||||
@@ -908,6 +1032,9 @@ github.com/spf13/cobra v0.0.6/go.mod h1:/6GTrnGXV9HjY+aR4k0oJ5tcvakLuG6EuKReYlHN
|
||||
github.com/spf13/cobra v1.0.0/go.mod h1:/6GTrnGXV9HjY+aR4k0oJ5tcvakLuG6EuKReYlHNrgE=
|
||||
github.com/spf13/cobra v1.1.1 h1:KfztREH0tPxJJ+geloSLaAkaPkr4ki2Er5quFV1TDo4=
|
||||
github.com/spf13/cobra v1.1.1/go.mod h1:WnodtKOvamDL/PwE2M4iKs8aMDBZ5Q5klgD3qfVJQMI=
|
||||
github.com/spf13/cobra v1.1.3 h1:xghbfqPkxzxP3C/f3n5DdpAbdKLj4ZE4BWQI362l53M=
|
||||
github.com/spf13/cobra v1.1.3/go.mod h1:pGADOWyqRD/YMrPZigI/zbliZ2wVD/23d+is3pSWzOo=
|
||||
github.com/spf13/jwalterweatherman v1.0.0 h1:XHEdyB+EcvlqZamSM4ZOMGlc93t6AcsBEu9Gc1vn7yk=
|
||||
github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo=
|
||||
github.com/spf13/pflag v0.0.0-20170130214245-9ff6c6923cff/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
|
||||
github.com/spf13/pflag v1.0.1-0.20171106142849-4c012f6dcd95/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
|
||||
@@ -918,12 +1045,15 @@ github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An
|
||||
github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s=
|
||||
github.com/spf13/viper v1.4.0/go.mod h1:PTJ7Z/lr49W6bUbkmS1V3by4uWynFiR9p7+dSq/yZzE=
|
||||
github.com/spf13/viper v1.7.0/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg=
|
||||
github.com/spf13/viper v1.7.1 h1:pM5oEahlgWv/WnHXpgbKz7iLIxRf65tye2Ci+XFK5sk=
|
||||
github.com/spf13/viper v1.7.1/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg=
|
||||
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.2.0 h1:Hbg2NidpLE8veEBkEZTL3CvlkUIVzuU9jDplZO54c48=
|
||||
github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE=
|
||||
github.com/stretchr/testify v0.0.0-20151208002404-e3a8ff8ce365/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
|
||||
github.com/stretchr/testify v0.0.0-20170130113145-4d4bfba8f1d1/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
|
||||
github.com/stretchr/testify v1.1.4/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
|
||||
github.com/stretchr/testify v1.2.1/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
|
||||
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
|
||||
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
|
||||
@@ -932,6 +1062,9 @@ github.com/stretchr/testify v1.5.0/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5
|
||||
github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA=
|
||||
github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0=
|
||||
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||
github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY=
|
||||
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||
github.com/subosito/gotenv v1.2.0 h1:Slr1R9HxAlEKefgq5jn9U+DnETlIUa6HfgEzj0g5d7s=
|
||||
github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw=
|
||||
github.com/syndtr/gocapability v0.0.0-20170704070218-db04d3cc01c8/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww=
|
||||
github.com/syndtr/gocapability v0.0.0-20180916011248-d98352740cb2/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww=
|
||||
@@ -947,12 +1080,16 @@ github.com/tidwall/pretty v1.1.0 h1:K3hMW5epkdAVwibsQEfR/7Zj0Qgt4DxtNumTq/VloO8=
|
||||
github.com/tidwall/pretty v1.1.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk=
|
||||
github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U=
|
||||
github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U=
|
||||
github.com/tmc/grpc-websocket-proxy v0.0.0-20200427203606-3cfed13b9966/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U=
|
||||
github.com/tomasen/realip v0.0.0-20180522021738-f0c99a92ddce/go.mod h1:o8v6yHRoik09Xen7gje4m9ERNah1d1PPsVq1VEx9vE4=
|
||||
github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc=
|
||||
github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0=
|
||||
github.com/urfave/cli v0.0.0-20171014202726-7bc6a0acffa5/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA=
|
||||
github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA=
|
||||
github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0=
|
||||
github.com/vbatts/tar-split v0.11.1/go.mod h1:LEuURwDEiWjRjwu46yU3KVGuUdVv/dcnpcEPSzR8z6g=
|
||||
github.com/vektah/gqlparser v1.1.2/go.mod h1:1ycwN7Ij5njmMkPPAOaRFY4rET2Enx7IkVv3vaXspKw=
|
||||
github.com/viki-org/dnscache v0.0.0-20130720023526-c70c1f23c5d8/go.mod h1:dniwbG03GafCjFohMDmz6Zc6oCuiqgH6tGNyXTkHzXE=
|
||||
github.com/vishvananda/netlink v1.0.0/go.mod h1:+SR5DhBJrl6ZM7CoCKvpw5BKroDKQ+PJqOg65H/2ktk=
|
||||
github.com/vishvananda/netns v0.0.0-20191106174202-0a2b9b5464df/go.mod h1:JP3t17pCcGlemwknint6hfoeCVQrEMVwxRLRjXpq+BU=
|
||||
github.com/vrischmann/envconfig v1.1.0/go.mod h1:c5DuUlkzfsnspy1g7qiqryPCsW+NjsrLsYq4zhwsoHo=
|
||||
@@ -973,11 +1110,19 @@ github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQ
|
||||
github.com/xiang90/probing v0.0.0-20160813154853-07dd2e8dfe18/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU=
|
||||
github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU=
|
||||
github.com/xlab/handysort v0.0.0-20150421192137-fb3537ed64a1/go.mod h1:QcJo0QPSfTONNIgpN5RA8prR7fF8nkF6cTWTcNerRO8=
|
||||
github.com/xo/terminfo v0.0.0-20210125001918-ca9a967f8778 h1:QldyIu/L63oPpyvQmHgvgickp1Yw510KJOqX7H24mg8=
|
||||
github.com/xo/terminfo v0.0.0-20210125001918-ca9a967f8778/go.mod h1:2MuV+tbUrU1zIOPMxZ5EncGwgmMJsa+9ucAQZXxsObs=
|
||||
github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q=
|
||||
github.com/xtgo/uuid v0.0.0-20140804021211-a0b114877d4c h1:3lbZUMbMiGUW/LMkfsEABsc5zNT9+b1CvsJx47JzJ8g=
|
||||
github.com/xtgo/uuid v0.0.0-20140804021211-a0b114877d4c/go.mod h1:UrdRz5enIKZ63MEE3IF9l2/ebyx59GyGgPi+tICQdmM=
|
||||
github.com/yudai/gojsondiff v1.0.0/go.mod h1:AY32+k2cwILAkW1fbgxQ5mUmMiZFgLIV+FBNExI05xg=
|
||||
github.com/yudai/golcs v0.0.0-20170316035057-ecda9a501e82/go.mod h1:lgjkn3NuSvDfVJdfcVVdX+jpBxNmX4rDAzaS45IcYoM=
|
||||
github.com/yudai/pp v2.0.1+incompatible/go.mod h1:PuxR/8QJ7cyCkFp/aUDS+JY727OFEZkTdatxwunjIkc=
|
||||
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.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k=
|
||||
github.com/yvasiyarov/go-metrics v0.0.0-20140926110328-57bccd1ccd43/go.mod h1:aX5oPXxHm3bOH+xeAttToC8pqch2ScQN/JoXYupl6xs=
|
||||
github.com/yvasiyarov/go-metrics v0.0.0-20150112132944-c25f46c4b940 h1:p7OofyZ509h8DmPLh8Hn+EIIZm/xYhdZHJ9GnXHdr6U=
|
||||
github.com/yvasiyarov/go-metrics v0.0.0-20150112132944-c25f46c4b940/go.mod h1:aX5oPXxHm3bOH+xeAttToC8pqch2ScQN/JoXYupl6xs=
|
||||
@@ -995,27 +1140,37 @@ go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU=
|
||||
go.etcd.io/bbolt v1.3.4/go.mod h1:G5EMThwa9y8QZGBClrRx5EY+Yw9kAhnjy3bSjsnlVTQ=
|
||||
go.etcd.io/bbolt v1.3.5/go.mod h1:G5EMThwa9y8QZGBClrRx5EY+Yw9kAhnjy3bSjsnlVTQ=
|
||||
go.etcd.io/etcd v0.0.0-20191023171146-3cf2f69b5738/go.mod h1:dnLIgRNXwCJa5e+c6mIZCrds/GIG4ncV9HhK5PX7jPg=
|
||||
go.etcd.io/etcd v0.0.0-20200513171258-e048e166ab9c/go.mod h1:xCI7ZzBfRuGgBXyXO6yfWfDmlWd35khcWpUa4L0xI/k=
|
||||
go.etcd.io/etcd v0.5.0-alpha.5.0.20200819165624-17cef6e3e9d5/go.mod h1:skWido08r9w6Lq/w70DO5XYIKMu4QFu1+4VsqLQuJy8=
|
||||
go.etcd.io/etcd v0.5.0-alpha.5.0.20200910180754-dd1b699fc489/go.mod h1:yVHk9ub3CSBatqGNg7GRmsnfLWtoW60w4eDYfh7vHDg=
|
||||
go.mongodb.org/mongo-driver v1.0.3/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM=
|
||||
go.mongodb.org/mongo-driver v1.1.0/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM=
|
||||
go.mongodb.org/mongo-driver v1.1.1/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM=
|
||||
go.mongodb.org/mongo-driver v1.1.2/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM=
|
||||
go.mozilla.org/mozlog v0.0.0-20170222151521-4bb13139d403/go.mod h1:jHoPAGnDrCy6kaI2tAze5Prf0Nr0w/oNkROt2lw3n3o=
|
||||
go.opencensus.io v0.20.1/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk=
|
||||
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 h1:8sGtKOrtQqkN1bp2AtX+misvLIlOmsEsNd+9NIcPEm8=
|
||||
go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
|
||||
go.opencensus.io v0.22.4 h1:LYy1Hy3MJdrCdMwwzxA/dRok4ejH+RwNGbuoD9fCjto=
|
||||
go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
|
||||
go.uber.org/atomic v0.0.0-20181018215023-8dc6146f7569/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE=
|
||||
go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE=
|
||||
go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE=
|
||||
go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ=
|
||||
go.uber.org/multierr v0.0.0-20180122172545-ddea229ff1df/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0=
|
||||
go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0=
|
||||
go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4=
|
||||
go.uber.org/multierr v1.4.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4=
|
||||
go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA=
|
||||
go.uber.org/zap v0.0.0-20180814183419-67bc79d13d15/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q=
|
||||
go.uber.org/zap v1.8.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q=
|
||||
go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q=
|
||||
go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM=
|
||||
golang.org/x/crypto v0.0.0-20171113213409-9f005a07e0d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
|
||||
golang.org/x/crypto v0.0.0-20180501155221-613d6eafa307/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
|
||||
golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
|
||||
golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
|
||||
golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
|
||||
@@ -1039,6 +1194,9 @@ golang.org/x/crypto v0.0.0-20200429183012-4b2356b1ed79/go.mod h1:LzIPMQfyMNhhGPh
|
||||
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
||||
golang.org/x/crypto v0.0.0-20201002170205-7f63de1d35b0 h1:hb9wdF1z5waM+dSIICn1l0DkLVDT3hqhhQsDNUmHPRE=
|
||||
golang.org/x/crypto v0.0.0-20201002170205-7f63de1d35b0/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
||||
golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I=
|
||||
golang.org/x/crypto v0.0.0-20210220033148-5ea612d1eb83 h1:/ZScEX8SfEmUGRHs0gxpqteO5nfNW6axyZbBdw9A12g=
|
||||
golang.org/x/crypto v0.0.0-20210220033148-5ea612d1eb83/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I=
|
||||
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
|
||||
golang.org/x/exp v0.0.0-20190125153040-c74c464bbbf2/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
|
||||
golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
|
||||
@@ -1052,6 +1210,7 @@ golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u0
|
||||
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/exp v0.0.0-20200331195152-e8c3332aa8e5/go.mod h1:4M0jN8W1tt0AVLNr8HDosyJCDCDuyL9N9+3m7wDWgKw=
|
||||
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=
|
||||
@@ -1072,6 +1231,9 @@ golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzB
|
||||
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.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
|
||||
golang.org/x/mod v0.4.2 h1:Gz96sIWK3OalVv/I/qNygP42zyoKp3xptRVCWRFEBvo=
|
||||
golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
|
||||
golang.org/x/net v0.0.0-20170114055629-f2499483f923/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
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=
|
||||
@@ -1101,6 +1263,8 @@ golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLL
|
||||
golang.org/x/net v0.0.0-20190812203447-cdfb69ac37fc/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
golang.org/x/net v0.0.0-20190923162816-aa69164e4478/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
golang.org/x/net v0.0.0-20191002035440-2ec189313ef0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
golang.org/x/net v0.0.0-20191004110552-13f9640d40b9/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
golang.org/x/net v0.0.0-20191021144547-ec77196f6094/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
golang.org/x/net v0.0.0-20191028085509-fe3aa8a45271/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
@@ -1111,12 +1275,21 @@ golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/go.mod h1:z5CRVTTTmAJ677TzLL
|
||||
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-20200421231249-e086a090c8fd/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-20200520004742-59133d7f0dd7/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-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
|
||||
golang.org/x/net v0.0.0-20201110031124-69a78807bb2b h1:uwuIcX0g4Yl1NC5XAz37xsr2lTtcqevgzYNVt49waME=
|
||||
golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
|
||||
golang.org/x/net v0.0.0-20201202161906-c7110b5ffcbb/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
|
||||
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
|
||||
golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4 h1:4nGaVu0QrbjT/AK2PRLuQfQuh6DJve+pELhqTdAj3x0=
|
||||
golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM=
|
||||
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
|
||||
golang.org/x/oauth2 v0.0.0-20181106182150-f42d05182288/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
|
||||
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
|
||||
@@ -1129,10 +1302,15 @@ golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJ
|
||||
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-20190412183630-56d357773e84/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 h1:SQFwaSi55rU7vdNs9Yr0Z324VNlrF+0wMqRXT4St8ck=
|
||||
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c h1:5KslGYwFpkhGh+Q16bwMP3cOontH8FOep7tGV86Y7SQ=
|
||||
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sys v0.0.0-20170830134202-bb24a47a89ea/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
@@ -1167,8 +1345,10 @@ golang.org/x/sys v0.0.0-20190801041406-cbf593c0f2f3/go.mod h1:h1NjWce9XRLGQEsW7w
|
||||
golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20190924154521-2837fb4f24fe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20191008105621-543471e840be/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20191010194322-b09406accb47/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20191020212454-3e7259c5e7c2/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
@@ -1185,8 +1365,14 @@ golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7w
|
||||
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-20200420163511-1957bb5e6d1f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200509044756-6aff5f38e54f/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-20200519105757-fe76b779f299/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200602225109-6fdc65e7d980/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200622214017-ed371f2e16b4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
@@ -1195,6 +1381,13 @@ golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7w
|
||||
golang.org/x/sys v0.0.0-20201112073958-5cba982894dd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68 h1:nxC68pudNYkKU6jWhgrqdreuFiOQWj1Fs7T3VrH4Pjw=
|
||||
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210510120138-977fb7262007 h1:gG67DSER+11cZvqIMb8S8bt0vZtiN6xWYARwirrOSfE=
|
||||
golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw=
|
||||
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
|
||||
golang.org/x/term v0.0.0-20210317153231-de623e64d2a6 h1:EC6+IGYTjPpRfv9a2b/6Puw0W+hLtAhkV1tPsXhutqs=
|
||||
golang.org/x/term v0.0.0-20210317153231-de623e64d2a6/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
|
||||
golang.org/x/text v0.0.0-20160726164857-2910a502d2bf/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
@@ -1205,10 +1398,13 @@ 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 h1:0YWbFKbhXG/wIiuHDSKpS0Iy7FSA+u45VtBMfQcFTTc=
|
||||
golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||
golang.org/x/text v0.3.5 h1:i6eZZ+zk0SOf0xgBpEpPD18qWcJda6q1sxt3S0kzyUQ=
|
||||
golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||
golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
||||
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/time v0.0.0-20200416051211-89c76fbcd5d1/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
||||
golang.org/x/time v0.0.0-20200630173020-3af7569d3a1e h1:EHBhcS0mlXEAVwNyO2dLfjToGsyY4j24pTs2ScHnX7s=
|
||||
golang.org/x/time v0.0.0-20200630173020-3af7569d3a1e/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
||||
golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||
@@ -1239,7 +1435,10 @@ golang.org/x/tools v0.0.0-20190706070813-72ffa07ba3db/go.mod h1:jcCCGcm9btYwXyDq
|
||||
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-20190920225731-5eefd052ad72/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||
golang.org/x/tools v0.0.0-20191010075000-0337d82405ff/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-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||
golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||
golang.org/x/tools v0.0.0-20191030203535-5e247c9ad0a0/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||
golang.org/x/tools v0.0.0-20191112195655-aa38f8e97acc/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||
golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||
@@ -1247,6 +1446,7 @@ golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtn
|
||||
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-20191216052735-49a3e744a425/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
|
||||
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-20200115044656-831fdb1e1868/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
|
||||
@@ -1257,11 +1457,25 @@ golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapK
|
||||
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-20200426102838-f3a5411a4c3b/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
|
||||
golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
|
||||
golang.org/x/tools v0.0.0-20200505023115-26f46d2f7ef8/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-20200616133436-c1934b75d054/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
|
||||
golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
|
||||
golang.org/x/tools v0.0.0-20200626171337-aa94e735be7f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
|
||||
golang.org/x/tools v0.0.0-20200630154851-b2d8b0336632/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
|
||||
golang.org/x/tools v0.0.0-20200706234117-b22de6825cf7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA=
|
||||
golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
|
||||
golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
|
||||
golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0=
|
||||
golang.org/x/tools v0.1.2-0.20210512205948-8287d5da45e4 h1:cYSqdOzmV9wJ7lWurRAws06Dmif0Wv6UL4gQLlz+im0=
|
||||
golang.org/x/tools v0.1.2-0.20210512205948-8287d5da45e4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
|
||||
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=
|
||||
@@ -1278,21 +1492,32 @@ google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEt
|
||||
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.10.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/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
|
||||
google.golang.org/appengine v1.3.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
|
||||
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.2/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0=
|
||||
google.golang.org/appengine v1.6.5 h1:tycE03LOZYQNhDpS27tcQdAzLCVMaj7QT2SXxebnpCM=
|
||||
google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc=
|
||||
google.golang.org/appengine v1.6.6 h1:lMO5rYAqUxkmaj76jAkRUvt5JZgFymx/+Q5Mzfivuhc=
|
||||
google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc=
|
||||
google.golang.org/cloud v0.0.0-20151119220103-975617b05ea8/go.mod h1:0H1ncTHf11KCFhTc/+EFRbzSCOZx+VUbRMk55Yv5MYk=
|
||||
google.golang.org/genproto v0.0.0-20170818010345-ee236bd376b0/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
|
||||
google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
|
||||
google.golang.org/genproto v0.0.0-20181107211654-5fc9ac540362/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-20190404172233-64821d5d2107/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
|
||||
google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
|
||||
@@ -1301,6 +1526,7 @@ google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRn
|
||||
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-20190927181202-20e1ac93f88c/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8=
|
||||
google.golang.org/genproto v0.0.0-20191009194640-548a555dbc03/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
|
||||
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=
|
||||
@@ -1312,12 +1538,22 @@ google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvx
|
||||
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-20200423170343-7949de9c1215/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-20200626011028-ee7919e894b5/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
|
||||
google.golang.org/genproto v0.0.0-20200701001935-0939c5918c31/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
|
||||
google.golang.org/genproto v0.0.0-20200707001353-8e8330bf89df/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
|
||||
google.golang.org/genproto v0.0.0-20201110150050-8816d57aaa9a h1:pOwg4OoaRYScjmR4LlLgdtnyoHYTSAVhhqe5uPdpII8=
|
||||
google.golang.org/genproto v0.0.0-20201110150050-8816d57aaa9a/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
|
||||
google.golang.org/grpc v0.0.0-20160317175043-d3ddb4469d5a/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw=
|
||||
google.golang.org/grpc v1.8.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw=
|
||||
google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs=
|
||||
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
|
||||
google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38=
|
||||
@@ -1330,6 +1566,9 @@ google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQ
|
||||
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.0/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk=
|
||||
google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk=
|
||||
google.golang.org/grpc v1.30.0 h1:M5a8xTlYTxwMn5ZFkwhRabsygDY5G8TYLyQDBxJNAxE=
|
||||
google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak=
|
||||
google.golang.org/grpc/cmd/protoc-gen-go-grpc v0.0.0-20200709232328-d8193ee9cc3e/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw=
|
||||
@@ -1356,12 +1595,15 @@ gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8
|
||||
gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f h1:BLraFXnmrev5lT+xlilqcH8XK9/i0At2xKjWk4p6zsU=
|
||||
gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/cheggaaa/pb.v1 v1.0.25/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw=
|
||||
gopkg.in/cheggaaa/pb.v1 v1.0.28/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw=
|
||||
gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI=
|
||||
gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys=
|
||||
gopkg.in/gcfg.v1 v1.2.3/go.mod h1:yesOnuUOFQAhST5vPY4nbZsb/huCgGGXlipJsBn0b3o=
|
||||
gopkg.in/gemnasium/logrus-airbrake-hook.v2 v2.1.2/go.mod h1:Xk6kEKp8OKb+X14hQBKWaSkCsqBpgog8nAV2xsGOxlo=
|
||||
gopkg.in/imdario/mergo.v0 v0.3.7/go.mod h1:9qPP6AGrlC1G2PTNXko614FwGZvorN7MiBU0Eppok+U=
|
||||
gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc=
|
||||
gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw=
|
||||
gopkg.in/ini.v1 v1.51.0 h1:AQvPpx3LzTDM0AjnIRlVFwFFGC+npRopjZxLJj6gdno=
|
||||
gopkg.in/ini.v1 v1.51.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k=
|
||||
gopkg.in/ldap.v2 v2.5.1/go.mod h1:oI0cpe/D7HRtBQl8aTg+ZmzFUAvu4lsv3eLXMLGFxWk=
|
||||
gopkg.in/natefinch/lumberjack.v2 v2.0.0/go.mod h1:l0ndWWf7gzL7RNwBG7wST/UCcT4T24xpD6X8LsfU/+k=
|
||||
@@ -1377,12 +1619,16 @@ gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRN
|
||||
gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74=
|
||||
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.3/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.2.6/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||
gopkg.in/yaml.v2 v2.2.7/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||
gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||
gopkg.in/yaml.v2 v2.3.0 h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU=
|
||||
gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
|
||||
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
|
||||
gopkg.in/yaml.v3 v3.0.0-20190905181640-827449938966/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||
gopkg.in/yaml.v3 v3.0.0-20191120175047-4206685974f2/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||
@@ -1402,6 +1648,7 @@ honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWh
|
||||
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=
|
||||
k8s.io/api v0.0.0-20190918155943-95b840bb6a1f/go.mod h1:uWuOHnjmNrtQomJrvEBg0c0HRNyQ+8KTEERVsK0PW48=
|
||||
k8s.io/api v0.16.7/go.mod h1:oUAiGRgo4t+5yqcxjOu5LoHT3wJ8JSbgczkaFYS5L7I=
|
||||
k8s.io/api v0.17.0/go.mod h1:npsyOePkeP0CPwyGfXDHxvypiYMJxBWAMpQxCaJ4ZxI=
|
||||
|
||||
14
scripts/tools.go
Normal file
14
scripts/tools.go
Normal file
@@ -0,0 +1,14 @@
|
||||
// +build tools
|
||||
|
||||
package tools
|
||||
|
||||
import (
|
||||
_ "github.com/frapposelli/wwhrd"
|
||||
_ "github.com/onsi/ginkgo/ginkgo"
|
||||
_ "github.com/securego/gosec/v2/cmd/gosec"
|
||||
)
|
||||
|
||||
// https://github.com/onsi/ginkgo#go-module-tools-package
|
||||
|
||||
// This file imports packages that are used when running go generate, or used
|
||||
// during the development process but not otherwise depended on by built code.
|
||||
2
vendor/cloud.google.com/go/compute/metadata/metadata.go
generated
vendored
2
vendor/cloud.google.com/go/compute/metadata/metadata.go
generated
vendored
@@ -140,7 +140,7 @@ func testOnGCE() bool {
|
||||
}()
|
||||
|
||||
go func() {
|
||||
addrs, err := net.LookupHost("metadata.google.internal")
|
||||
addrs, err := net.DefaultResolver.LookupHost(ctx, "metadata.google.internal")
|
||||
if err != nil || len(addrs) == 0 {
|
||||
resc <- false
|
||||
return
|
||||
|
||||
3
vendor/github.com/emicklei/dot/.gitignore
generated
vendored
Normal file
3
vendor/github.com/emicklei/dot/.gitignore
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
/*.dot
|
||||
/*.png
|
||||
.idea
|
||||
13
vendor/github.com/emicklei/dot/.travis.yml
generated
vendored
Normal file
13
vendor/github.com/emicklei/dot/.travis.yml
generated
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
language: go
|
||||
|
||||
matrix:
|
||||
include:
|
||||
- go: "1.11.x"
|
||||
|
||||
script:
|
||||
- go test -v ./...
|
||||
|
||||
env:
|
||||
- GO111MODULE=on
|
||||
|
||||
install: true
|
||||
43
vendor/github.com/emicklei/dot/CHANGES.md
generated
vendored
Normal file
43
vendor/github.com/emicklei/dot/CHANGES.md
generated
vendored
Normal file
@@ -0,0 +1,43 @@
|
||||
# Change history of the dot package
|
||||
|
||||
|
||||
## v0.15.0 - 2020-10-30
|
||||
|
||||
- add Node initializer, see Issue #15
|
||||
- add Edge initializer
|
||||
|
||||
## v0.14.0 - 2020-08-25
|
||||
|
||||
- add Attrs for conveniently adding multiple label=value attribute pairs.
|
||||
|
||||
## v0.13.0 - 2020-08-22
|
||||
|
||||
- add FindSubgraph
|
||||
|
||||
## v0.12.0 - 2020-08-20
|
||||
|
||||
- Added style methods to Edge to easily add bold,dotted and dashed lines. (#21)
|
||||
|
||||
## v0.11.0 - 2020-05-16
|
||||
|
||||
- add functionality to find node by id
|
||||
- add function to find all nodes of a graph
|
||||
|
||||
## v0.10.2 - 2020-01-31
|
||||
|
||||
- Fix indexing subgraphs by label ; must use id. Issue #16
|
||||
- Add Label(newLabel) to Graph
|
||||
- Add Delete(key) to AttributesMap
|
||||
- Use internal ids for subgraphs
|
||||
|
||||
## v0.10.0
|
||||
|
||||
- Allow setting same rank for a group of nodes
|
||||
- Introduce Literal attribute type
|
||||
- Introduce Node.Label(string) function
|
||||
|
||||
## v0.9.2 and earlier
|
||||
|
||||
- Add support for HTML attributes.
|
||||
- fixed undirected transitions
|
||||
- Change how node is printed, so that attributes only affect individual node
|
||||
22
vendor/github.com/emicklei/dot/LICENSE
generated
vendored
Normal file
22
vendor/github.com/emicklei/dot/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
Copyright(c) Ernest Micklei
|
||||
|
||||
MIT License
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
"Software"), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
77
vendor/github.com/emicklei/dot/README.md
generated
vendored
Normal file
77
vendor/github.com/emicklei/dot/README.md
generated
vendored
Normal file
@@ -0,0 +1,77 @@
|
||||
## dot - little helper package in Go for the graphviz dot language
|
||||
|
||||
[](https://travis-ci.org/emicklei/dot)
|
||||
[](https://goreportcard.com/report/github.com/emicklei/dot)
|
||||
[](https://pkg.go.dev/github.com/emicklei/dot)
|
||||
|
||||
[DOT language](http://www.graphviz.org/doc/info/lang.html)
|
||||
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/emicklei/dot"
|
||||
)
|
||||
|
||||
// go run main.go | dot -Tpng > test.png && open test.png
|
||||
|
||||
func main() {
|
||||
g := dot.NewGraph(dot.Directed)
|
||||
n1 := g.Node("coding")
|
||||
n2 := g.Node("testing a little").Box()
|
||||
|
||||
g.Edge(n1, n2)
|
||||
g.Edge(n2, n1, "back").Attr("color", "red")
|
||||
|
||||
fmt.Println(g.String())
|
||||
}
|
||||
|
||||
Output
|
||||
|
||||
digraph {
|
||||
node [label="coding"]; n1;
|
||||
node [label="testing a little",shape="box"]; n2;
|
||||
n1 -> n2;
|
||||
n2 -> n1 [color="red", label="back"];
|
||||
}
|
||||
|
||||
Chaining edges
|
||||
|
||||
g.Node("A").Edge(g.Node("B")).Edge(g.Node("C"))
|
||||
|
||||
A -> B -> C
|
||||
|
||||
Subgraphs
|
||||
|
||||
s := g.Subgraph("cluster")
|
||||
s.Attr("style","filled")
|
||||
|
||||
## cluster example
|
||||
|
||||

|
||||
|
||||
di := dot.NewGraph(dot.Directed)
|
||||
outside := di.Node("Outside")
|
||||
|
||||
// A
|
||||
clusterA := di.Subgraph("Cluster A", dot.ClusterOption{})
|
||||
insideOne := clusterA.Node("one")
|
||||
insideTwo := clusterA.Node("two")
|
||||
|
||||
// B
|
||||
clusterB := di.Subgraph("Cluster B", dot.ClusterOption{})
|
||||
insideThree := clusterB.Node("three")
|
||||
insideFour := clusterB.Node("four")
|
||||
|
||||
// edges
|
||||
outside.Edge(insideFour).Edge(insideOne).Edge(insideTwo).Edge(insideThree).Edge(outside)
|
||||
|
||||
## About dot attributes
|
||||
|
||||
https://graphviz.gitlab.io/_pages/doc/info/attrs.html
|
||||
|
||||
## display your graph
|
||||
|
||||
go run main.go | dot -Tpng > test.png && open test.png
|
||||
|
||||
(c) 2015-2020, http://ernestmicklei.com. MIT License
|
||||
56
vendor/github.com/emicklei/dot/attr.go
generated
vendored
Normal file
56
vendor/github.com/emicklei/dot/attr.go
generated
vendored
Normal file
@@ -0,0 +1,56 @@
|
||||
package dot
|
||||
|
||||
// HTML renders the provided content as graphviz HTML. Use of this
|
||||
// type is only valid for some attributes, like the 'label' attribute.
|
||||
type HTML string
|
||||
|
||||
// Literal renders the provided value as is, without adding enclosing
|
||||
// quotes, escaping newlines, quotations marks or any other characters.
|
||||
// For example:
|
||||
// node.Attr("label", Literal(`"left-justified text\l"`))
|
||||
// allows you to left-justify the label (due to the \l at the end).
|
||||
// The caller is responsible for enclosing the value in quotes and for
|
||||
// proper escaping of special characters.
|
||||
type Literal string
|
||||
|
||||
// AttributesMap holds attribute=value pairs.
|
||||
type AttributesMap struct {
|
||||
attributes map[string]interface{}
|
||||
}
|
||||
|
||||
// Attrs sets multiple values for attributes (unless empty) taking a label,value list
|
||||
// E.g Attrs("style","filled","fillcolor","red")
|
||||
func (a AttributesMap) Attrs(labelvalues ...interface{}) {
|
||||
if len(labelvalues)%2 != 0 {
|
||||
panic("missing label or value ; must provide pairs")
|
||||
}
|
||||
for i := 0; i < len(labelvalues); i += 2 {
|
||||
label := labelvalues[i].(string)
|
||||
value := labelvalues[i+1]
|
||||
a.Attr(label, value)
|
||||
}
|
||||
}
|
||||
|
||||
// Attr sets the value for an attribute (unless empty).
|
||||
func (a AttributesMap) Attr(label string, value interface{}) {
|
||||
if len(label) == 0 || value == nil {
|
||||
return
|
||||
}
|
||||
if s, ok := value.(string); ok {
|
||||
if len(s) > 0 {
|
||||
a.attributes[label] = s
|
||||
return
|
||||
}
|
||||
}
|
||||
a.attributes[label] = value
|
||||
}
|
||||
|
||||
// Value return the value added for this label.
|
||||
func (a AttributesMap) Value(label string) interface{} {
|
||||
return a.attributes[label]
|
||||
}
|
||||
|
||||
// Delete removes the attribute value at key, if any
|
||||
func (a AttributesMap) Delete(key string) {
|
||||
delete(a.attributes, key)
|
||||
}
|
||||
5
vendor/github.com/emicklei/dot/doc.go
generated
vendored
Normal file
5
vendor/github.com/emicklei/dot/doc.go
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
// Package dot is a helper for producing graphs in DOT format (graphviz).
|
||||
// It offers Graph,Node and Edge objects to construct simple and complex (e.g. nested) graphs.
|
||||
//
|
||||
// Copyright (c) Ernest Micklei. MIT License
|
||||
package dot // import "github.com/emicklei/dot"
|
||||
52
vendor/github.com/emicklei/dot/edge.go
generated
vendored
Normal file
52
vendor/github.com/emicklei/dot/edge.go
generated
vendored
Normal file
@@ -0,0 +1,52 @@
|
||||
package dot
|
||||
|
||||
// Edge represents a graph edge between two Nodes.
|
||||
type Edge struct {
|
||||
AttributesMap
|
||||
graph *Graph
|
||||
from, to Node
|
||||
}
|
||||
|
||||
// Attr sets key=value and returns the Egde.
|
||||
func (e Edge) Attr(key string, value interface{}) Edge {
|
||||
e.AttributesMap.Attr(key, value)
|
||||
return e
|
||||
}
|
||||
|
||||
// Label sets "label"=value and returns the Edge.
|
||||
// Same as Attr("label",value)
|
||||
func (e Edge) Label(value interface{}) Edge {
|
||||
e.AttributesMap.Attr("label", value)
|
||||
return e
|
||||
}
|
||||
|
||||
// Solid sets the edge attribute "style" to "solid"
|
||||
// Default style
|
||||
func (e Edge) Solid() Edge {
|
||||
return e.Attr("style", "solid")
|
||||
}
|
||||
|
||||
// Bold sets the edge attribute "style" to "bold"
|
||||
func (e Edge) Bold() Edge {
|
||||
return e.Attr("style", "bold")
|
||||
}
|
||||
|
||||
// Dashed sets the edge attribute "style" to "dashed"
|
||||
func (e Edge) Dashed() Edge {
|
||||
return e.Attr("style", "dashed")
|
||||
}
|
||||
|
||||
// Dotted sets the edge attribute "style" to "dotted"
|
||||
func (e Edge) Dotted() Edge {
|
||||
return e.Attr("style", "dotted")
|
||||
}
|
||||
|
||||
// Edge returns a new Edge between the "to" node of this Edge and the argument Node.
|
||||
func (e Edge) Edge(to Node, labels ...string) Edge {
|
||||
return e.graph.Edge(e.to, to, labels...)
|
||||
}
|
||||
|
||||
// EdgesTo returns all existing edges between the "to" Node of thie Edge and the argument Node.
|
||||
func (e Edge) EdgesTo(to Node) []Edge {
|
||||
return e.graph.FindEdges(e.to, to)
|
||||
}
|
||||
3
vendor/github.com/emicklei/dot/go.mod
generated
vendored
Normal file
3
vendor/github.com/emicklei/dot/go.mod
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
module github.com/emicklei/dot
|
||||
|
||||
go 1.13
|
||||
336
vendor/github.com/emicklei/dot/graph.go
generated
vendored
Normal file
336
vendor/github.com/emicklei/dot/graph.go
generated
vendored
Normal file
@@ -0,0 +1,336 @@
|
||||
package dot
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
"io"
|
||||
"sort"
|
||||
"strings"
|
||||
)
|
||||
|
||||
// Graph represents a dot graph with nodes and edges.
|
||||
type Graph struct {
|
||||
AttributesMap
|
||||
id string
|
||||
isCluster bool
|
||||
graphType string
|
||||
seq int
|
||||
nodes map[string]Node
|
||||
edgesFrom map[string][]Edge
|
||||
subgraphs map[string]*Graph
|
||||
parent *Graph
|
||||
sameRank map[string][]Node
|
||||
//
|
||||
nodeInitializer func(Node)
|
||||
edgeInitializer func(Edge)
|
||||
}
|
||||
|
||||
// NewGraph return a new initialized Graph.
|
||||
func NewGraph(options ...GraphOption) *Graph {
|
||||
graph := &Graph{
|
||||
AttributesMap: AttributesMap{attributes: map[string]interface{}{}},
|
||||
graphType: Directed.Name,
|
||||
nodes: map[string]Node{},
|
||||
edgesFrom: map[string][]Edge{},
|
||||
subgraphs: map[string]*Graph{},
|
||||
sameRank: map[string][]Node{},
|
||||
}
|
||||
for _, each := range options {
|
||||
each.Apply(graph)
|
||||
}
|
||||
return graph
|
||||
}
|
||||
|
||||
// ID sets the identifier of the graph.
|
||||
func (g *Graph) ID(newID string) *Graph {
|
||||
if len(g.id) > 0 {
|
||||
panic("cannot overwrite non-empty id ; both the old and the new could be in use and we cannot tell")
|
||||
}
|
||||
g.id = newID
|
||||
return g
|
||||
}
|
||||
|
||||
// Label sets the "label" attribute value.
|
||||
func (g *Graph) Label(label string) *Graph {
|
||||
g.AttributesMap.Attr("label", label)
|
||||
return g
|
||||
}
|
||||
|
||||
func (g *Graph) beCluster() {
|
||||
g.id = "cluster_" + g.id
|
||||
}
|
||||
|
||||
// Root returns the top-level graph if this was a subgraph.
|
||||
func (g *Graph) Root() *Graph {
|
||||
if g.parent == nil {
|
||||
return g
|
||||
}
|
||||
return g.parent.Root()
|
||||
}
|
||||
|
||||
// FindSubgraph returns the subgraph of the graph or one from its parents.
|
||||
func (g *Graph) FindSubgraph(id string) (*Graph, bool) {
|
||||
sub, ok := g.subgraphs[id]
|
||||
if !ok {
|
||||
if g.parent != nil {
|
||||
return g.parent.FindSubgraph(id)
|
||||
}
|
||||
}
|
||||
return sub, ok
|
||||
}
|
||||
|
||||
// Subgraph returns the Graph with the given id ; creates one if absent.
|
||||
// The label attribute is also set to the id ; use Label() to overwrite it.
|
||||
func (g *Graph) Subgraph(id string, options ...GraphOption) *Graph {
|
||||
sub, ok := g.subgraphs[id]
|
||||
if ok {
|
||||
return sub
|
||||
}
|
||||
sub = NewGraph(Sub)
|
||||
sub.Attr("label", id) // for consistency with Node creation behavior.
|
||||
sub.id = fmt.Sprintf("s%d", g.nextSeq())
|
||||
for _, each := range options {
|
||||
each.Apply(sub)
|
||||
}
|
||||
sub.parent = g
|
||||
sub.edgeInitializer = g.edgeInitializer
|
||||
sub.nodeInitializer = g.nodeInitializer
|
||||
g.subgraphs[id] = sub
|
||||
return sub
|
||||
}
|
||||
|
||||
func (g *Graph) findNode(id string) (Node, bool) {
|
||||
if n, ok := g.nodes[id]; ok {
|
||||
return n, ok
|
||||
}
|
||||
if g.parent == nil {
|
||||
return Node{id: "void"}, false
|
||||
}
|
||||
return g.parent.findNode(id)
|
||||
}
|
||||
|
||||
// nextSeq takes the next sequence number from the root graph
|
||||
func (g *Graph) nextSeq() int {
|
||||
root := g.Root()
|
||||
root.seq++
|
||||
return root.seq
|
||||
}
|
||||
|
||||
// NodeInitializer sets a function that is called (if not nil) when a Node is implicitly created.
|
||||
func (g *Graph) NodeInitializer(callback func(n Node)) {
|
||||
g.nodeInitializer = callback
|
||||
}
|
||||
|
||||
// EdgeInitializer sets a function that is called (if not nil) when an Edge is implicitly created.
|
||||
func (g *Graph) EdgeInitializer(callback func(e Edge)) {
|
||||
g.edgeInitializer = callback
|
||||
}
|
||||
|
||||
// Node returns the node created with this id or creates a new node if absent.
|
||||
// The node will have a label attribute with the id as its value. Use Label() to overwrite this.
|
||||
// This method can be used as both a constructor and accessor.
|
||||
// not thread safe!
|
||||
func (g *Graph) Node(id string) Node {
|
||||
if n, ok := g.findNode(id); ok {
|
||||
return n
|
||||
}
|
||||
n := Node{
|
||||
id: id,
|
||||
seq: g.nextSeq(), // create a new, use root sequence
|
||||
AttributesMap: AttributesMap{attributes: map[string]interface{}{
|
||||
"label": id}},
|
||||
graph: g,
|
||||
}
|
||||
if g.nodeInitializer != nil {
|
||||
g.nodeInitializer(n)
|
||||
}
|
||||
// store local
|
||||
g.nodes[id] = n
|
||||
return n
|
||||
}
|
||||
|
||||
// Edge creates a new edge between two nodes.
|
||||
// Nodes can be have multiple edges to the same other node (or itself).
|
||||
// If one or more labels are given then the "label" attribute is set to the edge.
|
||||
func (g *Graph) Edge(fromNode, toNode Node, labels ...string) Edge {
|
||||
// assume fromNode owner == toNode owner
|
||||
edgeOwner := g
|
||||
if fromNode.graph != toNode.graph { // 1 or 2 are subgraphs
|
||||
edgeOwner = commonParentOf(fromNode.graph, toNode.graph)
|
||||
}
|
||||
e := Edge{
|
||||
from: fromNode,
|
||||
to: toNode,
|
||||
AttributesMap: AttributesMap{attributes: map[string]interface{}{}},
|
||||
graph: edgeOwner}
|
||||
if len(labels) > 0 {
|
||||
e.Attr("label", strings.Join(labels, ","))
|
||||
}
|
||||
if g.edgeInitializer != nil {
|
||||
g.edgeInitializer(e)
|
||||
}
|
||||
edgeOwner.edgesFrom[fromNode.id] = append(edgeOwner.edgesFrom[fromNode.id], e)
|
||||
return e
|
||||
}
|
||||
|
||||
// FindEdges finds all edges in the graph that go from the fromNode to the toNode.
|
||||
// Otherwise, returns an empty slice.
|
||||
func (g *Graph) FindEdges(fromNode, toNode Node) (found []Edge) {
|
||||
found = make([]Edge, 0)
|
||||
edgeOwner := g
|
||||
if fromNode.graph != toNode.graph {
|
||||
edgeOwner = commonParentOf(fromNode.graph, toNode.graph)
|
||||
}
|
||||
if edges, ok := edgeOwner.edgesFrom[fromNode.id]; ok {
|
||||
for _, e := range edges {
|
||||
if e.to.id == toNode.id {
|
||||
found = append(found, e)
|
||||
}
|
||||
}
|
||||
}
|
||||
return found
|
||||
}
|
||||
|
||||
func commonParentOf(one *Graph, two *Graph) *Graph {
|
||||
// TODO
|
||||
return one.Root()
|
||||
}
|
||||
|
||||
// AddToSameRank adds the given nodes to the specified rank group, forcing them to be rendered in the same row
|
||||
func (g *Graph) AddToSameRank(group string, nodes ...Node) {
|
||||
g.sameRank[group] = append(g.sameRank[group], nodes...)
|
||||
}
|
||||
|
||||
// String returns the source in dot notation.
|
||||
func (g Graph) String() string {
|
||||
b := new(bytes.Buffer)
|
||||
g.Write(b)
|
||||
return b.String()
|
||||
}
|
||||
|
||||
func (g Graph) Write(w io.Writer) {
|
||||
g.IndentedWrite(NewIndentWriter(w))
|
||||
}
|
||||
|
||||
// IndentedWrite write the graph to a writer using simple TAB indentation.
|
||||
func (g Graph) IndentedWrite(w *IndentWriter) {
|
||||
fmt.Fprintf(w, "%s %s {", g.graphType, g.id)
|
||||
w.NewLineIndentWhile(func() {
|
||||
// subgraphs
|
||||
for _, key := range g.sortedSubgraphsKeys() {
|
||||
each := g.subgraphs[key]
|
||||
each.IndentedWrite(w)
|
||||
}
|
||||
// graph attributes
|
||||
appendSortedMap(g.AttributesMap.attributes, false, w)
|
||||
w.NewLine()
|
||||
// graph nodes
|
||||
for _, key := range g.sortedNodesKeys() {
|
||||
each := g.nodes[key]
|
||||
fmt.Fprintf(w, "n%d", each.seq)
|
||||
appendSortedMap(each.attributes, true, w)
|
||||
fmt.Fprintf(w, ";")
|
||||
w.NewLine()
|
||||
}
|
||||
// graph edges
|
||||
denoteEdge := "->"
|
||||
if g.graphType == "graph" {
|
||||
denoteEdge = "--"
|
||||
}
|
||||
for _, each := range g.sortedEdgesFromKeys() {
|
||||
all := g.edgesFrom[each]
|
||||
for _, each := range all {
|
||||
fmt.Fprintf(w, "n%d%sn%d", each.from.seq, denoteEdge, each.to.seq)
|
||||
appendSortedMap(each.attributes, true, w)
|
||||
fmt.Fprint(w, ";")
|
||||
w.NewLine()
|
||||
}
|
||||
}
|
||||
for _, nodes := range g.sameRank {
|
||||
str := ""
|
||||
for _, n := range nodes {
|
||||
str += fmt.Sprintf("n%d;", n.seq)
|
||||
}
|
||||
fmt.Fprintf(w, "{rank=same; %s};", str)
|
||||
w.NewLine()
|
||||
}
|
||||
})
|
||||
fmt.Fprintf(w, "}")
|
||||
w.NewLine()
|
||||
}
|
||||
|
||||
func appendSortedMap(m map[string]interface{}, mustBracket bool, b io.Writer) {
|
||||
if len(m) == 0 {
|
||||
return
|
||||
}
|
||||
if mustBracket {
|
||||
fmt.Fprint(b, "[")
|
||||
}
|
||||
first := true
|
||||
// first collect keys
|
||||
keys := []string{}
|
||||
for k := range m {
|
||||
keys = append(keys, k)
|
||||
}
|
||||
sort.StringSlice(keys).Sort()
|
||||
|
||||
for _, k := range keys {
|
||||
if !first {
|
||||
if mustBracket {
|
||||
fmt.Fprint(b, ",")
|
||||
} else {
|
||||
fmt.Fprintf(b, ";")
|
||||
}
|
||||
}
|
||||
if html, isHTML := m[k].(HTML); isHTML {
|
||||
fmt.Fprintf(b, "%s=<%s>", k, html)
|
||||
} else if literal, isLiteral := m[k].(Literal); isLiteral {
|
||||
fmt.Fprintf(b, "%s=%s", k, literal)
|
||||
} else {
|
||||
fmt.Fprintf(b, "%s=%q", k, m[k])
|
||||
}
|
||||
first = false
|
||||
}
|
||||
if mustBracket {
|
||||
fmt.Fprint(b, "]")
|
||||
} else {
|
||||
fmt.Fprint(b, ";")
|
||||
}
|
||||
}
|
||||
|
||||
// VisitNodes visits all nodes recursively
|
||||
func (g Graph) VisitNodes(callback func(node Node) (done bool)) {
|
||||
for _, node := range g.nodes {
|
||||
done := callback(node)
|
||||
if done {
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
for _, subGraph := range g.subgraphs {
|
||||
subGraph.VisitNodes(callback)
|
||||
}
|
||||
}
|
||||
|
||||
// FindNodeById return node by id
|
||||
func (g Graph) FindNodeById(id string) (foundNode Node, found bool) {
|
||||
g.VisitNodes(func(node Node) (done bool) {
|
||||
if node.id == id {
|
||||
found = true
|
||||
foundNode = node
|
||||
return true
|
||||
}
|
||||
return false
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
// FindNodes returns all nodes recursively
|
||||
func (g Graph) FindNodes() (nodes []Node) {
|
||||
var foundNodes []Node
|
||||
g.VisitNodes(func(node Node) (done bool) {
|
||||
foundNodes = append(foundNodes, node)
|
||||
return false
|
||||
})
|
||||
return foundNodes
|
||||
}
|
||||
26
vendor/github.com/emicklei/dot/graph_options.go
generated
vendored
Normal file
26
vendor/github.com/emicklei/dot/graph_options.go
generated
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
package dot
|
||||
|
||||
type GraphOption interface {
|
||||
Apply(*Graph)
|
||||
}
|
||||
|
||||
type ClusterOption struct{}
|
||||
|
||||
func (o ClusterOption) Apply(g *Graph) {
|
||||
g.beCluster()
|
||||
}
|
||||
|
||||
var (
|
||||
Strict = GraphTypeOption{"strict"}
|
||||
Undirected = GraphTypeOption{"graph"}
|
||||
Directed = GraphTypeOption{"digraph"}
|
||||
Sub = GraphTypeOption{"subgraph"}
|
||||
)
|
||||
|
||||
type GraphTypeOption struct {
|
||||
Name string
|
||||
}
|
||||
|
||||
func (o GraphTypeOption) Apply(g *Graph) {
|
||||
g.graphType = o.Name
|
||||
}
|
||||
55
vendor/github.com/emicklei/dot/indent.go
generated
vendored
Normal file
55
vendor/github.com/emicklei/dot/indent.go
generated
vendored
Normal file
@@ -0,0 +1,55 @@
|
||||
package dot
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"io"
|
||||
)
|
||||
|
||||
type IndentWriter struct {
|
||||
level int
|
||||
writer io.Writer
|
||||
}
|
||||
|
||||
func NewIndentWriter(w io.Writer) *IndentWriter {
|
||||
return &IndentWriter{level: 0, writer: w}
|
||||
}
|
||||
|
||||
func (i *IndentWriter) Indent() {
|
||||
i.level++
|
||||
fmt.Fprint(i.writer, "\t")
|
||||
}
|
||||
|
||||
func (i *IndentWriter) BackIndent() {
|
||||
i.level--
|
||||
}
|
||||
|
||||
func (i *IndentWriter) IndentWhile(block func()) {
|
||||
i.Indent()
|
||||
block()
|
||||
i.BackIndent()
|
||||
}
|
||||
|
||||
func (i *IndentWriter) NewLineIndentWhile(block func()) {
|
||||
i.NewLine()
|
||||
i.Indent()
|
||||
block()
|
||||
i.BackIndent()
|
||||
i.NewLine()
|
||||
}
|
||||
|
||||
func (i *IndentWriter) NewLine() {
|
||||
fmt.Fprint(i.writer, "\n")
|
||||
for j := 0; j < i.level; j++ {
|
||||
fmt.Fprint(i.writer, "\t")
|
||||
}
|
||||
}
|
||||
|
||||
// Write makes it an io.Writer
|
||||
func (i *IndentWriter) Write(data []byte) (n int, err error) {
|
||||
return i.writer.Write(data)
|
||||
}
|
||||
|
||||
func (i *IndentWriter) WriteString(s string) (n int, err error) {
|
||||
fmt.Fprint(i.writer, s)
|
||||
return len(s), nil
|
||||
}
|
||||
35
vendor/github.com/emicklei/dot/node.go
generated
vendored
Normal file
35
vendor/github.com/emicklei/dot/node.go
generated
vendored
Normal file
@@ -0,0 +1,35 @@
|
||||
package dot
|
||||
|
||||
// Node represents a dot Node.
|
||||
type Node struct {
|
||||
AttributesMap
|
||||
graph *Graph
|
||||
id string
|
||||
seq int
|
||||
}
|
||||
|
||||
// Attr sets label=value and return the Node
|
||||
func (n Node) Attr(label string, value interface{}) Node {
|
||||
n.AttributesMap.Attr(label, value)
|
||||
return n
|
||||
}
|
||||
|
||||
// Label sets the attribute "label" to the given label
|
||||
func (n Node) Label(label string) Node {
|
||||
return n.Attr("label", label)
|
||||
}
|
||||
|
||||
// Box sets the attribute "shape" to "box"
|
||||
func (n Node) Box() Node {
|
||||
return n.Attr("shape", "box")
|
||||
}
|
||||
|
||||
// Edge sets label=value and returns the Edge for chaining.
|
||||
func (n Node) Edge(toNode Node, labels ...string) Edge {
|
||||
return n.graph.Edge(n, toNode, labels...)
|
||||
}
|
||||
|
||||
// EdgesTo returns all existing edges between this Node and the argument Node.
|
||||
func (n Node) EdgesTo(toNode Node) []Edge {
|
||||
return n.graph.FindEdges(n, toNode)
|
||||
}
|
||||
25
vendor/github.com/emicklei/dot/sort.go
generated
vendored
Normal file
25
vendor/github.com/emicklei/dot/sort.go
generated
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
package dot
|
||||
|
||||
import "sort"
|
||||
|
||||
func (g *Graph) sortedNodesKeys() (keys []string) {
|
||||
for each := range g.nodes {
|
||||
keys = append(keys, each)
|
||||
}
|
||||
sort.StringSlice(keys).Sort()
|
||||
return
|
||||
}
|
||||
func (g *Graph) sortedEdgesFromKeys() (keys []string) {
|
||||
for each := range g.edgesFrom {
|
||||
keys = append(keys, each)
|
||||
}
|
||||
sort.StringSlice(keys).Sort()
|
||||
return
|
||||
}
|
||||
func (g *Graph) sortedSubgraphsKeys() (keys []string) {
|
||||
for each := range g.subgraphs {
|
||||
keys = append(keys, each)
|
||||
}
|
||||
sort.StringSlice(keys).Sort()
|
||||
return
|
||||
}
|
||||
13
vendor/github.com/fatih/color/README.md
generated
vendored
13
vendor/github.com/fatih/color/README.md
generated
vendored
@@ -1,20 +1,11 @@
|
||||
# Archived project. No maintenance.
|
||||
|
||||
This project is not maintained anymore and is archived. Feel free to fork and
|
||||
make your own changes if needed. For more detail read my blog post: [Taking an indefinite sabbatical from my projects](https://arslan.io/2018/10/09/taking-an-indefinite-sabbatical-from-my-projects/)
|
||||
|
||||
Thanks to everyone for their valuable feedback and contributions.
|
||||
|
||||
|
||||
# Color [](https://godoc.org/github.com/fatih/color)
|
||||
# color [](https://github.com/fatih/color/actions) [](https://pkg.go.dev/github.com/fatih/color)
|
||||
|
||||
Color lets you use colorized outputs in terms of [ANSI Escape
|
||||
Codes](http://en.wikipedia.org/wiki/ANSI_escape_code#Colors) in Go (Golang). It
|
||||
has support for Windows too! The API can be used in several ways, pick one that
|
||||
suits you.
|
||||
|
||||
|
||||

|
||||

|
||||
|
||||
|
||||
## Install
|
||||
|
||||
4
vendor/github.com/fatih/color/go.mod
generated
vendored
4
vendor/github.com/fatih/color/go.mod
generated
vendored
@@ -3,6 +3,6 @@ module github.com/fatih/color
|
||||
go 1.13
|
||||
|
||||
require (
|
||||
github.com/mattn/go-colorable v0.1.4
|
||||
github.com/mattn/go-isatty v0.0.11
|
||||
github.com/mattn/go-colorable v0.1.8
|
||||
github.com/mattn/go-isatty v0.0.12
|
||||
)
|
||||
|
||||
15
vendor/github.com/fatih/color/go.sum
generated
vendored
15
vendor/github.com/fatih/color/go.sum
generated
vendored
@@ -1,8 +1,7 @@
|
||||
github.com/mattn/go-colorable v0.1.4 h1:snbPLB8fVfU9iwbbo30TPtbLRzwWu6aJS6Xh4eaaviA=
|
||||
github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE=
|
||||
github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s=
|
||||
github.com/mattn/go-isatty v0.0.11 h1:FxPOTFNqGkuDUGi3H/qkUbQO4ZiBa2brKq5r0l8TGeM=
|
||||
github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE=
|
||||
golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20191026070338-33540a1f6037 h1:YyJpGZS1sBuBCzLAR1VEpK193GlqGZbnPFnPV/5Rsb4=
|
||||
golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
github.com/mattn/go-colorable v0.1.8 h1:c1ghPdyEDarC70ftn0y+A/Ee++9zz8ljHG1b13eJ0s8=
|
||||
github.com/mattn/go-colorable v0.1.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc=
|
||||
github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY=
|
||||
github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU=
|
||||
golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae h1:/WDfKMnPU+m5M4xB+6x4kaepxRw6jWvR5iDRdvjHgy8=
|
||||
golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
|
||||
34
vendor/github.com/frapposelli/wwhrd/.gitignore
generated
vendored
Normal file
34
vendor/github.com/frapposelli/wwhrd/.gitignore
generated
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
# Compiled Object files, Static and Dynamic libs (Shared Objects)
|
||||
*.o
|
||||
*.a
|
||||
*.so
|
||||
|
||||
# Folders
|
||||
_obj
|
||||
_test
|
||||
|
||||
# Architecture specific extensions/prefixes
|
||||
*.[568vq]
|
||||
[568vq].out
|
||||
|
||||
*.cgo1.go
|
||||
*.cgo2.c
|
||||
_cgo_defun.c
|
||||
_cgo_gotypes.go
|
||||
_cgo_export.*
|
||||
|
||||
_testmain.go
|
||||
|
||||
*.exe
|
||||
*.test
|
||||
|
||||
wwhrd
|
||||
wwhrd.exe
|
||||
wwhrd-graph.png
|
||||
|
||||
.cover
|
||||
.vscode
|
||||
|
||||
dist/
|
||||
|
||||
.idea/
|
||||
42
vendor/github.com/frapposelli/wwhrd/.goreleaser.yml
generated
vendored
Normal file
42
vendor/github.com/frapposelli/wwhrd/.goreleaser.yml
generated
vendored
Normal file
@@ -0,0 +1,42 @@
|
||||
---
|
||||
project_name: wwhrd
|
||||
builds:
|
||||
- goos:
|
||||
- linux
|
||||
- darwin
|
||||
- windows
|
||||
goarch:
|
||||
- amd64
|
||||
env:
|
||||
- CGO_ENABLED=0
|
||||
archives:
|
||||
- id: github
|
||||
name_template: '{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}'
|
||||
format: tar.gz
|
||||
files:
|
||||
- LICENSE*
|
||||
- README*
|
||||
checksum:
|
||||
name_template: '{{ .ProjectName }}_{{ .Version }}_checksums.txt'
|
||||
dockers:
|
||||
- image_templates:
|
||||
- "frapposelli/wwhrd:latest"
|
||||
- "frapposelli/wwhrd:{{ .Tag }}"
|
||||
- "frapposelli/wwhrd:v{{ .Major }}"
|
||||
goos: linux
|
||||
goarch: amd64
|
||||
dockerfile: Dockerfile
|
||||
brews:
|
||||
- folder: Formula
|
||||
tap:
|
||||
owner: frapposelli
|
||||
name: homebrew-tap
|
||||
commit_author:
|
||||
name: Fabio Rapposelli
|
||||
email: fabio@rapposelli.org
|
||||
homepage: "https://github.com/frapposelli/wwhrd/blob/master/README.md"
|
||||
description: "Have Henry Rollins check vendor licenses in your Go project"
|
||||
test: |
|
||||
system "#{bin}/wwhrd -v"
|
||||
install: |
|
||||
bin.install "wwhrd"
|
||||
10
vendor/github.com/frapposelli/wwhrd/.wwhrd.yml
generated
vendored
Normal file
10
vendor/github.com/frapposelli/wwhrd/.wwhrd.yml
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
---
|
||||
denylist:
|
||||
- GPL-2.0
|
||||
|
||||
allowlist:
|
||||
- Apache-2.0
|
||||
- MIT
|
||||
- ISC
|
||||
- BSD-2-Clause
|
||||
- BSD-3-Clause
|
||||
4
vendor/github.com/frapposelli/wwhrd/Dockerfile
generated
vendored
Normal file
4
vendor/github.com/frapposelli/wwhrd/Dockerfile
generated
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
FROM scratch
|
||||
LABEL maintainer="fabio@rapposelli.org"
|
||||
COPY wwhrd /
|
||||
ENTRYPOINT [ "/wwhrd" ]
|
||||
18
vendor/github.com/frapposelli/wwhrd/LICENSE
generated
vendored
Normal file
18
vendor/github.com/frapposelli/wwhrd/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
Copyright (c) 2016 Fabio Rapposelli
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
||||
the Software, and to permit persons to whom the Software is furnished to do so,
|
||||
subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
||||
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
||||
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
107
vendor/github.com/frapposelli/wwhrd/README.md
generated
vendored
Normal file
107
vendor/github.com/frapposelli/wwhrd/README.md
generated
vendored
Normal file
@@ -0,0 +1,107 @@
|
||||
# WWHRD? (What Would Henry Rollins Do?) [](https://github.com/frapposelli/wwhrd/actions?query=workflow%3Aci) [](https://codecov.io/gh/frapposelli/wwhrd)
|
||||
|
||||

|
||||
|
||||
Have Henry Rollins check vendored licenses in your Go project.
|
||||
|
||||
Please note that `wwhrd` **only checks** packages stored under `vendor/`, if you are using Go modules (`go mod`), you can add `go mod vendor` before running `wwhrd`, this will dump a copy of the vendored packages inside the local repo.
|
||||
|
||||
## Installation
|
||||
|
||||
```console
|
||||
go get -u github.com/frapposelli/wwhrd
|
||||
```
|
||||
|
||||
Using [Brew](https://brew.sh) on macOS:
|
||||
|
||||
```console
|
||||
brew install frapposelli/tap/wwhrd
|
||||
```
|
||||
|
||||
## Configuration file
|
||||
|
||||
Configuration for `wwhrd` is stored in `.wwhrd.yml` at the root of the repo you want to check.
|
||||
|
||||
The format is compatible with [Anderson](https://github.com/xoebus/anderson), just run `wwhrd check -f .anderson.yml`.
|
||||
|
||||
```yaml
|
||||
---
|
||||
denylist:
|
||||
- GPL-2.0
|
||||
|
||||
allowlist:
|
||||
- Apache-2.0
|
||||
- MIT
|
||||
|
||||
exceptions:
|
||||
- github.com/jessevdk/go-flags
|
||||
- github.com/pmezard/go-difflib/difflib
|
||||
```
|
||||
|
||||
Having a license in the `blacklist` section will fail the check, unless the package is listed under `exceptions`.
|
||||
|
||||
`exceptions` can also be listed as wildcards:
|
||||
|
||||
```yaml
|
||||
exceptions:
|
||||
- github.com/davecgh/go-spew/spew/...
|
||||
```
|
||||
|
||||
Will make a blanket exception for all the packages under `github.com/davecgh/go-spew/spew`.
|
||||
|
||||
Use it in your CI!
|
||||
|
||||
```console
|
||||
$ wwhrd check
|
||||
INFO[0006] Found Approved license license=Apache-2.0 package="github.com/xanzy/ssh-agent"
|
||||
INFO[0006] Found Approved license license=BSD-3-Clause package="golang.org/x/crypto/ed25519"
|
||||
INFO[0006] Found Approved license license=Apache-2.0 package="gopkg.in/src-d/go-git.v4/internal/revision"
|
||||
INFO[0006] Found Approved license license=Apache-2.0 package="gopkg.in/src-d/go-git.v4/plumbing/format/config"
|
||||
INFO[0006] Found Approved license license=BSD-3-Clause package="golang.org/x/exp/rand"
|
||||
INFO[0006] Found Approved license license=BSD-3-Clause package="gonum.org/v1/gonum/internal/cmplx64"
|
||||
INFO[0006] Found Approved license license=Apache-2.0 package="gopkg.in/src-d/go-git.v4/plumbing/cache"
|
||||
INFO[0006] Found Approved license license=MIT package="github.com/montanaflynn/stats"
|
||||
INFO[0006] Found Approved license license=MIT package="github.com/ekzhu/minhash-lsh"
|
||||
FATA[0006] Exiting: Non-Approved license found
|
||||
$ echo $?
|
||||
1
|
||||
```
|
||||
|
||||
## Generate a dependency graph
|
||||
|
||||
Starting from version `v0.3.0`, `wwhrd graph` can be used to generate a graph in DOT language, the graph can then be parsed by Graphviz or other compatible tools.
|
||||
|
||||
To generate a PNG of the dependencies of your repository, you can run:
|
||||
|
||||
```console
|
||||
$ wwhrd graph -o - | dot -Tpng > wwhrd-graph.png
|
||||
```
|
||||
|
||||
The `-o -` option will print the DOT output to `STDOUT`.
|
||||
|
||||
## Usage
|
||||
|
||||
```console
|
||||
$ wwhrd
|
||||
Usage:
|
||||
wwhrd [OPTIONS] <check | graph | list>
|
||||
|
||||
What would Henry Rollins do?
|
||||
|
||||
Application Options:
|
||||
-v, --version Show CLI version
|
||||
-q, --quiet quiet mode, do not log accepted packages
|
||||
-d, --debug verbose mode, log everything
|
||||
|
||||
Help Options:
|
||||
-h, --help Show this help message
|
||||
|
||||
Available commands:
|
||||
check Check licenses against config file (aliases: chk)
|
||||
graph Generate dot graph dependency tree (aliases: dot)
|
||||
list List licenses (aliases: ls)
|
||||
```
|
||||
|
||||
## Acknowledgments
|
||||
|
||||
WWHRD? graphic by [Mitch Clem](http://mitchclem.tumblr.com/), used with permission, [support him!](https://store.silversprocket.net/collections/mitchclem).
|
||||
284
vendor/github.com/frapposelli/wwhrd/cli.go
generated
vendored
Normal file
284
vendor/github.com/frapposelli/wwhrd/cli.go
generated
vendored
Normal file
@@ -0,0 +1,284 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"bufio"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"strings"
|
||||
|
||||
"github.com/jessevdk/go-flags"
|
||||
log "github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
type cliOpts struct {
|
||||
List `command:"list" alias:"ls" description:"List licenses"`
|
||||
Check `command:"check" alias:"chk" description:"Check licenses against config file"`
|
||||
Graph `command:"graph" alias:"dot" description:"Generate dot graph dependency tree"`
|
||||
VersionFlag func() error `long:"version" short:"v" description:"Show CLI version"`
|
||||
|
||||
Quiet func() error `short:"q" long:"quiet" description:"quiet mode, do not log accepted packages"`
|
||||
Debug func() error `short:"d" long:"debug" description:"verbose mode, log everything"`
|
||||
}
|
||||
|
||||
type List struct {
|
||||
NoColor bool `long:"no-color" description:"disable colored output"`
|
||||
CoverageThreshold float64 `short:"c" long:"coverage" description:"coverage threshold is the minimum percentage of the file that must contain license text" default:"75"`
|
||||
CheckTestFiles bool `short:"t" long:"check-test-files" description:"check imported dependencies for test files"`
|
||||
}
|
||||
|
||||
type Check struct {
|
||||
File string `short:"f" long:"file" description:"input file, use - for stdin" default:".wwhrd.yml"`
|
||||
NoColor bool `long:"no-color" description:"disable colored output"`
|
||||
CoverageThreshold float64 `short:"c" long:"coverage" description:"coverage threshold is the minimum percentage of the file that must contain license text" default:"75"`
|
||||
CheckTestFiles bool `short:"t" long:"check-test-files" description:"check imported dependencies for test files"`
|
||||
}
|
||||
|
||||
type Graph struct {
|
||||
File string `short:"o" long:"output" description:"output file, use - for stdout" default:"wwhrd-graph.dot"`
|
||||
CheckTestFiles bool `short:"t" long:"check-test-files" description:"check imported dependencies for test files"`
|
||||
}
|
||||
|
||||
const VersionHelp flags.ErrorType = 1961
|
||||
|
||||
var (
|
||||
version = "dev"
|
||||
commit = "1961213"
|
||||
date = "1961-02-13T20:06:35Z"
|
||||
)
|
||||
|
||||
func setQuiet() error {
|
||||
log.SetLevel(log.ErrorLevel)
|
||||
return nil
|
||||
}
|
||||
|
||||
func setDebug() error {
|
||||
log.SetLevel(log.DebugLevel)
|
||||
return nil
|
||||
}
|
||||
|
||||
func newCli() *flags.Parser {
|
||||
opts := cliOpts{
|
||||
VersionFlag: func() error {
|
||||
return &flags.Error{
|
||||
Type: VersionHelp,
|
||||
Message: fmt.Sprintf("version %s\ncommit %s\ndate %s\n", version, commit, date),
|
||||
}
|
||||
},
|
||||
Quiet: setQuiet,
|
||||
Debug: setDebug,
|
||||
}
|
||||
parser := flags.NewParser(&opts, flags.HelpFlag|flags.PassDoubleDash)
|
||||
parser.LongDescription = "What would Henry Rollins do?"
|
||||
|
||||
return parser
|
||||
}
|
||||
|
||||
func (g *Graph) Execute(args []string) error {
|
||||
root, err := rootDir()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
log.Infof("Generating DOT graph")
|
||||
|
||||
dotGraph, err := GraphImports(root, g.CheckTestFiles)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
if g.File == "-" {
|
||||
mf := bufio.NewWriter(os.Stdout)
|
||||
defer mf.Flush()
|
||||
|
||||
_, err = mf.Write([]byte(dotGraph))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
log.Debug("Creating file... ", g.File)
|
||||
mf, err := os.Create(g.File)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer mf.Close()
|
||||
|
||||
_, err = mf.Write([]byte(dotGraph))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
log.Infof("Graph saved in %q", g.File)
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (l *List) Execute(args []string) error {
|
||||
|
||||
if l.NoColor {
|
||||
log.SetFormatter(&log.TextFormatter{DisableColors: true})
|
||||
} else {
|
||||
log.SetFormatter(&log.TextFormatter{ForceColors: true})
|
||||
}
|
||||
|
||||
root, err := rootDir()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
pkgs, err := WalkImports(root, l.CheckTestFiles)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
lics := GetLicenses(root, pkgs, l.CoverageThreshold)
|
||||
|
||||
for k, v := range lics {
|
||||
log.WithFields(log.Fields{
|
||||
"package": k,
|
||||
"license": v,
|
||||
}).Info("Found License")
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (c *Check) Execute(args []string) error {
|
||||
|
||||
if c.NoColor {
|
||||
log.SetFormatter(&log.TextFormatter{DisableColors: true})
|
||||
} else {
|
||||
log.SetFormatter(&log.TextFormatter{ForceColors: true})
|
||||
}
|
||||
|
||||
var config []byte
|
||||
|
||||
if c.File == "-" {
|
||||
mf := bufio.NewReader(os.Stdin)
|
||||
var err error
|
||||
config, err = ioutil.ReadAll(mf)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
if _, err := os.Stat(c.File); os.IsNotExist(err) {
|
||||
return fmt.Errorf("can't read config file: %s", err)
|
||||
}
|
||||
|
||||
f, err := os.Open(c.File)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
config, err = ioutil.ReadAll(f)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if err = f.Close(); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
t, err := ReadConfig(config)
|
||||
if err != nil {
|
||||
err = fmt.Errorf("can't read config file: %s", err)
|
||||
return err
|
||||
}
|
||||
|
||||
log.Debugf("Loaded config: %+v", t)
|
||||
|
||||
root, err := rootDir()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
pkgs, err := WalkImports(root, c.CheckTestFiles)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
lics := GetLicenses(root, pkgs, c.CoverageThreshold)
|
||||
|
||||
// Make a map out of the blacklist
|
||||
blacklist := make(map[string]bool)
|
||||
for _, v := range t.Denylist {
|
||||
blacklist[v] = true
|
||||
}
|
||||
|
||||
// Make a map out of the whitelist
|
||||
whitelist := make(map[string]bool)
|
||||
for _, v := range t.Allowlist {
|
||||
whitelist[v] = true
|
||||
}
|
||||
|
||||
// Make a map out of the exceptions list
|
||||
exceptions := make(map[string]bool)
|
||||
exceptionsWildcard := make(map[string]bool)
|
||||
for _, v := range t.Exceptions {
|
||||
if strings.HasSuffix(v, "/...") {
|
||||
exceptionsWildcard[strings.TrimSuffix(v, "/...")] = true
|
||||
} else {
|
||||
exceptions[v] = true
|
||||
}
|
||||
}
|
||||
|
||||
PackageList:
|
||||
for pkg, lic := range lics {
|
||||
contextLogger := log.WithFields(log.Fields{
|
||||
"package": pkg,
|
||||
"license": lic,
|
||||
})
|
||||
|
||||
// License is whitelisted and not specified in blacklist
|
||||
if whitelist[lic] && !blacklist[lic] {
|
||||
contextLogger.Info("Found Approved license")
|
||||
continue PackageList
|
||||
}
|
||||
|
||||
// if we have exceptions wildcards, let's run through them
|
||||
if len(exceptionsWildcard) > 0 {
|
||||
for wc := range exceptionsWildcard {
|
||||
if strings.HasPrefix(pkg, wc) {
|
||||
// we have a match
|
||||
contextLogger.Warn("Found exceptioned package")
|
||||
continue PackageList
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// match single-package exceptions
|
||||
if _, exists := exceptions[pkg]; exists {
|
||||
contextLogger.Warn("Found exceptioned package")
|
||||
continue PackageList
|
||||
}
|
||||
|
||||
// no matches, it's a non-approved license
|
||||
contextLogger.Error("Found Non-Approved license")
|
||||
err = fmt.Errorf("Non-Approved license found")
|
||||
|
||||
}
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
func rootDir() (string, error) {
|
||||
root, err := os.Getwd()
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
info, err := os.Lstat(root)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
if info.Mode()&os.ModeSymlink != 0 {
|
||||
root, err = os.Readlink(root)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
}
|
||||
return root, nil
|
||||
}
|
||||
40
vendor/github.com/frapposelli/wwhrd/config.go
generated
vendored
Normal file
40
vendor/github.com/frapposelli/wwhrd/config.go
generated
vendored
Normal file
@@ -0,0 +1,40 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"gopkg.in/yaml.v2"
|
||||
)
|
||||
|
||||
type OldConfig struct {
|
||||
Allowlist []string `yaml:"whitelist"`
|
||||
Denylist []string `yaml:"blacklist"`
|
||||
Exceptions []string `yaml:"exceptions"`
|
||||
}
|
||||
|
||||
type Config struct {
|
||||
Allowlist []string `yaml:"allowlist"`
|
||||
Denylist []string `yaml:"denylist"`
|
||||
Exceptions []string `yaml:"exceptions"`
|
||||
}
|
||||
|
||||
func ReadConfig(config []byte) (*Config, error) {
|
||||
|
||||
t := Config{}
|
||||
old := OldConfig{}
|
||||
|
||||
// Parse new format
|
||||
if err := yaml.NewDecoder(bytes.NewReader(config)).Decode(&t); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// Parse old format
|
||||
if err := yaml.NewDecoder(bytes.NewReader(config)).Decode(&old); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
t.Allowlist = append(t.Allowlist, old.Allowlist...)
|
||||
t.Denylist = append(t.Denylist, old.Denylist...)
|
||||
t.Exceptions = append(t.Exceptions, old.Exceptions...)
|
||||
|
||||
return &t, nil
|
||||
}
|
||||
16
vendor/github.com/frapposelli/wwhrd/go.mod
generated
vendored
Normal file
16
vendor/github.com/frapposelli/wwhrd/go.mod
generated
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
module github.com/frapposelli/wwhrd
|
||||
|
||||
go 1.15
|
||||
|
||||
require (
|
||||
github.com/emicklei/dot v0.15.0
|
||||
github.com/google/licensecheck v0.3.1
|
||||
github.com/jessevdk/go-flags v1.4.0
|
||||
github.com/kr/text v0.2.0 // indirect
|
||||
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e // indirect
|
||||
github.com/sirupsen/logrus v1.7.0
|
||||
github.com/stretchr/testify v1.6.1
|
||||
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68 // indirect
|
||||
gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f // indirect
|
||||
gopkg.in/yaml.v2 v2.3.0
|
||||
)
|
||||
34
vendor/github.com/frapposelli/wwhrd/go.sum
generated
vendored
Normal file
34
vendor/github.com/frapposelli/wwhrd/go.sum
generated
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
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/emicklei/dot v0.15.0 h1:XDBW0Xco1QNyRb33cqLe10cT04yMWL1XpCZfa98Q6Og=
|
||||
github.com/emicklei/dot v0.15.0/go.mod h1:DeV7GvQtIw4h2u73RKBkkFdvVAz0D9fzeJrgPW6gy/s=
|
||||
github.com/google/licensecheck v0.3.1 h1:QoxgoDkaeC4nFrtGN1jV7IPmDCHFNIVh54e5hSt6sPs=
|
||||
github.com/google/licensecheck v0.3.1/go.mod h1:ORkR35t/JjW+emNKtfJDII0zlciG9JgbT7SmsohlHmY=
|
||||
github.com/jessevdk/go-flags v1.4.0 h1:4IU2WS7AumrZ/40jfhf4QVDMsQwqA7VEHozFRrGARJA=
|
||||
github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI=
|
||||
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/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs=
|
||||
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno=
|
||||
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/sirupsen/logrus v1.7.0 h1:ShrD1U9pZB12TX0cVy0DtePoCH97K8EtX+mg7ZARUtM=
|
||||
github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0=
|
||||
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
|
||||
github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0=
|
||||
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||
golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68 h1:nxC68pudNYkKU6jWhgrqdreuFiOQWj1Fs7T3VrH4Pjw=
|
||||
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f h1:BLraFXnmrev5lT+xlilqcH8XK9/i0At2xKjWk4p6zsU=
|
||||
gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/yaml.v2 v2.3.0 h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU=
|
||||
gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo=
|
||||
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||
386
vendor/github.com/frapposelli/wwhrd/walker.go
generated
vendored
Normal file
386
vendor/github.com/frapposelli/wwhrd/walker.go
generated
vendored
Normal file
@@ -0,0 +1,386 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"go/parser"
|
||||
"go/token"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
"sync"
|
||||
|
||||
"github.com/emicklei/dot"
|
||||
"github.com/google/licensecheck"
|
||||
log "github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
const (
|
||||
unknownLicense string = "UNKNOWN"
|
||||
)
|
||||
|
||||
var (
|
||||
// FileNames used to search for licenses
|
||||
// "LICENSE.docs" and "LICENCE.docs" are excluded from the list as we only care about source code in the repo.
|
||||
FileNames = []string{
|
||||
"COPYING",
|
||||
"COPYING.md",
|
||||
"COPYING.markdown",
|
||||
"COPYING.txt",
|
||||
"LICENCE",
|
||||
"LICENCE.md",
|
||||
"LICENCE.markdown",
|
||||
"LICENCE.txt",
|
||||
"LICENSE",
|
||||
"LICENSE.md",
|
||||
"LICENSE.markdown",
|
||||
"LICENSE.txt",
|
||||
"LICENSE-2.0.txt",
|
||||
"LICENCE-2.0.txt",
|
||||
"LICENSE-APACHE",
|
||||
"LICENCE-APACHE",
|
||||
"LICENSE-APACHE-2.0.txt",
|
||||
"LICENCE-APACHE-2.0.txt",
|
||||
"LICENSE-MIT",
|
||||
"LICENCE-MIT",
|
||||
"LICENSE.MIT",
|
||||
"LICENCE.MIT",
|
||||
"LICENSE.code",
|
||||
"LICENCE.code",
|
||||
"LICENSE.rst",
|
||||
"LICENCE.rst",
|
||||
"MIT-LICENSE",
|
||||
"MIT-LICENCE",
|
||||
"MIT-LICENSE.md",
|
||||
"MIT-LICENCE.md",
|
||||
"MIT-LICENSE.markdown",
|
||||
"MIT-LICENCE.markdown",
|
||||
"MIT-LICENSE.txt",
|
||||
"MIT-LICENCE.txt",
|
||||
"MIT_LICENSE",
|
||||
"MIT_LICENCE",
|
||||
"UNLICENSE",
|
||||
"UNLICENCE",
|
||||
}
|
||||
)
|
||||
|
||||
// fileNamesLowercase has all the entries of FileNames, lower cased and made a set
|
||||
// for fast case-insensitive matching.
|
||||
var fileNamesLowercase = map[string]bool{}
|
||||
|
||||
func init() {
|
||||
for _, f := range FileNames {
|
||||
fileNamesLowercase[strings.ToLower(f)] = true
|
||||
}
|
||||
}
|
||||
|
||||
// dependencies are tracked as a graph, but the graph itself is not used to build the node list
|
||||
type dependencies struct {
|
||||
nodes []*node
|
||||
nodesList map[string]bool
|
||||
edges map[node][]*node
|
||||
dotGraph *dot.Graph
|
||||
checkTest bool
|
||||
sync.RWMutex
|
||||
}
|
||||
|
||||
type node struct {
|
||||
pkg string
|
||||
dir string
|
||||
vendor string
|
||||
}
|
||||
|
||||
func newGraph(checkTest bool) *dependencies {
|
||||
var g dependencies
|
||||
g.nodesList = make(map[string]bool)
|
||||
g.checkTest = checkTest
|
||||
return &g
|
||||
}
|
||||
|
||||
// AddNode adds a node to the graph
|
||||
func (g *dependencies) addNode(n *node) error {
|
||||
log.Debugf("[%s] current nodesList status %+v", n.pkg, g.nodesList)
|
||||
// check if Node has been visited, this is done raw by caching it in a global hashtable
|
||||
if !g.nodesList[n.pkg] {
|
||||
g.Lock()
|
||||
g.nodes = append(g.nodes, n)
|
||||
g.nodesList[n.pkg] = true
|
||||
g.Unlock()
|
||||
return nil
|
||||
}
|
||||
return fmt.Errorf("[%s] node already visited", n.pkg)
|
||||
}
|
||||
|
||||
// addEdge adds an edge to the graph
|
||||
func (g *dependencies) addEdge(n1, n2 *node) {
|
||||
g.Lock()
|
||||
if g.edges == nil {
|
||||
g.edges = make(map[node][]*node)
|
||||
}
|
||||
g.edges[*n1] = append(g.edges[*n1], n2)
|
||||
g.edges[*n2] = append(g.edges[*n2], n1)
|
||||
g.Unlock()
|
||||
}
|
||||
|
||||
func (g *dependencies) getDotGraph() string {
|
||||
g.dotGraph = dot.NewGraph(dot.Directed)
|
||||
g.generateDotGraph(func(n *node) {})
|
||||
return g.dotGraph.String()
|
||||
}
|
||||
|
||||
type nodeQueue struct {
|
||||
items []node
|
||||
sync.RWMutex
|
||||
}
|
||||
|
||||
func (s *nodeQueue) new() *nodeQueue {
|
||||
s.Lock()
|
||||
s.items = []node{}
|
||||
s.Unlock()
|
||||
return s
|
||||
}
|
||||
|
||||
func (s *nodeQueue) enqueue(t node) {
|
||||
s.Lock()
|
||||
s.items = append(s.items, t)
|
||||
s.Unlock()
|
||||
}
|
||||
|
||||
func (s *nodeQueue) dequeue() *node {
|
||||
s.Lock()
|
||||
item := s.items[0]
|
||||
s.items = s.items[1:len(s.items)]
|
||||
s.Unlock()
|
||||
return &item
|
||||
}
|
||||
|
||||
func (s *nodeQueue) isEmpty() bool {
|
||||
s.RLock()
|
||||
defer s.RUnlock()
|
||||
return len(s.items) == 0
|
||||
}
|
||||
|
||||
// do a BFS on the graph and generate dot.Graph
|
||||
func (g *dependencies) generateDotGraph(f func(*node)) {
|
||||
g.RLock()
|
||||
q := nodeQueue{}
|
||||
q.new()
|
||||
n := g.nodes[0]
|
||||
q.enqueue(*n)
|
||||
visited := make(map[*node]bool)
|
||||
for {
|
||||
if q.isEmpty() {
|
||||
break
|
||||
}
|
||||
node := q.dequeue()
|
||||
// add dotGraph node after dequeing
|
||||
dGN := g.dotGraph.Node(node.pkg)
|
||||
|
||||
visited[node] = true
|
||||
near := g.edges[*node]
|
||||
|
||||
for i := 0; i < len(near); i++ {
|
||||
j := near[i]
|
||||
if !visited[j] {
|
||||
// add unvisited node to dotGraph
|
||||
edGN := g.dotGraph.Node(j.pkg)
|
||||
// add an edge in the dotGraph between ancestor and descendant
|
||||
g.dotGraph.Edge(dGN, edGN)
|
||||
q.enqueue(*j)
|
||||
visited[j] = true
|
||||
}
|
||||
}
|
||||
if f != nil {
|
||||
f(node)
|
||||
}
|
||||
}
|
||||
g.RUnlock()
|
||||
}
|
||||
|
||||
func (g *dependencies) WalkNode(n *node) {
|
||||
var walkFn = func(path string, info os.FileInfo, err error) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
log.Debugf("walking %q", path)
|
||||
|
||||
// check if we need to skip this
|
||||
if ok, err := shouldSkip(path, info, g.checkTest); ok {
|
||||
return err
|
||||
}
|
||||
|
||||
fs := token.NewFileSet()
|
||||
f, err := parser.ParseFile(fs, path, nil, parser.ImportsOnly)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
for _, s := range f.Imports {
|
||||
vendorpkg := strings.Replace(s.Path.Value, "\"", "", -1)
|
||||
log.Debugf("found import %q", vendorpkg)
|
||||
pkgdir := filepath.Join(n.vendor, "vendor", vendorpkg)
|
||||
if _, err := os.Stat(pkgdir); !os.IsNotExist(err) {
|
||||
|
||||
// Add imported pkg to the graph
|
||||
var vendornode = node{pkg: vendorpkg, dir: pkgdir, vendor: n.vendor}
|
||||
log.Debugf("[%s] adding node", vendornode.pkg)
|
||||
if err := g.addNode(&vendornode); err != nil {
|
||||
log.Debug(err.Error())
|
||||
continue
|
||||
}
|
||||
log.Debugf("[%s] adding node as edge of %s", vendornode.pkg, n.pkg)
|
||||
g.addEdge(n, &vendornode)
|
||||
log.Debugf("[%s] walking node", vendornode.pkg)
|
||||
g.WalkNode(&vendornode)
|
||||
}
|
||||
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
if err := filepath.Walk(n.dir, walkFn); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
func WalkImports(root string, checkTest bool) (map[string]bool, error) {
|
||||
|
||||
graph := newGraph(checkTest)
|
||||
rootNode := node{pkg: "root", dir: root, vendor: root}
|
||||
if err := graph.addNode(&rootNode); err != nil {
|
||||
log.Debug(err.Error())
|
||||
}
|
||||
|
||||
log.Debugf("[%s] walking root node", rootNode.pkg)
|
||||
graph.WalkNode(&rootNode)
|
||||
|
||||
return graph.nodesList, nil
|
||||
}
|
||||
|
||||
func GraphImports(root string, checkTest bool) (string, error) {
|
||||
|
||||
graph := newGraph(checkTest)
|
||||
rootNode := node{pkg: "root", dir: root, vendor: root}
|
||||
if err := graph.addNode(&rootNode); err != nil {
|
||||
log.Debug(err.Error())
|
||||
}
|
||||
|
||||
log.Debugf("[%s] walking root node", rootNode.pkg)
|
||||
graph.WalkNode(&rootNode)
|
||||
|
||||
return graph.getDotGraph(), nil
|
||||
}
|
||||
|
||||
func GetLicenses(root string, list map[string]bool, threshold float64) map[string]string {
|
||||
|
||||
checker, err := licensecheck.NewScanner(licensecheck.BuiltinLicenses())
|
||||
if err != nil {
|
||||
log.Fatal("Cannot initialize LicenseChecker")
|
||||
}
|
||||
|
||||
var lics = make(map[string]string)
|
||||
|
||||
if !strings.HasSuffix(root, "vendor") {
|
||||
root = filepath.Join(root, "vendor")
|
||||
}
|
||||
log.Debug("Start walking paths for LICENSE discovery")
|
||||
for k := range list {
|
||||
|
||||
var fpath = filepath.Join(root, k)
|
||||
pkg, err := os.Stat(fpath)
|
||||
|
||||
if err != nil {
|
||||
continue
|
||||
}
|
||||
if pkg.IsDir() {
|
||||
log.Debugf("Walking path: %s", fpath)
|
||||
|
||||
waa := scanDir(checker, fpath, threshold)
|
||||
if waa != "" {
|
||||
lics[k] = waa
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return lics
|
||||
}
|
||||
|
||||
func scanDir(checker *licensecheck.Scanner, fpath string, threshold float64) string {
|
||||
var license = ""
|
||||
|
||||
filesInDir, err := ioutil.ReadDir(fpath)
|
||||
if err != nil {
|
||||
return ""
|
||||
}
|
||||
for _, f := range filesInDir {
|
||||
log.Debugf("Evaluating: %s", f.Name())
|
||||
// if it's a directory or not in the list of well-known license files, we skip
|
||||
if f.IsDir() || !fileNamesLowercase[strings.ToLower(f.Name())] {
|
||||
log.Debugf("Skipping...")
|
||||
continue
|
||||
}
|
||||
|
||||
// Read the license file
|
||||
text, err := ioutil.ReadFile(filepath.Join(fpath, f.Name()))
|
||||
if err != nil {
|
||||
log.Errorf("Cannot read file: %s because: %s", filepath.Join(fpath, f.Name()), err.Error())
|
||||
continue
|
||||
}
|
||||
|
||||
// Verify against the checker
|
||||
cov := checker.Scan(text)
|
||||
log.Debugf("%.1f%% of text covered by licenses:\n", cov.Percent)
|
||||
for _, m := range cov.Match {
|
||||
log.Debugf("%s at [%d:%d] IsURL=%v\n", m.ID, m.Start, m.End, m.IsURL)
|
||||
}
|
||||
|
||||
// If the threshold is met, we qualify the license
|
||||
if cov.Percent >= threshold {
|
||||
license = cov.Match[0].ID
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// if we didn't find any licenses after walking the path, we pop one out from it
|
||||
if license == "" {
|
||||
pak := strings.Split(filepath.ToSlash(fpath), "/")
|
||||
// if we're 1 directories removed from vendor/ that means we couldn't find a decent license file
|
||||
if pak[len(pak)-2] != "vendor" {
|
||||
log.Debugf("Recursive call to scanDir starting from: %s going to: %s", fpath, filepath.FromSlash(strings.Join(pak[:len(pak)-1], "/")))
|
||||
license = scanDir(checker, filepath.FromSlash(strings.Join(pak[:len(pak)-1], "/")), threshold)
|
||||
}
|
||||
}
|
||||
|
||||
if license == "" {
|
||||
license = unknownLicense
|
||||
}
|
||||
|
||||
return license
|
||||
}
|
||||
|
||||
func shouldSkip(path string, info os.FileInfo, checkTest bool) (bool, error) {
|
||||
if info.IsDir() {
|
||||
name := info.Name()
|
||||
// check if directory is in the blocklist
|
||||
if strings.HasPrefix(name, ".") || strings.HasPrefix(name, "_") || name == "testdata" || name == "vendor" {
|
||||
log.Debugf("skipping %q: directory in blocklist", path)
|
||||
return true, filepath.SkipDir
|
||||
}
|
||||
return true, nil
|
||||
}
|
||||
// if it's not a .go file, skip
|
||||
if filepath.Ext(path) != ".go" {
|
||||
log.Debugf("skipping %q: not a go file", path)
|
||||
return true, nil
|
||||
}
|
||||
// if it's a test file, skip
|
||||
if strings.HasSuffix(path, "_test.go") && !checkTest {
|
||||
log.Debugf("skipping %q: test file", path)
|
||||
return true, nil
|
||||
}
|
||||
return false, nil
|
||||
}
|
||||
33
vendor/github.com/frapposelli/wwhrd/wwhrd.go
generated
vendored
Normal file
33
vendor/github.com/frapposelli/wwhrd/wwhrd.go
generated
vendored
Normal file
@@ -0,0 +1,33 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/jessevdk/go-flags"
|
||||
log "github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
// Initialize and run wwhrd
|
||||
func main() {
|
||||
parser := newCli()
|
||||
c, err := parser.Parse()
|
||||
if err != nil {
|
||||
if _, ok := err.(*flags.Error); ok {
|
||||
typ := err.(*flags.Error).Type
|
||||
switch {
|
||||
case typ == VersionHelp:
|
||||
fmt.Println(err.(*flags.Error).Message)
|
||||
case typ == flags.ErrHelp:
|
||||
parser.WriteHelp(os.Stdout)
|
||||
case typ == flags.ErrCommandRequired && len(c[0]) == 0:
|
||||
parser.WriteHelp(os.Stdout)
|
||||
default:
|
||||
log.Info(err.Error() + fmt.Sprint(typ))
|
||||
parser.WriteHelp(os.Stdout)
|
||||
}
|
||||
} else {
|
||||
log.Fatalf("Exiting: %s", err.Error())
|
||||
}
|
||||
}
|
||||
}
|
||||
14
vendor/github.com/go-task/slim-sprig/.editorconfig
generated
vendored
Normal file
14
vendor/github.com/go-task/slim-sprig/.editorconfig
generated
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
# editorconfig.org
|
||||
|
||||
root = true
|
||||
|
||||
[*]
|
||||
insert_final_newline = true
|
||||
charset = utf-8
|
||||
trim_trailing_whitespace = true
|
||||
indent_style = tab
|
||||
indent_size = 8
|
||||
|
||||
[*.{md,yml,yaml,json}]
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
1
vendor/github.com/go-task/slim-sprig/.gitattributes
generated
vendored
Normal file
1
vendor/github.com/go-task/slim-sprig/.gitattributes
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
* text=auto
|
||||
2
vendor/github.com/go-task/slim-sprig/.gitignore
generated
vendored
Normal file
2
vendor/github.com/go-task/slim-sprig/.gitignore
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
vendor/
|
||||
/.glide
|
||||
364
vendor/github.com/go-task/slim-sprig/CHANGELOG.md
generated
vendored
Normal file
364
vendor/github.com/go-task/slim-sprig/CHANGELOG.md
generated
vendored
Normal file
@@ -0,0 +1,364 @@
|
||||
# Changelog
|
||||
|
||||
## Release 3.2.0 (2020-12-14)
|
||||
|
||||
### Added
|
||||
|
||||
- #211: Added randInt function (thanks @kochurovro)
|
||||
- #223: Added fromJson and mustFromJson functions (thanks @mholt)
|
||||
- #242: Added a bcrypt function (thanks @robbiet480)
|
||||
- #253: Added randBytes function (thanks @MikaelSmith)
|
||||
- #254: Added dig function for dicts (thanks @nyarly)
|
||||
- #257: Added regexQuoteMeta for quoting regex metadata (thanks @rheaton)
|
||||
- #261: Added filepath functions osBase, osDir, osExt, osClean, osIsAbs (thanks @zugl)
|
||||
- #268: Added and and all functions for testing conditions (thanks @phuslu)
|
||||
- #181: Added float64 arithmetic addf, add1f, subf, divf, mulf, maxf, and minf
|
||||
(thanks @andrewmostello)
|
||||
- #265: Added chunk function to split array into smaller arrays (thanks @karelbilek)
|
||||
- #270: Extend certificate functions to handle non-RSA keys + add support for
|
||||
ed25519 keys (thanks @misberner)
|
||||
|
||||
### Changed
|
||||
|
||||
- Removed testing and support for Go 1.12. ed25519 support requires Go 1.13 or newer
|
||||
- Using semver 3.1.1 and mergo 0.3.11
|
||||
|
||||
### Fixed
|
||||
|
||||
- #249: Fix htmlDateInZone example (thanks @spawnia)
|
||||
|
||||
NOTE: The dependency github.com/imdario/mergo reverted the breaking change in
|
||||
0.3.9 via 0.3.10 release.
|
||||
|
||||
## Release 3.1.0 (2020-04-16)
|
||||
|
||||
NOTE: The dependency github.com/imdario/mergo made a behavior change in 0.3.9
|
||||
that impacts sprig functionality. Do not use sprig with a version newer than 0.3.8.
|
||||
|
||||
### Added
|
||||
|
||||
- #225: Added support for generating htpasswd hash (thanks @rustycl0ck)
|
||||
- #224: Added duration filter (thanks @frebib)
|
||||
- #205: Added `seq` function (thanks @thadc23)
|
||||
|
||||
### Changed
|
||||
|
||||
- #203: Unlambda functions with correct signature (thanks @muesli)
|
||||
- #236: Updated the license formatting for GitHub display purposes
|
||||
- #238: Updated package dependency versions. Note, mergo not updated to 0.3.9
|
||||
as it causes a breaking change for sprig. That issue is tracked at
|
||||
https://github.com/imdario/mergo/issues/139
|
||||
|
||||
### Fixed
|
||||
|
||||
- #229: Fix `seq` example in docs (thanks @kalmant)
|
||||
|
||||
## Release 3.0.2 (2019-12-13)
|
||||
|
||||
### Fixed
|
||||
|
||||
- #220: Updating to semver v3.0.3 to fix issue with <= ranges
|
||||
- #218: fix typo elyptical->elliptic in ecdsa key description (thanks @laverya)
|
||||
|
||||
## Release 3.0.1 (2019-12-08)
|
||||
|
||||
### Fixed
|
||||
|
||||
- #212: Updated semver fixing broken constraint checking with ^0.0
|
||||
|
||||
## Release 3.0.0 (2019-10-02)
|
||||
|
||||
### Added
|
||||
|
||||
- #187: Added durationRound function (thanks @yjp20)
|
||||
- #189: Added numerous template functions that return errors rather than panic (thanks @nrvnrvn)
|
||||
- #193: Added toRawJson support (thanks @Dean-Coakley)
|
||||
- #197: Added get support to dicts (thanks @Dean-Coakley)
|
||||
|
||||
### Changed
|
||||
|
||||
- #186: Moving dependency management to Go modules
|
||||
- #186: Updated semver to v3. This has changes in the way ^ is handled
|
||||
- #194: Updated documentation on merging and how it copies. Added example using deepCopy
|
||||
- #196: trunc now supports negative values (thanks @Dean-Coakley)
|
||||
|
||||
## Release 2.22.0 (2019-10-02)
|
||||
|
||||
### Added
|
||||
|
||||
- #173: Added getHostByName function to resolve dns names to ips (thanks @fcgravalos)
|
||||
- #195: Added deepCopy function for use with dicts
|
||||
|
||||
### Changed
|
||||
|
||||
- Updated merge and mergeOverwrite documentation to explain copying and how to
|
||||
use deepCopy with it
|
||||
|
||||
## Release 2.21.0 (2019-09-18)
|
||||
|
||||
### Added
|
||||
|
||||
- #122: Added encryptAES/decryptAES functions (thanks @n0madic)
|
||||
- #128: Added toDecimal support (thanks @Dean-Coakley)
|
||||
- #169: Added list contcat (thanks @astorath)
|
||||
- #174: Added deepEqual function (thanks @bonifaido)
|
||||
- #170: Added url parse and join functions (thanks @astorath)
|
||||
|
||||
### Changed
|
||||
|
||||
- #171: Updated glide config for Google UUID to v1 and to add ranges to semver and testify
|
||||
|
||||
### Fixed
|
||||
|
||||
- #172: Fix semver wildcard example (thanks @piepmatz)
|
||||
- #175: Fix dateInZone doc example (thanks @s3than)
|
||||
|
||||
## Release 2.20.0 (2019-06-18)
|
||||
|
||||
### Added
|
||||
|
||||
- #164: Adding function to get unix epoch for a time (@mattfarina)
|
||||
- #166: Adding tests for date_in_zone (@mattfarina)
|
||||
|
||||
### Changed
|
||||
|
||||
- #144: Fix function comments based on best practices from Effective Go (@CodeLingoTeam)
|
||||
- #150: Handles pointer type for time.Time in "htmlDate" (@mapreal19)
|
||||
- #161, #157, #160, #153, #158, #156, #155, #159, #152 documentation updates (@badeadan)
|
||||
|
||||
### Fixed
|
||||
|
||||
## Release 2.19.0 (2019-03-02)
|
||||
|
||||
IMPORTANT: This release reverts a change from 2.18.0
|
||||
|
||||
In the previous release (2.18), we prematurely merged a partial change to the crypto functions that led to creating two sets of crypto functions (I blame @technosophos -- since that's me). This release rolls back that change, and does what was originally intended: It alters the existing crypto functions to use secure random.
|
||||
|
||||
We debated whether this classifies as a change worthy of major revision, but given the proximity to the last release, we have decided that treating 2.18 as a faulty release is the correct course of action. We apologize for any inconvenience.
|
||||
|
||||
### Changed
|
||||
|
||||
- Fix substr panic 35fb796 (Alexey igrychev)
|
||||
- Remove extra period 1eb7729 (Matthew Lorimor)
|
||||
- Make random string functions use crypto by default 6ceff26 (Matthew Lorimor)
|
||||
- README edits/fixes/suggestions 08fe136 (Lauri Apple)
|
||||
|
||||
|
||||
## Release 2.18.0 (2019-02-12)
|
||||
|
||||
### Added
|
||||
|
||||
- Added mergeOverwrite function
|
||||
- cryptographic functions that use secure random (see fe1de12)
|
||||
|
||||
### Changed
|
||||
|
||||
- Improve documentation of regexMatch function, resolves #139 90b89ce (Jan Tagscherer)
|
||||
- Handle has for nil list 9c10885 (Daniel Cohen)
|
||||
- Document behaviour of mergeOverwrite fe0dbe9 (Lukas Rieder)
|
||||
- doc: adds missing documentation. 4b871e6 (Fernandez Ludovic)
|
||||
- Replace outdated goutils imports 01893d2 (Matthew Lorimor)
|
||||
- Surface crypto secure random strings from goutils fe1de12 (Matthew Lorimor)
|
||||
- Handle untyped nil values as paramters to string functions 2b2ec8f (Morten Torkildsen)
|
||||
|
||||
### Fixed
|
||||
|
||||
- Fix dict merge issue and provide mergeOverwrite .dst .src1 to overwrite from src -> dst 4c59c12 (Lukas Rieder)
|
||||
- Fix substr var names and comments d581f80 (Dean Coakley)
|
||||
- Fix substr documentation 2737203 (Dean Coakley)
|
||||
|
||||
## Release 2.17.1 (2019-01-03)
|
||||
|
||||
### Fixed
|
||||
|
||||
The 2.17.0 release did not have a version pinned for xstrings, which caused compilation failures when xstrings < 1.2 was used. This adds the correct version string to glide.yaml.
|
||||
|
||||
## Release 2.17.0 (2019-01-03)
|
||||
|
||||
### Added
|
||||
|
||||
- adds alder32sum function and test 6908fc2 (marshallford)
|
||||
- Added kebabcase function ca331a1 (Ilyes512)
|
||||
|
||||
### Changed
|
||||
|
||||
- Update goutils to 1.1.0 4e1125d (Matt Butcher)
|
||||
|
||||
### Fixed
|
||||
|
||||
- Fix 'has' documentation e3f2a85 (dean-coakley)
|
||||
- docs(dict): fix typo in pick example dc424f9 (Dustin Specker)
|
||||
- fixes spelling errors... not sure how that happened 4cf188a (marshallford)
|
||||
|
||||
## Release 2.16.0 (2018-08-13)
|
||||
|
||||
### Added
|
||||
|
||||
- add splitn function fccb0b0 (Helgi Þorbjörnsson)
|
||||
- Add slice func df28ca7 (gongdo)
|
||||
- Generate serial number a3bdffd (Cody Coons)
|
||||
- Extract values of dict with values function df39312 (Lawrence Jones)
|
||||
|
||||
### Changed
|
||||
|
||||
- Modify panic message for list.slice ae38335 (gongdo)
|
||||
- Minor improvement in code quality - Removed an unreachable piece of code at defaults.go#L26:6 - Resolve formatting issues. 5834241 (Abhishek Kashyap)
|
||||
- Remove duplicated documentation 1d97af1 (Matthew Fisher)
|
||||
- Test on go 1.11 49df809 (Helgi Þormar Þorbjörnsson)
|
||||
|
||||
### Fixed
|
||||
|
||||
- Fix file permissions c5f40b5 (gongdo)
|
||||
- Fix example for buildCustomCert 7779e0d (Tin Lam)
|
||||
|
||||
## Release 2.15.0 (2018-04-02)
|
||||
|
||||
### Added
|
||||
|
||||
- #68 and #69: Add json helpers to docs (thanks @arunvelsriram)
|
||||
- #66: Add ternary function (thanks @binoculars)
|
||||
- #67: Allow keys function to take multiple dicts (thanks @binoculars)
|
||||
- #89: Added sha1sum to crypto function (thanks @benkeil)
|
||||
- #81: Allow customizing Root CA that used by genSignedCert (thanks @chenzhiwei)
|
||||
- #92: Add travis testing for go 1.10
|
||||
- #93: Adding appveyor config for windows testing
|
||||
|
||||
### Changed
|
||||
|
||||
- #90: Updating to more recent dependencies
|
||||
- #73: replace satori/go.uuid with google/uuid (thanks @petterw)
|
||||
|
||||
### Fixed
|
||||
|
||||
- #76: Fixed documentation typos (thanks @Thiht)
|
||||
- Fixed rounding issue on the `ago` function. Note, the removes support for Go 1.8 and older
|
||||
|
||||
## Release 2.14.1 (2017-12-01)
|
||||
|
||||
### Fixed
|
||||
|
||||
- #60: Fix typo in function name documentation (thanks @neil-ca-moore)
|
||||
- #61: Removing line with {{ due to blocking github pages genertion
|
||||
- #64: Update the list functions to handle int, string, and other slices for compatibility
|
||||
|
||||
## Release 2.14.0 (2017-10-06)
|
||||
|
||||
This new version of Sprig adds a set of functions for generating and working with SSL certificates.
|
||||
|
||||
- `genCA` generates an SSL Certificate Authority
|
||||
- `genSelfSignedCert` generates an SSL self-signed certificate
|
||||
- `genSignedCert` generates an SSL certificate and key based on a given CA
|
||||
|
||||
## Release 2.13.0 (2017-09-18)
|
||||
|
||||
This release adds new functions, including:
|
||||
|
||||
- `regexMatch`, `regexFindAll`, `regexFind`, `regexReplaceAll`, `regexReplaceAllLiteral`, and `regexSplit` to work with regular expressions
|
||||
- `floor`, `ceil`, and `round` math functions
|
||||
- `toDate` converts a string to a date
|
||||
- `nindent` is just like `indent` but also prepends a new line
|
||||
- `ago` returns the time from `time.Now`
|
||||
|
||||
### Added
|
||||
|
||||
- #40: Added basic regex functionality (thanks @alanquillin)
|
||||
- #41: Added ceil floor and round functions (thanks @alanquillin)
|
||||
- #48: Added toDate function (thanks @andreynering)
|
||||
- #50: Added nindent function (thanks @binoculars)
|
||||
- #46: Added ago function (thanks @slayer)
|
||||
|
||||
### Changed
|
||||
|
||||
- #51: Updated godocs to include new string functions (thanks @curtisallen)
|
||||
- #49: Added ability to merge multiple dicts (thanks @binoculars)
|
||||
|
||||
## Release 2.12.0 (2017-05-17)
|
||||
|
||||
- `snakecase`, `camelcase`, and `shuffle` are three new string functions
|
||||
- `fail` allows you to bail out of a template render when conditions are not met
|
||||
|
||||
## Release 2.11.0 (2017-05-02)
|
||||
|
||||
- Added `toJson` and `toPrettyJson`
|
||||
- Added `merge`
|
||||
- Refactored documentation
|
||||
|
||||
## Release 2.10.0 (2017-03-15)
|
||||
|
||||
- Added `semver` and `semverCompare` for Semantic Versions
|
||||
- `list` replaces `tuple`
|
||||
- Fixed issue with `join`
|
||||
- Added `first`, `last`, `intial`, `rest`, `prepend`, `append`, `toString`, `toStrings`, `sortAlpha`, `reverse`, `coalesce`, `pluck`, `pick`, `compact`, `keys`, `omit`, `uniq`, `has`, `without`
|
||||
|
||||
## Release 2.9.0 (2017-02-23)
|
||||
|
||||
- Added `splitList` to split a list
|
||||
- Added crypto functions of `genPrivateKey` and `derivePassword`
|
||||
|
||||
## Release 2.8.0 (2016-12-21)
|
||||
|
||||
- Added access to several path functions (`base`, `dir`, `clean`, `ext`, and `abs`)
|
||||
- Added functions for _mutating_ dictionaries (`set`, `unset`, `hasKey`)
|
||||
|
||||
## Release 2.7.0 (2016-12-01)
|
||||
|
||||
- Added `sha256sum` to generate a hash of an input
|
||||
- Added functions to convert a numeric or string to `int`, `int64`, `float64`
|
||||
|
||||
## Release 2.6.0 (2016-10-03)
|
||||
|
||||
- Added a `uuidv4` template function for generating UUIDs inside of a template.
|
||||
|
||||
## Release 2.5.0 (2016-08-19)
|
||||
|
||||
- New `trimSuffix`, `trimPrefix`, `hasSuffix`, and `hasPrefix` functions
|
||||
- New aliases have been added for a few functions that didn't follow the naming conventions (`trimAll` and `abbrevBoth`)
|
||||
- `trimall` and `abbrevboth` (notice the case) are deprecated and will be removed in 3.0.0
|
||||
|
||||
## Release 2.4.0 (2016-08-16)
|
||||
|
||||
- Adds two functions: `until` and `untilStep`
|
||||
|
||||
## Release 2.3.0 (2016-06-21)
|
||||
|
||||
- cat: Concatenate strings with whitespace separators.
|
||||
- replace: Replace parts of a string: `replace " " "-" "Me First"` renders "Me-First"
|
||||
- plural: Format plurals: `len "foo" | plural "one foo" "many foos"` renders "many foos"
|
||||
- indent: Indent blocks of text in a way that is sensitive to "\n" characters.
|
||||
|
||||
## Release 2.2.0 (2016-04-21)
|
||||
|
||||
- Added a `genPrivateKey` function (Thanks @bacongobbler)
|
||||
|
||||
## Release 2.1.0 (2016-03-30)
|
||||
|
||||
- `default` now prints the default value when it does not receive a value down the pipeline. It is much safer now to do `{{.Foo | default "bar"}}`.
|
||||
- Added accessors for "hermetic" functions. These return only functions that, when given the same input, produce the same output.
|
||||
|
||||
## Release 2.0.0 (2016-03-29)
|
||||
|
||||
Because we switched from `int` to `int64` as the return value for all integer math functions, the library's major version number has been incremented.
|
||||
|
||||
- `min` complements `max` (formerly `biggest`)
|
||||
- `empty` indicates that a value is the empty value for its type
|
||||
- `tuple` creates a tuple inside of a template: `{{$t := tuple "a", "b" "c"}}`
|
||||
- `dict` creates a dictionary inside of a template `{{$d := dict "key1" "val1" "key2" "val2"}}`
|
||||
- Date formatters have been added for HTML dates (as used in `date` input fields)
|
||||
- Integer math functions can convert from a number of types, including `string` (via `strconv.ParseInt`).
|
||||
|
||||
## Release 1.2.0 (2016-02-01)
|
||||
|
||||
- Added quote and squote
|
||||
- Added b32enc and b32dec
|
||||
- add now takes varargs
|
||||
- biggest now takes varargs
|
||||
|
||||
## Release 1.1.0 (2015-12-29)
|
||||
|
||||
- Added #4: Added contains function. strings.Contains, but with the arguments
|
||||
switched to simplify common pipelines. (thanks krancour)
|
||||
- Added Travis-CI testing support
|
||||
|
||||
## Release 1.0.0 (2015-12-23)
|
||||
|
||||
- Initial release
|
||||
19
vendor/github.com/go-task/slim-sprig/LICENSE.txt
generated
vendored
Normal file
19
vendor/github.com/go-task/slim-sprig/LICENSE.txt
generated
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
Copyright (C) 2013-2020 Masterminds
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
73
vendor/github.com/go-task/slim-sprig/README.md
generated
vendored
Normal file
73
vendor/github.com/go-task/slim-sprig/README.md
generated
vendored
Normal file
@@ -0,0 +1,73 @@
|
||||
# Slim-Sprig: Template functions for Go templates [](https://godoc.org/github.com/go-task/slim-sprig) [](https://goreportcard.com/report/github.com/go-task/slim-sprig)
|
||||
|
||||
Slim-Sprig is a fork of [Sprig](https://github.com/Masterminds/sprig), but with
|
||||
all functions that depend on external (non standard library) or crypto packages
|
||||
removed.
|
||||
The reason for this is to make this library more lightweight. Most of these
|
||||
functions (specially crypto ones) are not needed on most apps, but costs a lot
|
||||
in terms of binary size and compilation time.
|
||||
|
||||
## Usage
|
||||
|
||||
**Template developers**: Please use Slim-Sprig's [function documentation](https://go-task.github.io/slim-sprig/) for
|
||||
detailed instructions and code snippets for the >100 template functions available.
|
||||
|
||||
**Go developers**: If you'd like to include Slim-Sprig as a library in your program,
|
||||
our API documentation is available [at GoDoc.org](http://godoc.org/github.com/go-task/slim-sprig).
|
||||
|
||||
For standard usage, read on.
|
||||
|
||||
### Load the Slim-Sprig library
|
||||
|
||||
To load the Slim-Sprig `FuncMap`:
|
||||
|
||||
```go
|
||||
|
||||
import (
|
||||
"html/template"
|
||||
|
||||
"github.com/go-task/slim-sprig"
|
||||
)
|
||||
|
||||
// This example illustrates that the FuncMap *must* be set before the
|
||||
// templates themselves are loaded.
|
||||
tpl := template.Must(
|
||||
template.New("base").Funcs(sprig.FuncMap()).ParseGlob("*.html")
|
||||
)
|
||||
```
|
||||
|
||||
### Calling the functions inside of templates
|
||||
|
||||
By convention, all functions are lowercase. This seems to follow the Go
|
||||
idiom for template functions (as opposed to template methods, which are
|
||||
TitleCase). For example, this:
|
||||
|
||||
```
|
||||
{{ "hello!" | upper | repeat 5 }}
|
||||
```
|
||||
|
||||
produces this:
|
||||
|
||||
```
|
||||
HELLO!HELLO!HELLO!HELLO!HELLO!
|
||||
```
|
||||
|
||||
## Principles Driving Our Function Selection
|
||||
|
||||
We followed these principles to decide which functions to add and how to implement them:
|
||||
|
||||
- Use template functions to build layout. The following
|
||||
types of operations are within the domain of template functions:
|
||||
- Formatting
|
||||
- Layout
|
||||
- Simple type conversions
|
||||
- Utilities that assist in handling common formatting and layout needs (e.g. arithmetic)
|
||||
- Template functions should not return errors unless there is no way to print
|
||||
a sensible value. For example, converting a string to an integer should not
|
||||
produce an error if conversion fails. Instead, it should display a default
|
||||
value.
|
||||
- Simple math is necessary for grid layouts, pagers, and so on. Complex math
|
||||
(anything other than arithmetic) should be done outside of templates.
|
||||
- Template functions only deal with the data passed into them. They never retrieve
|
||||
data from a source.
|
||||
- Finally, do not override core Go template functions.
|
||||
12
vendor/github.com/go-task/slim-sprig/Taskfile.yml
generated
vendored
Normal file
12
vendor/github.com/go-task/slim-sprig/Taskfile.yml
generated
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
# https://taskfile.dev
|
||||
|
||||
version: '2'
|
||||
|
||||
tasks:
|
||||
default:
|
||||
cmds:
|
||||
- task: test
|
||||
|
||||
test:
|
||||
cmds:
|
||||
- go test -v .
|
||||
24
vendor/github.com/go-task/slim-sprig/crypto.go
generated
vendored
Normal file
24
vendor/github.com/go-task/slim-sprig/crypto.go
generated
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
package sprig
|
||||
|
||||
import (
|
||||
"crypto/sha1"
|
||||
"crypto/sha256"
|
||||
"encoding/hex"
|
||||
"fmt"
|
||||
"hash/adler32"
|
||||
)
|
||||
|
||||
func sha256sum(input string) string {
|
||||
hash := sha256.Sum256([]byte(input))
|
||||
return hex.EncodeToString(hash[:])
|
||||
}
|
||||
|
||||
func sha1sum(input string) string {
|
||||
hash := sha1.Sum([]byte(input))
|
||||
return hex.EncodeToString(hash[:])
|
||||
}
|
||||
|
||||
func adler32sum(input string) string {
|
||||
hash := adler32.Checksum([]byte(input))
|
||||
return fmt.Sprintf("%d", hash)
|
||||
}
|
||||
152
vendor/github.com/go-task/slim-sprig/date.go
generated
vendored
Normal file
152
vendor/github.com/go-task/slim-sprig/date.go
generated
vendored
Normal file
@@ -0,0 +1,152 @@
|
||||
package sprig
|
||||
|
||||
import (
|
||||
"strconv"
|
||||
"time"
|
||||
)
|
||||
|
||||
// Given a format and a date, format the date string.
|
||||
//
|
||||
// Date can be a `time.Time` or an `int, int32, int64`.
|
||||
// In the later case, it is treated as seconds since UNIX
|
||||
// epoch.
|
||||
func date(fmt string, date interface{}) string {
|
||||
return dateInZone(fmt, date, "Local")
|
||||
}
|
||||
|
||||
func htmlDate(date interface{}) string {
|
||||
return dateInZone("2006-01-02", date, "Local")
|
||||
}
|
||||
|
||||
func htmlDateInZone(date interface{}, zone string) string {
|
||||
return dateInZone("2006-01-02", date, zone)
|
||||
}
|
||||
|
||||
func dateInZone(fmt string, date interface{}, zone string) string {
|
||||
var t time.Time
|
||||
switch date := date.(type) {
|
||||
default:
|
||||
t = time.Now()
|
||||
case time.Time:
|
||||
t = date
|
||||
case *time.Time:
|
||||
t = *date
|
||||
case int64:
|
||||
t = time.Unix(date, 0)
|
||||
case int:
|
||||
t = time.Unix(int64(date), 0)
|
||||
case int32:
|
||||
t = time.Unix(int64(date), 0)
|
||||
}
|
||||
|
||||
loc, err := time.LoadLocation(zone)
|
||||
if err != nil {
|
||||
loc, _ = time.LoadLocation("UTC")
|
||||
}
|
||||
|
||||
return t.In(loc).Format(fmt)
|
||||
}
|
||||
|
||||
func dateModify(fmt string, date time.Time) time.Time {
|
||||
d, err := time.ParseDuration(fmt)
|
||||
if err != nil {
|
||||
return date
|
||||
}
|
||||
return date.Add(d)
|
||||
}
|
||||
|
||||
func mustDateModify(fmt string, date time.Time) (time.Time, error) {
|
||||
d, err := time.ParseDuration(fmt)
|
||||
if err != nil {
|
||||
return time.Time{}, err
|
||||
}
|
||||
return date.Add(d), nil
|
||||
}
|
||||
|
||||
func dateAgo(date interface{}) string {
|
||||
var t time.Time
|
||||
|
||||
switch date := date.(type) {
|
||||
default:
|
||||
t = time.Now()
|
||||
case time.Time:
|
||||
t = date
|
||||
case int64:
|
||||
t = time.Unix(date, 0)
|
||||
case int:
|
||||
t = time.Unix(int64(date), 0)
|
||||
}
|
||||
// Drop resolution to seconds
|
||||
duration := time.Since(t).Round(time.Second)
|
||||
return duration.String()
|
||||
}
|
||||
|
||||
func duration(sec interface{}) string {
|
||||
var n int64
|
||||
switch value := sec.(type) {
|
||||
default:
|
||||
n = 0
|
||||
case string:
|
||||
n, _ = strconv.ParseInt(value, 10, 64)
|
||||
case int64:
|
||||
n = value
|
||||
}
|
||||
return (time.Duration(n) * time.Second).String()
|
||||
}
|
||||
|
||||
func durationRound(duration interface{}) string {
|
||||
var d time.Duration
|
||||
switch duration := duration.(type) {
|
||||
default:
|
||||
d = 0
|
||||
case string:
|
||||
d, _ = time.ParseDuration(duration)
|
||||
case int64:
|
||||
d = time.Duration(duration)
|
||||
case time.Time:
|
||||
d = time.Since(duration)
|
||||
}
|
||||
|
||||
u := uint64(d)
|
||||
neg := d < 0
|
||||
if neg {
|
||||
u = -u
|
||||
}
|
||||
|
||||
var (
|
||||
year = uint64(time.Hour) * 24 * 365
|
||||
month = uint64(time.Hour) * 24 * 30
|
||||
day = uint64(time.Hour) * 24
|
||||
hour = uint64(time.Hour)
|
||||
minute = uint64(time.Minute)
|
||||
second = uint64(time.Second)
|
||||
)
|
||||
switch {
|
||||
case u > year:
|
||||
return strconv.FormatUint(u/year, 10) + "y"
|
||||
case u > month:
|
||||
return strconv.FormatUint(u/month, 10) + "mo"
|
||||
case u > day:
|
||||
return strconv.FormatUint(u/day, 10) + "d"
|
||||
case u > hour:
|
||||
return strconv.FormatUint(u/hour, 10) + "h"
|
||||
case u > minute:
|
||||
return strconv.FormatUint(u/minute, 10) + "m"
|
||||
case u > second:
|
||||
return strconv.FormatUint(u/second, 10) + "s"
|
||||
}
|
||||
return "0s"
|
||||
}
|
||||
|
||||
func toDate(fmt, str string) time.Time {
|
||||
t, _ := time.ParseInLocation(fmt, str, time.Local)
|
||||
return t
|
||||
}
|
||||
|
||||
func mustToDate(fmt, str string) (time.Time, error) {
|
||||
return time.ParseInLocation(fmt, str, time.Local)
|
||||
}
|
||||
|
||||
func unixEpoch(date time.Time) string {
|
||||
return strconv.FormatInt(date.Unix(), 10)
|
||||
}
|
||||
163
vendor/github.com/go-task/slim-sprig/defaults.go
generated
vendored
Normal file
163
vendor/github.com/go-task/slim-sprig/defaults.go
generated
vendored
Normal file
@@ -0,0 +1,163 @@
|
||||
package sprig
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"encoding/json"
|
||||
"math/rand"
|
||||
"reflect"
|
||||
"strings"
|
||||
"time"
|
||||
)
|
||||
|
||||
func init() {
|
||||
rand.Seed(time.Now().UnixNano())
|
||||
}
|
||||
|
||||
// dfault checks whether `given` is set, and returns default if not set.
|
||||
//
|
||||
// This returns `d` if `given` appears not to be set, and `given` otherwise.
|
||||
//
|
||||
// For numeric types 0 is unset.
|
||||
// For strings, maps, arrays, and slices, len() = 0 is considered unset.
|
||||
// For bool, false is unset.
|
||||
// Structs are never considered unset.
|
||||
//
|
||||
// For everything else, including pointers, a nil value is unset.
|
||||
func dfault(d interface{}, given ...interface{}) interface{} {
|
||||
|
||||
if empty(given) || empty(given[0]) {
|
||||
return d
|
||||
}
|
||||
return given[0]
|
||||
}
|
||||
|
||||
// empty returns true if the given value has the zero value for its type.
|
||||
func empty(given interface{}) bool {
|
||||
g := reflect.ValueOf(given)
|
||||
if !g.IsValid() {
|
||||
return true
|
||||
}
|
||||
|
||||
// Basically adapted from text/template.isTrue
|
||||
switch g.Kind() {
|
||||
default:
|
||||
return g.IsNil()
|
||||
case reflect.Array, reflect.Slice, reflect.Map, reflect.String:
|
||||
return g.Len() == 0
|
||||
case reflect.Bool:
|
||||
return !g.Bool()
|
||||
case reflect.Complex64, reflect.Complex128:
|
||||
return g.Complex() == 0
|
||||
case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
|
||||
return g.Int() == 0
|
||||
case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr:
|
||||
return g.Uint() == 0
|
||||
case reflect.Float32, reflect.Float64:
|
||||
return g.Float() == 0
|
||||
case reflect.Struct:
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
// coalesce returns the first non-empty value.
|
||||
func coalesce(v ...interface{}) interface{} {
|
||||
for _, val := range v {
|
||||
if !empty(val) {
|
||||
return val
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// all returns true if empty(x) is false for all values x in the list.
|
||||
// If the list is empty, return true.
|
||||
func all(v ...interface{}) bool {
|
||||
for _, val := range v {
|
||||
if empty(val) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
// any returns true if empty(x) is false for any x in the list.
|
||||
// If the list is empty, return false.
|
||||
func any(v ...interface{}) bool {
|
||||
for _, val := range v {
|
||||
if !empty(val) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
// fromJson decodes JSON into a structured value, ignoring errors.
|
||||
func fromJson(v string) interface{} {
|
||||
output, _ := mustFromJson(v)
|
||||
return output
|
||||
}
|
||||
|
||||
// mustFromJson decodes JSON into a structured value, returning errors.
|
||||
func mustFromJson(v string) (interface{}, error) {
|
||||
var output interface{}
|
||||
err := json.Unmarshal([]byte(v), &output)
|
||||
return output, err
|
||||
}
|
||||
|
||||
// toJson encodes an item into a JSON string
|
||||
func toJson(v interface{}) string {
|
||||
output, _ := json.Marshal(v)
|
||||
return string(output)
|
||||
}
|
||||
|
||||
func mustToJson(v interface{}) (string, error) {
|
||||
output, err := json.Marshal(v)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
return string(output), nil
|
||||
}
|
||||
|
||||
// toPrettyJson encodes an item into a pretty (indented) JSON string
|
||||
func toPrettyJson(v interface{}) string {
|
||||
output, _ := json.MarshalIndent(v, "", " ")
|
||||
return string(output)
|
||||
}
|
||||
|
||||
func mustToPrettyJson(v interface{}) (string, error) {
|
||||
output, err := json.MarshalIndent(v, "", " ")
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
return string(output), nil
|
||||
}
|
||||
|
||||
// toRawJson encodes an item into a JSON string with no escaping of HTML characters.
|
||||
func toRawJson(v interface{}) string {
|
||||
output, err := mustToRawJson(v)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return string(output)
|
||||
}
|
||||
|
||||
// mustToRawJson encodes an item into a JSON string with no escaping of HTML characters.
|
||||
func mustToRawJson(v interface{}) (string, error) {
|
||||
buf := new(bytes.Buffer)
|
||||
enc := json.NewEncoder(buf)
|
||||
enc.SetEscapeHTML(false)
|
||||
err := enc.Encode(&v)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
return strings.TrimSuffix(buf.String(), "\n"), nil
|
||||
}
|
||||
|
||||
// ternary returns the first value if the last value is true, otherwise returns the second value.
|
||||
func ternary(vt interface{}, vf interface{}, v bool) interface{} {
|
||||
if v {
|
||||
return vt
|
||||
}
|
||||
|
||||
return vf
|
||||
}
|
||||
118
vendor/github.com/go-task/slim-sprig/dict.go
generated
vendored
Normal file
118
vendor/github.com/go-task/slim-sprig/dict.go
generated
vendored
Normal file
@@ -0,0 +1,118 @@
|
||||
package sprig
|
||||
|
||||
func get(d map[string]interface{}, key string) interface{} {
|
||||
if val, ok := d[key]; ok {
|
||||
return val
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func set(d map[string]interface{}, key string, value interface{}) map[string]interface{} {
|
||||
d[key] = value
|
||||
return d
|
||||
}
|
||||
|
||||
func unset(d map[string]interface{}, key string) map[string]interface{} {
|
||||
delete(d, key)
|
||||
return d
|
||||
}
|
||||
|
||||
func hasKey(d map[string]interface{}, key string) bool {
|
||||
_, ok := d[key]
|
||||
return ok
|
||||
}
|
||||
|
||||
func pluck(key string, d ...map[string]interface{}) []interface{} {
|
||||
res := []interface{}{}
|
||||
for _, dict := range d {
|
||||
if val, ok := dict[key]; ok {
|
||||
res = append(res, val)
|
||||
}
|
||||
}
|
||||
return res
|
||||
}
|
||||
|
||||
func keys(dicts ...map[string]interface{}) []string {
|
||||
k := []string{}
|
||||
for _, dict := range dicts {
|
||||
for key := range dict {
|
||||
k = append(k, key)
|
||||
}
|
||||
}
|
||||
return k
|
||||
}
|
||||
|
||||
func pick(dict map[string]interface{}, keys ...string) map[string]interface{} {
|
||||
res := map[string]interface{}{}
|
||||
for _, k := range keys {
|
||||
if v, ok := dict[k]; ok {
|
||||
res[k] = v
|
||||
}
|
||||
}
|
||||
return res
|
||||
}
|
||||
|
||||
func omit(dict map[string]interface{}, keys ...string) map[string]interface{} {
|
||||
res := map[string]interface{}{}
|
||||
|
||||
omit := make(map[string]bool, len(keys))
|
||||
for _, k := range keys {
|
||||
omit[k] = true
|
||||
}
|
||||
|
||||
for k, v := range dict {
|
||||
if _, ok := omit[k]; !ok {
|
||||
res[k] = v
|
||||
}
|
||||
}
|
||||
return res
|
||||
}
|
||||
|
||||
func dict(v ...interface{}) map[string]interface{} {
|
||||
dict := map[string]interface{}{}
|
||||
lenv := len(v)
|
||||
for i := 0; i < lenv; i += 2 {
|
||||
key := strval(v[i])
|
||||
if i+1 >= lenv {
|
||||
dict[key] = ""
|
||||
continue
|
||||
}
|
||||
dict[key] = v[i+1]
|
||||
}
|
||||
return dict
|
||||
}
|
||||
|
||||
func values(dict map[string]interface{}) []interface{} {
|
||||
values := []interface{}{}
|
||||
for _, value := range dict {
|
||||
values = append(values, value)
|
||||
}
|
||||
|
||||
return values
|
||||
}
|
||||
|
||||
func dig(ps ...interface{}) (interface{}, error) {
|
||||
if len(ps) < 3 {
|
||||
panic("dig needs at least three arguments")
|
||||
}
|
||||
dict := ps[len(ps)-1].(map[string]interface{})
|
||||
def := ps[len(ps)-2]
|
||||
ks := make([]string, len(ps)-2)
|
||||
for i := 0; i < len(ks); i++ {
|
||||
ks[i] = ps[i].(string)
|
||||
}
|
||||
|
||||
return digFromDict(dict, def, ks)
|
||||
}
|
||||
|
||||
func digFromDict(dict map[string]interface{}, d interface{}, ks []string) (interface{}, error) {
|
||||
k, ns := ks[0], ks[1:len(ks)]
|
||||
step, has := dict[k]
|
||||
if !has {
|
||||
return d, nil
|
||||
}
|
||||
if len(ns) == 0 {
|
||||
return step, nil
|
||||
}
|
||||
return digFromDict(step.(map[string]interface{}), d, ns)
|
||||
}
|
||||
19
vendor/github.com/go-task/slim-sprig/doc.go
generated
vendored
Normal file
19
vendor/github.com/go-task/slim-sprig/doc.go
generated
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
/*
|
||||
Package sprig provides template functions for Go.
|
||||
|
||||
This package contains a number of utility functions for working with data
|
||||
inside of Go `html/template` and `text/template` files.
|
||||
|
||||
To add these functions, use the `template.Funcs()` method:
|
||||
|
||||
t := templates.New("foo").Funcs(sprig.FuncMap())
|
||||
|
||||
Note that you should add the function map before you parse any template files.
|
||||
|
||||
In several cases, Sprig reverses the order of arguments from the way they
|
||||
appear in the standard library. This is to make it easier to pipe
|
||||
arguments into functions.
|
||||
|
||||
See http://masterminds.github.io/sprig/ for more detailed documentation on each of the available functions.
|
||||
*/
|
||||
package sprig
|
||||
317
vendor/github.com/go-task/slim-sprig/functions.go
generated
vendored
Normal file
317
vendor/github.com/go-task/slim-sprig/functions.go
generated
vendored
Normal file
@@ -0,0 +1,317 @@
|
||||
package sprig
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"html/template"
|
||||
"math/rand"
|
||||
"os"
|
||||
"path"
|
||||
"path/filepath"
|
||||
"reflect"
|
||||
"strconv"
|
||||
"strings"
|
||||
ttemplate "text/template"
|
||||
"time"
|
||||
)
|
||||
|
||||
// FuncMap produces the function map.
|
||||
//
|
||||
// Use this to pass the functions into the template engine:
|
||||
//
|
||||
// tpl := template.New("foo").Funcs(sprig.FuncMap()))
|
||||
//
|
||||
func FuncMap() template.FuncMap {
|
||||
return HtmlFuncMap()
|
||||
}
|
||||
|
||||
// HermeticTxtFuncMap returns a 'text/template'.FuncMap with only repeatable functions.
|
||||
func HermeticTxtFuncMap() ttemplate.FuncMap {
|
||||
r := TxtFuncMap()
|
||||
for _, name := range nonhermeticFunctions {
|
||||
delete(r, name)
|
||||
}
|
||||
return r
|
||||
}
|
||||
|
||||
// HermeticHtmlFuncMap returns an 'html/template'.Funcmap with only repeatable functions.
|
||||
func HermeticHtmlFuncMap() template.FuncMap {
|
||||
r := HtmlFuncMap()
|
||||
for _, name := range nonhermeticFunctions {
|
||||
delete(r, name)
|
||||
}
|
||||
return r
|
||||
}
|
||||
|
||||
// TxtFuncMap returns a 'text/template'.FuncMap
|
||||
func TxtFuncMap() ttemplate.FuncMap {
|
||||
return ttemplate.FuncMap(GenericFuncMap())
|
||||
}
|
||||
|
||||
// HtmlFuncMap returns an 'html/template'.Funcmap
|
||||
func HtmlFuncMap() template.FuncMap {
|
||||
return template.FuncMap(GenericFuncMap())
|
||||
}
|
||||
|
||||
// GenericFuncMap returns a copy of the basic function map as a map[string]interface{}.
|
||||
func GenericFuncMap() map[string]interface{} {
|
||||
gfm := make(map[string]interface{}, len(genericMap))
|
||||
for k, v := range genericMap {
|
||||
gfm[k] = v
|
||||
}
|
||||
return gfm
|
||||
}
|
||||
|
||||
// These functions are not guaranteed to evaluate to the same result for given input, because they
|
||||
// refer to the environment or global state.
|
||||
var nonhermeticFunctions = []string{
|
||||
// Date functions
|
||||
"date",
|
||||
"date_in_zone",
|
||||
"date_modify",
|
||||
"now",
|
||||
"htmlDate",
|
||||
"htmlDateInZone",
|
||||
"dateInZone",
|
||||
"dateModify",
|
||||
|
||||
// Strings
|
||||
"randAlphaNum",
|
||||
"randAlpha",
|
||||
"randAscii",
|
||||
"randNumeric",
|
||||
"randBytes",
|
||||
"uuidv4",
|
||||
|
||||
// OS
|
||||
"env",
|
||||
"expandenv",
|
||||
|
||||
// Network
|
||||
"getHostByName",
|
||||
}
|
||||
|
||||
var genericMap = map[string]interface{}{
|
||||
"hello": func() string { return "Hello!" },
|
||||
|
||||
// Date functions
|
||||
"ago": dateAgo,
|
||||
"date": date,
|
||||
"date_in_zone": dateInZone,
|
||||
"date_modify": dateModify,
|
||||
"dateInZone": dateInZone,
|
||||
"dateModify": dateModify,
|
||||
"duration": duration,
|
||||
"durationRound": durationRound,
|
||||
"htmlDate": htmlDate,
|
||||
"htmlDateInZone": htmlDateInZone,
|
||||
"must_date_modify": mustDateModify,
|
||||
"mustDateModify": mustDateModify,
|
||||
"mustToDate": mustToDate,
|
||||
"now": time.Now,
|
||||
"toDate": toDate,
|
||||
"unixEpoch": unixEpoch,
|
||||
|
||||
// Strings
|
||||
"trunc": trunc,
|
||||
"trim": strings.TrimSpace,
|
||||
"upper": strings.ToUpper,
|
||||
"lower": strings.ToLower,
|
||||
"title": strings.Title,
|
||||
"substr": substring,
|
||||
// Switch order so that "foo" | repeat 5
|
||||
"repeat": func(count int, str string) string { return strings.Repeat(str, count) },
|
||||
// Deprecated: Use trimAll.
|
||||
"trimall": func(a, b string) string { return strings.Trim(b, a) },
|
||||
// Switch order so that "$foo" | trimall "$"
|
||||
"trimAll": func(a, b string) string { return strings.Trim(b, a) },
|
||||
"trimSuffix": func(a, b string) string { return strings.TrimSuffix(b, a) },
|
||||
"trimPrefix": func(a, b string) string { return strings.TrimPrefix(b, a) },
|
||||
// Switch order so that "foobar" | contains "foo"
|
||||
"contains": func(substr string, str string) bool { return strings.Contains(str, substr) },
|
||||
"hasPrefix": func(substr string, str string) bool { return strings.HasPrefix(str, substr) },
|
||||
"hasSuffix": func(substr string, str string) bool { return strings.HasSuffix(str, substr) },
|
||||
"quote": quote,
|
||||
"squote": squote,
|
||||
"cat": cat,
|
||||
"indent": indent,
|
||||
"nindent": nindent,
|
||||
"replace": replace,
|
||||
"plural": plural,
|
||||
"sha1sum": sha1sum,
|
||||
"sha256sum": sha256sum,
|
||||
"adler32sum": adler32sum,
|
||||
"toString": strval,
|
||||
|
||||
// Wrap Atoi to stop errors.
|
||||
"atoi": func(a string) int { i, _ := strconv.Atoi(a); return i },
|
||||
"int64": toInt64,
|
||||
"int": toInt,
|
||||
"float64": toFloat64,
|
||||
"seq": seq,
|
||||
"toDecimal": toDecimal,
|
||||
|
||||
//"gt": func(a, b int) bool {return a > b},
|
||||
//"gte": func(a, b int) bool {return a >= b},
|
||||
//"lt": func(a, b int) bool {return a < b},
|
||||
//"lte": func(a, b int) bool {return a <= b},
|
||||
|
||||
// split "/" foo/bar returns map[int]string{0: foo, 1: bar}
|
||||
"split": split,
|
||||
"splitList": func(sep, orig string) []string { return strings.Split(orig, sep) },
|
||||
// splitn "/" foo/bar/fuu returns map[int]string{0: foo, 1: bar/fuu}
|
||||
"splitn": splitn,
|
||||
"toStrings": strslice,
|
||||
|
||||
"until": until,
|
||||
"untilStep": untilStep,
|
||||
|
||||
// VERY basic arithmetic.
|
||||
"add1": func(i interface{}) int64 { return toInt64(i) + 1 },
|
||||
"add": func(i ...interface{}) int64 {
|
||||
var a int64 = 0
|
||||
for _, b := range i {
|
||||
a += toInt64(b)
|
||||
}
|
||||
return a
|
||||
},
|
||||
"sub": func(a, b interface{}) int64 { return toInt64(a) - toInt64(b) },
|
||||
"div": func(a, b interface{}) int64 { return toInt64(a) / toInt64(b) },
|
||||
"mod": func(a, b interface{}) int64 { return toInt64(a) % toInt64(b) },
|
||||
"mul": func(a interface{}, v ...interface{}) int64 {
|
||||
val := toInt64(a)
|
||||
for _, b := range v {
|
||||
val = val * toInt64(b)
|
||||
}
|
||||
return val
|
||||
},
|
||||
"randInt": func(min, max int) int { return rand.Intn(max-min) + min },
|
||||
"biggest": max,
|
||||
"max": max,
|
||||
"min": min,
|
||||
"maxf": maxf,
|
||||
"minf": minf,
|
||||
"ceil": ceil,
|
||||
"floor": floor,
|
||||
"round": round,
|
||||
|
||||
// string slices. Note that we reverse the order b/c that's better
|
||||
// for template processing.
|
||||
"join": join,
|
||||
"sortAlpha": sortAlpha,
|
||||
|
||||
// Defaults
|
||||
"default": dfault,
|
||||
"empty": empty,
|
||||
"coalesce": coalesce,
|
||||
"all": all,
|
||||
"any": any,
|
||||
"compact": compact,
|
||||
"mustCompact": mustCompact,
|
||||
"fromJson": fromJson,
|
||||
"toJson": toJson,
|
||||
"toPrettyJson": toPrettyJson,
|
||||
"toRawJson": toRawJson,
|
||||
"mustFromJson": mustFromJson,
|
||||
"mustToJson": mustToJson,
|
||||
"mustToPrettyJson": mustToPrettyJson,
|
||||
"mustToRawJson": mustToRawJson,
|
||||
"ternary": ternary,
|
||||
|
||||
// Reflection
|
||||
"typeOf": typeOf,
|
||||
"typeIs": typeIs,
|
||||
"typeIsLike": typeIsLike,
|
||||
"kindOf": kindOf,
|
||||
"kindIs": kindIs,
|
||||
"deepEqual": reflect.DeepEqual,
|
||||
|
||||
// OS:
|
||||
"env": os.Getenv,
|
||||
"expandenv": os.ExpandEnv,
|
||||
|
||||
// Network:
|
||||
"getHostByName": getHostByName,
|
||||
|
||||
// Paths:
|
||||
"base": path.Base,
|
||||
"dir": path.Dir,
|
||||
"clean": path.Clean,
|
||||
"ext": path.Ext,
|
||||
"isAbs": path.IsAbs,
|
||||
|
||||
// Filepaths:
|
||||
"osBase": filepath.Base,
|
||||
"osClean": filepath.Clean,
|
||||
"osDir": filepath.Dir,
|
||||
"osExt": filepath.Ext,
|
||||
"osIsAbs": filepath.IsAbs,
|
||||
|
||||
// Encoding:
|
||||
"b64enc": base64encode,
|
||||
"b64dec": base64decode,
|
||||
"b32enc": base32encode,
|
||||
"b32dec": base32decode,
|
||||
|
||||
// Data Structures:
|
||||
"tuple": list, // FIXME: with the addition of append/prepend these are no longer immutable.
|
||||
"list": list,
|
||||
"dict": dict,
|
||||
"get": get,
|
||||
"set": set,
|
||||
"unset": unset,
|
||||
"hasKey": hasKey,
|
||||
"pluck": pluck,
|
||||
"keys": keys,
|
||||
"pick": pick,
|
||||
"omit": omit,
|
||||
"values": values,
|
||||
|
||||
"append": push, "push": push,
|
||||
"mustAppend": mustPush, "mustPush": mustPush,
|
||||
"prepend": prepend,
|
||||
"mustPrepend": mustPrepend,
|
||||
"first": first,
|
||||
"mustFirst": mustFirst,
|
||||
"rest": rest,
|
||||
"mustRest": mustRest,
|
||||
"last": last,
|
||||
"mustLast": mustLast,
|
||||
"initial": initial,
|
||||
"mustInitial": mustInitial,
|
||||
"reverse": reverse,
|
||||
"mustReverse": mustReverse,
|
||||
"uniq": uniq,
|
||||
"mustUniq": mustUniq,
|
||||
"without": without,
|
||||
"mustWithout": mustWithout,
|
||||
"has": has,
|
||||
"mustHas": mustHas,
|
||||
"slice": slice,
|
||||
"mustSlice": mustSlice,
|
||||
"concat": concat,
|
||||
"dig": dig,
|
||||
"chunk": chunk,
|
||||
"mustChunk": mustChunk,
|
||||
|
||||
// Flow Control:
|
||||
"fail": func(msg string) (string, error) { return "", errors.New(msg) },
|
||||
|
||||
// Regex
|
||||
"regexMatch": regexMatch,
|
||||
"mustRegexMatch": mustRegexMatch,
|
||||
"regexFindAll": regexFindAll,
|
||||
"mustRegexFindAll": mustRegexFindAll,
|
||||
"regexFind": regexFind,
|
||||
"mustRegexFind": mustRegexFind,
|
||||
"regexReplaceAll": regexReplaceAll,
|
||||
"mustRegexReplaceAll": mustRegexReplaceAll,
|
||||
"regexReplaceAllLiteral": regexReplaceAllLiteral,
|
||||
"mustRegexReplaceAllLiteral": mustRegexReplaceAllLiteral,
|
||||
"regexSplit": regexSplit,
|
||||
"mustRegexSplit": mustRegexSplit,
|
||||
"regexQuoteMeta": regexQuoteMeta,
|
||||
|
||||
// URLs:
|
||||
"urlParse": urlParse,
|
||||
"urlJoin": urlJoin,
|
||||
}
|
||||
8
vendor/github.com/go-task/slim-sprig/go.mod
generated
vendored
Normal file
8
vendor/github.com/go-task/slim-sprig/go.mod
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
module github.com/go-task/slim-sprig
|
||||
|
||||
go 1.13
|
||||
|
||||
require (
|
||||
github.com/davecgh/go-spew v1.1.1 // indirect
|
||||
github.com/stretchr/testify v1.5.1
|
||||
)
|
||||
22
vendor/github.com/go-task/slim-sprig/go.sum
generated
vendored
Normal file
22
vendor/github.com/go-task/slim-sprig/go.sum
generated
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8=
|
||||
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
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 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
|
||||
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
|
||||
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/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||
github.com/stretchr/objx v0.1.0 h1:4G4v2dO3VZwixGIRoQ5Lfboy6nUhCyYzaqnIAPPhYs4=
|
||||
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||
github.com/stretchr/testify v1.5.1 h1:nOGnQDM7FYENwehXlg/kFVnos3rEvtKTjRvOWSzb6H4=
|
||||
github.com/stretchr/testify v1.5.1 h1:nOGnQDM7FYENwehXlg/kFVnos3rEvtKTjRvOWSzb6H4=
|
||||
github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA=
|
||||
github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA=
|
||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
|
||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw=
|
||||
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||
464
vendor/github.com/go-task/slim-sprig/list.go
generated
vendored
Normal file
464
vendor/github.com/go-task/slim-sprig/list.go
generated
vendored
Normal file
@@ -0,0 +1,464 @@
|
||||
package sprig
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"math"
|
||||
"reflect"
|
||||
"sort"
|
||||
)
|
||||
|
||||
// Reflection is used in these functions so that slices and arrays of strings,
|
||||
// ints, and other types not implementing []interface{} can be worked with.
|
||||
// For example, this is useful if you need to work on the output of regexs.
|
||||
|
||||
func list(v ...interface{}) []interface{} {
|
||||
return v
|
||||
}
|
||||
|
||||
func push(list interface{}, v interface{}) []interface{} {
|
||||
l, err := mustPush(list, v)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
return l
|
||||
}
|
||||
|
||||
func mustPush(list interface{}, v interface{}) ([]interface{}, error) {
|
||||
tp := reflect.TypeOf(list).Kind()
|
||||
switch tp {
|
||||
case reflect.Slice, reflect.Array:
|
||||
l2 := reflect.ValueOf(list)
|
||||
|
||||
l := l2.Len()
|
||||
nl := make([]interface{}, l)
|
||||
for i := 0; i < l; i++ {
|
||||
nl[i] = l2.Index(i).Interface()
|
||||
}
|
||||
|
||||
return append(nl, v), nil
|
||||
|
||||
default:
|
||||
return nil, fmt.Errorf("Cannot push on type %s", tp)
|
||||
}
|
||||
}
|
||||
|
||||
func prepend(list interface{}, v interface{}) []interface{} {
|
||||
l, err := mustPrepend(list, v)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
return l
|
||||
}
|
||||
|
||||
func mustPrepend(list interface{}, v interface{}) ([]interface{}, error) {
|
||||
//return append([]interface{}{v}, list...)
|
||||
|
||||
tp := reflect.TypeOf(list).Kind()
|
||||
switch tp {
|
||||
case reflect.Slice, reflect.Array:
|
||||
l2 := reflect.ValueOf(list)
|
||||
|
||||
l := l2.Len()
|
||||
nl := make([]interface{}, l)
|
||||
for i := 0; i < l; i++ {
|
||||
nl[i] = l2.Index(i).Interface()
|
||||
}
|
||||
|
||||
return append([]interface{}{v}, nl...), nil
|
||||
|
||||
default:
|
||||
return nil, fmt.Errorf("Cannot prepend on type %s", tp)
|
||||
}
|
||||
}
|
||||
|
||||
func chunk(size int, list interface{}) [][]interface{} {
|
||||
l, err := mustChunk(size, list)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
return l
|
||||
}
|
||||
|
||||
func mustChunk(size int, list interface{}) ([][]interface{}, error) {
|
||||
tp := reflect.TypeOf(list).Kind()
|
||||
switch tp {
|
||||
case reflect.Slice, reflect.Array:
|
||||
l2 := reflect.ValueOf(list)
|
||||
|
||||
l := l2.Len()
|
||||
|
||||
cs := int(math.Floor(float64(l-1)/float64(size)) + 1)
|
||||
nl := make([][]interface{}, cs)
|
||||
|
||||
for i := 0; i < cs; i++ {
|
||||
clen := size
|
||||
if i == cs-1 {
|
||||
clen = int(math.Floor(math.Mod(float64(l), float64(size))))
|
||||
if clen == 0 {
|
||||
clen = size
|
||||
}
|
||||
}
|
||||
|
||||
nl[i] = make([]interface{}, clen)
|
||||
|
||||
for j := 0; j < clen; j++ {
|
||||
ix := i*size + j
|
||||
nl[i][j] = l2.Index(ix).Interface()
|
||||
}
|
||||
}
|
||||
|
||||
return nl, nil
|
||||
|
||||
default:
|
||||
return nil, fmt.Errorf("Cannot chunk type %s", tp)
|
||||
}
|
||||
}
|
||||
|
||||
func last(list interface{}) interface{} {
|
||||
l, err := mustLast(list)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
return l
|
||||
}
|
||||
|
||||
func mustLast(list interface{}) (interface{}, error) {
|
||||
tp := reflect.TypeOf(list).Kind()
|
||||
switch tp {
|
||||
case reflect.Slice, reflect.Array:
|
||||
l2 := reflect.ValueOf(list)
|
||||
|
||||
l := l2.Len()
|
||||
if l == 0 {
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
return l2.Index(l - 1).Interface(), nil
|
||||
default:
|
||||
return nil, fmt.Errorf("Cannot find last on type %s", tp)
|
||||
}
|
||||
}
|
||||
|
||||
func first(list interface{}) interface{} {
|
||||
l, err := mustFirst(list)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
return l
|
||||
}
|
||||
|
||||
func mustFirst(list interface{}) (interface{}, error) {
|
||||
tp := reflect.TypeOf(list).Kind()
|
||||
switch tp {
|
||||
case reflect.Slice, reflect.Array:
|
||||
l2 := reflect.ValueOf(list)
|
||||
|
||||
l := l2.Len()
|
||||
if l == 0 {
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
return l2.Index(0).Interface(), nil
|
||||
default:
|
||||
return nil, fmt.Errorf("Cannot find first on type %s", tp)
|
||||
}
|
||||
}
|
||||
|
||||
func rest(list interface{}) []interface{} {
|
||||
l, err := mustRest(list)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
return l
|
||||
}
|
||||
|
||||
func mustRest(list interface{}) ([]interface{}, error) {
|
||||
tp := reflect.TypeOf(list).Kind()
|
||||
switch tp {
|
||||
case reflect.Slice, reflect.Array:
|
||||
l2 := reflect.ValueOf(list)
|
||||
|
||||
l := l2.Len()
|
||||
if l == 0 {
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
nl := make([]interface{}, l-1)
|
||||
for i := 1; i < l; i++ {
|
||||
nl[i-1] = l2.Index(i).Interface()
|
||||
}
|
||||
|
||||
return nl, nil
|
||||
default:
|
||||
return nil, fmt.Errorf("Cannot find rest on type %s", tp)
|
||||
}
|
||||
}
|
||||
|
||||
func initial(list interface{}) []interface{} {
|
||||
l, err := mustInitial(list)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
return l
|
||||
}
|
||||
|
||||
func mustInitial(list interface{}) ([]interface{}, error) {
|
||||
tp := reflect.TypeOf(list).Kind()
|
||||
switch tp {
|
||||
case reflect.Slice, reflect.Array:
|
||||
l2 := reflect.ValueOf(list)
|
||||
|
||||
l := l2.Len()
|
||||
if l == 0 {
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
nl := make([]interface{}, l-1)
|
||||
for i := 0; i < l-1; i++ {
|
||||
nl[i] = l2.Index(i).Interface()
|
||||
}
|
||||
|
||||
return nl, nil
|
||||
default:
|
||||
return nil, fmt.Errorf("Cannot find initial on type %s", tp)
|
||||
}
|
||||
}
|
||||
|
||||
func sortAlpha(list interface{}) []string {
|
||||
k := reflect.Indirect(reflect.ValueOf(list)).Kind()
|
||||
switch k {
|
||||
case reflect.Slice, reflect.Array:
|
||||
a := strslice(list)
|
||||
s := sort.StringSlice(a)
|
||||
s.Sort()
|
||||
return s
|
||||
}
|
||||
return []string{strval(list)}
|
||||
}
|
||||
|
||||
func reverse(v interface{}) []interface{} {
|
||||
l, err := mustReverse(v)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
return l
|
||||
}
|
||||
|
||||
func mustReverse(v interface{}) ([]interface{}, error) {
|
||||
tp := reflect.TypeOf(v).Kind()
|
||||
switch tp {
|
||||
case reflect.Slice, reflect.Array:
|
||||
l2 := reflect.ValueOf(v)
|
||||
|
||||
l := l2.Len()
|
||||
// We do not sort in place because the incoming array should not be altered.
|
||||
nl := make([]interface{}, l)
|
||||
for i := 0; i < l; i++ {
|
||||
nl[l-i-1] = l2.Index(i).Interface()
|
||||
}
|
||||
|
||||
return nl, nil
|
||||
default:
|
||||
return nil, fmt.Errorf("Cannot find reverse on type %s", tp)
|
||||
}
|
||||
}
|
||||
|
||||
func compact(list interface{}) []interface{} {
|
||||
l, err := mustCompact(list)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
return l
|
||||
}
|
||||
|
||||
func mustCompact(list interface{}) ([]interface{}, error) {
|
||||
tp := reflect.TypeOf(list).Kind()
|
||||
switch tp {
|
||||
case reflect.Slice, reflect.Array:
|
||||
l2 := reflect.ValueOf(list)
|
||||
|
||||
l := l2.Len()
|
||||
nl := []interface{}{}
|
||||
var item interface{}
|
||||
for i := 0; i < l; i++ {
|
||||
item = l2.Index(i).Interface()
|
||||
if !empty(item) {
|
||||
nl = append(nl, item)
|
||||
}
|
||||
}
|
||||
|
||||
return nl, nil
|
||||
default:
|
||||
return nil, fmt.Errorf("Cannot compact on type %s", tp)
|
||||
}
|
||||
}
|
||||
|
||||
func uniq(list interface{}) []interface{} {
|
||||
l, err := mustUniq(list)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
return l
|
||||
}
|
||||
|
||||
func mustUniq(list interface{}) ([]interface{}, error) {
|
||||
tp := reflect.TypeOf(list).Kind()
|
||||
switch tp {
|
||||
case reflect.Slice, reflect.Array:
|
||||
l2 := reflect.ValueOf(list)
|
||||
|
||||
l := l2.Len()
|
||||
dest := []interface{}{}
|
||||
var item interface{}
|
||||
for i := 0; i < l; i++ {
|
||||
item = l2.Index(i).Interface()
|
||||
if !inList(dest, item) {
|
||||
dest = append(dest, item)
|
||||
}
|
||||
}
|
||||
|
||||
return dest, nil
|
||||
default:
|
||||
return nil, fmt.Errorf("Cannot find uniq on type %s", tp)
|
||||
}
|
||||
}
|
||||
|
||||
func inList(haystack []interface{}, needle interface{}) bool {
|
||||
for _, h := range haystack {
|
||||
if reflect.DeepEqual(needle, h) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func without(list interface{}, omit ...interface{}) []interface{} {
|
||||
l, err := mustWithout(list, omit...)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
return l
|
||||
}
|
||||
|
||||
func mustWithout(list interface{}, omit ...interface{}) ([]interface{}, error) {
|
||||
tp := reflect.TypeOf(list).Kind()
|
||||
switch tp {
|
||||
case reflect.Slice, reflect.Array:
|
||||
l2 := reflect.ValueOf(list)
|
||||
|
||||
l := l2.Len()
|
||||
res := []interface{}{}
|
||||
var item interface{}
|
||||
for i := 0; i < l; i++ {
|
||||
item = l2.Index(i).Interface()
|
||||
if !inList(omit, item) {
|
||||
res = append(res, item)
|
||||
}
|
||||
}
|
||||
|
||||
return res, nil
|
||||
default:
|
||||
return nil, fmt.Errorf("Cannot find without on type %s", tp)
|
||||
}
|
||||
}
|
||||
|
||||
func has(needle interface{}, haystack interface{}) bool {
|
||||
l, err := mustHas(needle, haystack)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
return l
|
||||
}
|
||||
|
||||
func mustHas(needle interface{}, haystack interface{}) (bool, error) {
|
||||
if haystack == nil {
|
||||
return false, nil
|
||||
}
|
||||
tp := reflect.TypeOf(haystack).Kind()
|
||||
switch tp {
|
||||
case reflect.Slice, reflect.Array:
|
||||
l2 := reflect.ValueOf(haystack)
|
||||
var item interface{}
|
||||
l := l2.Len()
|
||||
for i := 0; i < l; i++ {
|
||||
item = l2.Index(i).Interface()
|
||||
if reflect.DeepEqual(needle, item) {
|
||||
return true, nil
|
||||
}
|
||||
}
|
||||
|
||||
return false, nil
|
||||
default:
|
||||
return false, fmt.Errorf("Cannot find has on type %s", tp)
|
||||
}
|
||||
}
|
||||
|
||||
// $list := [1, 2, 3, 4, 5]
|
||||
// slice $list -> list[0:5] = list[:]
|
||||
// slice $list 0 3 -> list[0:3] = list[:3]
|
||||
// slice $list 3 5 -> list[3:5]
|
||||
// slice $list 3 -> list[3:5] = list[3:]
|
||||
func slice(list interface{}, indices ...interface{}) interface{} {
|
||||
l, err := mustSlice(list, indices...)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
return l
|
||||
}
|
||||
|
||||
func mustSlice(list interface{}, indices ...interface{}) (interface{}, error) {
|
||||
tp := reflect.TypeOf(list).Kind()
|
||||
switch tp {
|
||||
case reflect.Slice, reflect.Array:
|
||||
l2 := reflect.ValueOf(list)
|
||||
|
||||
l := l2.Len()
|
||||
if l == 0 {
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
var start, end int
|
||||
if len(indices) > 0 {
|
||||
start = toInt(indices[0])
|
||||
}
|
||||
if len(indices) < 2 {
|
||||
end = l
|
||||
} else {
|
||||
end = toInt(indices[1])
|
||||
}
|
||||
|
||||
return l2.Slice(start, end).Interface(), nil
|
||||
default:
|
||||
return nil, fmt.Errorf("list should be type of slice or array but %s", tp)
|
||||
}
|
||||
}
|
||||
|
||||
func concat(lists ...interface{}) interface{} {
|
||||
var res []interface{}
|
||||
for _, list := range lists {
|
||||
tp := reflect.TypeOf(list).Kind()
|
||||
switch tp {
|
||||
case reflect.Slice, reflect.Array:
|
||||
l2 := reflect.ValueOf(list)
|
||||
for i := 0; i < l2.Len(); i++ {
|
||||
res = append(res, l2.Index(i).Interface())
|
||||
}
|
||||
default:
|
||||
panic(fmt.Sprintf("Cannot concat type %s as list", tp))
|
||||
}
|
||||
}
|
||||
return res
|
||||
}
|
||||
12
vendor/github.com/go-task/slim-sprig/network.go
generated
vendored
Normal file
12
vendor/github.com/go-task/slim-sprig/network.go
generated
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
package sprig
|
||||
|
||||
import (
|
||||
"math/rand"
|
||||
"net"
|
||||
)
|
||||
|
||||
func getHostByName(name string) string {
|
||||
addrs, _ := net.LookupHost(name)
|
||||
//TODO: add error handing when release v3 comes out
|
||||
return addrs[rand.Intn(len(addrs))]
|
||||
}
|
||||
228
vendor/github.com/go-task/slim-sprig/numeric.go
generated
vendored
Normal file
228
vendor/github.com/go-task/slim-sprig/numeric.go
generated
vendored
Normal file
@@ -0,0 +1,228 @@
|
||||
package sprig
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"math"
|
||||
"reflect"
|
||||
"strconv"
|
||||
"strings"
|
||||
)
|
||||
|
||||
// toFloat64 converts 64-bit floats
|
||||
func toFloat64(v interface{}) float64 {
|
||||
if str, ok := v.(string); ok {
|
||||
iv, err := strconv.ParseFloat(str, 64)
|
||||
if err != nil {
|
||||
return 0
|
||||
}
|
||||
return iv
|
||||
}
|
||||
|
||||
val := reflect.Indirect(reflect.ValueOf(v))
|
||||
switch val.Kind() {
|
||||
case reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64, reflect.Int:
|
||||
return float64(val.Int())
|
||||
case reflect.Uint8, reflect.Uint16, reflect.Uint32:
|
||||
return float64(val.Uint())
|
||||
case reflect.Uint, reflect.Uint64:
|
||||
return float64(val.Uint())
|
||||
case reflect.Float32, reflect.Float64:
|
||||
return val.Float()
|
||||
case reflect.Bool:
|
||||
if val.Bool() {
|
||||
return 1
|
||||
}
|
||||
return 0
|
||||
default:
|
||||
return 0
|
||||
}
|
||||
}
|
||||
|
||||
func toInt(v interface{}) int {
|
||||
//It's not optimal. Bud I don't want duplicate toInt64 code.
|
||||
return int(toInt64(v))
|
||||
}
|
||||
|
||||
// toInt64 converts integer types to 64-bit integers
|
||||
func toInt64(v interface{}) int64 {
|
||||
if str, ok := v.(string); ok {
|
||||
iv, err := strconv.ParseInt(str, 10, 64)
|
||||
if err != nil {
|
||||
return 0
|
||||
}
|
||||
return iv
|
||||
}
|
||||
|
||||
val := reflect.Indirect(reflect.ValueOf(v))
|
||||
switch val.Kind() {
|
||||
case reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64, reflect.Int:
|
||||
return val.Int()
|
||||
case reflect.Uint8, reflect.Uint16, reflect.Uint32:
|
||||
return int64(val.Uint())
|
||||
case reflect.Uint, reflect.Uint64:
|
||||
tv := val.Uint()
|
||||
if tv <= math.MaxInt64 {
|
||||
return int64(tv)
|
||||
}
|
||||
// TODO: What is the sensible thing to do here?
|
||||
return math.MaxInt64
|
||||
case reflect.Float32, reflect.Float64:
|
||||
return int64(val.Float())
|
||||
case reflect.Bool:
|
||||
if val.Bool() {
|
||||
return 1
|
||||
}
|
||||
return 0
|
||||
default:
|
||||
return 0
|
||||
}
|
||||
}
|
||||
|
||||
func max(a interface{}, i ...interface{}) int64 {
|
||||
aa := toInt64(a)
|
||||
for _, b := range i {
|
||||
bb := toInt64(b)
|
||||
if bb > aa {
|
||||
aa = bb
|
||||
}
|
||||
}
|
||||
return aa
|
||||
}
|
||||
|
||||
func maxf(a interface{}, i ...interface{}) float64 {
|
||||
aa := toFloat64(a)
|
||||
for _, b := range i {
|
||||
bb := toFloat64(b)
|
||||
aa = math.Max(aa, bb)
|
||||
}
|
||||
return aa
|
||||
}
|
||||
|
||||
func min(a interface{}, i ...interface{}) int64 {
|
||||
aa := toInt64(a)
|
||||
for _, b := range i {
|
||||
bb := toInt64(b)
|
||||
if bb < aa {
|
||||
aa = bb
|
||||
}
|
||||
}
|
||||
return aa
|
||||
}
|
||||
|
||||
func minf(a interface{}, i ...interface{}) float64 {
|
||||
aa := toFloat64(a)
|
||||
for _, b := range i {
|
||||
bb := toFloat64(b)
|
||||
aa = math.Min(aa, bb)
|
||||
}
|
||||
return aa
|
||||
}
|
||||
|
||||
func until(count int) []int {
|
||||
step := 1
|
||||
if count < 0 {
|
||||
step = -1
|
||||
}
|
||||
return untilStep(0, count, step)
|
||||
}
|
||||
|
||||
func untilStep(start, stop, step int) []int {
|
||||
v := []int{}
|
||||
|
||||
if stop < start {
|
||||
if step >= 0 {
|
||||
return v
|
||||
}
|
||||
for i := start; i > stop; i += step {
|
||||
v = append(v, i)
|
||||
}
|
||||
return v
|
||||
}
|
||||
|
||||
if step <= 0 {
|
||||
return v
|
||||
}
|
||||
for i := start; i < stop; i += step {
|
||||
v = append(v, i)
|
||||
}
|
||||
return v
|
||||
}
|
||||
|
||||
func floor(a interface{}) float64 {
|
||||
aa := toFloat64(a)
|
||||
return math.Floor(aa)
|
||||
}
|
||||
|
||||
func ceil(a interface{}) float64 {
|
||||
aa := toFloat64(a)
|
||||
return math.Ceil(aa)
|
||||
}
|
||||
|
||||
func round(a interface{}, p int, rOpt ...float64) float64 {
|
||||
roundOn := .5
|
||||
if len(rOpt) > 0 {
|
||||
roundOn = rOpt[0]
|
||||
}
|
||||
val := toFloat64(a)
|
||||
places := toFloat64(p)
|
||||
|
||||
var round float64
|
||||
pow := math.Pow(10, places)
|
||||
digit := pow * val
|
||||
_, div := math.Modf(digit)
|
||||
if div >= roundOn {
|
||||
round = math.Ceil(digit)
|
||||
} else {
|
||||
round = math.Floor(digit)
|
||||
}
|
||||
return round / pow
|
||||
}
|
||||
|
||||
// converts unix octal to decimal
|
||||
func toDecimal(v interface{}) int64 {
|
||||
result, err := strconv.ParseInt(fmt.Sprint(v), 8, 64)
|
||||
if err != nil {
|
||||
return 0
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
func seq(params ...int) string {
|
||||
increment := 1
|
||||
switch len(params) {
|
||||
case 0:
|
||||
return ""
|
||||
case 1:
|
||||
start := 1
|
||||
end := params[0]
|
||||
if end < start {
|
||||
increment = -1
|
||||
}
|
||||
return intArrayToString(untilStep(start, end+increment, increment), " ")
|
||||
case 3:
|
||||
start := params[0]
|
||||
end := params[2]
|
||||
step := params[1]
|
||||
if end < start {
|
||||
increment = -1
|
||||
if step > 0 {
|
||||
return ""
|
||||
}
|
||||
}
|
||||
return intArrayToString(untilStep(start, end+increment, step), " ")
|
||||
case 2:
|
||||
start := params[0]
|
||||
end := params[1]
|
||||
step := 1
|
||||
if end < start {
|
||||
step = -1
|
||||
}
|
||||
return intArrayToString(untilStep(start, end+step, step), " ")
|
||||
default:
|
||||
return ""
|
||||
}
|
||||
}
|
||||
|
||||
func intArrayToString(slice []int, delimeter string) string {
|
||||
return strings.Trim(strings.Join(strings.Fields(fmt.Sprint(slice)), delimeter), "[]")
|
||||
}
|
||||
28
vendor/github.com/go-task/slim-sprig/reflect.go
generated
vendored
Normal file
28
vendor/github.com/go-task/slim-sprig/reflect.go
generated
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
package sprig
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"reflect"
|
||||
)
|
||||
|
||||
// typeIs returns true if the src is the type named in target.
|
||||
func typeIs(target string, src interface{}) bool {
|
||||
return target == typeOf(src)
|
||||
}
|
||||
|
||||
func typeIsLike(target string, src interface{}) bool {
|
||||
t := typeOf(src)
|
||||
return target == t || "*"+target == t
|
||||
}
|
||||
|
||||
func typeOf(src interface{}) string {
|
||||
return fmt.Sprintf("%T", src)
|
||||
}
|
||||
|
||||
func kindIs(target string, src interface{}) bool {
|
||||
return target == kindOf(src)
|
||||
}
|
||||
|
||||
func kindOf(src interface{}) string {
|
||||
return reflect.ValueOf(src).Kind().String()
|
||||
}
|
||||
83
vendor/github.com/go-task/slim-sprig/regex.go
generated
vendored
Normal file
83
vendor/github.com/go-task/slim-sprig/regex.go
generated
vendored
Normal file
@@ -0,0 +1,83 @@
|
||||
package sprig
|
||||
|
||||
import (
|
||||
"regexp"
|
||||
)
|
||||
|
||||
func regexMatch(regex string, s string) bool {
|
||||
match, _ := regexp.MatchString(regex, s)
|
||||
return match
|
||||
}
|
||||
|
||||
func mustRegexMatch(regex string, s string) (bool, error) {
|
||||
return regexp.MatchString(regex, s)
|
||||
}
|
||||
|
||||
func regexFindAll(regex string, s string, n int) []string {
|
||||
r := regexp.MustCompile(regex)
|
||||
return r.FindAllString(s, n)
|
||||
}
|
||||
|
||||
func mustRegexFindAll(regex string, s string, n int) ([]string, error) {
|
||||
r, err := regexp.Compile(regex)
|
||||
if err != nil {
|
||||
return []string{}, err
|
||||
}
|
||||
return r.FindAllString(s, n), nil
|
||||
}
|
||||
|
||||
func regexFind(regex string, s string) string {
|
||||
r := regexp.MustCompile(regex)
|
||||
return r.FindString(s)
|
||||
}
|
||||
|
||||
func mustRegexFind(regex string, s string) (string, error) {
|
||||
r, err := regexp.Compile(regex)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
return r.FindString(s), nil
|
||||
}
|
||||
|
||||
func regexReplaceAll(regex string, s string, repl string) string {
|
||||
r := regexp.MustCompile(regex)
|
||||
return r.ReplaceAllString(s, repl)
|
||||
}
|
||||
|
||||
func mustRegexReplaceAll(regex string, s string, repl string) (string, error) {
|
||||
r, err := regexp.Compile(regex)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
return r.ReplaceAllString(s, repl), nil
|
||||
}
|
||||
|
||||
func regexReplaceAllLiteral(regex string, s string, repl string) string {
|
||||
r := regexp.MustCompile(regex)
|
||||
return r.ReplaceAllLiteralString(s, repl)
|
||||
}
|
||||
|
||||
func mustRegexReplaceAllLiteral(regex string, s string, repl string) (string, error) {
|
||||
r, err := regexp.Compile(regex)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
return r.ReplaceAllLiteralString(s, repl), nil
|
||||
}
|
||||
|
||||
func regexSplit(regex string, s string, n int) []string {
|
||||
r := regexp.MustCompile(regex)
|
||||
return r.Split(s, n)
|
||||
}
|
||||
|
||||
func mustRegexSplit(regex string, s string, n int) ([]string, error) {
|
||||
r, err := regexp.Compile(regex)
|
||||
if err != nil {
|
||||
return []string{}, err
|
||||
}
|
||||
return r.Split(s, n), nil
|
||||
}
|
||||
|
||||
func regexQuoteMeta(s string) string {
|
||||
return regexp.QuoteMeta(s)
|
||||
}
|
||||
189
vendor/github.com/go-task/slim-sprig/strings.go
generated
vendored
Normal file
189
vendor/github.com/go-task/slim-sprig/strings.go
generated
vendored
Normal file
@@ -0,0 +1,189 @@
|
||||
package sprig
|
||||
|
||||
import (
|
||||
"encoding/base32"
|
||||
"encoding/base64"
|
||||
"fmt"
|
||||
"reflect"
|
||||
"strconv"
|
||||
"strings"
|
||||
)
|
||||
|
||||
func base64encode(v string) string {
|
||||
return base64.StdEncoding.EncodeToString([]byte(v))
|
||||
}
|
||||
|
||||
func base64decode(v string) string {
|
||||
data, err := base64.StdEncoding.DecodeString(v)
|
||||
if err != nil {
|
||||
return err.Error()
|
||||
}
|
||||
return string(data)
|
||||
}
|
||||
|
||||
func base32encode(v string) string {
|
||||
return base32.StdEncoding.EncodeToString([]byte(v))
|
||||
}
|
||||
|
||||
func base32decode(v string) string {
|
||||
data, err := base32.StdEncoding.DecodeString(v)
|
||||
if err != nil {
|
||||
return err.Error()
|
||||
}
|
||||
return string(data)
|
||||
}
|
||||
|
||||
func quote(str ...interface{}) string {
|
||||
out := make([]string, 0, len(str))
|
||||
for _, s := range str {
|
||||
if s != nil {
|
||||
out = append(out, fmt.Sprintf("%q", strval(s)))
|
||||
}
|
||||
}
|
||||
return strings.Join(out, " ")
|
||||
}
|
||||
|
||||
func squote(str ...interface{}) string {
|
||||
out := make([]string, 0, len(str))
|
||||
for _, s := range str {
|
||||
if s != nil {
|
||||
out = append(out, fmt.Sprintf("'%v'", s))
|
||||
}
|
||||
}
|
||||
return strings.Join(out, " ")
|
||||
}
|
||||
|
||||
func cat(v ...interface{}) string {
|
||||
v = removeNilElements(v)
|
||||
r := strings.TrimSpace(strings.Repeat("%v ", len(v)))
|
||||
return fmt.Sprintf(r, v...)
|
||||
}
|
||||
|
||||
func indent(spaces int, v string) string {
|
||||
pad := strings.Repeat(" ", spaces)
|
||||
return pad + strings.Replace(v, "\n", "\n"+pad, -1)
|
||||
}
|
||||
|
||||
func nindent(spaces int, v string) string {
|
||||
return "\n" + indent(spaces, v)
|
||||
}
|
||||
|
||||
func replace(old, new, src string) string {
|
||||
return strings.Replace(src, old, new, -1)
|
||||
}
|
||||
|
||||
func plural(one, many string, count int) string {
|
||||
if count == 1 {
|
||||
return one
|
||||
}
|
||||
return many
|
||||
}
|
||||
|
||||
func strslice(v interface{}) []string {
|
||||
switch v := v.(type) {
|
||||
case []string:
|
||||
return v
|
||||
case []interface{}:
|
||||
b := make([]string, 0, len(v))
|
||||
for _, s := range v {
|
||||
if s != nil {
|
||||
b = append(b, strval(s))
|
||||
}
|
||||
}
|
||||
return b
|
||||
default:
|
||||
val := reflect.ValueOf(v)
|
||||
switch val.Kind() {
|
||||
case reflect.Array, reflect.Slice:
|
||||
l := val.Len()
|
||||
b := make([]string, 0, l)
|
||||
for i := 0; i < l; i++ {
|
||||
value := val.Index(i).Interface()
|
||||
if value != nil {
|
||||
b = append(b, strval(value))
|
||||
}
|
||||
}
|
||||
return b
|
||||
default:
|
||||
if v == nil {
|
||||
return []string{}
|
||||
}
|
||||
|
||||
return []string{strval(v)}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func removeNilElements(v []interface{}) []interface{} {
|
||||
newSlice := make([]interface{}, 0, len(v))
|
||||
for _, i := range v {
|
||||
if i != nil {
|
||||
newSlice = append(newSlice, i)
|
||||
}
|
||||
}
|
||||
return newSlice
|
||||
}
|
||||
|
||||
func strval(v interface{}) string {
|
||||
switch v := v.(type) {
|
||||
case string:
|
||||
return v
|
||||
case []byte:
|
||||
return string(v)
|
||||
case error:
|
||||
return v.Error()
|
||||
case fmt.Stringer:
|
||||
return v.String()
|
||||
default:
|
||||
return fmt.Sprintf("%v", v)
|
||||
}
|
||||
}
|
||||
|
||||
func trunc(c int, s string) string {
|
||||
if c < 0 && len(s)+c > 0 {
|
||||
return s[len(s)+c:]
|
||||
}
|
||||
if c >= 0 && len(s) > c {
|
||||
return s[:c]
|
||||
}
|
||||
return s
|
||||
}
|
||||
|
||||
func join(sep string, v interface{}) string {
|
||||
return strings.Join(strslice(v), sep)
|
||||
}
|
||||
|
||||
func split(sep, orig string) map[string]string {
|
||||
parts := strings.Split(orig, sep)
|
||||
res := make(map[string]string, len(parts))
|
||||
for i, v := range parts {
|
||||
res["_"+strconv.Itoa(i)] = v
|
||||
}
|
||||
return res
|
||||
}
|
||||
|
||||
func splitn(sep string, n int, orig string) map[string]string {
|
||||
parts := strings.SplitN(orig, sep, n)
|
||||
res := make(map[string]string, len(parts))
|
||||
for i, v := range parts {
|
||||
res["_"+strconv.Itoa(i)] = v
|
||||
}
|
||||
return res
|
||||
}
|
||||
|
||||
// substring creates a substring of the given string.
|
||||
//
|
||||
// If start is < 0, this calls string[:end].
|
||||
//
|
||||
// If start is >= 0 and end < 0 or end bigger than s length, this calls string[start:]
|
||||
//
|
||||
// Otherwise, this calls string[start, end].
|
||||
func substring(start, end int, s string) string {
|
||||
if start < 0 {
|
||||
return s[:end]
|
||||
}
|
||||
if end < 0 || end > len(s) {
|
||||
return s[start:]
|
||||
}
|
||||
return s[start:end]
|
||||
}
|
||||
66
vendor/github.com/go-task/slim-sprig/url.go
generated
vendored
Normal file
66
vendor/github.com/go-task/slim-sprig/url.go
generated
vendored
Normal file
@@ -0,0 +1,66 @@
|
||||
package sprig
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"net/url"
|
||||
"reflect"
|
||||
)
|
||||
|
||||
func dictGetOrEmpty(dict map[string]interface{}, key string) string {
|
||||
value, ok := dict[key]
|
||||
if !ok {
|
||||
return ""
|
||||
}
|
||||
tp := reflect.TypeOf(value).Kind()
|
||||
if tp != reflect.String {
|
||||
panic(fmt.Sprintf("unable to parse %s key, must be of type string, but %s found", key, tp.String()))
|
||||
}
|
||||
return reflect.ValueOf(value).String()
|
||||
}
|
||||
|
||||
// parses given URL to return dict object
|
||||
func urlParse(v string) map[string]interface{} {
|
||||
dict := map[string]interface{}{}
|
||||
parsedURL, err := url.Parse(v)
|
||||
if err != nil {
|
||||
panic(fmt.Sprintf("unable to parse url: %s", err))
|
||||
}
|
||||
dict["scheme"] = parsedURL.Scheme
|
||||
dict["host"] = parsedURL.Host
|
||||
dict["hostname"] = parsedURL.Hostname()
|
||||
dict["path"] = parsedURL.Path
|
||||
dict["query"] = parsedURL.RawQuery
|
||||
dict["opaque"] = parsedURL.Opaque
|
||||
dict["fragment"] = parsedURL.Fragment
|
||||
if parsedURL.User != nil {
|
||||
dict["userinfo"] = parsedURL.User.String()
|
||||
} else {
|
||||
dict["userinfo"] = ""
|
||||
}
|
||||
|
||||
return dict
|
||||
}
|
||||
|
||||
// join given dict to URL string
|
||||
func urlJoin(d map[string]interface{}) string {
|
||||
resURL := url.URL{
|
||||
Scheme: dictGetOrEmpty(d, "scheme"),
|
||||
Host: dictGetOrEmpty(d, "host"),
|
||||
Path: dictGetOrEmpty(d, "path"),
|
||||
RawQuery: dictGetOrEmpty(d, "query"),
|
||||
Opaque: dictGetOrEmpty(d, "opaque"),
|
||||
Fragment: dictGetOrEmpty(d, "fragment"),
|
||||
}
|
||||
userinfo := dictGetOrEmpty(d, "userinfo")
|
||||
var user *url.Userinfo
|
||||
if userinfo != "" {
|
||||
tempURL, err := url.Parse(fmt.Sprintf("proto://%s@host", userinfo))
|
||||
if err != nil {
|
||||
panic(fmt.Sprintf("unable to parse userinfo in dict: %s", err))
|
||||
}
|
||||
user = tempURL.User
|
||||
}
|
||||
|
||||
resURL.User = user
|
||||
return resURL.String()
|
||||
}
|
||||
6
vendor/github.com/google/go-cmp/cmp/compare.go
generated
vendored
6
vendor/github.com/google/go-cmp/cmp/compare.go
generated
vendored
@@ -1,6 +1,6 @@
|
||||
// Copyright 2017, The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE.md file.
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
// Package cmp determines equality of values.
|
||||
//
|
||||
@@ -100,8 +100,8 @@ func Equal(x, y interface{}, opts ...Option) bool {
|
||||
// same input values and options.
|
||||
//
|
||||
// The output is displayed as a literal in pseudo-Go syntax.
|
||||
// At the start of each line, a "-" prefix indicates an element removed from y,
|
||||
// a "+" prefix to indicates an element added to y, and the lack of a prefix
|
||||
// At the start of each line, a "-" prefix indicates an element removed from x,
|
||||
// a "+" prefix to indicates an element added from y, and the lack of a prefix
|
||||
// indicates an element common to both x and y. If possible, the output
|
||||
// uses fmt.Stringer.String or error.Error methods to produce more humanly
|
||||
// readable outputs. In such cases, the string is prefixed with either an
|
||||
|
||||
2
vendor/github.com/google/go-cmp/cmp/export_panic.go
generated
vendored
2
vendor/github.com/google/go-cmp/cmp/export_panic.go
generated
vendored
@@ -1,6 +1,6 @@
|
||||
// Copyright 2017, The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE.md file.
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
// +build purego
|
||||
|
||||
|
||||
2
vendor/github.com/google/go-cmp/cmp/export_unsafe.go
generated
vendored
2
vendor/github.com/google/go-cmp/cmp/export_unsafe.go
generated
vendored
@@ -1,6 +1,6 @@
|
||||
// Copyright 2017, The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE.md file.
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
// +build !purego
|
||||
|
||||
|
||||
2
vendor/github.com/google/go-cmp/cmp/internal/diff/debug_disable.go
generated
vendored
2
vendor/github.com/google/go-cmp/cmp/internal/diff/debug_disable.go
generated
vendored
@@ -1,6 +1,6 @@
|
||||
// Copyright 2017, The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE.md file.
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
// +build !cmp_debug
|
||||
|
||||
|
||||
2
vendor/github.com/google/go-cmp/cmp/internal/diff/debug_enable.go
generated
vendored
2
vendor/github.com/google/go-cmp/cmp/internal/diff/debug_enable.go
generated
vendored
@@ -1,6 +1,6 @@
|
||||
// Copyright 2017, The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE.md file.
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
// +build cmp_debug
|
||||
|
||||
|
||||
50
vendor/github.com/google/go-cmp/cmp/internal/diff/diff.go
generated
vendored
50
vendor/github.com/google/go-cmp/cmp/internal/diff/diff.go
generated
vendored
@@ -1,6 +1,6 @@
|
||||
// Copyright 2017, The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE.md file.
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
// Package diff implements an algorithm for producing edit-scripts.
|
||||
// The edit-script is a sequence of operations needed to transform one list
|
||||
@@ -119,7 +119,7 @@ func (r Result) Similar() bool {
|
||||
return r.NumSame+1 >= r.NumDiff
|
||||
}
|
||||
|
||||
var randInt = rand.New(rand.NewSource(time.Now().Unix())).Intn(2)
|
||||
var randBool = rand.New(rand.NewSource(time.Now().Unix())).Intn(2) == 0
|
||||
|
||||
// Difference reports whether two lists of lengths nx and ny are equal
|
||||
// given the definition of equality provided as f.
|
||||
@@ -168,17 +168,6 @@ func Difference(nx, ny int, f EqualFunc) (es EditScript) {
|
||||
// A vertical edge is equivalent to inserting a symbol from list Y.
|
||||
// A diagonal edge is equivalent to a matching symbol between both X and Y.
|
||||
|
||||
// To ensure flexibility in changing the algorithm in the future,
|
||||
// introduce some degree of deliberate instability.
|
||||
// This is achieved by fiddling the zigzag iterator to start searching
|
||||
// the graph starting from the bottom-right versus than the top-left.
|
||||
// The result may differ depending on the starting search location,
|
||||
// but still produces a valid edit script.
|
||||
zigzagInit := randInt // either 0 or 1
|
||||
if flags.Deterministic {
|
||||
zigzagInit = 0
|
||||
}
|
||||
|
||||
// Invariants:
|
||||
// • 0 ≤ fwdPath.X ≤ (fwdFrontier.X, revFrontier.X) ≤ revPath.X ≤ nx
|
||||
// • 0 ≤ fwdPath.Y ≤ (fwdFrontier.Y, revFrontier.Y) ≤ revPath.Y ≤ ny
|
||||
@@ -197,6 +186,11 @@ func Difference(nx, ny int, f EqualFunc) (es EditScript) {
|
||||
// approximately the square-root of the search budget.
|
||||
searchBudget := 4 * (nx + ny) // O(n)
|
||||
|
||||
// Running the tests with the "cmp_debug" build tag prints a visualization
|
||||
// of the algorithm running in real-time. This is educational for
|
||||
// understanding how the algorithm works. See debug_enable.go.
|
||||
f = debug.Begin(nx, ny, f, &fwdPath.es, &revPath.es)
|
||||
|
||||
// The algorithm below is a greedy, meet-in-the-middle algorithm for
|
||||
// computing sub-optimal edit-scripts between two lists.
|
||||
//
|
||||
@@ -214,22 +208,28 @@ func Difference(nx, ny int, f EqualFunc) (es EditScript) {
|
||||
// frontier towards the opposite corner.
|
||||
// • This algorithm terminates when either the X coordinates or the
|
||||
// Y coordinates of the forward and reverse frontier points ever intersect.
|
||||
//
|
||||
|
||||
// This algorithm is correct even if searching only in the forward direction
|
||||
// or in the reverse direction. We do both because it is commonly observed
|
||||
// that two lists commonly differ because elements were added to the front
|
||||
// or end of the other list.
|
||||
//
|
||||
// Running the tests with the "cmp_debug" build tag prints a visualization
|
||||
// of the algorithm running in real-time. This is educational for
|
||||
// understanding how the algorithm works. See debug_enable.go.
|
||||
f = debug.Begin(nx, ny, f, &fwdPath.es, &revPath.es)
|
||||
for {
|
||||
// Non-deterministically start with either the forward or reverse direction
|
||||
// to introduce some deliberate instability so that we have the flexibility
|
||||
// to change this algorithm in the future.
|
||||
if flags.Deterministic || randBool {
|
||||
goto forwardSearch
|
||||
} else {
|
||||
goto reverseSearch
|
||||
}
|
||||
|
||||
forwardSearch:
|
||||
{
|
||||
// Forward search from the beginning.
|
||||
if fwdFrontier.X >= revFrontier.X || fwdFrontier.Y >= revFrontier.Y || searchBudget == 0 {
|
||||
break
|
||||
goto finishSearch
|
||||
}
|
||||
for stop1, stop2, i := false, false, zigzagInit; !(stop1 && stop2) && searchBudget > 0; i++ {
|
||||
for stop1, stop2, i := false, false, 0; !(stop1 && stop2) && searchBudget > 0; i++ {
|
||||
// Search in a diagonal pattern for a match.
|
||||
z := zigzag(i)
|
||||
p := point{fwdFrontier.X + z, fwdFrontier.Y - z}
|
||||
@@ -262,10 +262,14 @@ func Difference(nx, ny int, f EqualFunc) (es EditScript) {
|
||||
} else {
|
||||
fwdFrontier.Y++
|
||||
}
|
||||
goto reverseSearch
|
||||
}
|
||||
|
||||
reverseSearch:
|
||||
{
|
||||
// Reverse search from the end.
|
||||
if fwdFrontier.X >= revFrontier.X || fwdFrontier.Y >= revFrontier.Y || searchBudget == 0 {
|
||||
break
|
||||
goto finishSearch
|
||||
}
|
||||
for stop1, stop2, i := false, false, 0; !(stop1 && stop2) && searchBudget > 0; i++ {
|
||||
// Search in a diagonal pattern for a match.
|
||||
@@ -300,8 +304,10 @@ func Difference(nx, ny int, f EqualFunc) (es EditScript) {
|
||||
} else {
|
||||
revFrontier.Y--
|
||||
}
|
||||
goto forwardSearch
|
||||
}
|
||||
|
||||
finishSearch:
|
||||
// Join the forward and reverse paths and then append the reverse path.
|
||||
fwdPath.connect(revPath.point, f)
|
||||
for i := len(revPath.es) - 1; i >= 0; i-- {
|
||||
|
||||
2
vendor/github.com/google/go-cmp/cmp/internal/flags/flags.go
generated
vendored
2
vendor/github.com/google/go-cmp/cmp/internal/flags/flags.go
generated
vendored
@@ -1,6 +1,6 @@
|
||||
// Copyright 2019, The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE.md file.
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package flags
|
||||
|
||||
|
||||
2
vendor/github.com/google/go-cmp/cmp/internal/flags/toolchain_legacy.go
generated
vendored
2
vendor/github.com/google/go-cmp/cmp/internal/flags/toolchain_legacy.go
generated
vendored
@@ -1,6 +1,6 @@
|
||||
// Copyright 2019, The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE.md file.
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
// +build !go1.10
|
||||
|
||||
|
||||
2
vendor/github.com/google/go-cmp/cmp/internal/flags/toolchain_recent.go
generated
vendored
2
vendor/github.com/google/go-cmp/cmp/internal/flags/toolchain_recent.go
generated
vendored
@@ -1,6 +1,6 @@
|
||||
// Copyright 2019, The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE.md file.
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
// +build go1.10
|
||||
|
||||
|
||||
2
vendor/github.com/google/go-cmp/cmp/internal/function/func.go
generated
vendored
2
vendor/github.com/google/go-cmp/cmp/internal/function/func.go
generated
vendored
@@ -1,6 +1,6 @@
|
||||
// Copyright 2017, The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE.md file.
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
// Package function provides functionality for identifying function types.
|
||||
package function
|
||||
|
||||
2
vendor/github.com/google/go-cmp/cmp/internal/value/name.go
generated
vendored
2
vendor/github.com/google/go-cmp/cmp/internal/value/name.go
generated
vendored
@@ -1,6 +1,6 @@
|
||||
// Copyright 2020, The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE.md file.
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package value
|
||||
|
||||
|
||||
2
vendor/github.com/google/go-cmp/cmp/internal/value/pointer_purego.go
generated
vendored
2
vendor/github.com/google/go-cmp/cmp/internal/value/pointer_purego.go
generated
vendored
@@ -1,6 +1,6 @@
|
||||
// Copyright 2018, The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE.md file.
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
// +build purego
|
||||
|
||||
|
||||
2
vendor/github.com/google/go-cmp/cmp/internal/value/pointer_unsafe.go
generated
vendored
2
vendor/github.com/google/go-cmp/cmp/internal/value/pointer_unsafe.go
generated
vendored
@@ -1,6 +1,6 @@
|
||||
// Copyright 2018, The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE.md file.
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
// +build !purego
|
||||
|
||||
|
||||
2
vendor/github.com/google/go-cmp/cmp/internal/value/sort.go
generated
vendored
2
vendor/github.com/google/go-cmp/cmp/internal/value/sort.go
generated
vendored
@@ -1,6 +1,6 @@
|
||||
// Copyright 2017, The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE.md file.
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package value
|
||||
|
||||
|
||||
2
vendor/github.com/google/go-cmp/cmp/internal/value/zero.go
generated
vendored
2
vendor/github.com/google/go-cmp/cmp/internal/value/zero.go
generated
vendored
@@ -1,6 +1,6 @@
|
||||
// Copyright 2017, The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE.md file.
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package value
|
||||
|
||||
|
||||
2
vendor/github.com/google/go-cmp/cmp/options.go
generated
vendored
2
vendor/github.com/google/go-cmp/cmp/options.go
generated
vendored
@@ -1,6 +1,6 @@
|
||||
// Copyright 2017, The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE.md file.
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package cmp
|
||||
|
||||
|
||||
2
vendor/github.com/google/go-cmp/cmp/path.go
generated
vendored
2
vendor/github.com/google/go-cmp/cmp/path.go
generated
vendored
@@ -1,6 +1,6 @@
|
||||
// Copyright 2017, The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE.md file.
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package cmp
|
||||
|
||||
|
||||
2
vendor/github.com/google/go-cmp/cmp/report.go
generated
vendored
2
vendor/github.com/google/go-cmp/cmp/report.go
generated
vendored
@@ -1,6 +1,6 @@
|
||||
// Copyright 2017, The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE.md file.
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package cmp
|
||||
|
||||
|
||||
2
vendor/github.com/google/go-cmp/cmp/report_compare.go
generated
vendored
2
vendor/github.com/google/go-cmp/cmp/report_compare.go
generated
vendored
@@ -1,6 +1,6 @@
|
||||
// Copyright 2019, The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE.md file.
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package cmp
|
||||
|
||||
|
||||
2
vendor/github.com/google/go-cmp/cmp/report_references.go
generated
vendored
2
vendor/github.com/google/go-cmp/cmp/report_references.go
generated
vendored
@@ -1,6 +1,6 @@
|
||||
// Copyright 2020, The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE.md file.
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package cmp
|
||||
|
||||
|
||||
4
vendor/github.com/google/go-cmp/cmp/report_reflect.go
generated
vendored
4
vendor/github.com/google/go-cmp/cmp/report_reflect.go
generated
vendored
@@ -1,6 +1,6 @@
|
||||
// Copyright 2019, The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE.md file.
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package cmp
|
||||
|
||||
@@ -351,6 +351,8 @@ func formatMapKey(v reflect.Value, disambiguate bool, ptrs *pointerReferences) s
|
||||
opts.PrintAddresses = disambiguate
|
||||
opts.AvoidStringer = disambiguate
|
||||
opts.QualifiedNames = disambiguate
|
||||
opts.VerbosityLevel = maxVerbosityPreset
|
||||
opts.LimitVerbosity = true
|
||||
s := opts.FormatValue(v, reflect.Map, ptrs).String()
|
||||
return strings.TrimSpace(s)
|
||||
}
|
||||
|
||||
2
vendor/github.com/google/go-cmp/cmp/report_slices.go
generated
vendored
2
vendor/github.com/google/go-cmp/cmp/report_slices.go
generated
vendored
@@ -1,6 +1,6 @@
|
||||
// Copyright 2019, The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE.md file.
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package cmp
|
||||
|
||||
|
||||
2
vendor/github.com/google/go-cmp/cmp/report_text.go
generated
vendored
2
vendor/github.com/google/go-cmp/cmp/report_text.go
generated
vendored
@@ -1,6 +1,6 @@
|
||||
// Copyright 2019, The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE.md file.
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package cmp
|
||||
|
||||
|
||||
2
vendor/github.com/google/go-cmp/cmp/report_value.go
generated
vendored
2
vendor/github.com/google/go-cmp/cmp/report_value.go
generated
vendored
@@ -1,6 +1,6 @@
|
||||
// Copyright 2019, The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE.md file.
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package cmp
|
||||
|
||||
|
||||
25
vendor/github.com/google/licensecheck/CONTRIBUTING.md
generated
vendored
Normal file
25
vendor/github.com/google/licensecheck/CONTRIBUTING.md
generated
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
# How to Contribute
|
||||
|
||||
## Contributor License Agreement
|
||||
|
||||
Contributions to this project must be accompanied by a Contributor License
|
||||
Agreement. You (or your employer) retain the copyright to your contribution;
|
||||
this simply gives us permission to use and redistribute your contributions as
|
||||
part of the project. Head over to <https://cla.developers.google.com/> to see
|
||||
your current agreements on file or to sign a new one.
|
||||
|
||||
You generally only need to submit a CLA once, so if you've already submitted one
|
||||
(even if it was for a different project), you probably don't need to do it
|
||||
again.
|
||||
|
||||
## Code reviews
|
||||
|
||||
All submissions, including submissions by project members, require review. We
|
||||
use GitHub pull requests for this purpose. Consult
|
||||
[GitHub Help](https://help.github.com/articles/about-pull-requests/) for more
|
||||
information on using pull requests.
|
||||
|
||||
## Community Guidelines
|
||||
|
||||
This project follows
|
||||
[Google's Open Source Community Guidelines](https://opensource.google.com/conduct/).
|
||||
27
vendor/github.com/google/licensecheck/LICENSE
generated
vendored
Normal file
27
vendor/github.com/google/licensecheck/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
Copyright (c) 2019 The Go Authors. All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above
|
||||
copyright notice, this list of conditions and the following disclaimer
|
||||
in the documentation and/or other materials provided with the
|
||||
distribution.
|
||||
* Neither the name of Google Inc. nor the names of its
|
||||
contributors may be used to endorse or promote products derived from
|
||||
this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
13
vendor/github.com/google/licensecheck/README.md
generated
vendored
Normal file
13
vendor/github.com/google/licensecheck/README.md
generated
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
# Licensecheck
|
||||
|
||||
The `licensecheck` package scans source texts for known licenses.
|
||||
The design aims never to give a false positive.
|
||||
It also reports matches of known license URLs.
|
||||
|
||||
See the [package documentation](https://pkg.go.dev/github.com/google/licensecheck)
|
||||
for API details.
|
||||
|
||||
The license scanner recognizes nearly all the licenses gathered by the SPDX project,
|
||||
along with a few others.
|
||||
|
||||
See [licenses/README.md](licenses/README.md) for license details.
|
||||
74708
vendor/github.com/google/licensecheck/data.gen.go
generated
vendored
Normal file
74708
vendor/github.com/google/licensecheck/data.gen.go
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
5
vendor/github.com/google/licensecheck/data.gen.go.triv
generated
vendored
Normal file
5
vendor/github.com/google/licensecheck/data.gen.go.triv
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
// Used as a temporary data.gen.go by go generate.
|
||||
|
||||
package licensecheck
|
||||
|
||||
var builtinLREs []License
|
||||
3
vendor/github.com/google/licensecheck/go.mod
generated
vendored
Normal file
3
vendor/github.com/google/licensecheck/go.mod
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
module github.com/google/licensecheck
|
||||
|
||||
go 1.12
|
||||
448
vendor/github.com/google/licensecheck/internal/match/dict.go
generated
vendored
Normal file
448
vendor/github.com/google/licensecheck/internal/match/dict.go
generated
vendored
Normal file
@@ -0,0 +1,448 @@
|
||||
// Copyright 2020 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
// Package match defines matching algorithms and support code for the license checker.
|
||||
package match
|
||||
|
||||
import (
|
||||
"strings"
|
||||
"unicode"
|
||||
"unicode/utf8"
|
||||
)
|
||||
|
||||
// A Dict maps words to integer indexes in a word list, of type WordID.
|
||||
// The zero Dict is an empty dictionary ready for use.
|
||||
//
|
||||
// Lookup and Words are read-only operations,
|
||||
// safe for any number of concurrent calls from multiple goroutines.
|
||||
// Insert is a write operation; it must not run concurrently with
|
||||
// any other call, whether to Insert, Lookup, or Words.
|
||||
type Dict struct {
|
||||
dict map[string]WordID // dict maps word to index in list
|
||||
list []string // list of known words
|
||||
}
|
||||
|
||||
// A WordID is the index of a word in a dictionary.
|
||||
type WordID int32
|
||||
|
||||
// BadWord represents a word not present in the dictionary.
|
||||
const BadWord WordID = -1
|
||||
|
||||
// AnyWord represents a wildcard matching any word.
|
||||
const AnyWord WordID = -2
|
||||
|
||||
// Insert adds the word w to the word list, returning its index.
|
||||
// If w is already in the word list, it is not added again; Insert returns the existing index.
|
||||
func (d *Dict) Insert(w string) WordID {
|
||||
id, ok := d.dict[w]
|
||||
if ok {
|
||||
return id
|
||||
}
|
||||
if d.dict == nil {
|
||||
d.dict = make(map[string]WordID)
|
||||
}
|
||||
id = WordID(len(d.list))
|
||||
if int(id) != len(d.list) {
|
||||
panic("dictionary too large")
|
||||
}
|
||||
d.list = append(d.list, w)
|
||||
d.dict[w] = id
|
||||
return id
|
||||
}
|
||||
|
||||
// Lookup looks for the word w in the word list and returns its index.
|
||||
// If w is not in the word list, Lookup returns BadWord.
|
||||
func (d *Dict) Lookup(w string) WordID {
|
||||
id, ok := d.dict[w]
|
||||
if !ok {
|
||||
return BadWord
|
||||
}
|
||||
return id
|
||||
}
|
||||
|
||||
// Words returns the current word list.
|
||||
// The list is not a copy; the caller can read but must not modify the list.
|
||||
func (d *Dict) Words() []string {
|
||||
return d.list
|
||||
}
|
||||
|
||||
// A Word represents a single word found in a text.
|
||||
type Word struct {
|
||||
ID WordID
|
||||
Lo int32 // Word appears at text[Lo:Hi].
|
||||
Hi int32
|
||||
}
|
||||
|
||||
// InsertSplit splits text into a sequence of lowercase words,
|
||||
// inserting any new words in the dictionary.
|
||||
func (d *Dict) InsertSplit(text string) []Word {
|
||||
return d.split(text, true)
|
||||
}
|
||||
|
||||
// Split splits text into a sequence of lowercase words.
|
||||
// It does not add any new words to the dictionary.
|
||||
// Unrecognized words are reported as having ID = BadWord.
|
||||
func (d *Dict) Split(text string) []Word {
|
||||
return d.split(text, false)
|
||||
}
|
||||
|
||||
// © is rewritten to this text.
|
||||
var copyright = []byte("copyright")
|
||||
|
||||
func (d *Dict) split(text string, insert bool) []Word {
|
||||
var wbuf []byte
|
||||
var words []Word
|
||||
t := text
|
||||
for t != "" {
|
||||
var w []byte
|
||||
var lo, hi int32
|
||||
{
|
||||
switch t[0] {
|
||||
case '<':
|
||||
if size := htmlTagSize(t); size > 0 {
|
||||
t = t[size:]
|
||||
continue
|
||||
}
|
||||
case '{':
|
||||
if size := markdownAnchorSize(t); size > 0 {
|
||||
t = t[size:]
|
||||
continue
|
||||
}
|
||||
case '&':
|
||||
// Assume HTML entity is punctuation.
|
||||
if size := htmlEntitySize(t); size > 0 {
|
||||
if t[:size] == "©" {
|
||||
lo = int32(len(text) - len(t))
|
||||
hi = lo + int32(size)
|
||||
w = copyright
|
||||
t = t[size:]
|
||||
goto Emit
|
||||
}
|
||||
t = t[size:]
|
||||
continue
|
||||
}
|
||||
}
|
||||
if len(t) >= 2 && t[0] == ']' && t[1] == '(' {
|
||||
if size := markdownLinkSize(t); size > 0 {
|
||||
t = t[size:]
|
||||
continue
|
||||
}
|
||||
}
|
||||
|
||||
r, size := utf8.DecodeRuneInString(t)
|
||||
if !isWordStart(r) {
|
||||
t = t[size:]
|
||||
continue
|
||||
}
|
||||
wbuf = appendFoldRune(wbuf[:0], r)
|
||||
|
||||
// Scan whole word
|
||||
// (except © which is already a word by itself,
|
||||
// even when it appears next to other text,
|
||||
// like ©1996).
|
||||
lo = int32(len(text) - len(t))
|
||||
if r != '©' {
|
||||
for size < len(t) {
|
||||
r, s := utf8.DecodeRuneInString(t[size:])
|
||||
if !isWordContinue(r) {
|
||||
break
|
||||
}
|
||||
size += s
|
||||
wbuf = appendFoldRune(wbuf, r)
|
||||
}
|
||||
if size+3 <= len(t) && t[size:size+3] == "(s)" {
|
||||
// Read "notice(s)" as "notices" and let spell-check accept "notice" too.
|
||||
wbuf = append(wbuf, 's')
|
||||
size += 3
|
||||
}
|
||||
}
|
||||
hi = lo + int32(size)
|
||||
t = t[size:]
|
||||
|
||||
w = wbuf
|
||||
|
||||
// Special case rewrites suggested by SPDX.
|
||||
switch {
|
||||
case string(w) == "https":
|
||||
// "https" -> "http".
|
||||
w = w[:4]
|
||||
|
||||
case string(w) == "c" && lo > 0 && text[lo-1] == '(' && int(hi) < len(text) && text[hi] == ')':
|
||||
w = copyright
|
||||
lo--
|
||||
hi++
|
||||
|
||||
case string(w) == "©":
|
||||
w = copyright
|
||||
}
|
||||
|
||||
// More of our own.
|
||||
for _, m := range canonicalRewrites {
|
||||
if string(w) == m.y {
|
||||
w = append(w[:0], m.x...)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Emit:
|
||||
id, ok := d.dict[string(w)]
|
||||
if ok {
|
||||
if len(words) > 0 && words[len(words)-1].ID == id && string(w) == "copyright" {
|
||||
// Treat "Copyright ©" as a single "copyright" instead of two.
|
||||
continue
|
||||
}
|
||||
words = append(words, Word{id, lo, hi})
|
||||
continue
|
||||
}
|
||||
|
||||
if insert {
|
||||
words = append(words, Word{d.Insert(string(w)), lo, hi})
|
||||
continue
|
||||
}
|
||||
|
||||
// Unknown word
|
||||
words = append(words, Word{BadWord, lo, hi})
|
||||
}
|
||||
|
||||
return words
|
||||
}
|
||||
|
||||
// foldRune returns the folded rune r.
|
||||
// It returns -1 if the rune r should be omitted entirely.
|
||||
//
|
||||
// Folding can be any canonicalizing transformation we want.
|
||||
// For now folding means:
|
||||
// - fold to consistent case (unicode.SimpleFold, but moving to lower-case afterward)
|
||||
// - return -1 for (drop) combining grave and acute U+0300, U+0301
|
||||
// - strip pre-combined graves and acutes on vowels:
|
||||
// é to e, etc. (for Canadian or European licenses
|
||||
// mentioning Québec or Commissariat à l'Energie Atomique)
|
||||
//
|
||||
// If necessary we could do a full Unicode-based conversion,
|
||||
// but that will require more thought about exactly what to do
|
||||
// and doing it efficiently. For now, the accents are enough.
|
||||
func foldRune(r rune) rune {
|
||||
// Iterate SimpleFold until we hit the min equivalent rune,
|
||||
// which - for the ones we care about - is the upper case ASCII rune.
|
||||
for {
|
||||
r1 := unicode.SimpleFold(r)
|
||||
if r1 >= r {
|
||||
break
|
||||
}
|
||||
r = r1
|
||||
}
|
||||
|
||||
switch r {
|
||||
case 'Á', 'À':
|
||||
return 'a'
|
||||
case 'É', 'È':
|
||||
return 'e'
|
||||
case 'Í', 'Ì':
|
||||
return 'i'
|
||||
case 'Ó', 'Ò':
|
||||
return 'o'
|
||||
case 'Ú', 'Ù':
|
||||
return 'u'
|
||||
}
|
||||
|
||||
if 'A' <= r && r <= 'Z' {
|
||||
r += 'a' - 'A'
|
||||
}
|
||||
if r == '(' || r == ')' {
|
||||
// delete ( ) in (c) or notice(s)
|
||||
return -1
|
||||
}
|
||||
|
||||
return r
|
||||
}
|
||||
|
||||
// toFold converts s to folded form.
|
||||
func toFold(s string) string {
|
||||
var buf []byte
|
||||
for _, r := range s {
|
||||
buf = appendFoldRune(buf, r)
|
||||
}
|
||||
return string(buf)
|
||||
}
|
||||
|
||||
// appendFoldRune appends foldRune(r) to buf and returns the updated buffer.
|
||||
func appendFoldRune(buf []byte, r rune) []byte {
|
||||
r = foldRune(r)
|
||||
if r < 0 {
|
||||
return buf
|
||||
}
|
||||
if r < utf8.RuneSelf {
|
||||
return append(buf, byte(r))
|
||||
}
|
||||
|
||||
n := len(buf)
|
||||
s := utf8.RuneLen(r)
|
||||
for cap(buf) < n+s {
|
||||
buf = append(buf[:cap(buf)], 0)
|
||||
}
|
||||
buf = buf[:n+s]
|
||||
utf8.EncodeRune(buf[n:], r)
|
||||
return buf
|
||||
}
|
||||
|
||||
// isWordStart reports whether r can appear at the start of a word.
|
||||
func isWordStart(r rune) bool {
|
||||
return unicode.IsLetter(r) || unicode.IsDigit(r) || r == '©'
|
||||
}
|
||||
|
||||
// isWordContinue reports whether r can appear in a word, after the start.
|
||||
func isWordContinue(r rune) bool {
|
||||
return unicode.IsLetter(r) || unicode.IsDigit(r) || unicode.Is(unicode.Mn, r)
|
||||
}
|
||||
|
||||
// htmlTagSize returns the length of the HTML tag at the start of t, or else 0.
|
||||
func htmlTagSize(t string) int {
|
||||
if len(t) < 3 || t[0] != '<' {
|
||||
return 0
|
||||
}
|
||||
i := 1
|
||||
if t[i] == '/' {
|
||||
i++
|
||||
}
|
||||
if !('A' <= t[i] && t[i] <= 'Z' || 'a' <= t[i] && t[i] <= 'z') {
|
||||
return 0
|
||||
}
|
||||
space := false
|
||||
nl := 0
|
||||
for ; i < len(t); i++ {
|
||||
switch t[i] {
|
||||
case '@':
|
||||
// Keep <me@example.com>
|
||||
if !space {
|
||||
return 0
|
||||
}
|
||||
case ':':
|
||||
// Keep <http://example.com>
|
||||
if !space && i+1 < len(t) && t[i+1] == '/' {
|
||||
return 0
|
||||
}
|
||||
case '\r', '\n':
|
||||
if nl++; nl > 2 {
|
||||
return 0
|
||||
}
|
||||
case '<':
|
||||
return 0
|
||||
case '>':
|
||||
return i + 1
|
||||
case ' ':
|
||||
space = true
|
||||
}
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
// htmlEntitySize returns the length of the HTML entity expression at the start of t, or else 0.
|
||||
func htmlEntitySize(t string) int {
|
||||
if len(t) < 3 || t[0] != '&' {
|
||||
return 0
|
||||
}
|
||||
if t[1] == '#' {
|
||||
if t[2] == 'x' {
|
||||
// &#xHEX;
|
||||
i := 3
|
||||
for i < len(t) && ('0' <= t[i] && t[i] <= '9' || 'A' <= t[i] && t[i] <= 'F' || 'a' <= t[i] && t[i] <= 'f') {
|
||||
i++
|
||||
}
|
||||
if i > 3 && i < len(t) && t[i] == ';' {
|
||||
return i + 1
|
||||
}
|
||||
return 0
|
||||
}
|
||||
// &#DECIMAL;
|
||||
i := 2
|
||||
for i < len(t) && '0' <= t[i] && t[i] <= '9' {
|
||||
i++
|
||||
}
|
||||
if i > 2 && i < len(t) && t[i] == ';' {
|
||||
return i + 1
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
// &name;
|
||||
i := 1
|
||||
for i < len(t) && ('A' <= t[i] && t[i] <= 'Z' || 'a' <= t[i] && t[i] <= 'z') {
|
||||
i++
|
||||
}
|
||||
if i > 1 && i < len(t) && t[i] == ';' {
|
||||
return i + 1
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
// markdownAnchorSize returns the length of the Markdown anchor at the start of t, or else 0.
|
||||
// (like {#head})
|
||||
func markdownAnchorSize(t string) int {
|
||||
if len(t) < 4 || t[0] != '{' || t[1] != '#' {
|
||||
return 0
|
||||
}
|
||||
i := 2
|
||||
for ; i < len(t); i++ {
|
||||
switch t[i] {
|
||||
case '}':
|
||||
return i + 1
|
||||
case ' ', '\r', '\n':
|
||||
return 0
|
||||
}
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
var markdownLinkPrefixes = []string{
|
||||
"http://",
|
||||
"https://",
|
||||
"mailto:",
|
||||
"file:",
|
||||
"#",
|
||||
}
|
||||
|
||||
// markdownLinkSize returns the length of the Markdown link target at the start of t, or else 0.
|
||||
// Instead of fully parsing Markdown, this looks for ](http:// or ](https://.
|
||||
func markdownLinkSize(t string) int {
|
||||
if len(t) < 2 || t[0] != ']' || t[1] != '(' {
|
||||
return 0
|
||||
}
|
||||
ok := false
|
||||
for _, prefix := range markdownLinkPrefixes {
|
||||
if strings.HasPrefix(t[2:], prefix) {
|
||||
ok = true
|
||||
break
|
||||
}
|
||||
}
|
||||
if !ok {
|
||||
return 0
|
||||
}
|
||||
|
||||
for i := 2; i < len(t); i++ {
|
||||
c := t[i]
|
||||
if c == ' ' || c == '\t' || c == '\r' || c == '\n' {
|
||||
return 0
|
||||
}
|
||||
if c == ')' {
|
||||
return i + 1
|
||||
}
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
// canonicalRewrites is a list of pairs that are canonicalized during word splittting.
|
||||
// The words on the right are parsed as if they were the words on the left.
|
||||
// This happens during dictionary splitting, so canMisspell will never see any
|
||||
// of the words on the right.
|
||||
var canonicalRewrites = []struct {
|
||||
x, y string
|
||||
}{
|
||||
{"is", "are"},
|
||||
{"it", "them"},
|
||||
{"it", "they"},
|
||||
{"the", "these"},
|
||||
{"the", "this"},
|
||||
{"the", "those"},
|
||||
{"copy", "copies"}, // most plurals are handled as 1-letter typos
|
||||
}
|
||||
214
vendor/github.com/google/licensecheck/internal/match/regexp.go
generated
vendored
Normal file
214
vendor/github.com/google/licensecheck/internal/match/regexp.go
generated
vendored
Normal file
@@ -0,0 +1,214 @@
|
||||
// Copyright 2020 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
// Exported LRE interface.
|
||||
|
||||
package match
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"sync"
|
||||
)
|
||||
|
||||
// An LRE is a compiled license regular expression.
|
||||
//
|
||||
// TODO: Move this comment somewhere non-internal later.
|
||||
//
|
||||
// A license regular expression (LRE) is a pattern syntax intended for
|
||||
// describing large English texts such as software licenses, with minor
|
||||
// allowed variations. The pattern syntax and the matching are word-based
|
||||
// and case-insensitive; punctuation is ignored in the pattern and in
|
||||
// the matched text.
|
||||
//
|
||||
// The valid LRE patterns are:
|
||||
//
|
||||
// word - a single case-insensitive word
|
||||
// __N__ - any sequence of up to N words
|
||||
// expr1 expr2 - concatenation
|
||||
// expr1 || expr2 - alternation
|
||||
// (( expr )) - grouping
|
||||
// expr?? - zero or one instances of expr
|
||||
// //** text **// - a comment
|
||||
//
|
||||
// To make patterns harder to misread in large texts:
|
||||
//
|
||||
// - || must only appear inside (( ))
|
||||
// - ?? must only follow (( ))
|
||||
// - (( must be at the start of a line, preceded only by spaces
|
||||
// - )) must be at the end of a line, followed only by spaces and ??.
|
||||
//
|
||||
// For example:
|
||||
//
|
||||
// //** https://en.wikipedia.org/wiki/Filler_text **//
|
||||
// Now is
|
||||
// ((not))??
|
||||
// the time for all good
|
||||
// ((men || women || people))
|
||||
// to come to the aid of their __1__.
|
||||
//
|
||||
type LRE struct {
|
||||
dict *Dict
|
||||
file string
|
||||
syntax *reSyntax
|
||||
prog reProg
|
||||
|
||||
onceDFA sync.Once
|
||||
dfa reDFA
|
||||
}
|
||||
|
||||
// ParseLRE parses the string s as a license regexp.
|
||||
// The file name is used in error messages if non-empty.
|
||||
func ParseLRE(d *Dict, file, s string) (*LRE, error) {
|
||||
syntax, err := reParse(d, s, true)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
prog, err := syntax.compile(nil, 0)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &LRE{dict: d, file: file, syntax: syntax, prog: prog}, nil
|
||||
}
|
||||
|
||||
// Dict returns the Dict used by the LRE.
|
||||
func (re *LRE) Dict() *Dict {
|
||||
return re.dict
|
||||
}
|
||||
|
||||
// File returns the file name passed to ParseLRE.
|
||||
func (re *LRE) File() string {
|
||||
return re.file
|
||||
}
|
||||
|
||||
// Match reports whether text matches the license regexp.
|
||||
func (re *LRE) match(text string) bool {
|
||||
re.onceDFA.Do(re.compile)
|
||||
match, _ := re.dfa.match(re.dict, text, re.dict.Split(text))
|
||||
return match >= 0
|
||||
}
|
||||
|
||||
// compile initializes lre.dfa.
|
||||
// It is invoked lazily (in Match) because most LREs end up only
|
||||
// being inputs to a MultiLRE; we never need their DFAs directly.
|
||||
func (re *LRE) compile() {
|
||||
re.dfa = reCompileDFA(re.prog)
|
||||
}
|
||||
|
||||
// A MultiLRE matches multiple LREs simultaneously against a text.
|
||||
// It is more efficient than matching each LRE in sequence against the text.
|
||||
type MultiLRE struct {
|
||||
dict *Dict // dict shared by all LREs
|
||||
dfa reDFA // compiled DFA for all LREs
|
||||
|
||||
// start contains the two-word phrases
|
||||
// where a match can validly start,
|
||||
// to allow for faster scans over non-license text.
|
||||
start map[phrase]struct{}
|
||||
}
|
||||
|
||||
// A phrase is a phrase of up to two words.
|
||||
// The zero-word phrase is phrase{NoWord, NoWord}.
|
||||
// A single-word phrase w is phrase{w, NoWord}.
|
||||
type phrase [2]WordID
|
||||
|
||||
// NewMultiLRE returns a MultiLRE looking for the given LREs.
|
||||
// All the LREs must have been parsed using the same Dict;
|
||||
// if not, NewMultiLRE panics.
|
||||
func NewMultiLRE(list []*LRE) (_ *MultiLRE, err error) {
|
||||
if len(list) == 0 {
|
||||
return &MultiLRE{}, nil
|
||||
}
|
||||
|
||||
dict := list[0].dict
|
||||
for _, sub := range list[1:] {
|
||||
if sub.dict != dict {
|
||||
panic("MultiRE: LREs parsed with different Dicts")
|
||||
}
|
||||
}
|
||||
|
||||
var progs []reProg
|
||||
for _, sub := range list {
|
||||
progs = append(progs, sub.prog)
|
||||
}
|
||||
|
||||
start := make(map[phrase]struct{})
|
||||
for _, sub := range list {
|
||||
phrases := sub.syntax.leadingPhrases()
|
||||
if len(phrases) == 0 {
|
||||
return nil, fmt.Errorf("%s: no leading phrases", sub.File())
|
||||
}
|
||||
for _, p := range phrases {
|
||||
if p[0] == BadWord {
|
||||
return nil, fmt.Errorf("%s: invalid pattern: matches empty text", sub.File())
|
||||
}
|
||||
if p[0] == AnyWord {
|
||||
if p[1] == BadWord {
|
||||
return nil, fmt.Errorf("%s: invalid pattern: matches a single wildcard", sub.File())
|
||||
}
|
||||
if p[1] == AnyWord {
|
||||
return nil, fmt.Errorf("%s: invalid pattern: begins with two wildcards", sub.File())
|
||||
}
|
||||
return nil, fmt.Errorf("%s: invalid pattern: begins with wildcard phrase: __ %s", sub.File(), dict.Words()[p[1]])
|
||||
}
|
||||
if p[1] == BadWord {
|
||||
return nil, fmt.Errorf("%s: invalid pattern: matches single word %s", sub.File(), dict.Words()[p[0]])
|
||||
}
|
||||
if p[1] == AnyWord {
|
||||
return nil, fmt.Errorf("%s: invalid pattern: begins with wildcard phrase: %s __", sub.File(), dict.Words()[p[0]])
|
||||
}
|
||||
start[p] = struct{}{}
|
||||
}
|
||||
}
|
||||
|
||||
prog := reCompileMulti(progs)
|
||||
dfa := reCompileDFA(prog)
|
||||
|
||||
return &MultiLRE{dict, dfa, start}, nil
|
||||
}
|
||||
|
||||
// Dict returns the Dict used by the MultiLRE.
|
||||
func (re *MultiLRE) Dict() *Dict {
|
||||
return re.dict
|
||||
}
|
||||
|
||||
// A Matches is a collection of all leftmost-longest, non-overlapping matches in text.
|
||||
type Matches struct {
|
||||
Text string // the entire text
|
||||
Words []Word // the text, split into Words
|
||||
List []Match // the matches
|
||||
}
|
||||
|
||||
// A Match records the position of a single match in a text.
|
||||
type Match struct {
|
||||
ID int // index of LRE in list passed to NewMultiLRE
|
||||
Start int // word index of start of match
|
||||
End int // word index of end of match
|
||||
}
|
||||
|
||||
// Match reports all leftmost-longest, non-overlapping matches in text.
|
||||
// It always returns a non-nil *Matches, in order to return the split text.
|
||||
// Check len(matches.List) to see whether any matches were found.
|
||||
func (re *MultiLRE) Match(text string) *Matches {
|
||||
m := &Matches{
|
||||
Text: text,
|
||||
Words: re.dict.Split(text),
|
||||
}
|
||||
p := phrase{BadWord, BadWord}
|
||||
for i := 0; i < len(m.Words); i++ {
|
||||
p[0], p[1] = p[1], m.Words[i].ID
|
||||
if _, ok := re.start[p]; ok {
|
||||
match, end := re.dfa.match(re.dict, text, m.Words[i-1:])
|
||||
if match >= 0 && end > 0 {
|
||||
end += i - 1 // translate from index in m.Words[i-1:] to index in m.Words
|
||||
m.List = append(m.List, Match{ID: int(match), Start: i - 1, End: end})
|
||||
|
||||
// Continue search at end of match.
|
||||
i = end - 1 // loop will i++
|
||||
p[0] = BadWord
|
||||
continue
|
||||
}
|
||||
}
|
||||
}
|
||||
return m
|
||||
}
|
||||
1005
vendor/github.com/google/licensecheck/internal/match/rematch.go
generated
vendored
Normal file
1005
vendor/github.com/google/licensecheck/internal/match/rematch.go
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
581
vendor/github.com/google/licensecheck/internal/match/resyntax.go
generated
vendored
Normal file
581
vendor/github.com/google/licensecheck/internal/match/resyntax.go
generated
vendored
Normal file
@@ -0,0 +1,581 @@
|
||||
// Copyright 2020 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
// License regexp syntax and parsing
|
||||
// See LRE doc comment in regexp.go for syntax.
|
||||
|
||||
package match
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"errors"
|
||||
"fmt"
|
||||
"strconv"
|
||||
"strings"
|
||||
)
|
||||
|
||||
// A SyntaxError reports a syntax error during parsing.
|
||||
type SyntaxError struct {
|
||||
File string
|
||||
Offset int
|
||||
Context string
|
||||
Err string
|
||||
}
|
||||
|
||||
func (e *SyntaxError) Error() string {
|
||||
var text string
|
||||
if e.File != "" {
|
||||
text = fmt.Sprintf("%s:#%d: syntax error", e.File, e.Offset)
|
||||
} else {
|
||||
text = fmt.Sprintf("syntax error at offset %d", e.Offset)
|
||||
}
|
||||
if e.Context != "" {
|
||||
text += " near `" + e.Context + "`"
|
||||
}
|
||||
text += ": " + e.Err
|
||||
return text
|
||||
}
|
||||
|
||||
// reSyntaxError returns a *SyntaxError with context.
|
||||
func reSyntaxError(s string, i int, err error) error {
|
||||
context := s[:i]
|
||||
j := i - 10
|
||||
for j >= 0 && s[j] != ' ' {
|
||||
j--
|
||||
}
|
||||
if j >= 0 && i-j < 20 {
|
||||
context = s[j+1 : i]
|
||||
} else {
|
||||
if j < 0 {
|
||||
j = 0
|
||||
}
|
||||
context = s[j:i]
|
||||
}
|
||||
return &SyntaxError{
|
||||
Offset: i,
|
||||
Context: context,
|
||||
Err: err.Error(),
|
||||
}
|
||||
}
|
||||
|
||||
// A reSyntax is a regexp syntax tree.
|
||||
type reSyntax struct {
|
||||
op reOp // opcode
|
||||
sub []*reSyntax // subexpressions (opConcat, opAlternate, opWild, opQuest)
|
||||
w []WordID // words (opWords)
|
||||
n int32 // wildcard count (opWild)
|
||||
}
|
||||
|
||||
// A reOp is the opcode for a regexp syntax tree node.
|
||||
type reOp int
|
||||
|
||||
const (
|
||||
opNone reOp = 1 + iota
|
||||
opEmpty
|
||||
opWords
|
||||
opConcat
|
||||
opAlternate
|
||||
opWild
|
||||
opQuest
|
||||
|
||||
// pseudo-ops during parsing
|
||||
opPseudo
|
||||
opLeftParen
|
||||
opVerticalBar
|
||||
)
|
||||
|
||||
// string returns a text form for the regexp syntax.
|
||||
// The dictionary d supplies the word literals.
|
||||
func (re *reSyntax) string(d *Dict) string {
|
||||
var b bytes.Buffer
|
||||
rePrint(&b, re, d)
|
||||
return strings.Trim(b.String(), "\n")
|
||||
}
|
||||
|
||||
// nl guarantees b ends with a complete, non-empty line with no trailing spaces
|
||||
// or has no lines at all.
|
||||
func nl(b *bytes.Buffer) {
|
||||
buf := b.Bytes()
|
||||
if len(buf) == 0 || buf[len(buf)-1] == '\n' {
|
||||
return
|
||||
}
|
||||
i := len(buf)
|
||||
for i > 0 && buf[i-1] == ' ' {
|
||||
i--
|
||||
}
|
||||
if i < len(buf) {
|
||||
b.Truncate(i)
|
||||
}
|
||||
b.WriteByte('\n')
|
||||
}
|
||||
|
||||
// rePrint prints re to b, using d for words.
|
||||
func rePrint(b *bytes.Buffer, re *reSyntax, d *Dict) {
|
||||
switch re.op {
|
||||
case opEmpty:
|
||||
b.WriteString("(( ))")
|
||||
case opConcat:
|
||||
if len(re.sub) == 0 {
|
||||
b.WriteString("«empty concat»")
|
||||
}
|
||||
for i, sub := range re.sub {
|
||||
if i > 0 && b.Len() > 0 && b.Bytes()[b.Len()-1] != '\n' {
|
||||
b.WriteString(" ")
|
||||
}
|
||||
rePrint(b, sub, d)
|
||||
}
|
||||
|
||||
case opAlternate:
|
||||
nl(b)
|
||||
b.WriteString("((")
|
||||
for i, sub := range re.sub {
|
||||
if i > 0 {
|
||||
b.WriteString(" || ")
|
||||
}
|
||||
rePrint(b, sub, d)
|
||||
}
|
||||
b.WriteString("))\n")
|
||||
|
||||
case opWild:
|
||||
fmt.Fprintf(b, "__%d__", re.n)
|
||||
|
||||
case opQuest:
|
||||
sub := re.sub[0]
|
||||
nl(b)
|
||||
if sub.op == opAlternate {
|
||||
rePrint(b, sub, d)
|
||||
b.Truncate(b.Len() - 1) // strip \n
|
||||
} else {
|
||||
b.WriteString("((")
|
||||
rePrint(b, sub, d)
|
||||
b.WriteString("))")
|
||||
}
|
||||
b.WriteString("??\n")
|
||||
|
||||
case opWords:
|
||||
if len(re.w) == 0 {
|
||||
b.WriteString("«empty opWords»")
|
||||
}
|
||||
for i, w := range re.w {
|
||||
if i > 0 && b.Len() > 0 && b.Bytes()[b.Len()-1] != '\n' {
|
||||
b.WriteString(" ")
|
||||
}
|
||||
s := d.Words()[w]
|
||||
if s == "" {
|
||||
b.WriteString("''")
|
||||
} else {
|
||||
b.WriteString(d.Words()[w])
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// A reParser is the regexp parser state.
|
||||
type reParser struct {
|
||||
dict *Dict
|
||||
stack []*reSyntax
|
||||
}
|
||||
|
||||
// reParse parses a license regexp s
|
||||
// and returns a reSyntax parse tree.
|
||||
// reParse adds words to the dictionary d,
|
||||
// so it is not safe to call reParse from concurrent goroutines
|
||||
// using the same dictionary.
|
||||
// If strict is false, the rules about operators at the start or end of line are ignored,
|
||||
// to make trivial test expressions easier to write.
|
||||
func reParse(d *Dict, s string, strict bool) (*reSyntax, error) {
|
||||
var p reParser
|
||||
p.dict = d
|
||||
|
||||
start := 0
|
||||
parens := 0
|
||||
i := 0
|
||||
for i < len(s) {
|
||||
switch {
|
||||
case strings.HasPrefix(s[i:], "(("):
|
||||
if strict && !atBOL(s, i) {
|
||||
return nil, reSyntaxError(s, i, fmt.Errorf("(( not at beginning of line"))
|
||||
}
|
||||
p.words(s[start:i], "((")
|
||||
p.push(&reSyntax{op: opLeftParen})
|
||||
i += 2
|
||||
start = i
|
||||
parens++
|
||||
|
||||
case strings.HasPrefix(s[i:], "||"):
|
||||
if strict && parens == 0 {
|
||||
return nil, reSyntaxError(s, i, fmt.Errorf("|| outside (( ))"))
|
||||
}
|
||||
p.words(s[start:i], "||")
|
||||
if err := p.verticalBar(); err != nil {
|
||||
return nil, reSyntaxError(s, i, err)
|
||||
}
|
||||
i += 2
|
||||
start = i
|
||||
|
||||
case strings.HasPrefix(s[i:], "))"):
|
||||
// )) must be followed by ?? or end line
|
||||
if strict {
|
||||
j := i + 2
|
||||
for j < len(s) && (s[j] == ' ' || s[j] == '\t') {
|
||||
j++
|
||||
}
|
||||
if j < len(s) && s[j] != '\n' && (j+1 >= len(s) || s[j] != '?' || s[j+1] != '?') {
|
||||
return nil, reSyntaxError(s, i, fmt.Errorf(")) not at end of line"))
|
||||
}
|
||||
}
|
||||
|
||||
p.words(s[start:i], "))")
|
||||
if err := p.rightParen(); err != nil {
|
||||
return nil, reSyntaxError(s, i, err)
|
||||
}
|
||||
i += 2
|
||||
start = i
|
||||
parens--
|
||||
|
||||
case strings.HasPrefix(s[i:], "??"):
|
||||
// ?? must be preceded by )) on same line and must end the line.
|
||||
if strict {
|
||||
j := i
|
||||
for j > 0 && (s[j-1] == ' ' || s[j-1] == '\t') {
|
||||
j--
|
||||
}
|
||||
if j < 2 || s[j-1] != ')' || s[j-2] != ')' {
|
||||
return nil, reSyntaxError(s, i, fmt.Errorf("?? not preceded by ))"))
|
||||
}
|
||||
}
|
||||
if strict && !atEOL(s, i+2) {
|
||||
return nil, reSyntaxError(s, i, fmt.Errorf("?? not at end of line"))
|
||||
}
|
||||
|
||||
p.words(s[start:i], "??")
|
||||
if err := p.quest(); err != nil {
|
||||
return nil, reSyntaxError(s, i, err)
|
||||
}
|
||||
i += 2
|
||||
start = i
|
||||
|
||||
case strings.HasPrefix(s[i:], "__"):
|
||||
j := i + 2
|
||||
for j < len(s) && '0' <= s[j] && s[j] <= '9' {
|
||||
j++
|
||||
}
|
||||
if j == i+2 {
|
||||
i++
|
||||
continue
|
||||
}
|
||||
if !strings.HasPrefix(s[j:], "__") {
|
||||
i++
|
||||
continue
|
||||
}
|
||||
n, err := strconv.Atoi(s[i+2 : j])
|
||||
if err != nil {
|
||||
return nil, reSyntaxError(s, i, errors.New("invalid wildcard count "+s[i:j+2]))
|
||||
}
|
||||
p.words(s[start:i], "__")
|
||||
p.push(&reSyntax{op: opWild, n: int32(n)})
|
||||
i = j + 2
|
||||
start = i
|
||||
|
||||
case strings.HasPrefix(s[i:], "//**"):
|
||||
j := strings.Index(s[i+4:], "**//")
|
||||
if j < 0 {
|
||||
return nil, reSyntaxError(s, i, errors.New("opening //** without closing **//"))
|
||||
}
|
||||
p.words(s[start:i], "//** **//")
|
||||
i += 4 + j + 4
|
||||
start = i
|
||||
|
||||
default:
|
||||
i++
|
||||
}
|
||||
}
|
||||
|
||||
p.words(s[start:], "")
|
||||
p.concat()
|
||||
if p.swapVerticalBar() {
|
||||
// pop vertical bar
|
||||
p.stack = p.stack[:len(p.stack)-1]
|
||||
}
|
||||
p.alternate()
|
||||
|
||||
n := len(p.stack)
|
||||
if n != 1 {
|
||||
return nil, reSyntaxError(s, len(s), fmt.Errorf("missing )) at end"))
|
||||
}
|
||||
return p.stack[0], nil
|
||||
}
|
||||
|
||||
// atBOL reports whether i is at the beginning of a line (ignoring spaces) in s.
|
||||
func atBOL(s string, i int) bool {
|
||||
for i > 0 && (s[i-1] == ' ' || s[i-1] == '\t') {
|
||||
i--
|
||||
}
|
||||
return i == 0 || s[i-1] == '\n'
|
||||
}
|
||||
|
||||
// atEOL reports whether i is at the end of a line (ignoring spaces) in s.
|
||||
func atEOL(s string, i int) bool {
|
||||
for i < len(s) && (s[i] == ' ' || s[i] == '\t' || s[i] == '\r') {
|
||||
i++
|
||||
}
|
||||
return i >= len(s) || s[i] == '\n'
|
||||
}
|
||||
|
||||
// push pushes the regexp re onto the parse stack and returns the regexp.
|
||||
func (p *reParser) push(re *reSyntax) *reSyntax {
|
||||
p.stack = append(p.stack, re)
|
||||
return re
|
||||
}
|
||||
|
||||
// words handles a block of words in the input.
|
||||
func (p *reParser) words(text, next string) {
|
||||
words := p.dict.InsertSplit(text)
|
||||
if len(words) == 0 {
|
||||
return
|
||||
}
|
||||
|
||||
// If the next operator is ??, we need to keep the last word
|
||||
// separate, so that the ?? will only apply to that word.
|
||||
// There are no other operators that grab the last word.
|
||||
var last Word
|
||||
if next == "??" {
|
||||
words, last = words[:len(words)-1], words[len(words)-1]
|
||||
}
|
||||
|
||||
// Add the words (with last possibly removed) into an opWords.
|
||||
// If there's one atop the stack, use it. Otherwise, add one.
|
||||
if len(words) > 0 {
|
||||
var re *reSyntax
|
||||
if len(p.stack) > 0 && p.stack[len(p.stack)-1].op == opWords {
|
||||
re = p.stack[len(p.stack)-1]
|
||||
} else {
|
||||
re = p.push(&reSyntax{op: opWords})
|
||||
}
|
||||
for _, w := range words {
|
||||
re.w = append(re.w, w.ID)
|
||||
}
|
||||
}
|
||||
|
||||
// Add the last word if needed.
|
||||
if next == "??" {
|
||||
p.stack = append(p.stack, &reSyntax{op: opWords, w: []WordID{last.ID}})
|
||||
}
|
||||
}
|
||||
|
||||
// verticalBar handles a || in the input.
|
||||
func (p *reParser) verticalBar() error {
|
||||
p.concat()
|
||||
|
||||
// The concatenation we just parsed is on top of the stack.
|
||||
// If it sits above an opVerticalBar, swap it below
|
||||
// (things below an opVerticalBar become an alternation).
|
||||
// Otherwise, push a new vertical bar.
|
||||
if !p.swapVerticalBar() {
|
||||
p.push(&reSyntax{op: opVerticalBar})
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// If the top of the stack is an element followed by an opVerticalBar
|
||||
// swapVerticalBar swaps the two and returns true.
|
||||
// Otherwise it returns false.
|
||||
func (p *reParser) swapVerticalBar() bool {
|
||||
n := len(p.stack)
|
||||
if n >= 2 {
|
||||
re1 := p.stack[n-1]
|
||||
re2 := p.stack[n-2]
|
||||
if re2.op == opVerticalBar {
|
||||
p.stack[n-2] = re1
|
||||
p.stack[n-1] = re2
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
// rightParen handles a )) in the input.
|
||||
func (p *reParser) rightParen() error {
|
||||
p.concat()
|
||||
if p.swapVerticalBar() {
|
||||
// pop vertical bar
|
||||
p.stack = p.stack[:len(p.stack)-1]
|
||||
}
|
||||
p.alternate()
|
||||
|
||||
n := len(p.stack)
|
||||
if n < 2 {
|
||||
return fmt.Errorf("unexpected ))")
|
||||
}
|
||||
re1 := p.stack[n-1]
|
||||
re2 := p.stack[n-2]
|
||||
p.stack = p.stack[:n-2]
|
||||
if re2.op != opLeftParen {
|
||||
return fmt.Errorf("unexpected ))")
|
||||
}
|
||||
|
||||
p.push(re1)
|
||||
return nil
|
||||
}
|
||||
|
||||
// quest replaces the top stack element with itself made optional.
|
||||
func (p *reParser) quest() error {
|
||||
n := len(p.stack)
|
||||
if n == 0 {
|
||||
return fmt.Errorf("missing argument to ??")
|
||||
}
|
||||
sub := p.stack[n-1]
|
||||
if sub.op >= opPseudo {
|
||||
return fmt.Errorf("missing argument to ??")
|
||||
}
|
||||
if sub.op == opQuest {
|
||||
// Repeated ?? don't accomplish anything new.
|
||||
return nil
|
||||
}
|
||||
|
||||
p.stack[n-1] = &reSyntax{op: opQuest, sub: []*reSyntax{sub}}
|
||||
return nil
|
||||
}
|
||||
|
||||
// concat replaces the top of the stack (above the topmost '||' or '((') with its concatenation.
|
||||
func (p *reParser) concat() *reSyntax {
|
||||
// Scan down to find pseudo-operator || or ((.
|
||||
i := len(p.stack)
|
||||
for i > 0 && p.stack[i-1].op < opPseudo {
|
||||
i--
|
||||
}
|
||||
subs := p.stack[i:]
|
||||
p.stack = p.stack[:i]
|
||||
|
||||
// Empty concatenation is special case.
|
||||
if len(subs) == 0 {
|
||||
return p.push(&reSyntax{op: opEmpty})
|
||||
}
|
||||
|
||||
return p.push(p.collapse(opConcat, subs))
|
||||
}
|
||||
|
||||
// alternate replaces the top of the stack (above the topmost '((') with its alternation.
|
||||
func (p *reParser) alternate() *reSyntax {
|
||||
// Scan down to find pseudo-operator ((.
|
||||
// There are no || above ((.
|
||||
i := len(p.stack)
|
||||
for i > 0 && p.stack[i-1].op < opPseudo {
|
||||
i--
|
||||
}
|
||||
subs := p.stack[i:]
|
||||
p.stack = p.stack[:i]
|
||||
|
||||
return p.push(p.collapse(opAlternate, subs))
|
||||
}
|
||||
|
||||
// collapse returns the result of applying op to sub.
|
||||
// If sub contains op nodes, they all get hoisted up
|
||||
// so that there is never a concat of a concat or an
|
||||
// alternate of an alternate.
|
||||
func (p *reParser) collapse(op reOp, subs []*reSyntax) *reSyntax {
|
||||
if len(subs) == 1 {
|
||||
return subs[0]
|
||||
}
|
||||
re := &reSyntax{op: op}
|
||||
for _, sub := range subs {
|
||||
if sub.op == op {
|
||||
re.sub = append(re.sub, sub.sub...)
|
||||
} else {
|
||||
re.sub = append(re.sub, sub)
|
||||
}
|
||||
}
|
||||
return re
|
||||
}
|
||||
|
||||
// leadingPhrases returns the set of possible initial phrases
|
||||
// in any match of the given re syntax.
|
||||
func (re *reSyntax) leadingPhrases() []phrase {
|
||||
switch re.op {
|
||||
default:
|
||||
panic("bad op in phrases")
|
||||
|
||||
case opWild:
|
||||
return []phrase{{BadWord, BadWord}, {AnyWord, BadWord}, {AnyWord, AnyWord}}
|
||||
|
||||
case opEmpty:
|
||||
return []phrase{{BadWord, BadWord}}
|
||||
|
||||
case opWords:
|
||||
w := re.w
|
||||
var p phrase
|
||||
if len(w) == 0 {
|
||||
p = phrase{BadWord, BadWord}
|
||||
} else if len(w) == 1 {
|
||||
p = phrase{w[0], BadWord}
|
||||
} else {
|
||||
p = phrase{w[0], w[1]}
|
||||
}
|
||||
return []phrase{p}
|
||||
|
||||
case opQuest:
|
||||
list := re.sub[0].leadingPhrases()
|
||||
for _, l := range list {
|
||||
if l[0] == BadWord {
|
||||
return list
|
||||
}
|
||||
}
|
||||
list = append(list, phrase{BadWord, BadWord})
|
||||
return list
|
||||
|
||||
case opAlternate:
|
||||
var list []phrase
|
||||
have := make(map[phrase]bool)
|
||||
for _, sub := range re.sub {
|
||||
for _, p := range sub.leadingPhrases() {
|
||||
if !have[p] {
|
||||
have[p] = true
|
||||
list = append(list, p)
|
||||
}
|
||||
}
|
||||
}
|
||||
return list
|
||||
|
||||
case opConcat:
|
||||
xs := []phrase{{BadWord, BadWord}}
|
||||
for _, sub := range re.sub {
|
||||
ok := true
|
||||
for _, x := range xs {
|
||||
if x[1] == BadWord {
|
||||
ok = false
|
||||
}
|
||||
}
|
||||
if ok {
|
||||
break
|
||||
}
|
||||
ys := sub.leadingPhrases()
|
||||
have := make(map[phrase]bool)
|
||||
var xys []phrase
|
||||
for _, x := range xs {
|
||||
if x[1] != BadWord {
|
||||
if !have[x] {
|
||||
have[x] = true
|
||||
xys = append(xys, x)
|
||||
}
|
||||
continue
|
||||
}
|
||||
for _, y := range ys {
|
||||
var xy phrase
|
||||
if x[0] == BadWord {
|
||||
xy = y
|
||||
} else {
|
||||
xy = phrase{x[0], y[0]}
|
||||
}
|
||||
if !have[xy] {
|
||||
have[xy] = true
|
||||
xys = append(xys, xy)
|
||||
}
|
||||
}
|
||||
}
|
||||
xs = xys
|
||||
}
|
||||
return xs
|
||||
}
|
||||
}
|
||||
244
vendor/github.com/google/licensecheck/license.go
generated
vendored
Normal file
244
vendor/github.com/google/licensecheck/license.go
generated
vendored
Normal file
@@ -0,0 +1,244 @@
|
||||
// Copyright 2019 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
// Package licensecheck classifies license files and heuristically determines
|
||||
// how well they correspond to known open source licenses.
|
||||
//
|
||||
// Scanning
|
||||
//
|
||||
// A text (a slice of bytes) can be scanned for known licenses by calling Scan.
|
||||
// The resulting Coverage structure describes all the matches found as well
|
||||
// as what percentage of the file was covered by known matches.
|
||||
//
|
||||
// cov := licensecheck.Scan(text)
|
||||
// fmt.Printf("%.1f%% of text covered by licenses:\n", cov.Percent)
|
||||
// for _, m := range cov.Match {
|
||||
// fmt.Printf("%s at [%d:%d] IsURL=%v\n", m.Name, m.Start, m.End, m.IsURL)
|
||||
// }
|
||||
//
|
||||
// The Scan function uses a built-in license set, which is the known SPDX licenses
|
||||
// augmented with some other commonly seen licenses.
|
||||
// (See licenses/README.md for details about the license set.)
|
||||
//
|
||||
// A custom scanner can be created using NewScanner, passing in a set of
|
||||
// license patterns to scan for. The license patterns are written as license regular expressions (LREs).
|
||||
// BuiltinLicenses returns the set of license patterns used by Scan.
|
||||
//
|
||||
// License Regular Expressions
|
||||
// Each license to be recognized is specified by writing a license regular expression (LRE) for it.
|
||||
// The pattern syntax and the matching are word-based and case-insensitive;
|
||||
// punctuation is ignored in the pattern and in the matched text.
|
||||
//
|
||||
// The valid LRE patterns are:
|
||||
//
|
||||
// - word, a single case-insensitive word
|
||||
// - __N__, any sequence of up to N words
|
||||
// - expr1 expr2, concatenation of two expressions
|
||||
// - expr1 || expr2, alternation of two expressions
|
||||
// - (( expr )), grouping
|
||||
// - (( expr ))??, zero or one instances of the grouped expression
|
||||
// - //** text **//, a comment ignored by the parser
|
||||
//
|
||||
// To make patterns harder to misread in large texts:
|
||||
// (( must only appear at the start of a line (possibly indented);
|
||||
// )) and ))?? must only appear at the end of a line (with possible trailing spaces);
|
||||
// and || must only appear inside a (( )) or (( ))?? group.
|
||||
//
|
||||
// For example:
|
||||
//
|
||||
// //** https://en.wikipedia.org/wiki/Filler_text **//
|
||||
// Now is
|
||||
// ((not))??
|
||||
// the time for all good
|
||||
// ((men || women || people))
|
||||
// to come to the aid of their __1__.
|
||||
//
|
||||
// The Old Cover and Checker API
|
||||
//
|
||||
// An older, less precise matcher using the names Cover, New, and Checker
|
||||
// was removed from this package.
|
||||
// Use v0.1.0 for the final version of that API.
|
||||
//
|
||||
package licensecheck
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"strconv"
|
||||
"strings"
|
||||
)
|
||||
|
||||
// The order matters here.
|
||||
// gen_data.go imports licensecheck for Type, so we copy over
|
||||
// a trivial data.gen.go in order to build gen_data.go during "go run".
|
||||
//go:generate cp data.gen.go.triv data.gen.go
|
||||
//go:generate go run gen_data.go
|
||||
|
||||
// A License describes a single license that can be recognized.
|
||||
// At least one of LRE or URL should be set.
|
||||
type License struct {
|
||||
ID string // reported license ID
|
||||
Type Type // reported license type
|
||||
LRE string // license regular expression (see licenses/README.md)
|
||||
URL string // identifying URL
|
||||
}
|
||||
|
||||
// Coverage describes how the text matches various licenses.
|
||||
type Coverage struct {
|
||||
// Percent is the fraction of the total text, in normalized words, that
|
||||
// matches any valid license, expressed as a percentage across all of the
|
||||
// licenses matched.
|
||||
Percent float64
|
||||
|
||||
// Match describes, in sequential order, the matches of the input text
|
||||
// across the various licenses. Typically it will be only one match long,
|
||||
// but if the input text is a concatenation of licenses it will contain
|
||||
// a match value for each element of the concatenation.
|
||||
Match []Match
|
||||
}
|
||||
|
||||
// When we build the Match, Start and End are word offsets,
|
||||
// but they are converted to byte offsets in the original
|
||||
// before being passed back to the caller.
|
||||
|
||||
// Match describes how a section of the input matches a license.
|
||||
type Match struct {
|
||||
ID string // License identifier. (See licenses/README.md.)
|
||||
Type Type // The type of the license: BSD, MIT, etc.
|
||||
Start int // Start offset of match in text; match is at text[Start:End].
|
||||
End int // End offset of match in text.
|
||||
IsURL bool // Whether match is a URL.
|
||||
}
|
||||
|
||||
// Type is a bit set describing the requirements imposed by a license or group of licenses.
|
||||
type Type uint
|
||||
|
||||
const (
|
||||
// Unknown indicates that the license requirements are unknown.
|
||||
Unknown Type = 0
|
||||
|
||||
// Unrestricted indicates that the license carries no requirements.
|
||||
// Examples: 0BSD, CC0, Unlicense.
|
||||
Unrestricted Type = 1 << iota
|
||||
|
||||
// Notice indicates that the license carries notice or advertising requirements.
|
||||
// Examples: MIT, BSD, Apache 1.1, Apache 2.0
|
||||
Notice
|
||||
|
||||
// ShareChanges indicates that source and binary distributions must include
|
||||
// source code for any modifications made to the original code itself,
|
||||
// made available under the same license as the original.
|
||||
// Example: LGPL.
|
||||
ShareChanges
|
||||
|
||||
// ShareProgram indicates that source and binary distributions must include
|
||||
// source code for the entire program using the original code library,
|
||||
// made available under the same license as the original.
|
||||
// Example: GPL.
|
||||
ShareProgram
|
||||
|
||||
// ShareServer indicates that any server program making use of the source code
|
||||
// must provide a download link for the entire source code of the server.
|
||||
// Examples: AGPL, CPAL, EUPL, SSPL.
|
||||
ShareServer
|
||||
|
||||
// NonCommercial indicates that commercial use of the software is disallowed.
|
||||
// Examples: CommonsClause, CC-BY-NC-4.0, Prosperity 3.0.0.
|
||||
NonCommercial
|
||||
|
||||
// Discouraged indicates that there is some legal problem with the license,
|
||||
// making it difficult to comply with or vague about what it permits.
|
||||
// Examples: Beerware, SISSL, WTFPL.
|
||||
Discouraged
|
||||
)
|
||||
|
||||
// Merge returns the result of merging the requirements of license types t and u.
|
||||
//
|
||||
// If either is Unknown, the result is Unknown.
|
||||
// Among the bits Unrestricted, Notice, ShareChanges, ShareProgram, ShareServer,
|
||||
// the result will use the one that appears latest in the list and is present in either t or u.
|
||||
// The NonCommercial and Discouraged bits are set in the result if they are set in either t or u.
|
||||
func (t Type) Merge(u Type) Type {
|
||||
if t == Unknown || u == Unknown {
|
||||
return Unknown
|
||||
}
|
||||
|
||||
var m Type
|
||||
for bit := ShareServer; bit > 0; bit >>= 1 {
|
||||
if (t|u)&bit != 0 {
|
||||
m |= bit
|
||||
break
|
||||
}
|
||||
}
|
||||
m |= (t | u) & (NonCommercial | Discouraged)
|
||||
|
||||
// Special case: NonCommercial is a restriction,
|
||||
// so drop the unrestricted bit if still set.
|
||||
if m&Unrestricted != 0 && m&NonCommercial != 0 {
|
||||
m &^= Unrestricted
|
||||
}
|
||||
|
||||
return m
|
||||
}
|
||||
|
||||
var typeBits = []struct {
|
||||
t Type
|
||||
s string
|
||||
}{
|
||||
{Unknown, "Unknown"},
|
||||
{Unrestricted, "Unrestricted"},
|
||||
{Notice, "Notice"},
|
||||
{ShareChanges, "ShareChanges"},
|
||||
{ShareProgram, "ShareProgram"},
|
||||
{ShareServer, "ShareServer"},
|
||||
{NonCommercial, "NonCommercial"},
|
||||
{Discouraged, "Discouraged"},
|
||||
}
|
||||
|
||||
// String returns the type t in string form.
|
||||
// The form is a |-separated list of bit values (Notice, NonCommercial, and so on)
|
||||
// with a final Type(0x###) if needed.
|
||||
//
|
||||
// For example, (ShareServer|NonCommercial).String() = "ShareServer|NonCommercial".
|
||||
func (t Type) String() string {
|
||||
if t == 0 {
|
||||
return "Unknown"
|
||||
}
|
||||
s := ""
|
||||
for _, b := range typeBits {
|
||||
if b.t != 0 && t&b.t == b.t {
|
||||
t &^= b.t
|
||||
s += "|" + b.s
|
||||
}
|
||||
}
|
||||
if t != 0 {
|
||||
s += fmt.Sprintf("|Type(%#x)", uint(t))
|
||||
}
|
||||
return s[1:]
|
||||
}
|
||||
|
||||
// ParseType parses s into a Type.
|
||||
// The string s should be of the same form returned by Type's String method.
|
||||
func ParseType(s string) (Type, error) {
|
||||
var t Type
|
||||
Fields:
|
||||
for _, f := range strings.Split(s, "|") {
|
||||
for _, b := range typeBits {
|
||||
if b.s == f {
|
||||
t |= b.t
|
||||
continue Fields
|
||||
}
|
||||
}
|
||||
if strings.HasPrefix(f, "Type(") && strings.HasSuffix(f, ")") {
|
||||
if n, err := strconv.ParseUint(f[5:len(f)-1], 0, 0); err == nil {
|
||||
t |= Type(n)
|
||||
continue Fields
|
||||
}
|
||||
}
|
||||
if f == "" {
|
||||
return 0, fmt.Errorf("parsing %q: malformed Type", s)
|
||||
}
|
||||
return 0, fmt.Errorf("parsing %q: unknown Type %q", s, f)
|
||||
}
|
||||
return t, nil
|
||||
}
|
||||
243
vendor/github.com/google/licensecheck/scan.go
generated
vendored
Normal file
243
vendor/github.com/google/licensecheck/scan.go
generated
vendored
Normal file
@@ -0,0 +1,243 @@
|
||||
// Copyright 2020 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package licensecheck
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"errors"
|
||||
"fmt"
|
||||
"regexp"
|
||||
"strings"
|
||||
"sync"
|
||||
|
||||
"github.com/google/licensecheck/internal/match"
|
||||
)
|
||||
|
||||
var (
|
||||
// builtinScanner is initialized lazily,
|
||||
// because init is fairly expensive,
|
||||
// and delaying it lets us see the init
|
||||
// in test cpu profiles.
|
||||
builtinScanner = new(Scanner)
|
||||
builtinScannerOnce sync.Once
|
||||
)
|
||||
|
||||
// BuiltinLicenses returns the list of licenses built into the package.
|
||||
// That is, the built-in checker is equivalent to New(BuiltinLicenses()).
|
||||
func BuiltinLicenses() []License {
|
||||
// Return a copy so caller cannot change list entries.
|
||||
list := append([]License{}, builtinLREs...)
|
||||
m := make(map[string]Type)
|
||||
for _, l := range list {
|
||||
m[l.ID] = l.Type
|
||||
}
|
||||
for _, l := range builtinURLs {
|
||||
// Fill in Type from builtinLREs.
|
||||
if typ, ok := m[l.ID]; ok {
|
||||
l.Type = typ
|
||||
} else {
|
||||
l.Type = Unknown
|
||||
}
|
||||
list = append(list, l)
|
||||
}
|
||||
return list
|
||||
}
|
||||
|
||||
// A Scanner matches a set of known licenses.
|
||||
type Scanner struct {
|
||||
licenses []License
|
||||
urls map[string]License
|
||||
re *match.MultiLRE
|
||||
}
|
||||
|
||||
// NewScanner returns a new Scanner that recognizes the given set of licenses.
|
||||
func NewScanner(licenses []License) (*Scanner, error) {
|
||||
s := new(Scanner)
|
||||
err := s.init(licenses)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return s, nil
|
||||
}
|
||||
|
||||
func (s *Scanner) init(licenses []License) error {
|
||||
d := new(match.Dict)
|
||||
d.Insert("copyright")
|
||||
d.Insert("http")
|
||||
var list []*match.LRE
|
||||
s.urls = make(map[string]License)
|
||||
for _, l := range licenses {
|
||||
if l.URL != "" {
|
||||
s.urls[l.URL] = l
|
||||
}
|
||||
if l.LRE != "" {
|
||||
s.licenses = append(s.licenses, l)
|
||||
re, err := match.ParseLRE(d, l.ID, l.LRE)
|
||||
if err != nil {
|
||||
return fmt.Errorf("parsing %v: %v", l.ID, err)
|
||||
}
|
||||
list = append(list, re)
|
||||
}
|
||||
}
|
||||
re, err := match.NewMultiLRE(list)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if re == nil {
|
||||
return errors.New("missing lre")
|
||||
}
|
||||
s.re = re
|
||||
return nil
|
||||
}
|
||||
|
||||
const maxCopyrightWords = 50
|
||||
|
||||
// Scan computes the coverage of the text according to the
|
||||
// license set compiled into the package.
|
||||
//
|
||||
// An input text may match multiple licenses. If that happens,
|
||||
// Match contains only disjoint matches. If multiple licenses
|
||||
// match a particular section of the input, the best match
|
||||
// is chosen so the returned coverage describes at most
|
||||
// one match for each section of the input.
|
||||
//
|
||||
func Scan(text []byte) Coverage {
|
||||
return builtinScanner.Scan(text)
|
||||
}
|
||||
|
||||
var urlScanRE = regexp.MustCompile(`^(?i)https?://[-a-z0-9_.]+\.(org|com)(/[-a-z0-9_.#?=]+)+/?`)
|
||||
|
||||
// Scan is like the top-level function Scan,
|
||||
// but it uses the set of licenses in the Scanner instead of the built-in license set.
|
||||
func (s *Scanner) Scan(text []byte) Coverage {
|
||||
if s == builtinScanner {
|
||||
builtinScannerOnce.Do(func() {
|
||||
if err := builtinScanner.init(BuiltinLicenses()); err != nil {
|
||||
panic("licensecheck: initializing Scan: " + err.Error())
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
matches := s.re.Match(string(text)) // TODO remove conversion
|
||||
|
||||
var c Coverage
|
||||
words := matches.Words
|
||||
total := 0
|
||||
lastEnd := 0
|
||||
copyright := s.re.Dict().Lookup("copyright")
|
||||
http := s.re.Dict().Lookup("http")
|
||||
|
||||
// Add sentinel match trigger URL scan from last match to end of text.
|
||||
matches.List = append(matches.List, match.Match{Start: len(words), ID: -1})
|
||||
|
||||
for _, m := range matches.List {
|
||||
if m.Start < len(words) && lastEnd < m.Start && copyright >= 0 {
|
||||
limit := m.Start - maxCopyrightWords
|
||||
if limit < lastEnd {
|
||||
limit = lastEnd
|
||||
}
|
||||
for i := limit; i < m.Start; i++ {
|
||||
if words[i].ID == copyright {
|
||||
m.Start = i
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Pick up any URLs before m.Start.
|
||||
for i := lastEnd; i < m.Start; i++ {
|
||||
w := &words[i]
|
||||
if w.ID == http {
|
||||
// Potential URL match.
|
||||
// urlRE only considers a match at the start of the input string.
|
||||
// Only accept URLs that end before the next scan match.
|
||||
if u := urlScanRE.FindIndex(text[w.Lo:]); u != nil && (m.Start == len(words) || int(w.Lo)+u[1] <= int(words[m.Start].Lo)) {
|
||||
u0, u1 := int(w.Lo)+u[0], int(w.Lo)+u[1]
|
||||
if l, ok := s.licenseURL(string(text[u0:u1])); ok {
|
||||
c.Match = append(c.Match, Match{
|
||||
ID: l.ID,
|
||||
Type: l.Type,
|
||||
Start: u0,
|
||||
End: u1,
|
||||
IsURL: true,
|
||||
})
|
||||
start := i
|
||||
for i < m.Start && int(words[i].Hi) <= u1 {
|
||||
i++
|
||||
}
|
||||
total += i - start
|
||||
i-- // counter loop i++
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if m.ID < 0 { // sentinel added above
|
||||
break
|
||||
}
|
||||
|
||||
start := int(words[m.Start].Lo) // byte offset (unlike m.Start)
|
||||
if m.Start == 0 {
|
||||
start = 0
|
||||
} else {
|
||||
prev := int(words[m.Start-1].Hi)
|
||||
if i := bytes.LastIndexByte(text[prev:start], '\n'); i >= 0 {
|
||||
start = prev + i + 1
|
||||
}
|
||||
}
|
||||
end := int(words[m.End-1].Hi) // byte offset (unlike m.End)
|
||||
if m.End == len(words) {
|
||||
end = len(text)
|
||||
} else {
|
||||
next := int(words[m.End].Lo)
|
||||
if i := bytes.IndexByte(text[end:next], '\n'); i >= 0 {
|
||||
end = end + i + 1
|
||||
}
|
||||
}
|
||||
l := &s.licenses[m.ID]
|
||||
c.Match = append(c.Match, Match{
|
||||
ID: l.ID,
|
||||
Type: l.Type,
|
||||
Start: start,
|
||||
End: end,
|
||||
})
|
||||
total += m.End - m.Start
|
||||
lastEnd = m.End
|
||||
}
|
||||
|
||||
if len(words) > 0 { // len(words)==0 should be impossible, but avoid NaN
|
||||
c.Percent = 100.0 * float64(total) / float64(len(words))
|
||||
}
|
||||
|
||||
return c
|
||||
}
|
||||
|
||||
// licenseURL reports whether url is a known URL, and returns its name if it is.
|
||||
func (s *Scanner) licenseURL(url string) (License, bool) {
|
||||
// We need to canonicalize the text for lookup.
|
||||
// First, trim the leading http:// or https:// and the trailing /.
|
||||
// Then we lower-case it.
|
||||
url = strings.TrimPrefix(url, "http://")
|
||||
url = strings.TrimPrefix(url, "https://")
|
||||
url = strings.TrimSuffix(url, "/")
|
||||
url = strings.TrimSuffix(url, "/legalcode") // Common for CC licenses.
|
||||
url = strings.ToLower(url)
|
||||
l, ok := s.urls[url]
|
||||
if ok {
|
||||
return l, true
|
||||
}
|
||||
|
||||
// Try trimming one more path element, so that the ported URL
|
||||
// https://creativecommons.org/licenses/by/3.0/us/
|
||||
// is recognized as the known unported URL
|
||||
// https://creativecommons.org/licenses/by/3.0
|
||||
if i := strings.LastIndex(url, "/"); i >= 0 {
|
||||
if l, ok = s.urls[url[:i]]; ok {
|
||||
return l, true
|
||||
}
|
||||
}
|
||||
|
||||
return License{}, false
|
||||
}
|
||||
152
vendor/github.com/google/licensecheck/urls.go
generated
vendored
Normal file
152
vendor/github.com/google/licensecheck/urls.go
generated
vendored
Normal file
@@ -0,0 +1,152 @@
|
||||
// Copyright 2019 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package licensecheck
|
||||
|
||||
// This file contains the list of known URLs for valid licenses, only.
|
||||
// Do not add other code.
|
||||
|
||||
// TODO: Find a canonical source of this information, or at least a
|
||||
// disciplined way to develop it. This is cadged from gopkg.in/src-d/go-license-detector.v2.
|
||||
|
||||
// The URL text does not include the leading http:// or https://
|
||||
// or trailing /.
|
||||
// All entries are lower case.
|
||||
// Keep this list sorted for easy checking.
|
||||
var builtinURLs = []License{
|
||||
{URL: "creativecommons.org/licenses/by-nc-nd/2.0", ID: "CC-BY-NC-ND-2.0"},
|
||||
{URL: "creativecommons.org/licenses/by-nc-nd/2.5", ID: "CC-BY-NC-ND-2.5"},
|
||||
{URL: "creativecommons.org/licenses/by-nc-nd/3.0", ID: "CC-BY-NC-ND-3.0"},
|
||||
{URL: "creativecommons.org/licenses/by-nc-nd/4.0", ID: "CC-BY-NC-ND-4.0"},
|
||||
{URL: "creativecommons.org/licenses/by-nc-sa/1.0", ID: "CC-BY-NC-SA-1.0"},
|
||||
{URL: "creativecommons.org/licenses/by-nc-sa/2.0", ID: "CC-BY-NC-SA-2.0"},
|
||||
{URL: "creativecommons.org/licenses/by-nc-sa/2.5", ID: "CC-BY-NC-SA-2.5"},
|
||||
{URL: "creativecommons.org/licenses/by-nc-sa/3.0", ID: "CC-BY-NC-SA-3.0"},
|
||||
{URL: "creativecommons.org/licenses/by-nc-sa/4.0", ID: "CC-BY-NC-SA-4.0"},
|
||||
{URL: "creativecommons.org/licenses/by-nc/1.0", ID: "CC-BY-NC-1.0"},
|
||||
{URL: "creativecommons.org/licenses/by-nc/2.0", ID: "CC-BY-NC-2.0"},
|
||||
{URL: "creativecommons.org/licenses/by-nc/2.5", ID: "CC-BY-NC-2.5"},
|
||||
{URL: "creativecommons.org/licenses/by-nc/3.0", ID: "CC-BY-NC-3.0"},
|
||||
{URL: "creativecommons.org/licenses/by-nc/4.0", ID: "CC-BY-NC-4.0"},
|
||||
{URL: "creativecommons.org/licenses/by-nd-nc/1.0", ID: "CC-BY-NC-ND-1.0"},
|
||||
{URL: "creativecommons.org/licenses/by-nd/1.0", ID: "CC-BY-ND-1.0"},
|
||||
{URL: "creativecommons.org/licenses/by-nd/2.0", ID: "CC-BY-ND-2.0"},
|
||||
{URL: "creativecommons.org/licenses/by-nd/2.5", ID: "CC-BY-ND-2.5"},
|
||||
{URL: "creativecommons.org/licenses/by-nd/3.0", ID: "CC-BY-ND-3.0"},
|
||||
{URL: "creativecommons.org/licenses/by-nd/4.0", ID: "CC-BY-ND-4.0"},
|
||||
{URL: "creativecommons.org/licenses/by-sa/1.0", ID: "CC-BY-SA-1.0"},
|
||||
{URL: "creativecommons.org/licenses/by-sa/2.0", ID: "CC-BY-SA-2.0"},
|
||||
{URL: "creativecommons.org/licenses/by-sa/2.5", ID: "CC-BY-SA-2.5"},
|
||||
{URL: "creativecommons.org/licenses/by-sa/3.0", ID: "CC-BY-SA-3.0"},
|
||||
{URL: "creativecommons.org/licenses/by-sa/4.0", ID: "CC-BY-SA-4.0"},
|
||||
{URL: "creativecommons.org/licenses/by/1.0", ID: "CC-BY-1.0"},
|
||||
{URL: "creativecommons.org/licenses/by/2.0", ID: "CC-BY-2.0"},
|
||||
{URL: "creativecommons.org/licenses/by/2.5", ID: "CC-BY-2.5"},
|
||||
{URL: "creativecommons.org/licenses/by/3.0", ID: "CC-BY-3.0"},
|
||||
{URL: "creativecommons.org/licenses/by/4.0", ID: "CC-BY-4.0"},
|
||||
{URL: "creativecommons.org/publicdomain/zero/1.0", ID: "CC0-1.0"},
|
||||
{URL: "opensource.org/licenses/apache-1.1", ID: "Apache-1.1"},
|
||||
{URL: "opensource.org/licenses/artistic-1.0", ID: "Artistic-1.0"},
|
||||
{URL: "opensource.org/licenses/bsdpluspatent", ID: "BSD-2-Clause-Patent"},
|
||||
{URL: "opensource.org/licenses/catosl-1.1", ID: "CATOSL-1.1"},
|
||||
{URL: "opensource.org/licenses/cpl-1.0", ID: "CPL-1.0"},
|
||||
{URL: "opensource.org/licenses/cua-opl-1.0", ID: "CUA-OPL-1.0"},
|
||||
{URL: "opensource.org/licenses/ecl-1.0", ID: "ECL-1.0"},
|
||||
{URL: "opensource.org/licenses/ecl-2.0", ID: "ECL-2.0"},
|
||||
{URL: "opensource.org/licenses/efl-1.0", ID: "EFL-1.0"},
|
||||
{URL: "opensource.org/licenses/efl-2.0", ID: "EFL-2.0"},
|
||||
{URL: "opensource.org/licenses/entessa", ID: "Entessa"},
|
||||
{URL: "opensource.org/licenses/intel", ID: "Intel"},
|
||||
{URL: "opensource.org/licenses/lpl-1.0", ID: "LPL-1.0"},
|
||||
{URL: "opensource.org/licenses/liliq-p-1.1", ID: "LiLiQ-P-1.1"},
|
||||
{URL: "opensource.org/licenses/liliq-r-1.1", ID: "LiLiQ-R-1.1"},
|
||||
{URL: "opensource.org/licenses/liliq-rplus-1.1", ID: "LiLiQ-Rplus-1.1"},
|
||||
{URL: "opensource.org/licenses/mpl-1.0", ID: "MPL-1.0"},
|
||||
{URL: "opensource.org/licenses/mpl-2.0", ID: "MPL-2.0"},
|
||||
{URL: "opensource.org/licenses/opl-2.1", ID: "OSET-PL-2.1"},
|
||||
{URL: "opensource.org/licenses/osl-1.0", ID: "OSL-1.0"},
|
||||
{URL: "opensource.org/licenses/osl-2.1", ID: "OSL-2.1"},
|
||||
{URL: "opensource.org/licenses/rpl-1.1", ID: "RPL-1.1"},
|
||||
{URL: "opensource.org/licenses/sissl", ID: "SISSL"},
|
||||
{URL: "opensource.org/licenses/upl", ID: "UPL-1.0"},
|
||||
{URL: "opensource.org/licenses/xnet", ID: "Xnet"},
|
||||
{URL: "opensource.org/licenses/zpl-2.0", ID: "ZPL-2.0"},
|
||||
{URL: "www.apache.org/licenses/license-2.0", ID: "Apache-2.0"},
|
||||
{URL: "www.gnu.org/licenses/agpl.txt", ID: "AGPL-3.0"},
|
||||
// {URL: "www.gnu.org/licenses/autoconf-exception-3.0.html", ID: "GPL-3.0-with-autoconf-exception"},
|
||||
// {URL: "www.gnu.org/licenses/ecos-license.html", ID: "eCos-2.0"},
|
||||
{URL: "www.gnu.org/licenses/fdl-1.3.txt", ID: "GFDL-1.3"},
|
||||
// {URL: "www.gnu.org/licenses/gcc-exception-3.1.html", ID: "GPL-3.0-with-GCC-exception"},
|
||||
{URL: "www.gnu.org/licenses/gpl-3.0-standalone.html", ID: "GPL-3.0"},
|
||||
// {URL: "www.gnu.org/licenses/gpl-faq.html#fontexception", ID: "GPL-2.0-with-font-exception"},
|
||||
{URL: "www.gnu.org/licenses/lgpl-3.0-standalone.html", ID: "LGPL-3.0"},
|
||||
{URL: "www.gnu.org/licenses/old-licenses/fdl-1.1.txt", ID: "GFDL-1.1"},
|
||||
{URL: "www.gnu.org/licenses/old-licenses/gpl-1.0-standalone.html", ID: "GPL-1.0"},
|
||||
{URL: "www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html", ID: "GPL-2.0"},
|
||||
{URL: "www.gnu.org/licenses/old-licenses/lgpl-2.0-standalone.html", ID: "LGPL-2.0"},
|
||||
{URL: "www.gnu.org/licenses/old-licenses/lgpl-2.1-standalone.html", ID: "LGPL-2.1"},
|
||||
{URL: "www.gnu.org/prep/maintain/html_node/license-notices-for-other-files.html", ID: "FSFAP"},
|
||||
// {URL: "www.gnu.org/software/classpath/license.html", ID: "GPL-2.0-with-classpath-exception"},
|
||||
{URL: "www.opensource.org/licenses/agpl-3.0", ID: "AGPL-3.0"},
|
||||
{URL: "www.opensource.org/licenses/apl-1.0", ID: "APL-1.0"},
|
||||
{URL: "www.opensource.org/licenses/apache-2.0", ID: "Apache-2.0"},
|
||||
{URL: "www.opensource.org/licenses/bsd-2-clause", ID: "BSD-2-Clause"},
|
||||
{URL: "www.opensource.org/licenses/bsd-3-clause", ID: "BSD-3-Clause"},
|
||||
{URL: "www.opensource.org/licenses/bsl-1.0", ID: "BSL-1.0"},
|
||||
{URL: "www.opensource.org/licenses/cnri-python", ID: "CNRI-Python"},
|
||||
{URL: "www.opensource.org/licenses/cpal-1.0", ID: "CPAL-1.0"},
|
||||
{URL: "www.opensource.org/licenses/epl-1.0", ID: "EPL-1.0"},
|
||||
{URL: "www.opensource.org/licenses/epl-2.0", ID: "EPL-2.0"},
|
||||
{URL: "www.opensource.org/licenses/eudatagrid", ID: "EUDatagrid"},
|
||||
{URL: "www.opensource.org/licenses/eupl-1.1", ID: "EUPL-1.1"},
|
||||
{URL: "www.opensource.org/licenses/fair", ID: "Fair"},
|
||||
{URL: "www.opensource.org/licenses/frameworx-1.0", ID: "Frameworx-1.0"},
|
||||
{URL: "www.opensource.org/licenses/gpl-2.0", ID: "GPL-2.0"},
|
||||
{URL: "www.opensource.org/licenses/gpl-3.0", ID: "GPL-3.0"},
|
||||
{URL: "www.opensource.org/licenses/hpnd", ID: "HPND"},
|
||||
{URL: "www.opensource.org/licenses/ipa", ID: "IPA"},
|
||||
{URL: "www.opensource.org/licenses/ipl-1.0", ID: "IPL-1.0"},
|
||||
{URL: "www.opensource.org/licenses/isc", ID: "ISC"},
|
||||
{URL: "www.opensource.org/licenses/lgpl-2.1", ID: "LGPL-2.1"},
|
||||
{URL: "www.opensource.org/licenses/lgpl-3.0", ID: "LGPL-3.0"},
|
||||
{URL: "www.opensource.org/licenses/lpl-1.02", ID: "LPL-1.02"},
|
||||
{URL: "www.opensource.org/licenses/lppl-1.3c", ID: "LPPL-1.3c"},
|
||||
{URL: "www.opensource.org/licenses/mit", ID: "MIT"},
|
||||
{URL: "www.opensource.org/licenses/mpl-1.1", ID: "MPL-1.1"},
|
||||
{URL: "www.opensource.org/licenses/ms-pl", ID: "MS-PL"},
|
||||
{URL: "www.opensource.org/licenses/ms-rl", ID: "MS-RL"},
|
||||
{URL: "www.opensource.org/licenses/miros", ID: "MirOS"},
|
||||
{URL: "www.opensource.org/licenses/motosoto", ID: "Motosoto"},
|
||||
{URL: "www.opensource.org/licenses/multics", ID: "Multics"},
|
||||
{URL: "www.opensource.org/licenses/nasa-1.3", ID: "NASA-1.3"},
|
||||
{URL: "www.opensource.org/licenses/ncsa", ID: "NCSA"},
|
||||
{URL: "www.opensource.org/licenses/ngpl", ID: "NGPL"},
|
||||
{URL: "www.opensource.org/licenses/nosl3.0", ID: "NPOSL-3.0"},
|
||||
{URL: "www.opensource.org/licenses/ntp", ID: "NTP"},
|
||||
{URL: "www.opensource.org/licenses/naumen", ID: "Naumen"},
|
||||
{URL: "www.opensource.org/licenses/oclc-2.0", ID: "OCLC-2.0"},
|
||||
{URL: "www.opensource.org/licenses/ofl-1.1", ID: "OFL-1.1"},
|
||||
{URL: "www.opensource.org/licenses/ogtsl", ID: "OGTSL"},
|
||||
{URL: "www.opensource.org/licenses/osl-3.0", ID: "OSL-3.0"},
|
||||
{URL: "www.opensource.org/licenses/php-3.0", ID: "PHP-3.0"},
|
||||
{URL: "www.opensource.org/licenses/postgresql", ID: "PostgreSQL"},
|
||||
{URL: "www.opensource.org/licenses/python-2.0", ID: "Python-2.0"},
|
||||
{URL: "www.opensource.org/licenses/qpl-1.0", ID: "QPL-1.0"},
|
||||
{URL: "www.opensource.org/licenses/rpl-1.5", ID: "RPL-1.5"},
|
||||
{URL: "www.opensource.org/licenses/rpsl-1.0", ID: "RPSL-1.0"},
|
||||
{URL: "www.opensource.org/licenses/rscpl", ID: "RSCPL"},
|
||||
{URL: "www.opensource.org/licenses/spl-1.0", ID: "SPL-1.0"},
|
||||
{URL: "www.opensource.org/licenses/simpl-2.0", ID: "SimPL-2.0"},
|
||||
{URL: "www.opensource.org/licenses/sleepycat", ID: "Sleepycat"},
|
||||
{URL: "www.opensource.org/licenses/vsl-1.0", ID: "VSL-1.0"},
|
||||
{URL: "www.opensource.org/licenses/w3c", ID: "W3C"},
|
||||
// {URL: "www.opensource.org/licenses/wxwindows", ID: "wxWindows"},
|
||||
{URL: "www.opensource.org/licenses/watcom-1.0", ID: "Watcom-1.0"},
|
||||
{URL: "www.opensource.org/licenses/zlib", ID: "Zlib"},
|
||||
{URL: "www.opensource.org/licenses/afl-3.0", ID: "AFL-3.0"},
|
||||
{URL: "www.opensource.org/licenses/artistic-license-2.0", ID: "Artistic-2.0"},
|
||||
{URL: "www.opensource.org/licenses/attribution", ID: "AAL"},
|
||||
{URL: "www.opensource.org/licenses/cddl1", ID: "CDDL-1.0"},
|
||||
{URL: "www.opensource.org/licenses/nokia", ID: "Nokia"},
|
||||
}
|
||||
20
vendor/github.com/gookit/color/.gitignore
generated
vendored
Normal file
20
vendor/github.com/gookit/color/.gitignore
generated
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
*.log
|
||||
*.swp
|
||||
.idea
|
||||
*.patch
|
||||
### Go template
|
||||
# Binaries for programs and plugins
|
||||
*.exe
|
||||
*.exe~
|
||||
*.dll
|
||||
*.so
|
||||
*.dylib
|
||||
|
||||
# Test binary, build with `go test -c`
|
||||
*.test
|
||||
|
||||
# Output of the go coverage tool, specifically when used with LiteIDE
|
||||
*.out
|
||||
.DS_Store
|
||||
app
|
||||
demo
|
||||
20
vendor/github.com/gookit/color/LICENSE
generated
vendored
Normal file
20
vendor/github.com/gookit/color/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2016 inhere
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
||||
the Software, and to permit persons to whom the Software is furnished to do so,
|
||||
subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
||||
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
||||
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
468
vendor/github.com/gookit/color/README.md
generated
vendored
Normal file
468
vendor/github.com/gookit/color/README.md
generated
vendored
Normal file
@@ -0,0 +1,468 @@
|
||||
# CLI Color
|
||||
|
||||

|
||||
[](https://github.com/gookit/color/actions)
|
||||
[](https://app.codacy.com/app/inhere/color)
|
||||
[](https://pkg.go.dev/github.com/gookit/color?tab=overview)
|
||||
[](https://github.com/gookit/color)
|
||||
[](https://travis-ci.org/gookit/color)
|
||||
[](https://coveralls.io/github/gookit/color?branch=master)
|
||||
[](https://goreportcard.com/report/github.com/gookit/color)
|
||||
|
||||
A command-line color library with true color support, universal API methods and Windows support.
|
||||
|
||||
> **[中文说明](README.zh-CN.md)**
|
||||
|
||||
Basic color preview:
|
||||
|
||||

|
||||
|
||||
Now, 256 colors and RGB colors have also been supported to work in Windows CMD and PowerShell:
|
||||
|
||||

|
||||
|
||||
## Features
|
||||
|
||||
- Simple to use, zero dependencies
|
||||
- Supports rich color output: 16-color (4-bit), 256-color (8-bit), true color (24-bit, RGB)
|
||||
- 16-color output is the most commonly used and most widely supported, working on any Windows version
|
||||
- Since `v1.2.4` **the 256-color (8-bit), true color (24-bit) support windows CMD and PowerShell**
|
||||
- See [this gist](https://gist.github.com/XVilka/8346728) for information on true color support
|
||||
- Generic API methods: `Print`, `Printf`, `Println`, `Sprint`, `Sprintf`
|
||||
- Supports HTML tag-style color rendering, such as `<green>message</>`.
|
||||
- In addition to using built-in tags, it also supports custom color attributes
|
||||
- Custom color attributes support the use of 16 color names, 256 color values, rgb color values and hex color values
|
||||
- Support working on Windows `cmd` and `powerShell` terminal
|
||||
- Basic colors: `Bold`, `Black`, `White`, `Gray`, `Red`, `Green`, `Yellow`, `Blue`, `Magenta`, `Cyan`
|
||||
- Additional styles: `Info`, `Note`, `Light`, `Error`, `Danger`, `Notice`, `Success`, `Comment`, `Primary`, `Warning`, `Question`, `Secondary`
|
||||
- Support by set `NO_COLOR` for disable color or use `FORCE_COLOR` for force open color render.
|
||||
- Support Rgb, 256, 16 color conversion
|
||||
|
||||
## GoDoc
|
||||
|
||||
- [godoc for gopkg](https://pkg.go.dev/gopkg.in/gookit/color.v1)
|
||||
- [godoc for github](https://pkg.go.dev/github.com/gookit/color)
|
||||
|
||||
## Install
|
||||
|
||||
```bash
|
||||
go get github.com/gookit/color
|
||||
```
|
||||
|
||||
## Quick start
|
||||
|
||||
```go
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/gookit/color"
|
||||
)
|
||||
|
||||
func main() {
|
||||
// quick use package func
|
||||
color.Redp("Simple to use color")
|
||||
color.Redln("Simple to use color")
|
||||
color.Greenp("Simple to use color\n")
|
||||
color.Cyanln("Simple to use color")
|
||||
color.Yellowln("Simple to use color")
|
||||
|
||||
// quick use like fmt.Print*
|
||||
color.Red.Println("Simple to use color")
|
||||
color.Green.Print("Simple to use color\n")
|
||||
color.Cyan.Printf("Simple to use %s\n", "color")
|
||||
color.Yellow.Printf("Simple to use %s\n", "color")
|
||||
|
||||
// use like func
|
||||
red := color.FgRed.Render
|
||||
green := color.FgGreen.Render
|
||||
fmt.Printf("%s line %s library\n", red("Command"), green("color"))
|
||||
|
||||
// custom color
|
||||
color.New(color.FgWhite, color.BgBlack).Println("custom color style")
|
||||
|
||||
// can also:
|
||||
color.Style{color.FgCyan, color.OpBold}.Println("custom color style")
|
||||
|
||||
// internal theme/style:
|
||||
color.Info.Tips("message")
|
||||
color.Info.Prompt("message")
|
||||
color.Info.Println("message")
|
||||
color.Warn.Println("message")
|
||||
color.Error.Println("message")
|
||||
|
||||
// use style tag
|
||||
color.Print("<suc>he</><comment>llo</>, <cyan>wel</><red>come</>\n")
|
||||
// Custom label attr: Supports the use of 16 color names, 256 color values, rgb color values and hex color values
|
||||
color.Println("<fg=11aa23>he</><bg=120,35,156>llo</>, <fg=167;bg=232>wel</><fg=red>come</>")
|
||||
|
||||
// apply a style tag
|
||||
color.Tag("info").Println("info style text")
|
||||
|
||||
// prompt message
|
||||
color.Info.Prompt("prompt style message")
|
||||
color.Warn.Prompt("prompt style message")
|
||||
|
||||
// tips message
|
||||
color.Info.Tips("tips style message")
|
||||
color.Warn.Tips("tips style message")
|
||||
}
|
||||
```
|
||||
|
||||
Run demo: `go run ./_examples/demo.go`
|
||||
|
||||

|
||||
|
||||
## Basic/16 color
|
||||
|
||||
Supported on any Windows version. Provide generic API methods: `Print`, `Printf`, `Println`, `Sprint`, `Sprintf`
|
||||
|
||||
```go
|
||||
color.Bold.Println("bold message")
|
||||
color.Black.Println("bold message")
|
||||
color.White.Println("bold message")
|
||||
color.Gray.Println("bold message")
|
||||
color.Red.Println("yellow message")
|
||||
color.Blue.Println("yellow message")
|
||||
color.Cyan.Println("yellow message")
|
||||
color.Yellow.Println("yellow message")
|
||||
color.Magenta.Println("yellow message")
|
||||
|
||||
// Only use foreground color
|
||||
color.FgCyan.Printf("Simple to use %s\n", "color")
|
||||
// Only use background color
|
||||
color.BgRed.Printf("Simple to use %s\n", "color")
|
||||
```
|
||||
|
||||
Run demo: `go run ./_examples/color_16.go`
|
||||
|
||||

|
||||
|
||||
### Custom build color
|
||||
|
||||
```go
|
||||
// Full custom: foreground, background, option
|
||||
myStyle := color.New(color.FgWhite, color.BgBlack, color.OpBold)
|
||||
myStyle.Println("custom color style")
|
||||
|
||||
// can also:
|
||||
color.Style{color.FgCyan, color.OpBold}.Println("custom color style")
|
||||
```
|
||||
|
||||
custom set console settings:
|
||||
|
||||
```go
|
||||
// set console color
|
||||
color.Set(color.FgCyan)
|
||||
|
||||
// print message
|
||||
fmt.Print("message")
|
||||
|
||||
// reset console settings
|
||||
color.Reset()
|
||||
```
|
||||
|
||||
### Additional styles
|
||||
|
||||
provide generic API methods: `Print`, `Printf`, `Println`, `Sprint`, `Sprintf`
|
||||
|
||||
print message use defined style:
|
||||
|
||||
```go
|
||||
color.Info.Println("Info message")
|
||||
color.Note.Println("Note message")
|
||||
color.Notice.Println("Notice message")
|
||||
color.Error.Println("Error message")
|
||||
color.Danger.Println("Danger message")
|
||||
color.Warn.Println("Warn message")
|
||||
color.Debug.Println("Debug message")
|
||||
color.Primary.Println("Primary message")
|
||||
color.Question.Println("Question message")
|
||||
color.Secondary.Println("Secondary message")
|
||||
```
|
||||
|
||||
Run demo: `go run ./_examples/theme_basic.go`
|
||||
|
||||

|
||||
|
||||
**Tips style**
|
||||
|
||||
```go
|
||||
color.Info.Tips("Info tips message")
|
||||
color.Note.Tips("Note tips message")
|
||||
color.Notice.Tips("Notice tips message")
|
||||
color.Error.Tips("Error tips message")
|
||||
color.Danger.Tips("Danger tips message")
|
||||
color.Warn.Tips("Warn tips message")
|
||||
color.Debug.Tips("Debug tips message")
|
||||
color.Primary.Tips("Primary tips message")
|
||||
color.Question.Tips("Question tips message")
|
||||
color.Secondary.Tips("Secondary tips message")
|
||||
```
|
||||
|
||||
Run demo: `go run ./_examples/theme_tips.go`
|
||||
|
||||

|
||||
|
||||
**Prompt Style**
|
||||
|
||||
```go
|
||||
color.Info.Prompt("Info prompt message")
|
||||
color.Note.Prompt("Note prompt message")
|
||||
color.Notice.Prompt("Notice prompt message")
|
||||
color.Error.Prompt("Error prompt message")
|
||||
color.Danger.Prompt("Danger prompt message")
|
||||
color.Warn.Prompt("Warn prompt message")
|
||||
color.Debug.Prompt("Debug prompt message")
|
||||
color.Primary.Prompt("Primary prompt message")
|
||||
color.Question.Prompt("Question prompt message")
|
||||
color.Secondary.Prompt("Secondary prompt message")
|
||||
```
|
||||
|
||||
Run demo: `go run ./_examples/theme_prompt.go`
|
||||
|
||||

|
||||
|
||||
**Block Style**
|
||||
|
||||
```go
|
||||
color.Info.Block("Info block message")
|
||||
color.Note.Block("Note block message")
|
||||
color.Notice.Block("Notice block message")
|
||||
color.Error.Block("Error block message")
|
||||
color.Danger.Block("Danger block message")
|
||||
color.Warn.Block("Warn block message")
|
||||
color.Debug.Block("Debug block message")
|
||||
color.Primary.Block("Primary block message")
|
||||
color.Question.Block("Question block message")
|
||||
color.Secondary.Block("Secondary block message")
|
||||
```
|
||||
|
||||
Run demo: `go run ./_examples/theme_block.go`
|
||||
|
||||

|
||||
|
||||
## 256-color usage
|
||||
|
||||
> 256 colors support Windows CMD, PowerShell environment after `v1.2.4`
|
||||
|
||||
### Set the foreground or background color
|
||||
|
||||
- `color.C256(val uint8, isBg ...bool) Color256`
|
||||
|
||||
```go
|
||||
c := color.C256(132) // fg color
|
||||
c.Println("message")
|
||||
c.Printf("format %s", "message")
|
||||
|
||||
c := color.C256(132, true) // bg color
|
||||
c.Println("message")
|
||||
c.Printf("format %s", "message")
|
||||
```
|
||||
|
||||
### 256-color style
|
||||
|
||||
Can be used to set foreground and background colors at the same time.
|
||||
|
||||
- `S256(fgAndBg ...uint8) *Style256`
|
||||
|
||||
```go
|
||||
s := color.S256(32, 203)
|
||||
s.Println("message")
|
||||
s.Printf("format %s", "message")
|
||||
```
|
||||
|
||||
with options:
|
||||
|
||||
```go
|
||||
s := color.S256(32, 203)
|
||||
s.SetOpts(color.Opts{color.OpBold})
|
||||
|
||||
s.Println("style with options")
|
||||
s.Printf("style with %s\n", "options")
|
||||
```
|
||||
|
||||
Run demo: `go run ./_examples/color_256.go`
|
||||
|
||||

|
||||
|
||||
## RGB/True color
|
||||
|
||||
> RGB colors support Windows `CMD`, `PowerShell` environment after `v1.2.4`
|
||||
|
||||
**Preview:**
|
||||
|
||||
> Run demo: `Run demo: go run ./_examples/color_rgb.go`
|
||||
|
||||

|
||||
|
||||
example:
|
||||
|
||||
```go
|
||||
color.RGB(30, 144, 255).Println("message. use RGB number")
|
||||
|
||||
color.HEX("#1976D2").Println("blue-darken")
|
||||
color.HEX("#D50000", true).Println("red-accent. use HEX style")
|
||||
|
||||
color.RGBStyleFromString("213,0,0").Println("red-accent. use RGB number")
|
||||
color.HEXStyle("eee", "D50000").Println("deep-purple color")
|
||||
```
|
||||
|
||||
### Set the foreground or background color
|
||||
|
||||
- `color.RGB(r, g, b uint8, isBg ...bool) RGBColor`
|
||||
|
||||
```go
|
||||
c := color.RGB(30,144,255) // fg color
|
||||
c.Println("message")
|
||||
c.Printf("format %s", "message")
|
||||
|
||||
c := color.RGB(30,144,255, true) // bg color
|
||||
c.Println("message")
|
||||
c.Printf("format %s", "message")
|
||||
```
|
||||
|
||||
Create a style from an hexadecimal color string:
|
||||
|
||||
- `color.HEX(hex string, isBg ...bool) RGBColor`
|
||||
|
||||
```go
|
||||
c := color.HEX("ccc") // can also: "cccccc" "#cccccc"
|
||||
c.Println("message")
|
||||
c.Printf("format %s", "message")
|
||||
|
||||
c = color.HEX("aabbcc", true) // as bg color
|
||||
c.Println("message")
|
||||
c.Printf("format %s", "message")
|
||||
```
|
||||
|
||||
### RGB color style
|
||||
|
||||
Can be used to set the foreground and background colors at the same time.
|
||||
|
||||
- `color.NewRGBStyle(fg RGBColor, bg ...RGBColor) *RGBStyle`
|
||||
|
||||
```go
|
||||
s := color.NewRGBStyle(RGB(20, 144, 234), RGB(234, 78, 23))
|
||||
s.Println("message")
|
||||
s.Printf("format %s", "message")
|
||||
```
|
||||
|
||||
Create a style from an hexadecimal color string:
|
||||
|
||||
- `color.HEXStyle(fg string, bg ...string) *RGBStyle`
|
||||
|
||||
```go
|
||||
s := color.HEXStyle("11aa23", "eee")
|
||||
s.Println("message")
|
||||
s.Printf("format %s", "message")
|
||||
```
|
||||
|
||||
with options:
|
||||
|
||||
```go
|
||||
s := color.HEXStyle("11aa23", "eee")
|
||||
s.SetOpts(color.Opts{color.OpBold})
|
||||
|
||||
s.Println("style with options")
|
||||
s.Printf("style with %s\n", "options")
|
||||
```
|
||||
|
||||
## HTML-like tag usage
|
||||
|
||||
**Supported** on Windows `cmd.exe` `PowerShell` .
|
||||
|
||||
```go
|
||||
// use style tag
|
||||
color.Print("<suc>he</><comment>llo</>, <cyan>wel</><red>come</>")
|
||||
color.Println("<suc>hello</>")
|
||||
color.Println("<error>hello</>")
|
||||
color.Println("<warning>hello</>")
|
||||
|
||||
// custom color attributes
|
||||
color.Print("<fg=yellow;bg=black;op=underscore;>hello, welcome</>\n")
|
||||
|
||||
// Custom label attr: Supports the use of 16 color names, 256 color values, rgb color values and hex color values
|
||||
color.Println("<fg=11aa23>he</><bg=120,35,156>llo</>, <fg=167;bg=232>wel</><fg=red>come</>")
|
||||
```
|
||||
|
||||
- `color.Tag`
|
||||
|
||||
```go
|
||||
// set a style tag
|
||||
color.Tag("info").Print("info style text")
|
||||
color.Tag("info").Printf("%s style text", "info")
|
||||
color.Tag("info").Println("info style text")
|
||||
```
|
||||
|
||||
Run demo: `go run ./_examples/color_tag.go`
|
||||
|
||||

|
||||
|
||||
## Color convert
|
||||
|
||||
Supports conversion between Rgb, 256, 16 colors, `Rgb <=> 256 <=> 16`
|
||||
|
||||
```go
|
||||
basic := color.Red
|
||||
basic.Println("basic color")
|
||||
|
||||
c256 := color.Red.C256()
|
||||
c256.Println("256 color")
|
||||
c256.C16().Println("basic color")
|
||||
|
||||
rgb := color.Red.RGB()
|
||||
rgb.Println("rgb color")
|
||||
rgb.C256().Println("256 color")
|
||||
```
|
||||
|
||||
## Func refer
|
||||
|
||||
There are some useful functions reference
|
||||
|
||||
- `Disable()` disable color render
|
||||
- `SetOutput(io.Writer)` custom set the colored text output writer
|
||||
- `ForceOpenColor()` force open color render
|
||||
- `Colors2code(colors ...Color) string` Convert colors to code. return like "32;45;3"
|
||||
- `ClearCode(str string) string` Use for clear color codes
|
||||
- `ClearTag(s string) string` clear all color html-tag for a string
|
||||
- `IsConsole(w io.Writer)` Determine whether w is one of stderr, stdout, stdin
|
||||
- `HexToRgb(hex string) (rgb []int)` Convert hex color string to RGB numbers
|
||||
- `RgbToHex(rgb []int) string` Convert RGB to hex code
|
||||
- More useful func please see https://pkg.go.dev/github.com/gookit/color
|
||||
|
||||
## Project use
|
||||
|
||||
Check out these projects, which use https://github.com/gookit/color :
|
||||
|
||||
- https://github.com/Delta456/box-cli-maker Make Highly Customized Boxes for your CLI
|
||||
|
||||
## Gookit packages
|
||||
|
||||
- [gookit/ini](https://github.com/gookit/ini) Go config management, use INI files
|
||||
- [gookit/rux](https://github.com/gookit/rux) Simple and fast request router for golang HTTP
|
||||
- [gookit/gcli](https://github.com/gookit/gcli) build CLI application, tool library, running CLI commands
|
||||
- [gookit/slog](https://github.com/gookit/slog) Concise and extensible go log library
|
||||
- [gookit/event](https://github.com/gookit/event) Lightweight event manager and dispatcher implements by Go
|
||||
- [gookit/cache](https://github.com/gookit/cache) Generic cache use and cache manager for golang. support File, Memory, Redis, Memcached.
|
||||
- [gookit/config](https://github.com/gookit/config) Go config management. support JSON, YAML, TOML, INI, HCL, ENV and Flags
|
||||
- [gookit/color](https://github.com/gookit/color) A command-line color library with true color support, universal API methods and Windows support
|
||||
- [gookit/filter](https://github.com/gookit/filter) Provide filtering, sanitizing, and conversion of golang data
|
||||
- [gookit/validate](https://github.com/gookit/validate) Use for data validation and filtering. support Map, Struct, Form data
|
||||
- [gookit/goutil](https://github.com/gookit/goutil) Some utils for the Go: string, array/slice, map, format, cli, env, filesystem, test and more
|
||||
- More, please see https://github.com/gookit
|
||||
|
||||
## See also
|
||||
|
||||
- [inhere/console](https://github.com/inhere/php-console)
|
||||
- [xo/terminfo](https://github.com/xo/terminfo)
|
||||
- [beego/bee](https://github.com/beego/bee)
|
||||
- [issue9/term](https://github.com/issue9/term)
|
||||
- [ANSI escape code](https://en.wikipedia.org/wiki/ANSI_escape_code)
|
||||
- [Standard ANSI color map](https://conemu.github.io/en/AnsiEscapeCodes.html#Standard_ANSI_color_map)
|
||||
- [Terminal Colors](https://gist.github.com/XVilka/8346728)
|
||||
|
||||
## License
|
||||
|
||||
[MIT](/LICENSE)
|
||||
472
vendor/github.com/gookit/color/README.zh-CN.md
generated
vendored
Normal file
472
vendor/github.com/gookit/color/README.zh-CN.md
generated
vendored
Normal file
@@ -0,0 +1,472 @@
|
||||
# CLI Color
|
||||
|
||||

|
||||
[](https://github.com/gookit/color/actions)
|
||||
[](https://app.codacy.com/app/inhere/color)
|
||||
[](https://pkg.go.dev/github.com/gookit/color?tab=overview)
|
||||
[](https://github.com/gookit/color)
|
||||
[](https://travis-ci.org/gookit/color)
|
||||
[](https://coveralls.io/github/gookit/color?branch=master)
|
||||
[](https://goreportcard.com/report/github.com/gookit/color)
|
||||
|
||||
Golang下的命令行色彩使用库, 拥有丰富的色彩渲染输出,通用的API方法,兼容Windows系统
|
||||
|
||||
> **[EN README](README.md)**
|
||||
|
||||
基本颜色预览:
|
||||
|
||||

|
||||
|
||||
现在,256色和RGB色彩也已经支持windows CMD和PowerShell中工作:
|
||||
|
||||

|
||||
|
||||
## 功能特色
|
||||
|
||||
- 使用简单方便
|
||||
- 支持丰富的颜色输出, 16色(4bit),256色(8bit),RGB色彩(24bit, RGB)
|
||||
- 16色(4bit)是最常用和支持最广的,支持Windows `cmd.exe`
|
||||
- 自 `v1.2.4` 起 **256色(8bit),RGB色彩(24bit)均支持Windows CMD和PowerShell终端**
|
||||
- 请查看 [this gist](https://gist.github.com/XVilka/8346728) 了解支持RGB色彩的终端
|
||||
- 提供通用的API方法:`Print` `Printf` `Println` `Sprint` `Sprintf`
|
||||
- 同时支持html标签式的颜色渲染,除了使用内置标签,同时支持自定义颜色属性
|
||||
- 例如: `this an <green>message</>` 标签内部的文本将会渲染为绿色字体
|
||||
- 自定义颜色属性: 支持使用16色彩名称,256色彩值,rgb色彩值以及hex色彩值
|
||||
- 基础色彩: `Bold` `Black` `White` `Gray` `Red` `Green` `Yellow` `Blue` `Magenta` `Cyan`
|
||||
- 扩展风格: `Info` `Note` `Light` `Error` `Danger` `Notice` `Success` `Comment` `Primary` `Warning` `Question` `Secondary`
|
||||
- 支持通过设置环境变量 `NO_COLOR` 来禁用色彩,或者使用 `FORCE_COLOR` 来强制使用色彩渲染.
|
||||
- 支持 Rgb, 256, 16 色彩之间的互相转换
|
||||
- 支持Linux、Mac,同时兼容Windows系统环境
|
||||
|
||||
## GoDoc
|
||||
|
||||
- [godoc for gopkg](https://pkg.go.dev/gopkg.in/gookit/color.v1)
|
||||
- [godoc for github](https://pkg.go.dev/github.com/gookit/color)
|
||||
|
||||
## 安装
|
||||
|
||||
```bash
|
||||
go get github.com/gookit/color
|
||||
```
|
||||
|
||||
## 快速开始
|
||||
|
||||
如下,引入当前包就可以快速的使用
|
||||
|
||||
```go
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/gookit/color"
|
||||
)
|
||||
|
||||
func main() {
|
||||
// 简单快速的使用,跟 fmt.Print* 类似
|
||||
color.Redp("Simple to use color")
|
||||
color.Redln("Simple to use color")
|
||||
color.Greenp("Simple to use color\n")
|
||||
color.Cyanln("Simple to use color")
|
||||
color.Yellowln("Simple to use color")
|
||||
|
||||
// 简单快速的使用,跟 fmt.Print* 类似
|
||||
color.Red.Println("Simple to use color")
|
||||
color.Green.Print("Simple to use color\n")
|
||||
color.Cyan.Printf("Simple to use %s\n", "color")
|
||||
color.Yellow.Printf("Simple to use %s\n", "color")
|
||||
|
||||
// use like func
|
||||
red := color.FgRed.Render
|
||||
green := color.FgGreen.Render
|
||||
fmt.Printf("%s line %s library\n", red("Command"), green("color"))
|
||||
|
||||
// 自定义颜色
|
||||
color.New(color.FgWhite, color.BgBlack).Println("custom color style")
|
||||
|
||||
// 也可以:
|
||||
color.Style{color.FgCyan, color.OpBold}.Println("custom color style")
|
||||
|
||||
// internal style:
|
||||
color.Info.Println("message")
|
||||
color.Warn.Println("message")
|
||||
color.Error.Println("message")
|
||||
|
||||
// 使用内置颜色标签
|
||||
color.Print("<suc>he</><comment>llo</>, <cyan>wel</><red>come</>\n")
|
||||
// 自定义标签: 支持使用16色彩名称,256色彩值,rgb色彩值以及hex色彩值
|
||||
color.Println("<fg=11aa23>he</><bg=120,35,156>llo</>, <fg=167;bg=232>wel</><fg=red>come</>")
|
||||
|
||||
// apply a style tag
|
||||
color.Tag("info").Println("info style text")
|
||||
|
||||
// prompt message
|
||||
color.Info.Prompt("prompt style message")
|
||||
color.Warn.Prompt("prompt style message")
|
||||
|
||||
// tips message
|
||||
color.Info.Tips("tips style message")
|
||||
color.Warn.Tips("tips style message")
|
||||
}
|
||||
```
|
||||
|
||||
> 运行 demo: `go run ./_examples/demo.go`
|
||||
|
||||

|
||||
|
||||
## 基础颜色(16-color)
|
||||
|
||||
提供通用的API方法:`Print` `Printf` `Println` `Sprint` `Sprintf`
|
||||
|
||||
> 支持在windows `cmd.exe` `powerShell` 等终端使用
|
||||
|
||||
```go
|
||||
color.Bold.Println("bold message")
|
||||
color.Black.Println("bold message")
|
||||
color.White.Println("bold message")
|
||||
color.Gray.Println("bold message")
|
||||
color.Red.Println("yellow message")
|
||||
color.Blue.Println("yellow message")
|
||||
color.Cyan.Println("yellow message")
|
||||
color.Yellow.Println("yellow message")
|
||||
color.Magenta.Println("yellow message")
|
||||
|
||||
// Only use foreground color
|
||||
color.FgCyan.Printf("Simple to use %s\n", "color")
|
||||
// Only use background color
|
||||
color.BgRed.Printf("Simple to use %s\n", "color")
|
||||
```
|
||||
|
||||
> 运行demo: `go run ./_examples/color_16.go`
|
||||
|
||||

|
||||
|
||||
### 构建风格
|
||||
|
||||
```go
|
||||
// 仅设置前景色
|
||||
color.FgCyan.Printf("Simple to use %s\n", "color")
|
||||
// 仅设置背景色
|
||||
color.BgRed.Printf("Simple to use %s\n", "color")
|
||||
|
||||
// 完全自定义: 前景色 背景色 选项
|
||||
style := color.New(color.FgWhite, color.BgBlack, color.OpBold)
|
||||
style.Println("custom color style")
|
||||
|
||||
// 也可以:
|
||||
color.Style{color.FgCyan, color.OpBold}.Println("custom color style")
|
||||
```
|
||||
|
||||
直接设置控制台属性:
|
||||
|
||||
```go
|
||||
// 设置console颜色
|
||||
color.Set(color.FgCyan)
|
||||
|
||||
// 输出信息
|
||||
fmt.Print("message")
|
||||
|
||||
// 重置console颜色
|
||||
color.Reset()
|
||||
```
|
||||
|
||||
> 当然,color已经内置丰富的色彩风格支持
|
||||
|
||||
### 扩展风格方法
|
||||
|
||||
提供通用的API方法:`Print` `Printf` `Println` `Sprint` `Sprintf`
|
||||
|
||||
> 支持在windows `cmd.exe` `powerShell` 等终端使用
|
||||
|
||||
基础使用:
|
||||
|
||||
```go
|
||||
// print message
|
||||
color.Info.Println("Info message")
|
||||
color.Note.Println("Note message")
|
||||
color.Notice.Println("Notice message")
|
||||
color.Error.Println("Error message")
|
||||
color.Danger.Println("Danger message")
|
||||
color.Warn.Println("Warn message")
|
||||
color.Debug.Println("Debug message")
|
||||
color.Primary.Println("Primary message")
|
||||
color.Question.Println("Question message")
|
||||
color.Secondary.Println("Secondary message")
|
||||
```
|
||||
|
||||
Run demo: `go run ./_examples/theme_basic.go`
|
||||
|
||||

|
||||
|
||||
**简约提示风格**
|
||||
|
||||
```go
|
||||
color.Info.Tips("Info tips message")
|
||||
color.Note.Tips("Note tips message")
|
||||
color.Notice.Tips("Notice tips message")
|
||||
color.Error.Tips("Error tips message")
|
||||
color.Danger.Tips("Danger tips message")
|
||||
color.Warn.Tips("Warn tips message")
|
||||
color.Debug.Tips("Debug tips message")
|
||||
color.Primary.Tips("Primary tips message")
|
||||
color.Question.Tips("Question tips message")
|
||||
color.Secondary.Tips("Secondary tips message")
|
||||
```
|
||||
|
||||
Run demo: `go run ./_examples/theme_tips.go`
|
||||
|
||||

|
||||
|
||||
**着重提示风格**
|
||||
|
||||
```go
|
||||
color.Info.Prompt("Info prompt message")
|
||||
color.Note.Prompt("Note prompt message")
|
||||
color.Notice.Prompt("Notice prompt message")
|
||||
color.Error.Prompt("Error prompt message")
|
||||
color.Danger.Prompt("Danger prompt message")
|
||||
```
|
||||
|
||||
Run demo: `go run ./_examples/theme_prompt.go`
|
||||
|
||||

|
||||
|
||||
**强调提示风格**
|
||||
|
||||
```go
|
||||
color.Warn.Block("Warn block message")
|
||||
color.Debug.Block("Debug block message")
|
||||
color.Primary.Block("Primary block message")
|
||||
color.Question.Block("Question block message")
|
||||
color.Secondary.Block("Secondary block message")
|
||||
```
|
||||
|
||||
Run demo: `go run ./_examples/theme_block.go`
|
||||
|
||||

|
||||
|
||||
## 256 色彩使用
|
||||
|
||||
> 256色彩在 `v1.2.4` 后支持Windows CMD,PowerShell 环境
|
||||
|
||||
### 使用前景或后景色
|
||||
|
||||
- `color.C256(val uint8, isBg ...bool) Color256`
|
||||
|
||||
```go
|
||||
c := color.C256(132) // fg color
|
||||
c.Println("message")
|
||||
c.Printf("format %s", "message")
|
||||
|
||||
c := color.C256(132, true) // bg color
|
||||
c.Println("message")
|
||||
c.Printf("format %s", "message")
|
||||
```
|
||||
|
||||
### 使用256 色彩风格
|
||||
|
||||
> 可同时设置前景和背景色
|
||||
|
||||
- `color.S256(fgAndBg ...uint8) *Style256`
|
||||
|
||||
```go
|
||||
s := color.S256(32, 203)
|
||||
s.Println("message")
|
||||
s.Printf("format %s", "message")
|
||||
```
|
||||
|
||||
可以同时添加选项设置:
|
||||
|
||||
```go
|
||||
s := color.S256(32, 203)
|
||||
s.SetOpts(color.Opts{color.OpBold})
|
||||
|
||||
s.Println("style with options")
|
||||
s.Printf("style with %s\n", "options")
|
||||
```
|
||||
|
||||
> 运行 demo: `go run ./_examples/color_256.go`
|
||||
|
||||

|
||||
|
||||
## RGB/True色彩使用
|
||||
|
||||
> RGB色彩在 `v1.2.4` 后支持 Windows `CMD`, `PowerShell` 环境
|
||||
|
||||
**效果预览:**
|
||||
|
||||
> 运行 demo: `Run demo: go run ./_examples/color_rgb.go`
|
||||
|
||||

|
||||
|
||||
代码示例:
|
||||
|
||||
```go
|
||||
color.RGB(30, 144, 255).Println("message. use RGB number")
|
||||
|
||||
color.HEX("#1976D2").Println("blue-darken")
|
||||
color.HEX("#D50000", true).Println("red-accent. use HEX style")
|
||||
|
||||
color.RGBStyleFromString("213,0,0").Println("red-accent. use RGB number")
|
||||
color.HEXStyle("eee", "D50000").Println("deep-purple color")
|
||||
```
|
||||
|
||||
### 使用前景或后景色
|
||||
|
||||
- `color.RGB(r, g, b uint8, isBg ...bool) RGBColor`
|
||||
|
||||
```go
|
||||
c := color.RGB(30,144,255) // fg color
|
||||
c.Println("message")
|
||||
c.Printf("format %s", "message")
|
||||
|
||||
c := color.RGB(30,144,255, true) // bg color
|
||||
c.Println("message")
|
||||
c.Printf("format %s", "message")
|
||||
```
|
||||
|
||||
- `color.HEX(hex string, isBg ...bool) RGBColor` 从16进制颜色创建
|
||||
|
||||
```go
|
||||
c := color.HEX("ccc") // 也可以写为: "cccccc" "#cccccc"
|
||||
c.Println("message")
|
||||
c.Printf("format %s", "message")
|
||||
|
||||
c = color.HEX("aabbcc", true) // as bg color
|
||||
c.Println("message")
|
||||
c.Printf("format %s", "message")
|
||||
```
|
||||
|
||||
### 使用RGB风格
|
||||
|
||||
> 可同时设置前景和背景色
|
||||
|
||||
- `color.NewRGBStyle(fg RGBColor, bg ...RGBColor) *RGBStyle`
|
||||
|
||||
```go
|
||||
s := color.NewRGBStyle(RGB(20, 144, 234), RGB(234, 78, 23))
|
||||
s.Println("message")
|
||||
s.Printf("format %s", "message")
|
||||
```
|
||||
|
||||
- `color.HEXStyle(fg string, bg ...string) *RGBStyle` 从16进制颜色创建
|
||||
|
||||
```go
|
||||
s := color.HEXStyle("11aa23", "eee")
|
||||
s.Println("message")
|
||||
s.Printf("format %s", "message")
|
||||
```
|
||||
|
||||
- 可以同时添加选项设置:
|
||||
|
||||
```go
|
||||
s := color.HEXStyle("11aa23", "eee")
|
||||
s.SetOpts(color.Opts{color.OpBold})
|
||||
|
||||
s.Println("style with options")
|
||||
s.Printf("style with %s\n", "options")
|
||||
```
|
||||
|
||||
## 使用颜色标签
|
||||
|
||||
> **支持** 在windows `cmd.exe` `PowerShell` 使用
|
||||
|
||||
使用内置的颜色标签,可以非常方便简单的构建自己需要的任何格式
|
||||
|
||||
> 同时支持自定义颜色属性: 支持使用16色彩名称,256色彩值,rgb色彩值以及hex色彩值
|
||||
|
||||
```go
|
||||
// 使用内置的 color tag
|
||||
color.Print("<suc>he</><comment>llo</>, <cyan>wel</><red>come</>")
|
||||
color.Println("<suc>hello</>")
|
||||
color.Println("<error>hello</>")
|
||||
color.Println("<warning>hello</>")
|
||||
|
||||
// 自定义颜色属性
|
||||
color.Print("<fg=yellow;bg=black;op=underscore;>hello, welcome</>\n")
|
||||
|
||||
// 自定义颜色属性: 支持使用16色彩名称,256色彩值,rgb色彩值以及hex色彩值
|
||||
color.Println("<fg=11aa23>he</><bg=120,35,156>llo</>, <fg=167;bg=232>wel</><fg=red>come</>")
|
||||
```
|
||||
|
||||
- 使用 `color.Tag`
|
||||
|
||||
给后面输出的文本信息加上给定的颜色风格标签
|
||||
|
||||
```go
|
||||
// set a style tag
|
||||
color.Tag("info").Print("info style text")
|
||||
color.Tag("info").Printf("%s style text", "info")
|
||||
color.Tag("info").Println("info style text")
|
||||
```
|
||||
|
||||
> 运行 demo: `go run ./_examples/color_tag.go`
|
||||
|
||||

|
||||
|
||||
## 颜色转换
|
||||
|
||||
支持 Rgb, 256, 16 色彩之间的互相转换 `Rgb <=> 256 <=> 16`
|
||||
|
||||
```go
|
||||
basic := color.Red
|
||||
basic.Println("basic color")
|
||||
|
||||
c256 := color.Red.C256()
|
||||
c256.Println("256 color")
|
||||
c256.C16().Println("basic color")
|
||||
|
||||
rgb := color.Red.RGB()
|
||||
rgb.Println("rgb color")
|
||||
rgb.C256().Println("256 color")
|
||||
```
|
||||
|
||||
## 方法参考
|
||||
|
||||
一些有用的工具方法参考
|
||||
|
||||
- `Disable()` disable color render
|
||||
- `SetOutput(io.Writer)` custom set the colored text output writer
|
||||
- `ForceOpenColor()` force open color render
|
||||
- `ClearCode(str string) string` Use for clear color codes
|
||||
- `Colors2code(colors ...Color) string` Convert colors to code. return like "32;45;3"
|
||||
- `ClearTag(s string) string` clear all color html-tag for a string
|
||||
- `IsConsole(w io.Writer)` Determine whether w is one of stderr, stdout, stdin
|
||||
- `HexToRgb(hex string) (rgb []int)` Convert hex color string to RGB numbers
|
||||
- `RgbToHex(rgb []int) string` Convert RGB to hex code
|
||||
- 更多请查看文档 https://pkg.go.dev/github.com/gookit/color
|
||||
|
||||
## 使用color的项目
|
||||
|
||||
看看这些使用了 https://github.com/gookit/color 的项目:
|
||||
|
||||
- https://github.com/Delta456/box-cli-maker Make Highly Customized Boxes for your CLI
|
||||
|
||||
## Gookit 工具包
|
||||
|
||||
- [gookit/ini](https://github.com/gookit/ini) INI配置读取管理,支持多文件加载,数据覆盖合并, 解析ENV变量, 解析变量引用
|
||||
- [gookit/rux](https://github.com/gookit/rux) Simple and fast request router for golang HTTP
|
||||
- [gookit/gcli](https://github.com/gookit/gcli) Go的命令行应用,工具库,运行CLI命令,支持命令行色彩,用户交互,进度显示,数据格式化显示
|
||||
- [gookit/slog](https://github.com/gookit/slog) 简洁易扩展的go日志库
|
||||
- [gookit/event](https://github.com/gookit/event) Go实现的轻量级的事件管理、调度程序库, 支持设置监听器的优先级, 支持对一组事件进行监听
|
||||
- [gookit/cache](https://github.com/gookit/cache) 通用的缓存使用包装库,通过包装各种常用的驱动,来提供统一的使用API
|
||||
- [gookit/config](https://github.com/gookit/config) Go应用配置管理,支持多种格式(JSON, YAML, TOML, INI, HCL, ENV, Flags),多文件加载,远程文件加载,数据合并
|
||||
- [gookit/color](https://github.com/gookit/color) CLI 控制台颜色渲染工具库, 拥有简洁的使用API,支持16色,256色,RGB色彩渲染输出
|
||||
- [gookit/filter](https://github.com/gookit/filter) 提供对Golang数据的过滤,净化,转换
|
||||
- [gookit/validate](https://github.com/gookit/validate) Go通用的数据验证与过滤库,使用简单,内置大部分常用验证、过滤器
|
||||
- [gookit/goutil](https://github.com/gookit/goutil) Go 的一些工具函数,格式化,特殊处理,常用信息获取等
|
||||
- 更多请查看 https://github.com/gookit
|
||||
|
||||
## 参考项目
|
||||
|
||||
- [inhere/console](https://github.com/inhere/php-console)
|
||||
- [xo/terminfo](https://github.com/xo/terminfo)
|
||||
- [beego/bee](https://github.com/beego/bee)
|
||||
- [issue9/term](https://github.com/issue9/term)
|
||||
- [ANSI转义序列](https://zh.wikipedia.org/wiki/ANSI转义序列)
|
||||
- [Standard ANSI color map](https://conemu.github.io/en/AnsiEscapeCodes.html#Standard_ANSI_color_map)
|
||||
- [Terminal Colors](https://gist.github.com/XVilka/8346728)
|
||||
|
||||
## License
|
||||
|
||||
MIT
|
||||
238
vendor/github.com/gookit/color/color.go
generated
vendored
Normal file
238
vendor/github.com/gookit/color/color.go
generated
vendored
Normal file
@@ -0,0 +1,238 @@
|
||||
/*
|
||||
Package color is Command line color library.
|
||||
Support rich color rendering output, universal API method, compatible with Windows system
|
||||
|
||||
Source code and other details for the project are available at GitHub:
|
||||
|
||||
https://github.com/gookit/color
|
||||
|
||||
More usage please see README and tests.
|
||||
*/
|
||||
package color
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"io"
|
||||
"os"
|
||||
"regexp"
|
||||
|
||||
"github.com/xo/terminfo"
|
||||
)
|
||||
|
||||
// terminal color available level alias of the terminfo.ColorLevel*
|
||||
const (
|
||||
LevelNo = terminfo.ColorLevelNone // not support color.
|
||||
Level16 = terminfo.ColorLevelBasic // 3/4 bit color supported
|
||||
Level256 = terminfo.ColorLevelHundreds // 8 bit color supported
|
||||
LevelRgb = terminfo.ColorLevelMillions // (24 bit)true color supported
|
||||
)
|
||||
|
||||
// color render templates
|
||||
// ESC 操作的表示:
|
||||
// "\033"(Octal 8进制) = "\x1b"(Hexadecimal 16进制) = 27 (10进制)
|
||||
const (
|
||||
SettingTpl = "\x1b[%sm"
|
||||
FullColorTpl = "\x1b[%sm%s\x1b[0m"
|
||||
)
|
||||
|
||||
// ResetSet Close all properties.
|
||||
const ResetSet = "\x1b[0m"
|
||||
|
||||
// CodeExpr regex to clear color codes eg "\033[1;36mText\x1b[0m"
|
||||
const CodeExpr = `\033\[[\d;?]+m`
|
||||
|
||||
var (
|
||||
// Enable switch color render and display
|
||||
//
|
||||
// NOTICE:
|
||||
// if ENV: NO_COLOR is not empty, will disable color render.
|
||||
Enable = os.Getenv("NO_COLOR") == ""
|
||||
// RenderTag render HTML tag on call color.Xprint, color.PrintX
|
||||
RenderTag = true
|
||||
// debug mode for development.
|
||||
//
|
||||
// set env:
|
||||
// COLOR_DEBUG_MODE=on
|
||||
// or:
|
||||
// COLOR_DEBUG_MODE=on go run ./_examples/envcheck.go
|
||||
debugMode = os.Getenv("COLOR_DEBUG_MODE") == "on"
|
||||
// inner errors record on detect color level
|
||||
innerErrs []error
|
||||
// output the default io.Writer message print
|
||||
output io.Writer = os.Stdout
|
||||
// mark current env, It's like in `cmd.exe`
|
||||
// if not in windows, it's always is False.
|
||||
isLikeInCmd bool
|
||||
// the color support level for current terminal
|
||||
// needVTP - need enable VTP, only for windows OS
|
||||
colorLevel, needVTP = detectTermColorLevel()
|
||||
// match color codes
|
||||
codeRegex = regexp.MustCompile(CodeExpr)
|
||||
// mark current env is support color.
|
||||
// Always: isLikeInCmd != supportColor
|
||||
// supportColor = IsSupportColor()
|
||||
)
|
||||
|
||||
// TermColorLevel value on current ENV
|
||||
func TermColorLevel() terminfo.ColorLevel {
|
||||
return colorLevel
|
||||
}
|
||||
|
||||
// SupportColor on the current ENV
|
||||
func SupportColor() bool {
|
||||
return colorLevel > terminfo.ColorLevelNone
|
||||
}
|
||||
|
||||
// Support16Color on the current ENV
|
||||
// func Support16Color() bool {
|
||||
// return colorLevel > terminfo.ColorLevelNone
|
||||
// }
|
||||
|
||||
// Support256Color on the current ENV
|
||||
func Support256Color() bool {
|
||||
return colorLevel > terminfo.ColorLevelBasic
|
||||
}
|
||||
|
||||
// SupportTrueColor on the current ENV
|
||||
func SupportTrueColor() bool {
|
||||
return colorLevel > terminfo.ColorLevelHundreds
|
||||
}
|
||||
|
||||
/*************************************************************
|
||||
* global settings
|
||||
*************************************************************/
|
||||
|
||||
// Set set console color attributes
|
||||
func Set(colors ...Color) (int, error) {
|
||||
code := Colors2code(colors...)
|
||||
err := SetTerminal(code)
|
||||
return 0, err
|
||||
}
|
||||
|
||||
// Reset reset console color attributes
|
||||
func Reset() (int, error) {
|
||||
err := ResetTerminal()
|
||||
return 0, err
|
||||
}
|
||||
|
||||
// Disable disable color output
|
||||
func Disable() bool {
|
||||
oldVal := Enable
|
||||
Enable = false
|
||||
return oldVal
|
||||
}
|
||||
|
||||
// NotRenderTag on call color.Xprint, color.PrintX
|
||||
func NotRenderTag() {
|
||||
RenderTag = false
|
||||
}
|
||||
|
||||
// SetOutput set default colored text output
|
||||
func SetOutput(w io.Writer) {
|
||||
output = w
|
||||
}
|
||||
|
||||
// ResetOutput reset output
|
||||
func ResetOutput() {
|
||||
output = os.Stdout
|
||||
}
|
||||
|
||||
// ResetOptions reset all package option setting
|
||||
func ResetOptions() {
|
||||
RenderTag = true
|
||||
Enable = true
|
||||
output = os.Stdout
|
||||
}
|
||||
|
||||
// ForceColor force open color render
|
||||
func ForceSetColorLevel(level terminfo.ColorLevel) terminfo.ColorLevel {
|
||||
oldLevelVal := colorLevel
|
||||
colorLevel = level
|
||||
return oldLevelVal
|
||||
}
|
||||
|
||||
// ForceColor force open color render
|
||||
func ForceColor() terminfo.ColorLevel {
|
||||
return ForceOpenColor()
|
||||
}
|
||||
|
||||
// ForceOpenColor force open color render
|
||||
func ForceOpenColor() terminfo.ColorLevel {
|
||||
// TODO should set level to ?
|
||||
return ForceSetColorLevel(terminfo.ColorLevelMillions)
|
||||
}
|
||||
|
||||
// IsLikeInCmd check result
|
||||
// Deprecated
|
||||
func IsLikeInCmd() bool {
|
||||
return isLikeInCmd
|
||||
}
|
||||
|
||||
// InnerErrs info
|
||||
func InnerErrs() []error {
|
||||
return innerErrs
|
||||
}
|
||||
|
||||
/*************************************************************
|
||||
* render color code
|
||||
*************************************************************/
|
||||
|
||||
// RenderCode render message by color code.
|
||||
// Usage:
|
||||
// msg := RenderCode("3;32;45", "some", "message")
|
||||
func RenderCode(code string, args ...interface{}) string {
|
||||
var message string
|
||||
if ln := len(args); ln == 0 {
|
||||
return ""
|
||||
}
|
||||
|
||||
message = fmt.Sprint(args...)
|
||||
if len(code) == 0 {
|
||||
return message
|
||||
}
|
||||
|
||||
// disabled OR not support color
|
||||
if !Enable || !SupportColor() {
|
||||
return ClearCode(message)
|
||||
}
|
||||
|
||||
return fmt.Sprintf(FullColorTpl, code, message)
|
||||
}
|
||||
|
||||
// RenderWithSpaces Render code with spaces.
|
||||
// If the number of args is > 1, a space will be added between the args
|
||||
func RenderWithSpaces(code string, args ...interface{}) string {
|
||||
message := formatArgsForPrintln(args)
|
||||
if len(code) == 0 {
|
||||
return message
|
||||
}
|
||||
|
||||
// disabled OR not support color
|
||||
if !Enable || !SupportColor() {
|
||||
return ClearCode(message)
|
||||
}
|
||||
|
||||
return fmt.Sprintf(FullColorTpl, code, message)
|
||||
}
|
||||
|
||||
// RenderString render a string with color code.
|
||||
// Usage:
|
||||
// msg := RenderString("3;32;45", "a message")
|
||||
func RenderString(code string, str string) string {
|
||||
if len(code) == 0 || str == "" {
|
||||
return str
|
||||
}
|
||||
|
||||
// disabled OR not support color
|
||||
if !Enable || !SupportColor() {
|
||||
return ClearCode(str)
|
||||
}
|
||||
|
||||
return fmt.Sprintf(FullColorTpl, code, str)
|
||||
}
|
||||
|
||||
// ClearCode clear color codes.
|
||||
// eg: "\033[36;1mText\x1b[0m" -> "Text"
|
||||
func ClearCode(str string) string {
|
||||
return codeRegex.ReplaceAllString(str, "")
|
||||
}
|
||||
440
vendor/github.com/gookit/color/color_16.go
generated
vendored
Normal file
440
vendor/github.com/gookit/color/color_16.go
generated
vendored
Normal file
@@ -0,0 +1,440 @@
|
||||
package color
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"strconv"
|
||||
)
|
||||
|
||||
// Color Color16, 16 color value type
|
||||
// 3(2^3=8) OR 4(2^4=16) bite color.
|
||||
type Color uint8
|
||||
type Basic = Color // alias of Color
|
||||
|
||||
// Opts basic color options. code: 0 - 9
|
||||
type Opts []Color
|
||||
|
||||
// Add option value
|
||||
func (o *Opts) Add(ops ...Color) {
|
||||
for _, op := range ops {
|
||||
if uint8(op) < 10 {
|
||||
*o = append(*o, op)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// IsValid options
|
||||
func (o Opts) IsValid() bool {
|
||||
return len(o) > 0
|
||||
}
|
||||
|
||||
// IsEmpty options
|
||||
func (o Opts) IsEmpty() bool {
|
||||
return len(o) == 0
|
||||
}
|
||||
|
||||
// String options to string. eg: "1;3"
|
||||
func (o Opts) String() string {
|
||||
return Colors2code(o...)
|
||||
}
|
||||
|
||||
/*************************************************************
|
||||
* Basic 16 color definition
|
||||
*************************************************************/
|
||||
|
||||
// Base value for foreground/background color
|
||||
const (
|
||||
FgBase uint8 = 30
|
||||
BgBase uint8 = 40
|
||||
// hi color base code
|
||||
HiFgBase uint8 = 90
|
||||
HiBgBase uint8 = 100
|
||||
)
|
||||
|
||||
// Foreground colors. basic foreground colors 30 - 37
|
||||
const (
|
||||
FgBlack Color = iota + 30
|
||||
FgRed
|
||||
FgGreen
|
||||
FgYellow
|
||||
FgBlue
|
||||
FgMagenta // 品红
|
||||
FgCyan // 青色
|
||||
FgWhite
|
||||
// FgDefault revert default FG
|
||||
FgDefault Color = 39
|
||||
)
|
||||
|
||||
// Extra foreground color 90 - 97(非标准)
|
||||
const (
|
||||
FgDarkGray Color = iota + 90 // 亮黑(灰)
|
||||
FgLightRed
|
||||
FgLightGreen
|
||||
FgLightYellow
|
||||
FgLightBlue
|
||||
FgLightMagenta
|
||||
FgLightCyan
|
||||
FgLightWhite
|
||||
// FgGray is alias of FgDarkGray
|
||||
FgGray Color = 90 // 亮黑(灰)
|
||||
)
|
||||
|
||||
// Background colors. basic background colors 40 - 47
|
||||
const (
|
||||
BgBlack Color = iota + 40
|
||||
BgRed
|
||||
BgGreen
|
||||
BgYellow // BgBrown like yellow
|
||||
BgBlue
|
||||
BgMagenta
|
||||
BgCyan
|
||||
BgWhite
|
||||
// BgDefault revert default BG
|
||||
BgDefault Color = 49
|
||||
)
|
||||
|
||||
// Extra background color 100 - 107(非标准)
|
||||
const (
|
||||
BgDarkGray Color = iota + 100
|
||||
BgLightRed
|
||||
BgLightGreen
|
||||
BgLightYellow
|
||||
BgLightBlue
|
||||
BgLightMagenta
|
||||
BgLightCyan
|
||||
BgLightWhite
|
||||
// BgGray is alias of BgDarkGray
|
||||
BgGray Color = 100
|
||||
)
|
||||
|
||||
// Option settings
|
||||
const (
|
||||
OpReset Color = iota // 0 重置所有设置
|
||||
OpBold // 1 加粗
|
||||
OpFuzzy // 2 模糊(不是所有的终端仿真器都支持)
|
||||
OpItalic // 3 斜体(不是所有的终端仿真器都支持)
|
||||
OpUnderscore // 4 下划线
|
||||
OpBlink // 5 闪烁
|
||||
OpFastBlink // 5 快速闪烁(未广泛支持)
|
||||
OpReverse // 7 颠倒的 交换背景色与前景色
|
||||
OpConcealed // 8 隐匿的
|
||||
OpStrikethrough // 9 删除的,删除线(未广泛支持)
|
||||
)
|
||||
|
||||
// There are basic and light foreground color aliases
|
||||
const (
|
||||
Red = FgRed
|
||||
Cyan = FgCyan
|
||||
Gray = FgDarkGray // is light Black
|
||||
Blue = FgBlue
|
||||
Black = FgBlack
|
||||
Green = FgGreen
|
||||
White = FgWhite
|
||||
Yellow = FgYellow
|
||||
Magenta = FgMagenta
|
||||
|
||||
// special
|
||||
|
||||
Bold = OpBold
|
||||
Normal = FgDefault
|
||||
|
||||
// extra light
|
||||
|
||||
LightRed = FgLightRed
|
||||
LightCyan = FgLightCyan
|
||||
LightBlue = FgLightBlue
|
||||
LightGreen = FgLightGreen
|
||||
LightWhite = FgLightWhite
|
||||
LightYellow = FgLightYellow
|
||||
LightMagenta = FgLightMagenta
|
||||
|
||||
HiRed = FgLightRed
|
||||
HiCyan = FgLightCyan
|
||||
HiBlue = FgLightBlue
|
||||
HiGreen = FgLightGreen
|
||||
HiWhite = FgLightWhite
|
||||
HiYellow = FgLightYellow
|
||||
HiMagenta = FgLightMagenta
|
||||
|
||||
BgHiRed = BgLightRed
|
||||
BgHiCyan = BgLightCyan
|
||||
BgHiBlue = BgLightBlue
|
||||
BgHiGreen = BgLightGreen
|
||||
BgHiWhite = BgLightWhite
|
||||
BgHiYellow = BgLightYellow
|
||||
BgHiMagenta = BgLightMagenta
|
||||
)
|
||||
|
||||
// Bit4 an method for create Color
|
||||
func Bit4(code uint8) Color {
|
||||
return Color(code)
|
||||
}
|
||||
|
||||
/*************************************************************
|
||||
* Color render methods
|
||||
*************************************************************/
|
||||
|
||||
// Name get color code name.
|
||||
func (c Color) Name() string {
|
||||
name, ok := basic2nameMap[uint8(c)]
|
||||
if ok {
|
||||
return name
|
||||
}
|
||||
return "unknown"
|
||||
}
|
||||
|
||||
// Text render a text message
|
||||
func (c Color) Text(message string) string {
|
||||
return RenderString(c.String(), message)
|
||||
}
|
||||
|
||||
// Render messages by color setting
|
||||
// Usage:
|
||||
// green := color.FgGreen.Render
|
||||
// fmt.Println(green("message"))
|
||||
func (c Color) Render(a ...interface{}) string {
|
||||
return RenderCode(c.String(), a...)
|
||||
}
|
||||
|
||||
// Renderln messages by color setting.
|
||||
// like Println, will add spaces for each argument
|
||||
// Usage:
|
||||
// green := color.FgGreen.Renderln
|
||||
// fmt.Println(green("message"))
|
||||
func (c Color) Renderln(a ...interface{}) string {
|
||||
return RenderWithSpaces(c.String(), a...)
|
||||
}
|
||||
|
||||
// Sprint render messages by color setting. is alias of the Render()
|
||||
func (c Color) Sprint(a ...interface{}) string {
|
||||
return RenderCode(c.String(), a...)
|
||||
}
|
||||
|
||||
// Sprintf format and render message.
|
||||
// Usage:
|
||||
// green := color.Green.Sprintf
|
||||
// colored := green("message")
|
||||
func (c Color) Sprintf(format string, args ...interface{}) string {
|
||||
return RenderString(c.String(), fmt.Sprintf(format, args...))
|
||||
}
|
||||
|
||||
// Print messages.
|
||||
// Usage:
|
||||
// color.Green.Print("message")
|
||||
// OR:
|
||||
// green := color.FgGreen.Print
|
||||
// green("message")
|
||||
func (c Color) Print(args ...interface{}) {
|
||||
doPrintV2(c.Code(), fmt.Sprint(args...))
|
||||
}
|
||||
|
||||
// Printf format and print messages.
|
||||
// Usage:
|
||||
// color.Cyan.Printf("string %s", "arg0")
|
||||
func (c Color) Printf(format string, a ...interface{}) {
|
||||
doPrintV2(c.Code(), fmt.Sprintf(format, a...))
|
||||
}
|
||||
|
||||
// Println messages with new line
|
||||
func (c Color) Println(a ...interface{}) {
|
||||
doPrintlnV2(c.String(), a)
|
||||
}
|
||||
|
||||
// Light current color. eg: 36(FgCyan) -> 96(FgLightCyan).
|
||||
// Usage:
|
||||
// lightCyan := Cyan.Light()
|
||||
// lightCyan.Print("message")
|
||||
func (c Color) Light() Color {
|
||||
val := int(c)
|
||||
if val >= 30 && val <= 47 {
|
||||
return Color(uint8(c) + 60)
|
||||
}
|
||||
|
||||
// don't change
|
||||
return c
|
||||
}
|
||||
|
||||
// Darken current color. eg. 96(FgLightCyan) -> 36(FgCyan)
|
||||
// Usage:
|
||||
// cyan := LightCyan.Darken()
|
||||
// cyan.Print("message")
|
||||
func (c Color) Darken() Color {
|
||||
val := int(c)
|
||||
if val >= 90 && val <= 107 {
|
||||
return Color(uint8(c) - 60)
|
||||
}
|
||||
|
||||
// don't change
|
||||
return c
|
||||
}
|
||||
|
||||
// C256 convert 16 color to 256-color code.
|
||||
func (c Color) C256() Color256 {
|
||||
val := uint8(c)
|
||||
if val < 10 { // is option code
|
||||
return emptyC256 // empty
|
||||
}
|
||||
|
||||
var isBg uint8
|
||||
if val >= BgBase && val <= 47 { // is bg
|
||||
isBg = AsBg
|
||||
val = val - 10 // to fg code
|
||||
} else if val >= HiBgBase && val <= 107 { // is hi bg
|
||||
isBg = AsBg
|
||||
val = val - 10 // to fg code
|
||||
}
|
||||
|
||||
if c256, ok := basicTo256Map[val]; ok {
|
||||
return Color256{c256, isBg}
|
||||
}
|
||||
|
||||
// use raw value direct convert
|
||||
return Color256{val}
|
||||
}
|
||||
|
||||
// RGB convert 16 color to 256-color code.
|
||||
func (c Color) RGB() RGBColor {
|
||||
val := uint8(c)
|
||||
if val < 10 { // is option code
|
||||
return emptyRGBColor
|
||||
}
|
||||
|
||||
return HEX(Basic2hex(val))
|
||||
}
|
||||
|
||||
// Code convert to code string. eg "35"
|
||||
func (c Color) Code() string {
|
||||
// return fmt.Sprintf("%d", c)
|
||||
return strconv.Itoa(int(c))
|
||||
}
|
||||
|
||||
// String convert to code string. eg "35"
|
||||
func (c Color) String() string {
|
||||
// return fmt.Sprintf("%d", c)
|
||||
return strconv.Itoa(int(c))
|
||||
}
|
||||
|
||||
// IsValid color value
|
||||
func (c Color) IsValid() bool {
|
||||
return c < 107
|
||||
}
|
||||
|
||||
/*************************************************************
|
||||
* basic color maps
|
||||
*************************************************************/
|
||||
|
||||
// FgColors foreground colors map
|
||||
var FgColors = map[string]Color{
|
||||
"black": FgBlack,
|
||||
"red": FgRed,
|
||||
"green": FgGreen,
|
||||
"yellow": FgYellow,
|
||||
"blue": FgBlue,
|
||||
"magenta": FgMagenta,
|
||||
"cyan": FgCyan,
|
||||
"white": FgWhite,
|
||||
"default": FgDefault,
|
||||
}
|
||||
|
||||
// BgColors background colors map
|
||||
var BgColors = map[string]Color{
|
||||
"black": BgBlack,
|
||||
"red": BgRed,
|
||||
"green": BgGreen,
|
||||
"yellow": BgYellow,
|
||||
"blue": BgBlue,
|
||||
"magenta": BgMagenta,
|
||||
"cyan": BgCyan,
|
||||
"white": BgWhite,
|
||||
"default": BgDefault,
|
||||
}
|
||||
|
||||
// ExFgColors extra foreground colors map
|
||||
var ExFgColors = map[string]Color{
|
||||
"darkGray": FgDarkGray,
|
||||
"lightRed": FgLightRed,
|
||||
"lightGreen": FgLightGreen,
|
||||
"lightYellow": FgLightYellow,
|
||||
"lightBlue": FgLightBlue,
|
||||
"lightMagenta": FgLightMagenta,
|
||||
"lightCyan": FgLightCyan,
|
||||
"lightWhite": FgLightWhite,
|
||||
}
|
||||
|
||||
// ExBgColors extra background colors map
|
||||
var ExBgColors = map[string]Color{
|
||||
"darkGray": BgDarkGray,
|
||||
"lightRed": BgLightRed,
|
||||
"lightGreen": BgLightGreen,
|
||||
"lightYellow": BgLightYellow,
|
||||
"lightBlue": BgLightBlue,
|
||||
"lightMagenta": BgLightMagenta,
|
||||
"lightCyan": BgLightCyan,
|
||||
"lightWhite": BgLightWhite,
|
||||
}
|
||||
|
||||
// Options color options map
|
||||
// Deprecated
|
||||
// NOTICE: please use AllOptions instead.
|
||||
var Options = AllOptions
|
||||
|
||||
// AllOptions color options map
|
||||
var AllOptions = map[string]Color{
|
||||
"reset": OpReset,
|
||||
"bold": OpBold,
|
||||
"fuzzy": OpFuzzy,
|
||||
"italic": OpItalic,
|
||||
"underscore": OpUnderscore,
|
||||
"blink": OpBlink,
|
||||
"reverse": OpReverse,
|
||||
"concealed": OpConcealed,
|
||||
}
|
||||
|
||||
var (
|
||||
// TODO basic name alias
|
||||
// basicNameAlias = map[string]string{}
|
||||
|
||||
// basic color name to code
|
||||
name2basicMap = initName2basicMap()
|
||||
// basic2nameMap basic color code to name
|
||||
basic2nameMap = map[uint8]string{
|
||||
30: "black",
|
||||
31: "red",
|
||||
32: "green",
|
||||
33: "yellow",
|
||||
34: "blue",
|
||||
35: "magenta",
|
||||
36: "cyan",
|
||||
37: "white",
|
||||
// hi color code
|
||||
90: "lightBlack",
|
||||
91: "lightRed",
|
||||
92: "lightGreen",
|
||||
93: "lightYellow",
|
||||
94: "lightBlue",
|
||||
95: "lightMagenta",
|
||||
96: "lightCyan",
|
||||
97: "lightWhite",
|
||||
// options
|
||||
0: "reset",
|
||||
1: "bold",
|
||||
2: "fuzzy",
|
||||
3: "italic",
|
||||
4: "underscore",
|
||||
5: "blink",
|
||||
7: "reverse",
|
||||
8: "concealed",
|
||||
}
|
||||
)
|
||||
|
||||
// Basic2nameMap data
|
||||
func Basic2nameMap() map[uint8]string {
|
||||
return basic2nameMap
|
||||
}
|
||||
|
||||
func initName2basicMap() map[string]uint8 {
|
||||
n2b := make(map[string]uint8, len(basic2nameMap))
|
||||
for u, s := range basic2nameMap {
|
||||
n2b[s] = u
|
||||
}
|
||||
return n2b
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user