Cleanup indirect dependencies
This commit is contained in:
parent
0e6e8d1926
commit
aec3981aee
35
go.mod
35
go.mod
@ -3,59 +3,24 @@ module github.com/kubernetes-csi/csi-driver-nfs
|
|||||||
go 1.13
|
go 1.13
|
||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/PuerkitoBio/purell v1.1.1 // indirect
|
|
||||||
github.com/beorn7/perks v1.0.0 // indirect
|
|
||||||
github.com/container-storage-interface/spec v1.1.0
|
github.com/container-storage-interface/spec v1.1.0
|
||||||
github.com/docker/distribution v2.7.1+incompatible // indirect
|
github.com/docker/distribution v2.7.1+incompatible // indirect
|
||||||
github.com/docker/spdystream v0.0.0-20181023171402-6480d4af844c // indirect
|
|
||||||
github.com/emicklei/go-restful v2.9.3+incompatible // indirect
|
|
||||||
github.com/evanphx/json-patch v3.0.0+incompatible // indirect
|
|
||||||
github.com/fatih/camelcase v1.0.0 // indirect
|
github.com/fatih/camelcase v1.0.0 // indirect
|
||||||
github.com/ghodss/yaml v1.0.0 // indirect
|
|
||||||
github.com/go-openapi/spec v0.19.0 // indirect
|
|
||||||
github.com/go-openapi/swag v0.19.0 // indirect
|
|
||||||
github.com/gogo/protobuf v1.2.1 // indirect
|
|
||||||
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b
|
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b
|
||||||
github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef // indirect
|
|
||||||
github.com/golang/protobuf v1.3.1 // indirect
|
|
||||||
github.com/google/btree v1.0.0 // indirect
|
|
||||||
github.com/google/gofuzz v1.0.0 // indirect
|
|
||||||
github.com/google/uuid v1.1.1 // indirect
|
|
||||||
github.com/googleapis/gnostic v0.2.0 // indirect
|
|
||||||
github.com/gregjones/httpcache v0.0.0-20190212212710-3befbb6ad0cc // indirect
|
|
||||||
github.com/hashicorp/golang-lru v0.5.1 // indirect
|
|
||||||
github.com/imdario/mergo v0.3.7 // indirect
|
|
||||||
github.com/json-iterator/go v1.1.6 // indirect
|
|
||||||
github.com/kubernetes-csi/csi-lib-utils v0.2.0
|
github.com/kubernetes-csi/csi-lib-utils v0.2.0
|
||||||
github.com/mailru/easyjson v0.0.0-20190403194419-1ea4449da983 // indirect
|
|
||||||
github.com/onsi/ginkgo v1.8.0
|
github.com/onsi/ginkgo v1.8.0
|
||||||
github.com/onsi/gomega v1.5.0
|
github.com/onsi/gomega v1.5.0
|
||||||
github.com/opencontainers/go-digest v1.0.0-rc1 // indirect
|
github.com/opencontainers/go-digest v1.0.0-rc1 // indirect
|
||||||
github.com/pkg/errors v0.8.1 // indirect
|
|
||||||
github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90 // indirect
|
|
||||||
github.com/prometheus/common v0.3.0 // indirect
|
|
||||||
github.com/prometheus/procfs v0.0.0-20190412120340-e22ddced7142 // indirect
|
|
||||||
github.com/spf13/afero v1.2.2 // indirect
|
github.com/spf13/afero v1.2.2 // indirect
|
||||||
github.com/spf13/cobra v0.0.3
|
github.com/spf13/cobra v0.0.3
|
||||||
github.com/spf13/pflag v1.0.3 // indirect
|
|
||||||
github.com/stretchr/testify v1.3.0 // indirect
|
|
||||||
golang.org/x/crypto v0.0.0-20190411191339-88737f569e3a // indirect
|
|
||||||
golang.org/x/net v0.0.0-20190415100556-4a65cf94b679
|
golang.org/x/net v0.0.0-20190415100556-4a65cf94b679
|
||||||
golang.org/x/oauth2 v0.0.0-20190402181905-9f3314589c9a // indirect
|
|
||||||
golang.org/x/sys v0.0.0-20190415081028-16da32be82c5 // indirect
|
|
||||||
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4 // indirect
|
|
||||||
google.golang.org/genproto v0.0.0-20190404172233-64821d5d2107 // indirect
|
|
||||||
google.golang.org/grpc v1.20.0
|
google.golang.org/grpc v1.20.0
|
||||||
gopkg.in/inf.v0 v0.9.1 // indirect
|
|
||||||
gopkg.in/square/go-jose.v2 v2.3.1 // indirect
|
|
||||||
gopkg.in/yaml.v2 v2.2.2 // indirect
|
|
||||||
k8s.io/api v0.0.0-20190415132514-c2f1300cac21
|
k8s.io/api v0.0.0-20190415132514-c2f1300cac21
|
||||||
k8s.io/apiextensions-apiserver v0.0.0-20190315093550-53c4693659ed // indirect
|
k8s.io/apiextensions-apiserver v0.0.0-20190315093550-53c4693659ed // indirect
|
||||||
k8s.io/apimachinery v0.0.0-20190415132420-07d458fe0356
|
k8s.io/apimachinery v0.0.0-20190415132420-07d458fe0356
|
||||||
k8s.io/cli-runtime v0.0.0-20190415133733-52015cbe156a // indirect
|
k8s.io/cli-runtime v0.0.0-20190415133733-52015cbe156a // indirect
|
||||||
k8s.io/cluster-bootstrap v0.0.0-20190415134033-d885a12fbbe4 // indirect
|
k8s.io/cluster-bootstrap v0.0.0-20190415134033-d885a12fbbe4 // indirect
|
||||||
k8s.io/csi-translation-lib v0.0.0-20190415134207-82f1dfd98d10 // indirect
|
k8s.io/csi-translation-lib v0.0.0-20190415134207-82f1dfd98d10 // indirect
|
||||||
k8s.io/klog v0.3.0 // indirect
|
|
||||||
k8s.io/kube-aggregator v0.0.0-20190415133304-80ce4e5a0cbc // indirect
|
k8s.io/kube-aggregator v0.0.0-20190415133304-80ce4e5a0cbc // indirect
|
||||||
k8s.io/kube-openapi v0.0.0-20190401085232-94e1e7b7574c // indirect
|
k8s.io/kube-openapi v0.0.0-20190401085232-94e1e7b7574c // indirect
|
||||||
k8s.io/kubernetes v1.14.1
|
k8s.io/kubernetes v1.14.1
|
||||||
|
|||||||
121
go.sum
121
go.sum
@ -1,22 +1,17 @@
|
|||||||
cloud.google.com/go v0.0.0-20160913182117-3b1ae45394a2/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
|
cloud.google.com/go v0.0.0-20160913182117-3b1ae45394a2/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
|
||||||
cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
|
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=
|
|
||||||
github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8=
|
github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8=
|
||||||
github.com/Azure/go-autorest v11.1.0+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24=
|
github.com/Azure/go-autorest v11.1.0+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24=
|
||||||
github.com/BurntSushi/toml v0.3.0/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
|
github.com/BurntSushi/toml v0.3.0/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
|
||||||
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
|
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/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
|
||||||
github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ=
|
github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ=
|
||||||
|
github.com/PuerkitoBio/purell v1.1.0 h1:rmGxhojJlM0tuKtfdvliR84CFHljx9ag64t2xmVkjK4=
|
||||||
github.com/PuerkitoBio/purell v1.1.0/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0=
|
github.com/PuerkitoBio/purell v1.1.0/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0=
|
||||||
github.com/PuerkitoBio/purell v1.1.1 h1:WEQqlqaGbrPkxLJWfBwQmfEAE1Z7ONdDLqrN38tNFfI=
|
|
||||||
github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0=
|
|
||||||
github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 h1:d+Bc7a5rLufV/sSk/8dngufqelfh6jnri85riMAaF/M=
|
github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 h1:d+Bc7a5rLufV/sSk/8dngufqelfh6jnri85riMAaF/M=
|
||||||
github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE=
|
github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE=
|
||||||
github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
|
github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973 h1:xJ4a3vCFaGF/jqvzLMYoU8P317H5OQ+Via4RmuPwCS0=
|
||||||
github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
|
|
||||||
github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/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 h1:HWo1m869IqiPhD389kmkxeTalrjNbbJTC8LXupb+sl0=
|
|
||||||
github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8=
|
|
||||||
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
|
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
|
||||||
github.com/container-storage-interface/spec v1.1.0 h1:qPsTqtR1VUPvMPeK0UnCZMtXaKGyyLPG8gj/wG6VqMs=
|
github.com/container-storage-interface/spec v1.1.0 h1:qPsTqtR1VUPvMPeK0UnCZMtXaKGyyLPG8gj/wG6VqMs=
|
||||||
github.com/container-storage-interface/spec v1.1.0/go.mod h1:6URME8mwIBbpVyZV93Ce5St17xBiQJQY67NDsuohiy4=
|
github.com/container-storage-interface/spec v1.1.0/go.mod h1:6URME8mwIBbpVyZV93Ce5St17xBiQJQY67NDsuohiy4=
|
||||||
@ -31,7 +26,6 @@ github.com/coreos/go-systemd v0.0.0-20180511133405-39ca1b05acc7 h1:u9SHYsPQNyt5t
|
|||||||
github.com/coreos/go-systemd v0.0.0-20180511133405-39ca1b05acc7/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4=
|
github.com/coreos/go-systemd v0.0.0-20180511133405-39ca1b05acc7/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4=
|
||||||
github.com/coreos/pkg v0.0.0-20180108230652-97fdf19511ea h1:n2Ltr3SrfQlf/9nOna1DoGKxLx3qTSI8Ttl6Xrqp6mw=
|
github.com/coreos/pkg v0.0.0-20180108230652-97fdf19511ea h1:n2Ltr3SrfQlf/9nOna1DoGKxLx3qTSI8Ttl6Xrqp6mw=
|
||||||
github.com/coreos/pkg v0.0.0-20180108230652-97fdf19511ea/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA=
|
github.com/coreos/pkg v0.0.0-20180108230652-97fdf19511ea/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA=
|
||||||
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/dgrijalva/jwt-go v0.0.0-20160705203006-01aeca54ebda h1:NyywMz59neOoVRFDz+ccfKWxn784fiHMDnZSy6T+JXY=
|
github.com/dgrijalva/jwt-go v0.0.0-20160705203006-01aeca54ebda h1:NyywMz59neOoVRFDz+ccfKWxn784fiHMDnZSy6T+JXY=
|
||||||
@ -41,116 +35,81 @@ github.com/docker/distribution v2.7.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4Kfc
|
|||||||
github.com/docker/docker v0.7.3-0.20190327010347-be7ac8be2ae0/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
|
github.com/docker/docker v0.7.3-0.20190327010347-be7ac8be2ae0/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
|
||||||
github.com/docker/spdystream v0.0.0-20160310174837-449fdfce4d96 h1:cenwrSVm+Z7QLSV/BsnenAOcDXdX4cMv4wP0B/5QbPg=
|
github.com/docker/spdystream v0.0.0-20160310174837-449fdfce4d96 h1:cenwrSVm+Z7QLSV/BsnenAOcDXdX4cMv4wP0B/5QbPg=
|
||||||
github.com/docker/spdystream v0.0.0-20160310174837-449fdfce4d96/go.mod h1:Qh8CwZgvJUkLughtfhJv5dyTYa91l1fOUCrgjqmcifM=
|
github.com/docker/spdystream v0.0.0-20160310174837-449fdfce4d96/go.mod h1:Qh8CwZgvJUkLughtfhJv5dyTYa91l1fOUCrgjqmcifM=
|
||||||
github.com/docker/spdystream v0.0.0-20181023171402-6480d4af844c h1:ZfSZ3P3BedhKGUhzj7BQlPSU4OvT6tfOKe3DVHzOA7s=
|
|
||||||
github.com/docker/spdystream v0.0.0-20181023171402-6480d4af844c/go.mod h1:Qh8CwZgvJUkLughtfhJv5dyTYa91l1fOUCrgjqmcifM=
|
|
||||||
github.com/elazarl/goproxy v0.0.0-20170405201442-c4fc26588b6e h1:p1yVGRW3nmb85p1Sh1ZJSDm4A4iKLS5QNbvUHMgGu/M=
|
github.com/elazarl/goproxy v0.0.0-20170405201442-c4fc26588b6e h1:p1yVGRW3nmb85p1Sh1ZJSDm4A4iKLS5QNbvUHMgGu/M=
|
||||||
github.com/elazarl/goproxy v0.0.0-20170405201442-c4fc26588b6e/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc=
|
github.com/elazarl/goproxy v0.0.0-20170405201442-c4fc26588b6e/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc=
|
||||||
|
github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633 h1:H2pdYOb3KQ1/YsqVWoWNLQO+fusocsw354rqGTZtAgw=
|
||||||
github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs=
|
github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs=
|
||||||
github.com/emicklei/go-restful v2.9.3+incompatible h1:2OwhVdhtzYUp5P5wuGsVDPagKSRd9JK72sJCHVCXh5g=
|
|
||||||
github.com/emicklei/go-restful v2.9.3+incompatible/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs=
|
|
||||||
github.com/envoyproxy/go-control-plane v0.6.9/go.mod h1:SBwIajubJHhxtWwsL9s8ss4safvEdbitLhGGK48rN6g=
|
github.com/envoyproxy/go-control-plane v0.6.9/go.mod h1:SBwIajubJHhxtWwsL9s8ss4safvEdbitLhGGK48rN6g=
|
||||||
github.com/evanphx/json-patch v0.0.0-20190203023257-5858425f7550 h1:mV9jbLoSW/8m4VK16ZkHTozJa8sesK5u5kTMFysTYac=
|
github.com/evanphx/json-patch v0.0.0-20190203023257-5858425f7550 h1:mV9jbLoSW/8m4VK16ZkHTozJa8sesK5u5kTMFysTYac=
|
||||||
github.com/evanphx/json-patch v0.0.0-20190203023257-5858425f7550/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk=
|
github.com/evanphx/json-patch v0.0.0-20190203023257-5858425f7550/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk=
|
||||||
github.com/evanphx/json-patch v3.0.0+incompatible h1:l91aby7TzBXBdmF8heZqjskeH9f3g7ZOL8/sSe+vTlU=
|
|
||||||
github.com/evanphx/json-patch v3.0.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk=
|
|
||||||
github.com/fatih/camelcase v1.0.0 h1:hxNvNX/xYBp0ovncs8WyWZrOrpBNub/JfaMvbURyft8=
|
github.com/fatih/camelcase v1.0.0 h1:hxNvNX/xYBp0ovncs8WyWZrOrpBNub/JfaMvbURyft8=
|
||||||
github.com/fatih/camelcase v1.0.0/go.mod h1:yN2Sb0lFhZJUdVvtELVWefmrXpuZESvPmqwoZc+/fpc=
|
github.com/fatih/camelcase v1.0.0/go.mod h1:yN2Sb0lFhZJUdVvtELVWefmrXpuZESvPmqwoZc+/fpc=
|
||||||
github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I=
|
github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I=
|
||||||
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
|
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
|
||||||
|
github.com/ghodss/yaml v0.0.0-20180820084758-c7ce16629ff4 h1:bRzFpEzvausOAt4va+I/22BZ1vXDtERngp0BNYDKej0=
|
||||||
github.com/ghodss/yaml v0.0.0-20180820084758-c7ce16629ff4/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
|
github.com/ghodss/yaml v0.0.0-20180820084758-c7ce16629ff4/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
|
||||||
github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk=
|
|
||||||
github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
|
|
||||||
github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=
|
|
||||||
github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE=
|
|
||||||
github.com/go-openapi/jsonpointer v0.17.0/go.mod h1:cOnomiV+CVVwFLk0A/MExoFMjwdsUdVpsRhURCKh+3M=
|
github.com/go-openapi/jsonpointer v0.17.0/go.mod h1:cOnomiV+CVVwFLk0A/MExoFMjwdsUdVpsRhURCKh+3M=
|
||||||
github.com/go-openapi/jsonpointer v0.19.0 h1:FTUMcX77w5rQkClIzDtTxvn6Bsa894CcrzNj2MMfeg8=
|
github.com/go-openapi/jsonpointer v0.19.0 h1:FTUMcX77w5rQkClIzDtTxvn6Bsa894CcrzNj2MMfeg8=
|
||||||
github.com/go-openapi/jsonpointer v0.19.0/go.mod h1:cOnomiV+CVVwFLk0A/MExoFMjwdsUdVpsRhURCKh+3M=
|
github.com/go-openapi/jsonpointer v0.19.0/go.mod h1:cOnomiV+CVVwFLk0A/MExoFMjwdsUdVpsRhURCKh+3M=
|
||||||
github.com/go-openapi/jsonreference v0.17.0/go.mod h1:g4xxGn04lDIRh0GJb5QlpE3HfopLOL6uZrK/VgnsK9I=
|
github.com/go-openapi/jsonreference v0.17.0/go.mod h1:g4xxGn04lDIRh0GJb5QlpE3HfopLOL6uZrK/VgnsK9I=
|
||||||
github.com/go-openapi/jsonreference v0.19.0 h1:BqWKpV1dFd+AuiKlgtddwVIFQsuMpxfBDBHGfM2yNpk=
|
github.com/go-openapi/jsonreference v0.19.0 h1:BqWKpV1dFd+AuiKlgtddwVIFQsuMpxfBDBHGfM2yNpk=
|
||||||
github.com/go-openapi/jsonreference v0.19.0/go.mod h1:g4xxGn04lDIRh0GJb5QlpE3HfopLOL6uZrK/VgnsK9I=
|
github.com/go-openapi/jsonreference v0.19.0/go.mod h1:g4xxGn04lDIRh0GJb5QlpE3HfopLOL6uZrK/VgnsK9I=
|
||||||
|
github.com/go-openapi/spec v0.17.2 h1:eb2NbuCnoe8cWAxhtK6CfMWUYmiFEZJ9Hx3Z2WRwJ5M=
|
||||||
github.com/go-openapi/spec v0.17.2/go.mod h1:XkF/MOi14NmjsfZ8VtAKf8pIlbZzyoTvZsdfssdxcBI=
|
github.com/go-openapi/spec v0.17.2/go.mod h1:XkF/MOi14NmjsfZ8VtAKf8pIlbZzyoTvZsdfssdxcBI=
|
||||||
github.com/go-openapi/spec v0.19.0 h1:A4SZ6IWh3lnjH0rG0Z5lkxazMGBECtrZcbyYQi+64k4=
|
|
||||||
github.com/go-openapi/spec v0.19.0/go.mod h1:XkF/MOi14NmjsfZ8VtAKf8pIlbZzyoTvZsdfssdxcBI=
|
|
||||||
github.com/go-openapi/swag v0.17.0/go.mod h1:AByQ+nYG6gQg71GINrmuDXCPWdL640yX49/kXLo40Tg=
|
github.com/go-openapi/swag v0.17.0/go.mod h1:AByQ+nYG6gQg71GINrmuDXCPWdL640yX49/kXLo40Tg=
|
||||||
|
github.com/go-openapi/swag v0.17.2 h1:K/ycE/XTUDFltNHSO32cGRUhrVGJD64o8WgAIZNyc3k=
|
||||||
github.com/go-openapi/swag v0.17.2/go.mod h1:AByQ+nYG6gQg71GINrmuDXCPWdL640yX49/kXLo40Tg=
|
github.com/go-openapi/swag v0.17.2/go.mod h1:AByQ+nYG6gQg71GINrmuDXCPWdL640yX49/kXLo40Tg=
|
||||||
github.com/go-openapi/swag v0.19.0 h1:Kg7Wl7LkTPlmc393QZQ/5rQadPhi7pBVEMZxyTi0Ii8=
|
|
||||||
github.com/go-openapi/swag v0.19.0/go.mod h1:AByQ+nYG6gQg71GINrmuDXCPWdL640yX49/kXLo40Tg=
|
|
||||||
github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY=
|
|
||||||
github.com/gogo/googleapis v1.1.0/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s=
|
github.com/gogo/googleapis v1.1.0/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s=
|
||||||
github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
|
github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
|
||||||
github.com/gogo/protobuf v1.2.0 h1:xU6/SpYbvkNYiptHJYEDRseDLvYE7wSqhYYNy0QSUzI=
|
github.com/gogo/protobuf v1.2.0 h1:xU6/SpYbvkNYiptHJYEDRseDLvYE7wSqhYYNy0QSUzI=
|
||||||
github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
|
github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
|
||||||
github.com/gogo/protobuf v1.2.1 h1:/s5zKNz0uPFCZ5hddgPdo2TK2TVrUNMn0OOX8/aZMTE=
|
|
||||||
github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4=
|
|
||||||
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b h1:VKtxabqXZkF25pY9ekfRL6a582T4P37/31XEstQ5p58=
|
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b h1:VKtxabqXZkF25pY9ekfRL6a582T4P37/31XEstQ5p58=
|
||||||
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
|
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
|
||||||
github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903 h1:LbsanbbD6LieFkXbj9YNNBupiGHJgFeLpO0j0Fza1h8=
|
github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903 h1:LbsanbbD6LieFkXbj9YNNBupiGHJgFeLpO0j0Fza1h8=
|
||||||
github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
|
github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
|
||||||
github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef h1:veQD95Isof8w9/WXiA+pa3tz3fJXkt5B7QaRBrM62gk=
|
|
||||||
github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
|
|
||||||
github.com/golang/mock v1.1.1 h1:G5FRp8JnTd7RQH5kemVNlMeyXQAztQ3mOWV95KxsXH8=
|
github.com/golang/mock v1.1.1 h1:G5FRp8JnTd7RQH5kemVNlMeyXQAztQ3mOWV95KxsXH8=
|
||||||
github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
|
github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
|
||||||
github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM=
|
github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM=
|
||||||
github.com/golang/protobuf v1.2.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 h1:YF8+flBXS5eO826T4nzqPrxfhQThhXl0YzfuUPu4SBg=
|
github.com/google/btree v0.0.0-20160524151835-7d79101e329e h1:JHB7F/4TJCrYBW8+GZO8VkWDj1jxcWuCl6uxKODiyi4=
|
||||||
github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
|
|
||||||
github.com/google/btree v0.0.0-20160524151835-7d79101e329e/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
|
github.com/google/btree v0.0.0-20160524151835-7d79101e329e/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/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
|
github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
|
||||||
github.com/google/gofuzz v0.0.0-20170612174753-24818f796faf h1:+RRA9JqSOZFfKrOeqr2z77+8R2RKyh8PG66dcu1V0ck=
|
github.com/google/gofuzz v0.0.0-20170612174753-24818f796faf h1:+RRA9JqSOZFfKrOeqr2z77+8R2RKyh8PG66dcu1V0ck=
|
||||||
github.com/google/gofuzz v0.0.0-20170612174753-24818f796faf/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI=
|
github.com/google/gofuzz v0.0.0-20170612174753-24818f796faf/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI=
|
||||||
github.com/google/gofuzz v1.0.0 h1:A8PeW59pxE9IoFRqBp37U+mSNaQoZ46F1f0f863XSXw=
|
|
||||||
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
|
|
||||||
github.com/google/uuid v1.0.0 h1:b4Gk+7WdP/d3HZH8EJsZpvV7EtDOgaZLtnaNGIu1adA=
|
github.com/google/uuid v1.0.0 h1:b4Gk+7WdP/d3HZH8EJsZpvV7EtDOgaZLtnaNGIu1adA=
|
||||||
github.com/google/uuid v1.0.0/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 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY=
|
|
||||||
github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
|
||||||
github.com/googleapis/gnostic v0.0.0-20170729233727-0c5108395e2d h1:7XGaL1e6bYS1yIonGp9761ExpPPV1ui0SAC59Yube9k=
|
github.com/googleapis/gnostic v0.0.0-20170729233727-0c5108395e2d h1:7XGaL1e6bYS1yIonGp9761ExpPPV1ui0SAC59Yube9k=
|
||||||
github.com/googleapis/gnostic v0.0.0-20170729233727-0c5108395e2d/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY=
|
github.com/googleapis/gnostic v0.0.0-20170729233727-0c5108395e2d/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY=
|
||||||
github.com/googleapis/gnostic v0.2.0 h1:l6N3VoaVzTncYYW+9yOz2LJJammFZGBO13sqgEhpy9g=
|
|
||||||
github.com/googleapis/gnostic v0.2.0/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY=
|
|
||||||
github.com/gophercloud/gophercloud v0.0.0-20190126172459-c818fa66e4c8/go.mod h1:3WdhXV3rUYy9p6AUW8d94kr+HS62Y4VL9mBnFxsD8q4=
|
github.com/gophercloud/gophercloud v0.0.0-20190126172459-c818fa66e4c8/go.mod h1:3WdhXV3rUYy9p6AUW8d94kr+HS62Y4VL9mBnFxsD8q4=
|
||||||
github.com/gorilla/websocket v0.0.0-20170926233335-4201258b820c h1:Lh2aW+HnU2Nbe1gqD9SOJLJxW1jBMmQOktN2acDyJk8=
|
github.com/gorilla/websocket v0.0.0-20170926233335-4201258b820c h1:Lh2aW+HnU2Nbe1gqD9SOJLJxW1jBMmQOktN2acDyJk8=
|
||||||
github.com/gorilla/websocket v0.0.0-20170926233335-4201258b820c/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ=
|
github.com/gorilla/websocket v0.0.0-20170926233335-4201258b820c/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ=
|
||||||
|
github.com/gregjones/httpcache v0.0.0-20170728041850-787624de3eb7 h1:6TSoaYExHper8PYsJu23GWVNOyYRCSnIFyxKgLSZ54w=
|
||||||
github.com/gregjones/httpcache v0.0.0-20170728041850-787624de3eb7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA=
|
github.com/gregjones/httpcache v0.0.0-20170728041850-787624de3eb7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA=
|
||||||
github.com/gregjones/httpcache v0.0.0-20190212212710-3befbb6ad0cc h1:f8eY6cV/x1x+HLjOp4r72s/31/V2aTUtg5oKRRPf8/Q=
|
|
||||||
github.com/gregjones/httpcache v0.0.0-20190212212710-3befbb6ad0cc/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA=
|
|
||||||
github.com/grpc-ecosystem/go-grpc-middleware v0.0.0-20190222133341-cfaf5686ec79 h1:lR9ssWAqp9qL0bALxqEEkuudiP1eweOdv9jsRK3e7lE=
|
github.com/grpc-ecosystem/go-grpc-middleware v0.0.0-20190222133341-cfaf5686ec79 h1:lR9ssWAqp9qL0bALxqEEkuudiP1eweOdv9jsRK3e7lE=
|
||||||
github.com/grpc-ecosystem/go-grpc-middleware v0.0.0-20190222133341-cfaf5686ec79/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs=
|
github.com/grpc-ecosystem/go-grpc-middleware v0.0.0-20190222133341-cfaf5686ec79/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs=
|
||||||
github.com/grpc-ecosystem/go-grpc-prometheus v0.0.0-20170330212424-2500245aa611 h1:f5vL2EW5pL274ztMNnizZAEa457nKyKPEaN/sm/kdBk=
|
github.com/grpc-ecosystem/go-grpc-prometheus v0.0.0-20170330212424-2500245aa611 h1:f5vL2EW5pL274ztMNnizZAEa457nKyKPEaN/sm/kdBk=
|
||||||
github.com/grpc-ecosystem/go-grpc-prometheus v0.0.0-20170330212424-2500245aa611/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk=
|
github.com/grpc-ecosystem/go-grpc-prometheus v0.0.0-20170330212424-2500245aa611/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk=
|
||||||
github.com/grpc-ecosystem/grpc-gateway v1.3.0 h1:HJtP6RRwj2EpPCD/mhAWzSvLL/dFTdPm1UrWwanoFos=
|
github.com/grpc-ecosystem/grpc-gateway v1.3.0 h1:HJtP6RRwj2EpPCD/mhAWzSvLL/dFTdPm1UrWwanoFos=
|
||||||
github.com/grpc-ecosystem/grpc-gateway v1.3.0/go.mod h1:RSKVYQBd5MCa4OVpNdGskqpgL2+G+NZTnrVHpWWfpdw=
|
github.com/grpc-ecosystem/grpc-gateway v1.3.0/go.mod h1:RSKVYQBd5MCa4OVpNdGskqpgL2+G+NZTnrVHpWWfpdw=
|
||||||
|
github.com/hashicorp/golang-lru v0.5.0 h1:CL2msUPvZTLb5O648aiLNJw3hnBxN2+1Jq8rCOH9wdo=
|
||||||
github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
|
github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
|
||||||
github.com/hashicorp/golang-lru v0.5.1 h1:0hERBMJE1eitiLkihrMvRVBYAkpHzc/J3QdDN+dAcgU=
|
|
||||||
github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
|
|
||||||
github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI=
|
github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI=
|
||||||
github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
|
github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
|
||||||
github.com/imdario/mergo v0.3.5 h1:JboBksRwiiAJWvIYJVo46AfV+IAIKZpfrSzVKj42R4Q=
|
github.com/imdario/mergo v0.3.5 h1:JboBksRwiiAJWvIYJVo46AfV+IAIKZpfrSzVKj42R4Q=
|
||||||
github.com/imdario/mergo v0.3.5/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA=
|
github.com/imdario/mergo v0.3.5/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA=
|
||||||
github.com/imdario/mergo v0.3.7 h1:Y+UAYTZ7gDEuOfhxKWy+dvb5dRQ6rJjFSdX2HZY1/gI=
|
|
||||||
github.com/imdario/mergo v0.3.7/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA=
|
|
||||||
github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM=
|
github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM=
|
||||||
github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8=
|
github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8=
|
||||||
github.com/jonboulle/clockwork v0.0.0-20141017032234-72f9bd7c4e0c h1:XpRROA6ssPlTwJI8/pH+61uieOkcJhmAFz25cu0B94Y=
|
github.com/jonboulle/clockwork v0.0.0-20141017032234-72f9bd7c4e0c h1:XpRROA6ssPlTwJI8/pH+61uieOkcJhmAFz25cu0B94Y=
|
||||||
github.com/jonboulle/clockwork v0.0.0-20141017032234-72f9bd7c4e0c/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo=
|
github.com/jonboulle/clockwork v0.0.0-20141017032234-72f9bd7c4e0c/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo=
|
||||||
github.com/json-iterator/go v0.0.0-20180701071628-ab8a2e0c74be h1:AHimNtVIpiBjPUhEF5KNCkrUyqTSA5zWUl8sQ2bfGBE=
|
github.com/json-iterator/go v0.0.0-20180701071628-ab8a2e0c74be h1:AHimNtVIpiBjPUhEF5KNCkrUyqTSA5zWUl8sQ2bfGBE=
|
||||||
github.com/json-iterator/go v0.0.0-20180701071628-ab8a2e0c74be/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU=
|
github.com/json-iterator/go v0.0.0-20180701071628-ab8a2e0c74be/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU=
|
||||||
github.com/json-iterator/go v1.1.6 h1:MrUvLMLTMxbqFJ9kzlvat/rYZqZnW3u4wkLzWTaFwKs=
|
|
||||||
github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU=
|
|
||||||
github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w=
|
|
||||||
github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q=
|
|
||||||
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
|
|
||||||
github.com/konsorten/go-windows-terminal-sequences v1.0.1 h1:mweAR1A6xJ3oS2pRaGiHgQ4OO8tzTaLawm8vnODuwDk=
|
github.com/konsorten/go-windows-terminal-sequences v1.0.1 h1:mweAR1A6xJ3oS2pRaGiHgQ4OO8tzTaLawm8vnODuwDk=
|
||||||
github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
|
github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
|
||||||
github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc=
|
|
||||||
github.com/kubernetes-csi/csi-lib-utils v0.2.0 h1:JPYmgBuogmlJWHUazSFH4Q36Cl9RGFPOasAcZ/FIX5A=
|
github.com/kubernetes-csi/csi-lib-utils v0.2.0 h1:JPYmgBuogmlJWHUazSFH4Q36Cl9RGFPOasAcZ/FIX5A=
|
||||||
github.com/kubernetes-csi/csi-lib-utils v0.2.0/go.mod h1:GVmlUmxZ+SUjVLXicRFjqWUUvWez0g0Y78zNV9t7KfQ=
|
github.com/kubernetes-csi/csi-lib-utils v0.2.0/go.mod h1:GVmlUmxZ+SUjVLXicRFjqWUUvWez0g0Y78zNV9t7KfQ=
|
||||||
github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ=
|
github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ=
|
||||||
|
github.com/mailru/easyjson v0.0.0-20180823135443-60711f1a8329 h1:2gxZ0XQIU/5z3Z3bUBu+FXuk2pFbkN6tcwi/pjyaDic=
|
||||||
github.com/mailru/easyjson v0.0.0-20180823135443-60711f1a8329/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
|
github.com/mailru/easyjson v0.0.0-20180823135443-60711f1a8329/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
|
||||||
github.com/mailru/easyjson v0.0.0-20190403194419-1ea4449da983 h1:wL11wNW7dhKIcRCHSm4sHKPWz0tt4mwBsVodG7+Xyqg=
|
|
||||||
github.com/mailru/easyjson v0.0.0-20190403194419-1ea4449da983/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
|
|
||||||
github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU=
|
github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU=
|
||||||
github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0=
|
github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0=
|
||||||
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg=
|
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg=
|
||||||
@ -158,7 +117,6 @@ github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJ
|
|||||||
github.com/modern-go/reflect2 v1.0.1 h1:9f412s+6RmYXLWZSEzVVgPGK7C2PphHj5RJrvfx9AWI=
|
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/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
|
||||||
github.com/munnerz/goautoneg v0.0.0-20120707110453-a547fc61f48d/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ=
|
github.com/munnerz/goautoneg v0.0.0-20120707110453-a547fc61f48d/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ=
|
||||||
github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
|
|
||||||
github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw=
|
github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw=
|
||||||
github.com/natefinch/lumberjack v2.0.0+incompatible/go.mod h1:Wi9p2TTF5DG5oU+6YfsmYQpsTIOm0B1VNzQg9Mw6nPk=
|
github.com/natefinch/lumberjack v2.0.0+incompatible/go.mod h1:Wi9p2TTF5DG5oU+6YfsmYQpsTIOm0B1VNzQg9Mw6nPk=
|
||||||
github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
|
github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
|
||||||
@ -175,27 +133,21 @@ github.com/peterbourgon/diskv v2.0.1+incompatible h1:UBdAOUP5p4RWqPBg048CAvpKN+v
|
|||||||
github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU=
|
github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU=
|
||||||
github.com/philhofer/fwd v1.0.0 h1:UbZqGr5Y38ApvM/V/jEljVxwocdweyH+vmYvRPBnbqQ=
|
github.com/philhofer/fwd v1.0.0 h1:UbZqGr5Y38ApvM/V/jEljVxwocdweyH+vmYvRPBnbqQ=
|
||||||
github.com/philhofer/fwd v1.0.0/go.mod h1:gk3iGcWd9+svBvR0sR+KPcfE+RNWozjowpeBVG3ZVNU=
|
github.com/philhofer/fwd v1.0.0/go.mod h1:gk3iGcWd9+svBvR0sR+KPcfE+RNWozjowpeBVG3ZVNU=
|
||||||
|
github.com/pkg/errors v0.8.0 h1:WdK/asTD0HN+q6hsWO3/vpuAkAr+tw6aNJNDFFf0+qw=
|
||||||
github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
|
github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
|
||||||
github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I=
|
|
||||||
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
|
|
||||||
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/pquerna/cachecontrol v0.0.0-20171018203845-0dec1b30a021/go.mod h1:prYjPmNq4d1NPVmpShWobRqXY3q7Vp+80DqgxxUrUIA=
|
github.com/pquerna/cachecontrol v0.0.0-20171018203845-0dec1b30a021/go.mod h1:prYjPmNq4d1NPVmpShWobRqXY3q7Vp+80DqgxxUrUIA=
|
||||||
github.com/pquerna/ffjson v0.0.0-20180717144149-af8b230fcd20 h1:7sBb9iOkeq+O7AXlVoH/8zpIcRXX523zMkKKspHjjx8=
|
github.com/pquerna/ffjson v0.0.0-20180717144149-af8b230fcd20 h1:7sBb9iOkeq+O7AXlVoH/8zpIcRXX523zMkKKspHjjx8=
|
||||||
github.com/pquerna/ffjson v0.0.0-20180717144149-af8b230fcd20/go.mod h1:YARuvh7BUWHNhzDq2OM5tzR2RiCcN2D7sapiKyCel/M=
|
github.com/pquerna/ffjson v0.0.0-20180717144149-af8b230fcd20/go.mod h1:YARuvh7BUWHNhzDq2OM5tzR2RiCcN2D7sapiKyCel/M=
|
||||||
github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw=
|
|
||||||
github.com/prometheus/client_golang v0.9.2 h1:awm861/B8OKDd2I/6o1dy3ra4BamzKhYOiGItCeZ740=
|
github.com/prometheus/client_golang v0.9.2 h1:awm861/B8OKDd2I/6o1dy3ra4BamzKhYOiGItCeZ740=
|
||||||
github.com/prometheus/client_golang v0.9.2/go.mod h1:OsXs2jCmiKlQ1lTBmv21f2mNfw4xf/QclQDMrYNZzcM=
|
github.com/prometheus/client_golang v0.9.2/go.mod h1:OsXs2jCmiKlQ1lTBmv21f2mNfw4xf/QclQDMrYNZzcM=
|
||||||
|
github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910 h1:idejC8f05m9MGOsuEi1ATq9shN03HrxNkD/luQvxCv8=
|
||||||
github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo=
|
github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo=
|
||||||
github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90 h1:S/YWwWx/RA8rT8tKFRuGUZhuA90OyIBpPCXkcbwU8DE=
|
github.com/prometheus/common v0.0.0-20181126121408-4724e9255275 h1:PnBWHBf+6L0jOqq0gIVUe6Yk0/QMZ640k6NvkxcBf+8=
|
||||||
github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
|
|
||||||
github.com/prometheus/common v0.0.0-20181126121408-4724e9255275/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro=
|
github.com/prometheus/common v0.0.0-20181126121408-4724e9255275/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro=
|
||||||
github.com/prometheus/common v0.3.0 h1:taZ4h8Tkxv2kNyoSctBvfXEHmBmxrwmIidZTIaHons4=
|
github.com/prometheus/procfs v0.0.0-20181204211112-1dc9a6cbc91a h1:9a8MnZMP0X2nLJdBg+pBmGgkJlSaKC2KaQmTCk1XDtE=
|
||||||
github.com/prometheus/common v0.3.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4=
|
|
||||||
github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
|
|
||||||
github.com/prometheus/procfs v0.0.0-20181204211112-1dc9a6cbc91a/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
|
github.com/prometheus/procfs v0.0.0-20181204211112-1dc9a6cbc91a/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
|
||||||
github.com/prometheus/procfs v0.0.0-20190412120340-e22ddced7142 h1:JO6VBMEDSBX/LT4GKwSdvuFigZNwVD4lkPyUE4BDCKE=
|
|
||||||
github.com/prometheus/procfs v0.0.0-20190412120340-e22ddced7142/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA=
|
|
||||||
github.com/remyoudompheng/bigfft v0.0.0-20170806203942-52369c62f446/go.mod h1:uYEyJGbgTkfkS4+E/PavXkNJcbFIpEtjt2B0KDQ5+9M=
|
github.com/remyoudompheng/bigfft v0.0.0-20170806203942-52369c62f446/go.mod h1:uYEyJGbgTkfkS4+E/PavXkNJcbFIpEtjt2B0KDQ5+9M=
|
||||||
github.com/sirupsen/logrus v1.2.0 h1:juTguoYk5qI21pwyTXY3B3Y5cOTH3ZUyZCg1v/mihuo=
|
github.com/sirupsen/logrus v1.2.0 h1:juTguoYk5qI21pwyTXY3B3Y5cOTH3ZUyZCg1v/mihuo=
|
||||||
github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo=
|
github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo=
|
||||||
@ -208,16 +160,10 @@ github.com/spf13/cobra v0.0.3 h1:ZlrZ4XsMRm04Fr5pSFxBgfND2EBVa1nLpiy1stUsX/8=
|
|||||||
github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ=
|
github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ=
|
||||||
github.com/spf13/pflag v1.0.1 h1:aCvUg6QPl3ibpQUxyLkrEkCHtPqYJL4x9AuhqVqFis4=
|
github.com/spf13/pflag v1.0.1 h1:aCvUg6QPl3ibpQUxyLkrEkCHtPqYJL4x9AuhqVqFis4=
|
||||||
github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
|
github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
|
||||||
github.com/spf13/pflag v1.0.3 h1:zPAT6CGy6wXeQ7NtTnaTerfKOsV6V6F8agHXFiazDkg=
|
|
||||||
github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
|
|
||||||
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.1 h1:2vfRuCMp5sSVIDSqO8oNnWJq7mPa6KVP3iPIwFBuy8A=
|
github.com/stretchr/objx v0.1.1 h1:2vfRuCMp5sSVIDSqO8oNnWJq7mPa6KVP3iPIwFBuy8A=
|
||||||
github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||||
github.com/stretchr/testify v1.2.2 h1:bSDNvY7ZPG5RlJ8otE/7V6gMiyenm9RtJ7IUVIAoJ1w=
|
github.com/stretchr/testify v1.2.2 h1:bSDNvY7ZPG5RlJ8otE/7V6gMiyenm9RtJ7IUVIAoJ1w=
|
||||||
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
|
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
|
||||||
github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q=
|
|
||||||
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
|
|
||||||
github.com/tinylib/msgp v1.1.0 h1:9fQd+ICuRIu/ue4vxJZu6/LzxN0HwMds2nq/0cFvxHU=
|
github.com/tinylib/msgp v1.1.0 h1:9fQd+ICuRIu/ue4vxJZu6/LzxN0HwMds2nq/0cFvxHU=
|
||||||
github.com/tinylib/msgp v1.1.0/go.mod h1:+d+yLhGm8mzTaHzB+wgMYrodPfmZrzkirds8fDWklFE=
|
github.com/tinylib/msgp v1.1.0/go.mod h1:+d+yLhGm8mzTaHzB+wgMYrodPfmZrzkirds8fDWklFE=
|
||||||
github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8 h1:ndzgwNDnKIqyCvHTXaCqh9KlOWKvBry6nuXMJmonVsE=
|
github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8 h1:ndzgwNDnKIqyCvHTXaCqh9KlOWKvBry6nuXMJmonVsE=
|
||||||
@ -236,58 +182,37 @@ golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnf
|
|||||||
golang.org/x/crypto v0.0.0-20181025213731-e84da0312774/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
|
golang.org/x/crypto v0.0.0-20181025213731-e84da0312774/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
|
||||||
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2 h1:VklqNMn3ovrHsnt90PveolxSbWFaJdECFbxSq0Mqo2M=
|
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2 h1:VklqNMn3ovrHsnt90PveolxSbWFaJdECFbxSq0Mqo2M=
|
||||||
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
||||||
golang.org/x/crypto v0.0.0-20190411191339-88737f569e3a h1:Igim7XhdOpBnWPuYJ70XcNpq8q3BCACtVgNfoJxOV7g=
|
|
||||||
golang.org/x/crypto v0.0.0-20190411191339-88737f569e3a/go.mod h1:WFFai1msRO1wXaEeE5yQxYXgSfI8pQAWXbQop6sCtWE=
|
|
||||||
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-20190125153040-c74c464bbbf2/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
|
||||||
golang.org/x/exp v0.0.0-20190312203227-4b39c73a6495/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8=
|
golang.org/x/exp v0.0.0-20190312203227-4b39c73a6495/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8=
|
||||||
golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js=
|
golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js=
|
||||||
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
|
|
||||||
golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU=
|
|
||||||
golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
|
golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
|
||||||
golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE=
|
golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE=
|
||||||
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/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=
|
|
||||||
golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||||
golang.org/x/net v0.0.0-20181005035420-146acd28ed58/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
golang.org/x/net v0.0.0-20181005035420-146acd28ed58/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||||
golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
|
||||||
golang.org/x/net v0.0.0-20181201002055-351d144fa1fc/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
golang.org/x/net v0.0.0-20181201002055-351d144fa1fc/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||||
golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
|
||||||
golang.org/x/net v0.0.0-20190206173232-65e2d4e15006/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
golang.org/x/net v0.0.0-20190206173232-65e2d4e15006/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||||
golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
|
||||||
golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
||||||
golang.org/x/net v0.0.0-20190415100556-4a65cf94b679 h1:tzVWzOrXxwAwdSCMrf+mbNrZFxwS0+HLP4m2qxtfdhk=
|
golang.org/x/net v0.0.0-20190415100556-4a65cf94b679 h1:tzVWzOrXxwAwdSCMrf+mbNrZFxwS0+HLP4m2qxtfdhk=
|
||||||
golang.org/x/net v0.0.0-20190415100556-4a65cf94b679/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
golang.org/x/net v0.0.0-20190415100556-4a65cf94b679/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
||||||
golang.org/x/oauth2 v0.0.0-20170412232759-a6bd8cefa181/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
|
golang.org/x/oauth2 v0.0.0-20170412232759-a6bd8cefa181/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
|
||||||
|
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be h1:vEDujvNQGv4jgYKudGeI/+DAX4Jffq6hpD55MmoEvKs=
|
||||||
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
|
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
|
||||||
golang.org/x/oauth2 v0.0.0-20190402181905-9f3314589c9a h1:tImsplftrFpALCYumobsd0K86vlAs/eXGFms2txfJfA=
|
|
||||||
golang.org/x/oauth2 v0.0.0-20190402181905-9f3314589c9a/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
|
|
||||||
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||||
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f h1:Bl/8QSvNqXvPGPGXa2z5xUTmV7VDcZyvRZ+QQXkXTZQ=
|
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f h1:Bl/8QSvNqXvPGPGXa2z5xUTmV7VDcZyvRZ+QQXkXTZQ=
|
||||||
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||||
golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
|
||||||
golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
|
||||||
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
|
||||||
golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||||
golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||||
golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
|
||||||
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||||
golang.org/x/sys v0.0.0-20190312061237-fead79001313 h1:pczuHS43Cp2ktBEEmLwScxgjWsBSzdaQiKzUyf3DTTc=
|
golang.org/x/sys v0.0.0-20190312061237-fead79001313 h1:pczuHS43Cp2ktBEEmLwScxgjWsBSzdaQiKzUyf3DTTc=
|
||||||
golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
golang.org/x/sys v0.0.0-20190403152447-81d4e9dc473e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
|
||||||
golang.org/x/sys v0.0.0-20190415081028-16da32be82c5 h1:UMbOtg4ZL2GyTAolLE9QfNvzskWvFkI935Z98i9moXA=
|
|
||||||
golang.org/x/sys v0.0.0-20190415081028-16da32be82c5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
|
||||||
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||||
golang.org/x/text v0.3.1-0.20181227161524-e6919f6577db h1:6/JqlYfC1CCaLnGceQTI+sDGhC9UBSPAsBqI0Gun6kU=
|
golang.org/x/text v0.3.1-0.20181227161524-e6919f6577db h1:6/JqlYfC1CCaLnGceQTI+sDGhC9UBSPAsBqI0Gun6kU=
|
||||||
golang.org/x/text v0.3.1-0.20181227161524-e6919f6577db/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
|
golang.org/x/text v0.3.1-0.20181227161524-e6919f6577db/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
|
||||||
|
golang.org/x/time v0.0.0-20161028155119-f51c12702a4d h1:TnM+PKb3ylGmZvyPXmo9m/wktg7Jn/a/fNmr33HSj8g=
|
||||||
golang.org/x/time v0.0.0-20161028155119-f51c12702a4d/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
golang.org/x/time v0.0.0-20161028155119-f51c12702a4d/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
||||||
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4 h1:SvFZT6jyqRaOeXpc5h/JSfZenJ2O330aBsf7JfSUXmQ=
|
|
||||||
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
|
||||||
golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
|
||||||
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||||
golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
|
||||||
golang.org/x/tools v0.0.0-20190206041539-40960b6deb8e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
golang.org/x/tools v0.0.0-20190206041539-40960b6deb8e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||||
golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY=
|
|
||||||
golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
|
golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
|
||||||
golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
|
golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
|
||||||
golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
|
golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
|
||||||
@ -295,38 +220,28 @@ gonum.org/v1/gonum v0.0.0-20190331200053-3d26580ed485/go.mod h1:2ltnJ7xHfj0zHS40
|
|||||||
gonum.org/v1/netlib v0.0.0-20190313105609-8cb42192e0e0/go.mod h1:wa6Ws7BG/ESfp6dHfk7C6KdzKA7wR7u/rKwOGE66zvw=
|
gonum.org/v1/netlib v0.0.0-20190313105609-8cb42192e0e0/go.mod h1:wa6Ws7BG/ESfp6dHfk7C6KdzKA7wR7u/rKwOGE66zvw=
|
||||||
gonum.org/v1/netlib v0.0.0-20190331212654-76723241ea4e/go.mod h1:kS+toOQn6AQKjmKJ7gzohV1XkqsFehRA2FbsbkopSuQ=
|
gonum.org/v1/netlib v0.0.0-20190331212654-76723241ea4e/go.mod h1:kS+toOQn6AQKjmKJ7gzohV1XkqsFehRA2FbsbkopSuQ=
|
||||||
google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
|
google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
|
||||||
google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
|
|
||||||
google.golang.org/appengine v1.5.0 h1:KxkO13IPW4Lslp2bz+KHP2E3gtFlrIGNThxkZQ3g+4c=
|
google.golang.org/appengine v1.5.0 h1:KxkO13IPW4Lslp2bz+KHP2E3gtFlrIGNThxkZQ3g+4c=
|
||||||
google.golang.org/appengine v1.5.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/genproto v0.0.0-20170731182057-09f6ed296fc6/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
|
google.golang.org/genproto v0.0.0-20170731182057-09f6ed296fc6/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
|
||||||
google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8 h1:Nw54tB0rB7hY/N0NQvRW8DG4Yk3Q6T9cu9RcFQDu1tc=
|
google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8 h1:Nw54tB0rB7hY/N0NQvRW8DG4Yk3Q6T9cu9RcFQDu1tc=
|
||||||
google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
|
google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
|
||||||
google.golang.org/genproto v0.0.0-20190404172233-64821d5d2107 h1:xtNn7qFlagY2mQNFHMSRPjT2RkOV4OXM7P5TVy9xATo=
|
|
||||||
google.golang.org/genproto v0.0.0-20190404172233-64821d5d2107/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
|
|
||||||
google.golang.org/grpc v1.13.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw=
|
google.golang.org/grpc v1.13.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw=
|
||||||
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
|
|
||||||
google.golang.org/grpc v1.20.0 h1:DlsSIrgEBuZAUFJcta2B5i/lzeHHbnfkNFAfFXLVFYQ=
|
google.golang.org/grpc v1.20.0 h1:DlsSIrgEBuZAUFJcta2B5i/lzeHHbnfkNFAfFXLVFYQ=
|
||||||
google.golang.org/grpc v1.20.0/go.mod h1:chYK+tFQF0nDUGJgXMSgLCQk3phJEuONr2DCgLDdAQM=
|
google.golang.org/grpc v1.20.0/go.mod h1:chYK+tFQF0nDUGJgXMSgLCQk3phJEuONr2DCgLDdAQM=
|
||||||
gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw=
|
|
||||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
|
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/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||||
gopkg.in/fsnotify.v1 v1.4.7 h1:xOHLXZwVvI9hhs+cLKq5+I5onOuwQLhQwiu63xxlHs4=
|
gopkg.in/fsnotify.v1 v1.4.7 h1:xOHLXZwVvI9hhs+cLKq5+I5onOuwQLhQwiu63xxlHs4=
|
||||||
gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys=
|
gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys=
|
||||||
gopkg.in/inf.v0 v0.9.0 h1:3zYtXIO92bvsdS3ggAdA8Gb4Azj0YU+TVY1uGYNFA8o=
|
gopkg.in/inf.v0 v0.9.0 h1:3zYtXIO92bvsdS3ggAdA8Gb4Azj0YU+TVY1uGYNFA8o=
|
||||||
gopkg.in/inf.v0 v0.9.0/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw=
|
gopkg.in/inf.v0 v0.9.0/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw=
|
||||||
gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc=
|
|
||||||
gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw=
|
|
||||||
gopkg.in/natefinch/lumberjack.v2 v2.0.0-20150622162204-20b71e5b60d7/go.mod h1:l0ndWWf7gzL7RNwBG7wST/UCcT4T24xpD6X8LsfU/+k=
|
gopkg.in/natefinch/lumberjack.v2 v2.0.0-20150622162204-20b71e5b60d7/go.mod h1:l0ndWWf7gzL7RNwBG7wST/UCcT4T24xpD6X8LsfU/+k=
|
||||||
|
gopkg.in/square/go-jose.v2 v2.0.0-20180411045311-89060dee6a84 h1:ELQJ5WuT+ydETLCpWvAuw8iGBQRGoJq+A3RAbbAcZUY=
|
||||||
gopkg.in/square/go-jose.v2 v2.0.0-20180411045311-89060dee6a84/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI=
|
gopkg.in/square/go-jose.v2 v2.0.0-20180411045311-89060dee6a84/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI=
|
||||||
gopkg.in/square/go-jose.v2 v2.3.1 h1:SK5KegNXmKmqE342YYN2qPHEnUYeoMiXXl1poUlI+o4=
|
|
||||||
gopkg.in/square/go-jose.v2 v2.3.1/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI=
|
|
||||||
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ=
|
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ=
|
||||||
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw=
|
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw=
|
||||||
gopkg.in/yaml.v1 v1.0.0-20140924161607-9f9df34309c0/go.mod h1:WDnlLJ4WF5VGsH/HVa3CI79GS0ol3YnhVnKP89i0kNg=
|
gopkg.in/yaml.v1 v1.0.0-20140924161607-9f9df34309c0/go.mod h1:WDnlLJ4WF5VGsH/HVa3CI79GS0ol3YnhVnKP89i0kNg=
|
||||||
gopkg.in/yaml.v2 v2.2.1 h1:mUhvW9EsL+naU5Q3cakzfE91YhliOondGd6ZrsDBHQE=
|
gopkg.in/yaml.v2 v2.2.1 h1:mUhvW9EsL+naU5Q3cakzfE91YhliOondGd6ZrsDBHQE=
|
||||||
gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||||
gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw=
|
|
||||||
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
|
||||||
gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw=
|
gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw=
|
||||||
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
|
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
|
||||||
k8s.io/api v0.0.0-20190415132514-c2f1300cac21 h1:XGJCFakX0XXD6V2frIsafsr96sDU1q6Gcvm2JaFQVyM=
|
k8s.io/api v0.0.0-20190415132514-c2f1300cac21 h1:XGJCFakX0XXD6V2frIsafsr96sDU1q6Gcvm2JaFQVyM=
|
||||||
@ -353,8 +268,6 @@ k8s.io/csi-translation-lib v0.0.0-20190415134207-82f1dfd98d10/go.mod h1:L35fSWHA
|
|||||||
k8s.io/gengo v0.0.0-20190116091435-f8a0810f38af/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0=
|
k8s.io/gengo v0.0.0-20190116091435-f8a0810f38af/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0=
|
||||||
k8s.io/klog v0.0.0-20190306015804-8e90cee79f82 h1:SHucoAy7lRb+w5oC/hbXyZg+zX+Wftn6hD4tGzHCVqA=
|
k8s.io/klog v0.0.0-20190306015804-8e90cee79f82 h1:SHucoAy7lRb+w5oC/hbXyZg+zX+Wftn6hD4tGzHCVqA=
|
||||||
k8s.io/klog v0.0.0-20190306015804-8e90cee79f82/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk=
|
k8s.io/klog v0.0.0-20190306015804-8e90cee79f82/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk=
|
||||||
k8s.io/klog v0.3.0 h1:0VPpR+sizsiivjIfIAQH/rl8tan6jvWkS7lU+0di3lE=
|
|
||||||
k8s.io/klog v0.3.0/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk=
|
|
||||||
k8s.io/kube-aggregator v0.0.0-20190415133304-80ce4e5a0cbc h1:My3QUoguktKeT5UYet1WNr9Mw4noRGlCHHsKnGzHsBI=
|
k8s.io/kube-aggregator v0.0.0-20190415133304-80ce4e5a0cbc h1:My3QUoguktKeT5UYet1WNr9Mw4noRGlCHHsKnGzHsBI=
|
||||||
k8s.io/kube-aggregator v0.0.0-20190415133304-80ce4e5a0cbc/go.mod h1:T/aMpr/6zvgjgJIumGJ+E8XhJCDwJH0hRfExeZJ1IJM=
|
k8s.io/kube-aggregator v0.0.0-20190415133304-80ce4e5a0cbc/go.mod h1:T/aMpr/6zvgjgJIumGJ+E8XhJCDwJH0hRfExeZJ1IJM=
|
||||||
k8s.io/kube-openapi v0.0.0-20190228160746-b3a7cee44a30 h1:TRb4wNWoBVrH9plmkp2q86FIDppkbrEXdXlxU3a3BMI=
|
k8s.io/kube-openapi v0.0.0-20190228160746-b3a7cee44a30 h1:TRb4wNWoBVrH9plmkp2q86FIDppkbrEXdXlxU3a3BMI=
|
||||||
|
|||||||
11
vendor/github.com/PuerkitoBio/purell/.travis.yml
generated
vendored
11
vendor/github.com/PuerkitoBio/purell/.travis.yml
generated
vendored
@ -1,12 +1,7 @@
|
|||||||
language: go
|
language: go
|
||||||
|
|
||||||
go:
|
go:
|
||||||
- 1.4.x
|
- 1.4
|
||||||
- 1.5.x
|
- 1.5
|
||||||
- 1.6.x
|
- 1.6
|
||||||
- 1.7.x
|
|
||||||
- 1.8.x
|
|
||||||
- 1.9.x
|
|
||||||
- "1.10.x"
|
|
||||||
- "1.11.x"
|
|
||||||
- tip
|
- tip
|
||||||
|
|||||||
3
vendor/github.com/PuerkitoBio/purell/README.md
generated
vendored
3
vendor/github.com/PuerkitoBio/purell/README.md
generated
vendored
@ -4,7 +4,7 @@ Purell is a tiny Go library to normalize URLs. It returns a pure URL. Pure-ell.
|
|||||||
|
|
||||||
Based on the [wikipedia paper][wiki] and the [RFC 3986 document][rfc].
|
Based on the [wikipedia paper][wiki] and the [RFC 3986 document][rfc].
|
||||||
|
|
||||||
[](http://travis-ci.org/PuerkitoBio/purell)
|
[](http://travis-ci.org/PuerkitoBio/purell)
|
||||||
|
|
||||||
## Install
|
## Install
|
||||||
|
|
||||||
@ -12,7 +12,6 @@ Based on the [wikipedia paper][wiki] and the [RFC 3986 document][rfc].
|
|||||||
|
|
||||||
## Changelog
|
## Changelog
|
||||||
|
|
||||||
* **v1.1.1** : Fix failing test due to Go1.12 changes (thanks to @ianlancetaylor).
|
|
||||||
* **2016-11-14 (v1.1.0)** : IDN: Conform to RFC 5895: Fold character width (thanks to @beeker1121).
|
* **2016-11-14 (v1.1.0)** : IDN: Conform to RFC 5895: Fold character width (thanks to @beeker1121).
|
||||||
* **2016-07-27 (v1.0.0)** : Normalize IDN to ASCII (thanks to @zenovich).
|
* **2016-07-27 (v1.0.0)** : Normalize IDN to ASCII (thanks to @zenovich).
|
||||||
* **2015-02-08** : Add fix for relative paths issue ([PR #5][pr5]) and add fix for unnecessary encoding of reserved characters ([see issue #7][iss7]).
|
* **2015-02-08** : Add fix for relative paths issue ([PR #5][pr5]) and add fix for unnecessary encoding of reserved characters ([see issue #7][iss7]).
|
||||||
|
|||||||
2
vendor/github.com/PuerkitoBio/purell/purell.go
generated
vendored
2
vendor/github.com/PuerkitoBio/purell/purell.go
generated
vendored
@ -299,7 +299,7 @@ func sortQuery(u *url.URL) {
|
|||||||
if len(q) > 0 {
|
if len(q) > 0 {
|
||||||
arKeys := make([]string, len(q))
|
arKeys := make([]string, len(q))
|
||||||
i := 0
|
i := 0
|
||||||
for k := range q {
|
for k, _ := range q {
|
||||||
arKeys[i] = k
|
arKeys[i] = k
|
||||||
i++
|
i++
|
||||||
}
|
}
|
||||||
|
|||||||
11
vendor/github.com/docker/spdystream/connection.go
generated
vendored
11
vendor/github.com/docker/spdystream/connection.go
generated
vendored
@ -14,7 +14,7 @@ import (
|
|||||||
|
|
||||||
var (
|
var (
|
||||||
ErrInvalidStreamId = errors.New("Invalid stream id")
|
ErrInvalidStreamId = errors.New("Invalid stream id")
|
||||||
ErrTimeout = errors.New("Timeout occurred")
|
ErrTimeout = errors.New("Timeout occured")
|
||||||
ErrReset = errors.New("Stream reset")
|
ErrReset = errors.New("Stream reset")
|
||||||
ErrWriteClosedStream = errors.New("Write on closed stream")
|
ErrWriteClosedStream = errors.New("Write on closed stream")
|
||||||
)
|
)
|
||||||
@ -325,7 +325,7 @@ Loop:
|
|||||||
readFrame, err := s.framer.ReadFrame()
|
readFrame, err := s.framer.ReadFrame()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if err != io.EOF {
|
if err != io.EOF {
|
||||||
debugMessage("frame read error: %s", err)
|
fmt.Errorf("frame read error: %s", err)
|
||||||
} else {
|
} else {
|
||||||
debugMessage("(%p) EOF received", s)
|
debugMessage("(%p) EOF received", s)
|
||||||
}
|
}
|
||||||
@ -421,7 +421,7 @@ func (s *Connection) frameHandler(frameQueue *PriorityFrameQueue, newHandler Str
|
|||||||
}
|
}
|
||||||
|
|
||||||
if frameErr != nil {
|
if frameErr != nil {
|
||||||
debugMessage("frame handling error: %s", frameErr)
|
fmt.Errorf("frame handling error: %s", frameErr)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -451,7 +451,6 @@ func (s *Connection) addStreamFrame(frame *spdy.SynStreamFrame) {
|
|||||||
dataChan: make(chan []byte),
|
dataChan: make(chan []byte),
|
||||||
headerChan: make(chan http.Header),
|
headerChan: make(chan http.Header),
|
||||||
closeChan: make(chan bool),
|
closeChan: make(chan bool),
|
||||||
priority: frame.Priority,
|
|
||||||
}
|
}
|
||||||
if frame.CFHeader.Flags&spdy.ControlFlagFin != 0x00 {
|
if frame.CFHeader.Flags&spdy.ControlFlagFin != 0x00 {
|
||||||
stream.closeRemoteChannels()
|
stream.closeRemoteChannels()
|
||||||
@ -474,7 +473,7 @@ func (s *Connection) checkStreamFrame(frame *spdy.SynStreamFrame) bool {
|
|||||||
go func() {
|
go func() {
|
||||||
resetErr := s.sendResetFrame(spdy.ProtocolError, frame.StreamId)
|
resetErr := s.sendResetFrame(spdy.ProtocolError, frame.StreamId)
|
||||||
if resetErr != nil {
|
if resetErr != nil {
|
||||||
debugMessage("reset error: %s", resetErr)
|
fmt.Errorf("reset error: %s", resetErr)
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
return false
|
return false
|
||||||
@ -719,7 +718,7 @@ func (s *Connection) shutdown(closeTimeout time.Duration) {
|
|||||||
select {
|
select {
|
||||||
case err, ok := <-s.shutdownChan:
|
case err, ok := <-s.shutdownChan:
|
||||||
if ok {
|
if ok {
|
||||||
debugMessage("Unhandled close error after %s: %s", duration, err)
|
fmt.Errorf("Unhandled close error after %s: %s", duration, err)
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
}
|
}
|
||||||
|
|||||||
4
vendor/github.com/docker/spdystream/handlers.go
generated
vendored
4
vendor/github.com/docker/spdystream/handlers.go
generated
vendored
@ -30,7 +30,9 @@ func MirrorStreamHandler(stream *Stream) {
|
|||||||
}()
|
}()
|
||||||
}
|
}
|
||||||
|
|
||||||
// NoopStreamHandler does nothing when stream connects.
|
// NoopStreamHandler does nothing when stream connects, most
|
||||||
|
// likely used with RejectAuthHandler which will not allow any
|
||||||
|
// streams to make it to the stream handler.
|
||||||
func NoOpStreamHandler(stream *Stream) {
|
func NoOpStreamHandler(stream *Stream) {
|
||||||
stream.SendReply(http.Header{}, false)
|
stream.SendReply(http.Header{}, false)
|
||||||
}
|
}
|
||||||
|
|||||||
42
vendor/github.com/emicklei/go-restful/CHANGES.md
generated
vendored
42
vendor/github.com/emicklei/go-restful/CHANGES.md
generated
vendored
@ -1,44 +1,6 @@
|
|||||||
## Change history of go-restful
|
Change history of go-restful
|
||||||
|
=
|
||||||
|
|
||||||
v2.9.2
|
|
||||||
|
|
||||||
- Reduce allocations in per-request methods to improve performance (#395)
|
|
||||||
|
|
||||||
v2.9.1
|
|
||||||
|
|
||||||
- Fix issue with default responses and invalid status code 0. (#393)
|
|
||||||
|
|
||||||
v2.9.0
|
|
||||||
|
|
||||||
- add per Route content encoding setting (overrides container setting)
|
|
||||||
|
|
||||||
v2.8.0
|
|
||||||
|
|
||||||
- add Request.QueryParameters()
|
|
||||||
- add json-iterator (via build tag)
|
|
||||||
- disable vgo module (until log is moved)
|
|
||||||
|
|
||||||
v2.7.1
|
|
||||||
|
|
||||||
- add vgo module
|
|
||||||
|
|
||||||
v2.6.1
|
|
||||||
|
|
||||||
- add JSONNewDecoderFunc to allow custom JSON Decoder usage (go 1.10+)
|
|
||||||
|
|
||||||
v2.6.0
|
|
||||||
|
|
||||||
- Make JSR 311 routing and path param processing consistent
|
|
||||||
- Adding description to RouteBuilder.Reads()
|
|
||||||
- Update example for Swagger12 and OpenAPI
|
|
||||||
|
|
||||||
2017-09-13
|
|
||||||
|
|
||||||
- added route condition functions using `.If(func)` in route building.
|
|
||||||
|
|
||||||
2017-02-16
|
2017-02-16
|
||||||
|
|
||||||
- solved issue #304, make operation names unique
|
- solved issue #304, make operation names unique
|
||||||
|
|
||||||
2017-01-30
|
2017-01-30
|
||||||
|
|||||||
20
vendor/github.com/emicklei/go-restful/README.md
generated
vendored
20
vendor/github.com/emicklei/go-restful/README.md
generated
vendored
@ -56,33 +56,19 @@ func (u UserResource) findUser(request *restful.Request, response *restful.Respo
|
|||||||
- Content encoding (gzip,deflate) of request and response payloads
|
- Content encoding (gzip,deflate) of request and response payloads
|
||||||
- Automatic responses on OPTIONS (using a filter)
|
- Automatic responses on OPTIONS (using a filter)
|
||||||
- Automatic CORS request handling (using a filter)
|
- Automatic CORS request handling (using a filter)
|
||||||
- API declaration for Swagger UI ([go-restful-openapi](https://github.com/emicklei/go-restful-openapi), see [go-restful-swagger12](https://github.com/emicklei/go-restful-swagger12))
|
- API declaration for Swagger UI (see [go-restful-swagger12](https://github.com/emicklei/go-restful-swagger12),[go-restful-openapi](https://github.com/emicklei/go-restful-openapi))
|
||||||
- Panic recovery to produce HTTP 500, customizable using RecoverHandler(...)
|
- Panic recovery to produce HTTP 500, customizable using RecoverHandler(...)
|
||||||
- Route errors produce HTTP 404/405/406/415 errors, customizable using ServiceErrorHandler(...)
|
- Route errors produce HTTP 404/405/406/415 errors, customizable using ServiceErrorHandler(...)
|
||||||
- Configurable (trace) logging
|
- Configurable (trace) logging
|
||||||
- Customizable gzip/deflate readers and writers using CompressorProvider registration
|
- Customizable gzip/deflate readers and writers using CompressorProvider registration
|
||||||
|
|
||||||
## How to customize
|
### Resources
|
||||||
There are several hooks to customize the behavior of the go-restful package.
|
|
||||||
|
|
||||||
- Router algorithm
|
|
||||||
- Panic recovery
|
|
||||||
- JSON decoder
|
|
||||||
- Trace logging
|
|
||||||
- Compression
|
|
||||||
- Encoders for other serializers
|
|
||||||
- Use [jsoniter](https://github.com/json-iterator/go) by build this package using a tag, e.g. `go build -tags=jsoniter .`
|
|
||||||
|
|
||||||
TODO: write examples of these.
|
|
||||||
|
|
||||||
## Resources
|
|
||||||
|
|
||||||
- [Example posted on blog](http://ernestmicklei.com/2012/11/go-restful-first-working-example/)
|
- [Example posted on blog](http://ernestmicklei.com/2012/11/go-restful-first-working-example/)
|
||||||
- [Design explained on blog](http://ernestmicklei.com/2012/11/go-restful-api-design/)
|
- [Design explained on blog](http://ernestmicklei.com/2012/11/go-restful-api-design/)
|
||||||
- [sourcegraph](https://sourcegraph.com/github.com/emicklei/go-restful)
|
- [sourcegraph](https://sourcegraph.com/github.com/emicklei/go-restful)
|
||||||
- [showcase: Zazkia - tcp proxy for testing resiliency](https://github.com/emicklei/zazkia)
|
|
||||||
- [showcase: Mora - MongoDB REST Api server](https://github.com/emicklei/mora)
|
- [showcase: Mora - MongoDB REST Api server](https://github.com/emicklei/mora)
|
||||||
|
|
||||||
Type ```git shortlog -s``` for a full list of contributors.
|
Type ```git shortlog -s``` for a full list of contributors.
|
||||||
|
|
||||||
© 2012 - 2018, http://ernestmicklei.com. MIT License. Contributions are welcome.
|
© 2012 - 2017, http://ernestmicklei.com. MIT License. Contributions are welcome.
|
||||||
8
vendor/github.com/emicklei/go-restful/compressors.go
generated
vendored
8
vendor/github.com/emicklei/go-restful/compressors.go
generated
vendored
@ -15,20 +15,20 @@ type CompressorProvider interface {
|
|||||||
// Before using it, call Reset().
|
// Before using it, call Reset().
|
||||||
AcquireGzipWriter() *gzip.Writer
|
AcquireGzipWriter() *gzip.Writer
|
||||||
|
|
||||||
// Releases an acquired *gzip.Writer.
|
// Releases an aqcuired *gzip.Writer.
|
||||||
ReleaseGzipWriter(w *gzip.Writer)
|
ReleaseGzipWriter(w *gzip.Writer)
|
||||||
|
|
||||||
// Returns a *gzip.Reader which needs to be released later.
|
// Returns a *gzip.Reader which needs to be released later.
|
||||||
AcquireGzipReader() *gzip.Reader
|
AcquireGzipReader() *gzip.Reader
|
||||||
|
|
||||||
// Releases an acquired *gzip.Reader.
|
// Releases an aqcuired *gzip.Reader.
|
||||||
ReleaseGzipReader(w *gzip.Reader)
|
ReleaseGzipReader(w *gzip.Reader)
|
||||||
|
|
||||||
// Returns a *zlib.Writer which needs to be released later.
|
// Returns a *zlib.Writer which needs to be released later.
|
||||||
// Before using it, call Reset().
|
// Before using it, call Reset().
|
||||||
AcquireZlibWriter() *zlib.Writer
|
AcquireZlibWriter() *zlib.Writer
|
||||||
|
|
||||||
// Releases an acquired *zlib.Writer.
|
// Releases an aqcuired *zlib.Writer.
|
||||||
ReleaseZlibWriter(w *zlib.Writer)
|
ReleaseZlibWriter(w *zlib.Writer)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -45,7 +45,7 @@ func CurrentCompressorProvider() CompressorProvider {
|
|||||||
return currentCompressorProvider
|
return currentCompressorProvider
|
||||||
}
|
}
|
||||||
|
|
||||||
// SetCompressorProvider sets the actual provider of compressors (zlib or gzip).
|
// CompressorProvider sets the actual provider of compressors (zlib or gzip).
|
||||||
func SetCompressorProvider(p CompressorProvider) {
|
func SetCompressorProvider(p CompressorProvider) {
|
||||||
if p == nil {
|
if p == nil {
|
||||||
panic("cannot set compressor provider to nil")
|
panic("cannot set compressor provider to nil")
|
||||||
|
|||||||
49
vendor/github.com/emicklei/go-restful/container.go
generated
vendored
49
vendor/github.com/emicklei/go-restful/container.go
generated
vendored
@ -97,7 +97,7 @@ func (c *Container) Add(service *WebService) *Container {
|
|||||||
// cannot have duplicate root paths
|
// cannot have duplicate root paths
|
||||||
for _, each := range c.webServices {
|
for _, each := range c.webServices {
|
||||||
if each.RootPath() == service.RootPath() {
|
if each.RootPath() == service.RootPath() {
|
||||||
log.Printf("WebService with duplicate root path detected:['%v']", each)
|
log.Printf("[restful] WebService with duplicate root path detected:['%v']", each)
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -139,8 +139,8 @@ func (c *Container) addHandler(service *WebService, serveMux *http.ServeMux) boo
|
|||||||
|
|
||||||
func (c *Container) Remove(ws *WebService) error {
|
func (c *Container) Remove(ws *WebService) error {
|
||||||
if c.ServeMux == http.DefaultServeMux {
|
if c.ServeMux == http.DefaultServeMux {
|
||||||
errMsg := fmt.Sprintf("cannot remove a WebService from a Container using the DefaultServeMux: ['%v']", ws)
|
errMsg := fmt.Sprintf("[restful] cannot remove a WebService from a Container using the DefaultServeMux: ['%v']", ws)
|
||||||
log.Print(errMsg)
|
log.Printf(errMsg)
|
||||||
return errors.New(errMsg)
|
return errors.New(errMsg)
|
||||||
}
|
}
|
||||||
c.webServicesLock.Lock()
|
c.webServicesLock.Lock()
|
||||||
@ -168,7 +168,7 @@ func (c *Container) Remove(ws *WebService) error {
|
|||||||
// This may be a security issue as it exposes sourcecode information.
|
// This may be a security issue as it exposes sourcecode information.
|
||||||
func logStackOnRecover(panicReason interface{}, httpWriter http.ResponseWriter) {
|
func logStackOnRecover(panicReason interface{}, httpWriter http.ResponseWriter) {
|
||||||
var buffer bytes.Buffer
|
var buffer bytes.Buffer
|
||||||
buffer.WriteString(fmt.Sprintf("recover from panic situation: - %v\r\n", panicReason))
|
buffer.WriteString(fmt.Sprintf("[restful] recover from panic situation: - %v\r\n", panicReason))
|
||||||
for i := 2; ; i += 1 {
|
for i := 2; ; i += 1 {
|
||||||
_, file, line, ok := runtime.Caller(i)
|
_, file, line, ok := runtime.Caller(i)
|
||||||
if !ok {
|
if !ok {
|
||||||
@ -220,6 +220,20 @@ func (c *Container) dispatch(httpWriter http.ResponseWriter, httpRequest *http.R
|
|||||||
}()
|
}()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Detect if compression is needed
|
||||||
|
// assume without compression, test for override
|
||||||
|
if c.contentEncodingEnabled {
|
||||||
|
doCompress, encoding := wantsCompressedResponse(httpRequest)
|
||||||
|
if doCompress {
|
||||||
|
var err error
|
||||||
|
writer, err = NewCompressingResponseWriter(httpWriter, encoding)
|
||||||
|
if err != nil {
|
||||||
|
log.Print("[restful] unable to install compressor: ", err)
|
||||||
|
httpWriter.WriteHeader(http.StatusInternalServerError)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
// Find best match Route ; err is non nil if no match was found
|
// Find best match Route ; err is non nil if no match was found
|
||||||
var webService *WebService
|
var webService *WebService
|
||||||
var route *Route
|
var route *Route
|
||||||
@ -231,26 +245,6 @@ func (c *Container) dispatch(httpWriter http.ResponseWriter, httpRequest *http.R
|
|||||||
c.webServices,
|
c.webServices,
|
||||||
httpRequest)
|
httpRequest)
|
||||||
}()
|
}()
|
||||||
|
|
||||||
// Detect if compression is needed
|
|
||||||
// assume without compression, test for override
|
|
||||||
contentEncodingEnabled := c.contentEncodingEnabled
|
|
||||||
if route != nil && route.contentEncodingEnabled != nil {
|
|
||||||
contentEncodingEnabled = *route.contentEncodingEnabled
|
|
||||||
}
|
|
||||||
if contentEncodingEnabled {
|
|
||||||
doCompress, encoding := wantsCompressedResponse(httpRequest)
|
|
||||||
if doCompress {
|
|
||||||
var err error
|
|
||||||
writer, err = NewCompressingResponseWriter(httpWriter, encoding)
|
|
||||||
if err != nil {
|
|
||||||
log.Print("unable to install compressor: ", err)
|
|
||||||
httpWriter.WriteHeader(http.StatusInternalServerError)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
// a non-200 response has already been written
|
// a non-200 response has already been written
|
||||||
// run container filters anyway ; they should not touch the response...
|
// run container filters anyway ; they should not touch the response...
|
||||||
@ -265,12 +259,7 @@ func (c *Container) dispatch(httpWriter http.ResponseWriter, httpRequest *http.R
|
|||||||
chain.ProcessFilter(NewRequest(httpRequest), NewResponse(writer))
|
chain.ProcessFilter(NewRequest(httpRequest), NewResponse(writer))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
pathProcessor, routerProcessesPath := c.router.(PathProcessor)
|
wrappedRequest, wrappedResponse := route.wrapRequestResponse(writer, httpRequest)
|
||||||
if !routerProcessesPath {
|
|
||||||
pathProcessor = defaultPathProcessor{}
|
|
||||||
}
|
|
||||||
pathParams := pathProcessor.ExtractParameters(route, webService, httpRequest.URL.Path)
|
|
||||||
wrappedRequest, wrappedResponse := route.wrapRequestResponse(writer, httpRequest, pathParams)
|
|
||||||
// pass through filters (if any)
|
// pass through filters (if any)
|
||||||
if len(c.containerFilters)+len(webService.filters)+len(route.Filters) > 0 {
|
if len(c.containerFilters)+len(webService.filters)+len(route.Filters) > 0 {
|
||||||
// compose filter chain
|
// compose filter chain
|
||||||
|
|||||||
4
vendor/github.com/emicklei/go-restful/curly.go
generated
vendored
4
vendor/github.com/emicklei/go-restful/curly.go
generated
vendored
@ -45,14 +45,14 @@ func (c CurlyRouter) SelectRoute(
|
|||||||
|
|
||||||
// selectRoutes return a collection of Route from a WebService that matches the path tokens from the request.
|
// selectRoutes return a collection of Route from a WebService that matches the path tokens from the request.
|
||||||
func (c CurlyRouter) selectRoutes(ws *WebService, requestTokens []string) sortableCurlyRoutes {
|
func (c CurlyRouter) selectRoutes(ws *WebService, requestTokens []string) sortableCurlyRoutes {
|
||||||
candidates := make(sortableCurlyRoutes, 0, 8)
|
candidates := sortableCurlyRoutes{}
|
||||||
for _, each := range ws.routes {
|
for _, each := range ws.routes {
|
||||||
matches, paramCount, staticCount := c.matchesRouteByPathTokens(each.pathParts, requestTokens)
|
matches, paramCount, staticCount := c.matchesRouteByPathTokens(each.pathParts, requestTokens)
|
||||||
if matches {
|
if matches {
|
||||||
candidates.add(curlyRoute{each, paramCount, staticCount}) // TODO make sure Routes() return pointers?
|
candidates.add(curlyRoute{each, paramCount, staticCount}) // TODO make sure Routes() return pointers?
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
sort.Sort(candidates)
|
sort.Sort(sort.Reverse(candidates))
|
||||||
return candidates
|
return candidates
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
16
vendor/github.com/emicklei/go-restful/curly_route.go
generated
vendored
16
vendor/github.com/emicklei/go-restful/curly_route.go
generated
vendored
@ -11,7 +11,6 @@ type curlyRoute struct {
|
|||||||
staticCount int
|
staticCount int
|
||||||
}
|
}
|
||||||
|
|
||||||
// sortableCurlyRoutes orders by most parameters and path elements first.
|
|
||||||
type sortableCurlyRoutes []curlyRoute
|
type sortableCurlyRoutes []curlyRoute
|
||||||
|
|
||||||
func (s *sortableCurlyRoutes) add(route curlyRoute) {
|
func (s *sortableCurlyRoutes) add(route curlyRoute) {
|
||||||
@ -19,7 +18,6 @@ func (s *sortableCurlyRoutes) add(route curlyRoute) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (s sortableCurlyRoutes) routes() (routes []Route) {
|
func (s sortableCurlyRoutes) routes() (routes []Route) {
|
||||||
routes = make([]Route, 0, len(s))
|
|
||||||
for _, each := range s {
|
for _, each := range s {
|
||||||
routes = append(routes, each.route) // TODO change return type
|
routes = append(routes, each.route) // TODO change return type
|
||||||
}
|
}
|
||||||
@ -33,22 +31,22 @@ func (s sortableCurlyRoutes) Swap(i, j int) {
|
|||||||
s[i], s[j] = s[j], s[i]
|
s[i], s[j] = s[j], s[i]
|
||||||
}
|
}
|
||||||
func (s sortableCurlyRoutes) Less(i, j int) bool {
|
func (s sortableCurlyRoutes) Less(i, j int) bool {
|
||||||
a := s[j]
|
ci := s[i]
|
||||||
b := s[i]
|
cj := s[j]
|
||||||
|
|
||||||
// primary key
|
// primary key
|
||||||
if a.staticCount < b.staticCount {
|
if ci.staticCount < cj.staticCount {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
if a.staticCount > b.staticCount {
|
if ci.staticCount > cj.staticCount {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
// secundary key
|
// secundary key
|
||||||
if a.paramCount < b.paramCount {
|
if ci.paramCount < cj.paramCount {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
if a.paramCount > b.paramCount {
|
if ci.paramCount > cj.paramCount {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
return a.route.Path < b.route.Path
|
return ci.route.Path < cj.route.Path
|
||||||
}
|
}
|
||||||
|
|||||||
7
vendor/github.com/emicklei/go-restful/entity_accessors.go
generated
vendored
7
vendor/github.com/emicklei/go-restful/entity_accessors.go
generated
vendored
@ -5,6 +5,7 @@ package restful
|
|||||||
// that can be found in the LICENSE file.
|
// that can be found in the LICENSE file.
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"encoding/json"
|
||||||
"encoding/xml"
|
"encoding/xml"
|
||||||
"strings"
|
"strings"
|
||||||
"sync"
|
"sync"
|
||||||
@ -127,7 +128,7 @@ type entityJSONAccess struct {
|
|||||||
|
|
||||||
// Read unmarshalls the value from JSON
|
// Read unmarshalls the value from JSON
|
||||||
func (e entityJSONAccess) Read(req *Request, v interface{}) error {
|
func (e entityJSONAccess) Read(req *Request, v interface{}) error {
|
||||||
decoder := NewDecoder(req.Request.Body)
|
decoder := json.NewDecoder(req.Request.Body)
|
||||||
decoder.UseNumber()
|
decoder.UseNumber()
|
||||||
return decoder.Decode(v)
|
return decoder.Decode(v)
|
||||||
}
|
}
|
||||||
@ -146,7 +147,7 @@ func writeJSON(resp *Response, status int, contentType string, v interface{}) er
|
|||||||
}
|
}
|
||||||
if resp.prettyPrint {
|
if resp.prettyPrint {
|
||||||
// pretty output must be created and written explicitly
|
// pretty output must be created and written explicitly
|
||||||
output, err := MarshalIndent(v, "", " ")
|
output, err := json.MarshalIndent(v, " ", " ")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
@ -158,5 +159,5 @@ func writeJSON(resp *Response, status int, contentType string, v interface{}) er
|
|||||||
// not-so-pretty
|
// not-so-pretty
|
||||||
resp.Header().Set(HEADER_ContentType, contentType)
|
resp.Header().Set(HEADER_ContentType, contentType)
|
||||||
resp.WriteHeader(status)
|
resp.WriteHeader(status)
|
||||||
return NewEncoder(resp).Encode(v)
|
return json.NewEncoder(resp).Encode(v)
|
||||||
}
|
}
|
||||||
|
|||||||
11
vendor/github.com/emicklei/go-restful/json.go
generated
vendored
11
vendor/github.com/emicklei/go-restful/json.go
generated
vendored
@ -1,11 +0,0 @@
|
|||||||
// +build !jsoniter
|
|
||||||
|
|
||||||
package restful
|
|
||||||
|
|
||||||
import "encoding/json"
|
|
||||||
|
|
||||||
var (
|
|
||||||
MarshalIndent = json.MarshalIndent
|
|
||||||
NewDecoder = json.NewDecoder
|
|
||||||
NewEncoder = json.NewEncoder
|
|
||||||
)
|
|
||||||
12
vendor/github.com/emicklei/go-restful/jsoniter.go
generated
vendored
12
vendor/github.com/emicklei/go-restful/jsoniter.go
generated
vendored
@ -1,12 +0,0 @@
|
|||||||
// +build jsoniter
|
|
||||||
|
|
||||||
package restful
|
|
||||||
|
|
||||||
import "github.com/json-iterator/go"
|
|
||||||
|
|
||||||
var (
|
|
||||||
json = jsoniter.ConfigCompatibleWithStandardLibrary
|
|
||||||
MarshalIndent = json.MarshalIndent
|
|
||||||
NewDecoder = json.NewDecoder
|
|
||||||
NewEncoder = json.NewEncoder
|
|
||||||
)
|
|
||||||
83
vendor/github.com/emicklei/go-restful/jsr311.go
generated
vendored
83
vendor/github.com/emicklei/go-restful/jsr311.go
generated
vendored
@ -39,106 +39,57 @@ func (r RouterJSR311) SelectRoute(
|
|||||||
return dispatcher, route, ok
|
return dispatcher, route, ok
|
||||||
}
|
}
|
||||||
|
|
||||||
// ExtractParameters is used to obtain the path parameters from the route using the same matching
|
|
||||||
// engine as the JSR 311 router.
|
|
||||||
func (r RouterJSR311) ExtractParameters(route *Route, webService *WebService, urlPath string) map[string]string {
|
|
||||||
webServiceExpr := webService.pathExpr
|
|
||||||
webServiceMatches := webServiceExpr.Matcher.FindStringSubmatch(urlPath)
|
|
||||||
pathParameters := r.extractParams(webServiceExpr, webServiceMatches)
|
|
||||||
routeExpr := route.pathExpr
|
|
||||||
routeMatches := routeExpr.Matcher.FindStringSubmatch(webServiceMatches[len(webServiceMatches)-1])
|
|
||||||
routeParams := r.extractParams(routeExpr, routeMatches)
|
|
||||||
for key, value := range routeParams {
|
|
||||||
pathParameters[key] = value
|
|
||||||
}
|
|
||||||
return pathParameters
|
|
||||||
}
|
|
||||||
|
|
||||||
func (RouterJSR311) extractParams(pathExpr *pathExpression, matches []string) map[string]string {
|
|
||||||
params := map[string]string{}
|
|
||||||
for i := 1; i < len(matches); i++ {
|
|
||||||
if len(pathExpr.VarNames) >= i {
|
|
||||||
params[pathExpr.VarNames[i-1]] = matches[i]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return params
|
|
||||||
}
|
|
||||||
|
|
||||||
// http://jsr311.java.net/nonav/releases/1.1/spec/spec3.html#x3-360003.7.2
|
// http://jsr311.java.net/nonav/releases/1.1/spec/spec3.html#x3-360003.7.2
|
||||||
func (r RouterJSR311) detectRoute(routes []Route, httpRequest *http.Request) (*Route, error) {
|
func (r RouterJSR311) detectRoute(routes []Route, httpRequest *http.Request) (*Route, error) {
|
||||||
candidates := make([]*Route, 0, 8)
|
|
||||||
for i, each := range routes {
|
|
||||||
ok := true
|
|
||||||
for _, fn := range each.If {
|
|
||||||
if !fn(httpRequest) {
|
|
||||||
ok = false
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if ok {
|
|
||||||
candidates = append(candidates, &routes[i])
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if len(candidates) == 0 {
|
|
||||||
if trace {
|
|
||||||
traceLogger.Printf("no Route found (from %d) that passes conditional checks", len(routes))
|
|
||||||
}
|
|
||||||
return nil, NewError(http.StatusNotFound, "404: Not Found")
|
|
||||||
}
|
|
||||||
|
|
||||||
// http method
|
// http method
|
||||||
previous := candidates
|
methodOk := []Route{}
|
||||||
candidates = candidates[:0]
|
for _, each := range routes {
|
||||||
for _, each := range previous {
|
|
||||||
if httpRequest.Method == each.Method {
|
if httpRequest.Method == each.Method {
|
||||||
candidates = append(candidates, each)
|
methodOk = append(methodOk, each)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if len(candidates) == 0 {
|
if len(methodOk) == 0 {
|
||||||
if trace {
|
if trace {
|
||||||
traceLogger.Printf("no Route found (in %d routes) that matches HTTP method %s\n", len(previous), httpRequest.Method)
|
traceLogger.Printf("no Route found (in %d routes) that matches HTTP method %s\n", len(routes), httpRequest.Method)
|
||||||
}
|
}
|
||||||
return nil, NewError(http.StatusMethodNotAllowed, "405: Method Not Allowed")
|
return nil, NewError(http.StatusMethodNotAllowed, "405: Method Not Allowed")
|
||||||
}
|
}
|
||||||
|
inputMediaOk := methodOk
|
||||||
|
|
||||||
// content-type
|
// content-type
|
||||||
contentType := httpRequest.Header.Get(HEADER_ContentType)
|
contentType := httpRequest.Header.Get(HEADER_ContentType)
|
||||||
previous = candidates
|
inputMediaOk = []Route{}
|
||||||
candidates = candidates[:0]
|
for _, each := range methodOk {
|
||||||
for _, each := range previous {
|
|
||||||
if each.matchesContentType(contentType) {
|
if each.matchesContentType(contentType) {
|
||||||
candidates = append(candidates, each)
|
inputMediaOk = append(inputMediaOk, each)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if len(candidates) == 0 {
|
if len(inputMediaOk) == 0 {
|
||||||
if trace {
|
if trace {
|
||||||
traceLogger.Printf("no Route found (from %d) that matches HTTP Content-Type: %s\n", len(previous), contentType)
|
traceLogger.Printf("no Route found (from %d) that matches HTTP Content-Type: %s\n", len(methodOk), contentType)
|
||||||
}
|
}
|
||||||
if httpRequest.ContentLength > 0 {
|
|
||||||
return nil, NewError(http.StatusUnsupportedMediaType, "415: Unsupported Media Type")
|
return nil, NewError(http.StatusUnsupportedMediaType, "415: Unsupported Media Type")
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// accept
|
// accept
|
||||||
previous = candidates
|
outputMediaOk := []Route{}
|
||||||
candidates = candidates[:0]
|
|
||||||
accept := httpRequest.Header.Get(HEADER_Accept)
|
accept := httpRequest.Header.Get(HEADER_Accept)
|
||||||
if len(accept) == 0 {
|
if len(accept) == 0 {
|
||||||
accept = "*/*"
|
accept = "*/*"
|
||||||
}
|
}
|
||||||
for _, each := range previous {
|
for _, each := range inputMediaOk {
|
||||||
if each.matchesAccept(accept) {
|
if each.matchesAccept(accept) {
|
||||||
candidates = append(candidates, each)
|
outputMediaOk = append(outputMediaOk, each)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if len(candidates) == 0 {
|
if len(outputMediaOk) == 0 {
|
||||||
if trace {
|
if trace {
|
||||||
traceLogger.Printf("no Route found (from %d) that matches HTTP Accept: %s\n", len(previous), accept)
|
traceLogger.Printf("no Route found (from %d) that matches HTTP Accept: %s\n", len(inputMediaOk), accept)
|
||||||
}
|
}
|
||||||
return nil, NewError(http.StatusNotAcceptable, "406: Not Acceptable")
|
return nil, NewError(http.StatusNotAcceptable, "406: Not Acceptable")
|
||||||
}
|
}
|
||||||
// return r.bestMatchByMedia(outputMediaOk, contentType, accept), nil
|
// return r.bestMatchByMedia(outputMediaOk, contentType, accept), nil
|
||||||
return candidates[0], nil
|
return &outputMediaOk[0], nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// http://jsr311.java.net/nonav/releases/1.1/spec/spec3.html#x3-360003.7.2
|
// http://jsr311.java.net/nonav/releases/1.1/spec/spec3.html#x3-360003.7.2
|
||||||
|
|||||||
2
vendor/github.com/emicklei/go-restful/logger.go
generated
vendored
2
vendor/github.com/emicklei/go-restful/logger.go
generated
vendored
@ -21,7 +21,7 @@ func TraceLogger(logger log.StdLogger) {
|
|||||||
EnableTracing(logger != nil)
|
EnableTracing(logger != nil)
|
||||||
}
|
}
|
||||||
|
|
||||||
// SetLogger exposes the setter for the global logger on the top-level package
|
// expose the setter for the global logger on the top-level package
|
||||||
func SetLogger(customLogger log.StdLogger) {
|
func SetLogger(customLogger log.StdLogger) {
|
||||||
log.SetLogger(customLogger)
|
log.SetLogger(customLogger)
|
||||||
}
|
}
|
||||||
|
|||||||
10
vendor/github.com/emicklei/go-restful/options_filter.go
generated
vendored
10
vendor/github.com/emicklei/go-restful/options_filter.go
generated
vendored
@ -15,15 +15,7 @@ func (c *Container) OPTIONSFilter(req *Request, resp *Response, chain *FilterCha
|
|||||||
chain.ProcessFilter(req, resp)
|
chain.ProcessFilter(req, resp)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
resp.AddHeader(HEADER_Allow, strings.Join(c.computeAllowedMethods(req), ","))
|
||||||
archs := req.Request.Header.Get(HEADER_AccessControlRequestHeaders)
|
|
||||||
methods := strings.Join(c.computeAllowedMethods(req), ",")
|
|
||||||
origin := req.Request.Header.Get(HEADER_Origin)
|
|
||||||
|
|
||||||
resp.AddHeader(HEADER_Allow, methods)
|
|
||||||
resp.AddHeader(HEADER_AccessControlAllowOrigin, origin)
|
|
||||||
resp.AddHeader(HEADER_AccessControlAllowHeaders, archs)
|
|
||||||
resp.AddHeader(HEADER_AccessControlAllowMethods, methods)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// OPTIONSFilter is a filter function that inspects the Http Request for the OPTIONS method
|
// OPTIONSFilter is a filter function that inspects the Http Request for the OPTIONS method
|
||||||
|
|||||||
29
vendor/github.com/emicklei/go-restful/parameter.go
generated
vendored
29
vendor/github.com/emicklei/go-restful/parameter.go
generated
vendored
@ -19,30 +19,8 @@ const (
|
|||||||
|
|
||||||
// FormParameterKind = indicator of Request parameter type "form"
|
// FormParameterKind = indicator of Request parameter type "form"
|
||||||
FormParameterKind
|
FormParameterKind
|
||||||
|
|
||||||
// CollectionFormatCSV comma separated values `foo,bar`
|
|
||||||
CollectionFormatCSV = CollectionFormat("csv")
|
|
||||||
|
|
||||||
// CollectionFormatSSV space separated values `foo bar`
|
|
||||||
CollectionFormatSSV = CollectionFormat("ssv")
|
|
||||||
|
|
||||||
// CollectionFormatTSV tab separated values `foo\tbar`
|
|
||||||
CollectionFormatTSV = CollectionFormat("tsv")
|
|
||||||
|
|
||||||
// CollectionFormatPipes pipe separated values `foo|bar`
|
|
||||||
CollectionFormatPipes = CollectionFormat("pipes")
|
|
||||||
|
|
||||||
// CollectionFormatMulti corresponds to multiple parameter instances instead of multiple values for a single
|
|
||||||
// instance `foo=bar&foo=baz`. This is valid only for QueryParameters and FormParameters
|
|
||||||
CollectionFormatMulti = CollectionFormat("multi")
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type CollectionFormat string
|
|
||||||
|
|
||||||
func (cf CollectionFormat) String() string {
|
|
||||||
return string(cf)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Parameter is for documententing the parameter used in a Http Request
|
// Parameter is for documententing the parameter used in a Http Request
|
||||||
// ParameterData kinds are Path,Query and Body
|
// ParameterData kinds are Path,Query and Body
|
||||||
type Parameter struct {
|
type Parameter struct {
|
||||||
@ -58,7 +36,6 @@ type ParameterData struct {
|
|||||||
AllowableValues map[string]string
|
AllowableValues map[string]string
|
||||||
AllowMultiple bool
|
AllowMultiple bool
|
||||||
DefaultValue string
|
DefaultValue string
|
||||||
CollectionFormat string
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Data returns the state of the Parameter
|
// Data returns the state of the Parameter
|
||||||
@ -135,9 +112,3 @@ func (p *Parameter) Description(doc string) *Parameter {
|
|||||||
p.data.Description = doc
|
p.data.Description = doc
|
||||||
return p
|
return p
|
||||||
}
|
}
|
||||||
|
|
||||||
// CollectionFormat sets the collection format for an array type
|
|
||||||
func (p *Parameter) CollectionFormat(format CollectionFormat) *Parameter {
|
|
||||||
p.data.CollectionFormat = format.String()
|
|
||||||
return p
|
|
||||||
}
|
|
||||||
|
|||||||
13
vendor/github.com/emicklei/go-restful/path_expression.go
generated
vendored
13
vendor/github.com/emicklei/go-restful/path_expression.go
generated
vendored
@ -15,7 +15,6 @@ import (
|
|||||||
// Http request paths and to extract path parameter values.
|
// Http request paths and to extract path parameter values.
|
||||||
type pathExpression struct {
|
type pathExpression struct {
|
||||||
LiteralCount int // the number of literal characters (means those not resulting from template variable substitution)
|
LiteralCount int // the number of literal characters (means those not resulting from template variable substitution)
|
||||||
VarNames []string // the names of parameters (enclosed by {}) in the path
|
|
||||||
VarCount int // the number of named parameters (enclosed by {}) in the path
|
VarCount int // the number of named parameters (enclosed by {}) in the path
|
||||||
Matcher *regexp.Regexp
|
Matcher *regexp.Regexp
|
||||||
Source string // Path as defined by the RouteBuilder
|
Source string // Path as defined by the RouteBuilder
|
||||||
@ -25,16 +24,16 @@ type pathExpression struct {
|
|||||||
// NewPathExpression creates a PathExpression from the input URL path.
|
// NewPathExpression creates a PathExpression from the input URL path.
|
||||||
// Returns an error if the path is invalid.
|
// Returns an error if the path is invalid.
|
||||||
func newPathExpression(path string) (*pathExpression, error) {
|
func newPathExpression(path string) (*pathExpression, error) {
|
||||||
expression, literalCount, varNames, varCount, tokens := templateToRegularExpression(path)
|
expression, literalCount, varCount, tokens := templateToRegularExpression(path)
|
||||||
compiled, err := regexp.Compile(expression)
|
compiled, err := regexp.Compile(expression)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
return &pathExpression{literalCount, varNames, varCount, compiled, expression, tokens}, nil
|
return &pathExpression{literalCount, varCount, compiled, expression, tokens}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// http://jsr311.java.net/nonav/releases/1.1/spec/spec3.html#x3-370003.7.3
|
// http://jsr311.java.net/nonav/releases/1.1/spec/spec3.html#x3-370003.7.3
|
||||||
func templateToRegularExpression(template string) (expression string, literalCount int, varNames []string, varCount int, tokens []string) {
|
func templateToRegularExpression(template string) (expression string, literalCount int, varCount int, tokens []string) {
|
||||||
var buffer bytes.Buffer
|
var buffer bytes.Buffer
|
||||||
buffer.WriteString("^")
|
buffer.WriteString("^")
|
||||||
//tokens = strings.Split(template, "/")
|
//tokens = strings.Split(template, "/")
|
||||||
@ -47,10 +46,8 @@ func templateToRegularExpression(template string) (expression string, literalCou
|
|||||||
if strings.HasPrefix(each, "{") {
|
if strings.HasPrefix(each, "{") {
|
||||||
// check for regular expression in variable
|
// check for regular expression in variable
|
||||||
colon := strings.Index(each, ":")
|
colon := strings.Index(each, ":")
|
||||||
var varName string
|
|
||||||
if colon != -1 {
|
if colon != -1 {
|
||||||
// extract expression
|
// extract expression
|
||||||
varName = strings.TrimSpace(each[1:colon])
|
|
||||||
paramExpr := strings.TrimSpace(each[colon+1 : len(each)-1])
|
paramExpr := strings.TrimSpace(each[colon+1 : len(each)-1])
|
||||||
if paramExpr == "*" { // special case
|
if paramExpr == "*" { // special case
|
||||||
buffer.WriteString("(.*)")
|
buffer.WriteString("(.*)")
|
||||||
@ -59,10 +56,8 @@ func templateToRegularExpression(template string) (expression string, literalCou
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// plain var
|
// plain var
|
||||||
varName = strings.TrimSpace(each[1 : len(each)-1])
|
|
||||||
buffer.WriteString("([^/]+?)")
|
buffer.WriteString("([^/]+?)")
|
||||||
}
|
}
|
||||||
varNames = append(varNames, varName)
|
|
||||||
varCount += 1
|
varCount += 1
|
||||||
} else {
|
} else {
|
||||||
literalCount += len(each)
|
literalCount += len(each)
|
||||||
@ -70,5 +65,5 @@ func templateToRegularExpression(template string) (expression string, literalCou
|
|||||||
buffer.WriteString(regexp.QuoteMeta(encoded))
|
buffer.WriteString(regexp.QuoteMeta(encoded))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return strings.TrimRight(buffer.String(), "/") + "(/.*)?$", literalCount, varNames, varCount, tokens
|
return strings.TrimRight(buffer.String(), "/") + "(/.*)?$", literalCount, varCount, tokens
|
||||||
}
|
}
|
||||||
|
|||||||
63
vendor/github.com/emicklei/go-restful/path_processor.go
generated
vendored
63
vendor/github.com/emicklei/go-restful/path_processor.go
generated
vendored
@ -1,63 +0,0 @@
|
|||||||
package restful
|
|
||||||
|
|
||||||
import (
|
|
||||||
"bytes"
|
|
||||||
"strings"
|
|
||||||
)
|
|
||||||
|
|
||||||
// Copyright 2018 Ernest Micklei. All rights reserved.
|
|
||||||
// Use of this source code is governed by a license
|
|
||||||
// that can be found in the LICENSE file.
|
|
||||||
|
|
||||||
// PathProcessor is extra behaviour that a Router can provide to extract path parameters from the path.
|
|
||||||
// If a Router does not implement this interface then the default behaviour will be used.
|
|
||||||
type PathProcessor interface {
|
|
||||||
// ExtractParameters gets the path parameters defined in the route and webService from the urlPath
|
|
||||||
ExtractParameters(route *Route, webService *WebService, urlPath string) map[string]string
|
|
||||||
}
|
|
||||||
|
|
||||||
type defaultPathProcessor struct{}
|
|
||||||
|
|
||||||
// Extract the parameters from the request url path
|
|
||||||
func (d defaultPathProcessor) ExtractParameters(r *Route, _ *WebService, urlPath string) map[string]string {
|
|
||||||
urlParts := tokenizePath(urlPath)
|
|
||||||
pathParameters := map[string]string{}
|
|
||||||
for i, key := range r.pathParts {
|
|
||||||
var value string
|
|
||||||
if i >= len(urlParts) {
|
|
||||||
value = ""
|
|
||||||
} else {
|
|
||||||
value = urlParts[i]
|
|
||||||
}
|
|
||||||
if strings.HasPrefix(key, "{") { // path-parameter
|
|
||||||
if colon := strings.Index(key, ":"); colon != -1 {
|
|
||||||
// extract by regex
|
|
||||||
regPart := key[colon+1 : len(key)-1]
|
|
||||||
keyPart := key[1:colon]
|
|
||||||
if regPart == "*" {
|
|
||||||
pathParameters[keyPart] = untokenizePath(i, urlParts)
|
|
||||||
break
|
|
||||||
} else {
|
|
||||||
pathParameters[keyPart] = value
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
// without enclosing {}
|
|
||||||
pathParameters[key[1:len(key)-1]] = value
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return pathParameters
|
|
||||||
}
|
|
||||||
|
|
||||||
// Untokenize back into an URL path using the slash separator
|
|
||||||
func untokenizePath(offset int, parts []string) string {
|
|
||||||
var buffer bytes.Buffer
|
|
||||||
for p := offset; p < len(parts); p++ {
|
|
||||||
buffer.WriteString(parts[p])
|
|
||||||
// do not end
|
|
||||||
if p < len(parts)-1 {
|
|
||||||
buffer.WriteString("/")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return buffer.String()
|
|
||||||
}
|
|
||||||
5
vendor/github.com/emicklei/go-restful/request.go
generated
vendored
5
vendor/github.com/emicklei/go-restful/request.go
generated
vendored
@ -51,11 +51,6 @@ func (r *Request) QueryParameter(name string) string {
|
|||||||
return r.Request.FormValue(name)
|
return r.Request.FormValue(name)
|
||||||
}
|
}
|
||||||
|
|
||||||
// QueryParameters returns the all the query parameters values by name
|
|
||||||
func (r *Request) QueryParameters(name string) []string {
|
|
||||||
return r.Request.URL.Query()[name]
|
|
||||||
}
|
|
||||||
|
|
||||||
// BodyParameter parses the body of the request (once for typically a POST or a PUT) and returns the value of the given name or an error.
|
// BodyParameter parses the body of the request (once for typically a POST or a PUT) and returns the value of the given name or an error.
|
||||||
func (r *Request) BodyParameter(name string) (string, error) {
|
func (r *Request) BodyParameter(name string) (string, error) {
|
||||||
err := r.Request.ParseForm()
|
err := r.Request.ParseForm()
|
||||||
|
|||||||
18
vendor/github.com/emicklei/go-restful/response.go
generated
vendored
18
vendor/github.com/emicklei/go-restful/response.go
generated
vendored
@ -5,9 +5,7 @@ package restful
|
|||||||
// that can be found in the LICENSE file.
|
// that can be found in the LICENSE file.
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"bufio"
|
|
||||||
"errors"
|
"errors"
|
||||||
"net"
|
|
||||||
"net/http"
|
"net/http"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -23,17 +21,15 @@ type Response struct {
|
|||||||
http.ResponseWriter
|
http.ResponseWriter
|
||||||
requestAccept string // mime-type what the Http Request says it wants to receive
|
requestAccept string // mime-type what the Http Request says it wants to receive
|
||||||
routeProduces []string // mime-types what the Route says it can produce
|
routeProduces []string // mime-types what the Route says it can produce
|
||||||
statusCode int // HTTP status code that has been written explicitly (if zero then net/http has written 200)
|
statusCode int // HTTP status code that has been written explicity (if zero then net/http has written 200)
|
||||||
contentLength int // number of bytes written for the response body
|
contentLength int // number of bytes written for the response body
|
||||||
prettyPrint bool // controls the indentation feature of XML and JSON serialization. It is initialized using var PrettyPrintResponses.
|
prettyPrint bool // controls the indentation feature of XML and JSON serialization. It is initialized using var PrettyPrintResponses.
|
||||||
err error // err property is kept when WriteError is called
|
err error // err property is kept when WriteError is called
|
||||||
hijacker http.Hijacker // if underlying ResponseWriter supports it
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewResponse creates a new response based on a http ResponseWriter.
|
// NewResponse creates a new response based on a http ResponseWriter.
|
||||||
func NewResponse(httpWriter http.ResponseWriter) *Response {
|
func NewResponse(httpWriter http.ResponseWriter) *Response {
|
||||||
hijacker, _ := httpWriter.(http.Hijacker)
|
return &Response{httpWriter, "", []string{}, http.StatusOK, 0, PrettyPrintResponses, nil} // empty content-types
|
||||||
return &Response{ResponseWriter: httpWriter, routeProduces: []string{}, statusCode: http.StatusOK, prettyPrint: PrettyPrintResponses, hijacker: hijacker}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// DefaultResponseContentType set a default.
|
// DefaultResponseContentType set a default.
|
||||||
@ -52,16 +48,6 @@ func (r Response) InternalServerError() Response {
|
|||||||
return r
|
return r
|
||||||
}
|
}
|
||||||
|
|
||||||
// Hijack implements the http.Hijacker interface. This expands
|
|
||||||
// the Response to fulfill http.Hijacker if the underlying
|
|
||||||
// http.ResponseWriter supports it.
|
|
||||||
func (r *Response) Hijack() (net.Conn, *bufio.ReadWriter, error) {
|
|
||||||
if r.hijacker == nil {
|
|
||||||
return nil, nil, errors.New("http.Hijacker not implemented by underlying http.ResponseWriter")
|
|
||||||
}
|
|
||||||
return r.hijacker.Hijack()
|
|
||||||
}
|
|
||||||
|
|
||||||
// PrettyPrint changes whether this response must produce pretty (line-by-line, indented) JSON or XML output.
|
// PrettyPrint changes whether this response must produce pretty (line-by-line, indented) JSON or XML output.
|
||||||
func (r *Response) PrettyPrint(bePretty bool) {
|
func (r *Response) PrettyPrint(bePretty bool) {
|
||||||
r.prettyPrint = bePretty
|
r.prettyPrint = bePretty
|
||||||
|
|||||||
122
vendor/github.com/emicklei/go-restful/route.go
generated
vendored
122
vendor/github.com/emicklei/go-restful/route.go
generated
vendored
@ -5,6 +5,7 @@ package restful
|
|||||||
// that can be found in the LICENSE file.
|
// that can be found in the LICENSE file.
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"bytes"
|
||||||
"net/http"
|
"net/http"
|
||||||
"strings"
|
"strings"
|
||||||
)
|
)
|
||||||
@ -12,11 +13,6 @@ import (
|
|||||||
// RouteFunction declares the signature of a function that can be bound to a Route.
|
// RouteFunction declares the signature of a function that can be bound to a Route.
|
||||||
type RouteFunction func(*Request, *Response)
|
type RouteFunction func(*Request, *Response)
|
||||||
|
|
||||||
// RouteSelectionConditionFunction declares the signature of a function that
|
|
||||||
// can be used to add extra conditional logic when selecting whether the route
|
|
||||||
// matches the HTTP request.
|
|
||||||
type RouteSelectionConditionFunction func(httpRequest *http.Request) bool
|
|
||||||
|
|
||||||
// Route binds a HTTP Method,Path,Consumes combination to a RouteFunction.
|
// Route binds a HTTP Method,Path,Consumes combination to a RouteFunction.
|
||||||
type Route struct {
|
type Route struct {
|
||||||
Method string
|
Method string
|
||||||
@ -25,7 +21,6 @@ type Route struct {
|
|||||||
Path string // webservice root path + described path
|
Path string // webservice root path + described path
|
||||||
Function RouteFunction
|
Function RouteFunction
|
||||||
Filters []FilterFunction
|
Filters []FilterFunction
|
||||||
If []RouteSelectionConditionFunction
|
|
||||||
|
|
||||||
// cached values for dispatching
|
// cached values for dispatching
|
||||||
relativePath string
|
relativePath string
|
||||||
@ -38,17 +33,10 @@ type Route struct {
|
|||||||
Operation string
|
Operation string
|
||||||
ParameterDocs []*Parameter
|
ParameterDocs []*Parameter
|
||||||
ResponseErrors map[int]ResponseError
|
ResponseErrors map[int]ResponseError
|
||||||
DefaultResponse *ResponseError
|
|
||||||
ReadSample, WriteSample interface{} // structs that model an example request or response payload
|
ReadSample, WriteSample interface{} // structs that model an example request or response payload
|
||||||
|
|
||||||
// Extra information used to store custom information about the route.
|
// Extra information used to store custom information about the route.
|
||||||
Metadata map[string]interface{}
|
Metadata map[string]interface{}
|
||||||
|
|
||||||
// marks a route as deprecated
|
|
||||||
Deprecated bool
|
|
||||||
|
|
||||||
//Overrides the container.contentEncodingEnabled
|
|
||||||
contentEncodingEnabled *bool
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Initialize for Route
|
// Initialize for Route
|
||||||
@ -57,9 +45,10 @@ func (r *Route) postBuild() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Create Request and Response from their http versions
|
// Create Request and Response from their http versions
|
||||||
func (r *Route) wrapRequestResponse(httpWriter http.ResponseWriter, httpRequest *http.Request, pathParams map[string]string) (*Request, *Response) {
|
func (r *Route) wrapRequestResponse(httpWriter http.ResponseWriter, httpRequest *http.Request) (*Request, *Response) {
|
||||||
|
params := r.extractParameters(httpRequest.URL.Path)
|
||||||
wrappedRequest := NewRequest(httpRequest)
|
wrappedRequest := NewRequest(httpRequest)
|
||||||
wrappedRequest.pathParameters = pathParams
|
wrappedRequest.pathParameters = params
|
||||||
wrappedRequest.selectedRoutePath = r.Path
|
wrappedRequest.selectedRoutePath = r.Path
|
||||||
wrappedResponse := NewResponse(httpWriter)
|
wrappedResponse := NewResponse(httpWriter)
|
||||||
wrappedResponse.requestAccept = httpRequest.Header.Get(HEADER_Accept)
|
wrappedResponse.requestAccept = httpRequest.Header.Get(HEADER_Accept)
|
||||||
@ -78,37 +67,29 @@ func (r *Route) dispatchWithFilters(wrappedRequest *Request, wrappedResponse *Re
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func stringTrimSpaceCutset(r rune) bool {
|
|
||||||
return r == ' '
|
|
||||||
}
|
|
||||||
|
|
||||||
// Return whether the mimeType matches to what this Route can produce.
|
// Return whether the mimeType matches to what this Route can produce.
|
||||||
func (r Route) matchesAccept(mimeTypesWithQuality string) bool {
|
func (r Route) matchesAccept(mimeTypesWithQuality string) bool {
|
||||||
remaining := mimeTypesWithQuality
|
parts := strings.Split(mimeTypesWithQuality, ",")
|
||||||
for {
|
for _, each := range parts {
|
||||||
var mimeType string
|
var withoutQuality string
|
||||||
if end := strings.Index(remaining, ","); end == -1 {
|
if strings.Contains(each, ";") {
|
||||||
mimeType, remaining = remaining, ""
|
withoutQuality = strings.Split(each, ";")[0]
|
||||||
} else {
|
} else {
|
||||||
mimeType, remaining = remaining[:end], remaining[end+1:]
|
withoutQuality = each
|
||||||
}
|
}
|
||||||
if quality := strings.Index(mimeType, ";"); quality != -1 {
|
// trim before compare
|
||||||
mimeType = mimeType[:quality]
|
withoutQuality = strings.Trim(withoutQuality, " ")
|
||||||
}
|
if withoutQuality == "*/*" {
|
||||||
mimeType = strings.TrimFunc(mimeType, stringTrimSpaceCutset)
|
|
||||||
if mimeType == "*/*" {
|
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
for _, producibleType := range r.Produces {
|
for _, producibleType := range r.Produces {
|
||||||
if producibleType == "*/*" || producibleType == mimeType {
|
if producibleType == "*/*" || producibleType == withoutQuality {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if len(remaining) == 0 {
|
}
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Return whether this Route can consume content with a type specified by mimeTypes (can be empty).
|
// Return whether this Route can consume content with a type specified by mimeTypes (can be empty).
|
||||||
func (r Route) matchesContentType(mimeTypes string) bool {
|
func (r Route) matchesContentType(mimeTypes string) bool {
|
||||||
@ -119,7 +100,7 @@ func (r Route) matchesContentType(mimeTypes string) bool {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if len(mimeTypes) == 0 {
|
if len(mimeTypes) == 0 {
|
||||||
// idempotent methods with (most-likely or guaranteed) empty content match missing Content-Type
|
// idempotent methods with (most-likely or garanteed) empty content match missing Content-Type
|
||||||
m := r.Method
|
m := r.Method
|
||||||
if m == "GET" || m == "HEAD" || m == "OPTIONS" || m == "DELETE" || m == "TRACE" {
|
if m == "GET" || m == "HEAD" || m == "OPTIONS" || m == "DELETE" || m == "TRACE" {
|
||||||
return true
|
return true
|
||||||
@ -128,33 +109,73 @@ func (r Route) matchesContentType(mimeTypes string) bool {
|
|||||||
mimeTypes = MIME_OCTET
|
mimeTypes = MIME_OCTET
|
||||||
}
|
}
|
||||||
|
|
||||||
remaining := mimeTypes
|
parts := strings.Split(mimeTypes, ",")
|
||||||
for {
|
for _, each := range parts {
|
||||||
var mimeType string
|
var contentType string
|
||||||
if end := strings.Index(remaining, ","); end == -1 {
|
if strings.Contains(each, ";") {
|
||||||
mimeType, remaining = remaining, ""
|
contentType = strings.Split(each, ";")[0]
|
||||||
} else {
|
} else {
|
||||||
mimeType, remaining = remaining[:end], remaining[end+1:]
|
contentType = each
|
||||||
}
|
}
|
||||||
if quality := strings.Index(mimeType, ";"); quality != -1 {
|
// trim before compare
|
||||||
mimeType = mimeType[:quality]
|
contentType = strings.Trim(contentType, " ")
|
||||||
}
|
|
||||||
mimeType = strings.TrimFunc(mimeType, stringTrimSpaceCutset)
|
|
||||||
for _, consumeableType := range r.Consumes {
|
for _, consumeableType := range r.Consumes {
|
||||||
if consumeableType == "*/*" || consumeableType == mimeType {
|
if consumeableType == "*/*" || consumeableType == contentType {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if len(remaining) == 0 {
|
}
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Extract the parameters from the request url path
|
||||||
|
func (r Route) extractParameters(urlPath string) map[string]string {
|
||||||
|
urlParts := tokenizePath(urlPath)
|
||||||
|
pathParameters := map[string]string{}
|
||||||
|
for i, key := range r.pathParts {
|
||||||
|
var value string
|
||||||
|
if i >= len(urlParts) {
|
||||||
|
value = ""
|
||||||
|
} else {
|
||||||
|
value = urlParts[i]
|
||||||
}
|
}
|
||||||
|
if strings.HasPrefix(key, "{") { // path-parameter
|
||||||
|
if colon := strings.Index(key, ":"); colon != -1 {
|
||||||
|
// extract by regex
|
||||||
|
regPart := key[colon+1 : len(key)-1]
|
||||||
|
keyPart := key[1:colon]
|
||||||
|
if regPart == "*" {
|
||||||
|
pathParameters[keyPart] = untokenizePath(i, urlParts)
|
||||||
|
break
|
||||||
|
} else {
|
||||||
|
pathParameters[keyPart] = value
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// without enclosing {}
|
||||||
|
pathParameters[key[1:len(key)-1]] = value
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return pathParameters
|
||||||
|
}
|
||||||
|
|
||||||
|
// Untokenize back into an URL path using the slash separator
|
||||||
|
func untokenizePath(offset int, parts []string) string {
|
||||||
|
var buffer bytes.Buffer
|
||||||
|
for p := offset; p < len(parts); p++ {
|
||||||
|
buffer.WriteString(parts[p])
|
||||||
|
// do not end
|
||||||
|
if p < len(parts)-1 {
|
||||||
|
buffer.WriteString("/")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return buffer.String()
|
||||||
}
|
}
|
||||||
|
|
||||||
// Tokenize an URL path using the slash separator ; the result does not have empty tokens
|
// Tokenize an URL path using the slash separator ; the result does not have empty tokens
|
||||||
func tokenizePath(path string) []string {
|
func tokenizePath(path string) []string {
|
||||||
if "/" == path {
|
if "/" == path {
|
||||||
return nil
|
return []string{}
|
||||||
}
|
}
|
||||||
return strings.Split(strings.Trim(path, "/"), "/")
|
return strings.Split(strings.Trim(path, "/"), "/")
|
||||||
}
|
}
|
||||||
@ -163,8 +184,3 @@ func tokenizePath(path string) []string {
|
|||||||
func (r Route) String() string {
|
func (r Route) String() string {
|
||||||
return r.Method + " " + r.Path
|
return r.Method + " " + r.Path
|
||||||
}
|
}
|
||||||
|
|
||||||
// EnableContentEncoding (default=false) allows for GZIP or DEFLATE encoding of responses. Overrides the container.contentEncodingEnabled value.
|
|
||||||
func (r Route) EnableContentEncoding(enabled bool) {
|
|
||||||
r.contentEncodingEnabled = &enabled
|
|
||||||
}
|
|
||||||
|
|||||||
60
vendor/github.com/emicklei/go-restful/route_builder.go
generated
vendored
60
vendor/github.com/emicklei/go-restful/route_builder.go
generated
vendored
@ -24,7 +24,6 @@ type RouteBuilder struct {
|
|||||||
httpMethod string // required
|
httpMethod string // required
|
||||||
function RouteFunction // required
|
function RouteFunction // required
|
||||||
filters []FilterFunction
|
filters []FilterFunction
|
||||||
conditions []RouteSelectionConditionFunction
|
|
||||||
|
|
||||||
typeNameHandleFunc TypeNameHandleFunction // required
|
typeNameHandleFunc TypeNameHandleFunction // required
|
||||||
|
|
||||||
@ -35,9 +34,7 @@ type RouteBuilder struct {
|
|||||||
readSample, writeSample interface{}
|
readSample, writeSample interface{}
|
||||||
parameters []*Parameter
|
parameters []*Parameter
|
||||||
errorMap map[int]ResponseError
|
errorMap map[int]ResponseError
|
||||||
defaultResponse *ResponseError
|
|
||||||
metadata map[string]interface{}
|
metadata map[string]interface{}
|
||||||
deprecated bool
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Do evaluates each argument with the RouteBuilder itself.
|
// Do evaluates each argument with the RouteBuilder itself.
|
||||||
@ -92,7 +89,7 @@ func (b *RouteBuilder) Doc(documentation string) *RouteBuilder {
|
|||||||
return b
|
return b
|
||||||
}
|
}
|
||||||
|
|
||||||
// Notes is a verbose explanation of the operation behavior. Optional.
|
// A verbose explanation of the operation behavior. Optional.
|
||||||
func (b *RouteBuilder) Notes(notes string) *RouteBuilder {
|
func (b *RouteBuilder) Notes(notes string) *RouteBuilder {
|
||||||
b.notes = notes
|
b.notes = notes
|
||||||
return b
|
return b
|
||||||
@ -100,18 +97,15 @@ func (b *RouteBuilder) Notes(notes string) *RouteBuilder {
|
|||||||
|
|
||||||
// Reads tells what resource type will be read from the request payload. Optional.
|
// Reads tells what resource type will be read from the request payload. Optional.
|
||||||
// A parameter of type "body" is added ,required is set to true and the dataType is set to the qualified name of the sample's type.
|
// A parameter of type "body" is added ,required is set to true and the dataType is set to the qualified name of the sample's type.
|
||||||
func (b *RouteBuilder) Reads(sample interface{}, optionalDescription ...string) *RouteBuilder {
|
func (b *RouteBuilder) Reads(sample interface{}) *RouteBuilder {
|
||||||
fn := b.typeNameHandleFunc
|
fn := b.typeNameHandleFunc
|
||||||
if fn == nil {
|
if fn == nil {
|
||||||
fn = reflectTypeName
|
fn = reflectTypeName
|
||||||
}
|
}
|
||||||
typeAsName := fn(sample)
|
typeAsName := fn(sample)
|
||||||
description := ""
|
|
||||||
if len(optionalDescription) > 0 {
|
|
||||||
description = optionalDescription[0]
|
|
||||||
}
|
|
||||||
b.readSample = sample
|
b.readSample = sample
|
||||||
bodyParameter := &Parameter{&ParameterData{Name: "body", Description: description}}
|
bodyParameter := &Parameter{&ParameterData{Name: "body"}}
|
||||||
bodyParameter.beBody()
|
bodyParameter.beBody()
|
||||||
bodyParameter.Required(true)
|
bodyParameter.Required(true)
|
||||||
bodyParameter.DataType(typeAsName)
|
bodyParameter.DataType(typeAsName)
|
||||||
@ -165,7 +159,7 @@ func (b *RouteBuilder) Returns(code int, message string, model interface{}) *Rou
|
|||||||
Code: code,
|
Code: code,
|
||||||
Message: message,
|
Message: message,
|
||||||
Model: model,
|
Model: model,
|
||||||
IsDefault: false, // this field is deprecated, use default response instead.
|
IsDefault: false,
|
||||||
}
|
}
|
||||||
// lazy init because there is no NewRouteBuilder (yet)
|
// lazy init because there is no NewRouteBuilder (yet)
|
||||||
if b.errorMap == nil {
|
if b.errorMap == nil {
|
||||||
@ -175,11 +169,17 @@ func (b *RouteBuilder) Returns(code int, message string, model interface{}) *Rou
|
|||||||
return b
|
return b
|
||||||
}
|
}
|
||||||
|
|
||||||
// DefaultReturns is a special Returns call that sets the default of the response.
|
// DefaultReturns is a special Returns call that sets the default of the response ; the code is zero.
|
||||||
func (b *RouteBuilder) DefaultReturns(message string, model interface{}) *RouteBuilder {
|
func (b *RouteBuilder) DefaultReturns(message string, model interface{}) *RouteBuilder {
|
||||||
b.defaultResponse = &ResponseError{
|
b.Returns(0, message, model)
|
||||||
Message: message,
|
// Modify the ResponseError just added/updated
|
||||||
Model: model,
|
re := b.errorMap[0]
|
||||||
|
// errorMap is initialized
|
||||||
|
b.errorMap[0] = ResponseError{
|
||||||
|
Code: re.Code,
|
||||||
|
Message: re.Message,
|
||||||
|
Model: re.Model,
|
||||||
|
IsDefault: true,
|
||||||
}
|
}
|
||||||
return b
|
return b
|
||||||
}
|
}
|
||||||
@ -193,12 +193,6 @@ func (b *RouteBuilder) Metadata(key string, value interface{}) *RouteBuilder {
|
|||||||
return b
|
return b
|
||||||
}
|
}
|
||||||
|
|
||||||
// Deprecate sets the value of deprecated to true. Deprecated routes have a special UI treatment to warn against use
|
|
||||||
func (b *RouteBuilder) Deprecate() *RouteBuilder {
|
|
||||||
b.deprecated = true
|
|
||||||
return b
|
|
||||||
}
|
|
||||||
|
|
||||||
// ResponseError represents a response; not necessarily an error.
|
// ResponseError represents a response; not necessarily an error.
|
||||||
type ResponseError struct {
|
type ResponseError struct {
|
||||||
Code int
|
Code int
|
||||||
@ -218,21 +212,6 @@ func (b *RouteBuilder) Filter(filter FilterFunction) *RouteBuilder {
|
|||||||
return b
|
return b
|
||||||
}
|
}
|
||||||
|
|
||||||
// If sets a condition function that controls matching the Route based on custom logic.
|
|
||||||
// The condition function is provided the HTTP request and should return true if the route
|
|
||||||
// should be considered.
|
|
||||||
//
|
|
||||||
// Efficiency note: the condition function is called before checking the method, produces, and
|
|
||||||
// consumes criteria, so that the correct HTTP status code can be returned.
|
|
||||||
//
|
|
||||||
// Lifecycle note: no filter functions have been called prior to calling the condition function,
|
|
||||||
// so the condition function should not depend on any context that might be set up by container
|
|
||||||
// or route filters.
|
|
||||||
func (b *RouteBuilder) If(condition RouteSelectionConditionFunction) *RouteBuilder {
|
|
||||||
b.conditions = append(b.conditions, condition)
|
|
||||||
return b
|
|
||||||
}
|
|
||||||
|
|
||||||
// If no specific Route path then set to rootPath
|
// If no specific Route path then set to rootPath
|
||||||
// If no specific Produces then set to rootProduces
|
// If no specific Produces then set to rootProduces
|
||||||
// If no specific Consumes then set to rootConsumes
|
// If no specific Consumes then set to rootConsumes
|
||||||
@ -256,11 +235,11 @@ func (b *RouteBuilder) typeNameHandler(handler TypeNameHandleFunction) *RouteBui
|
|||||||
func (b *RouteBuilder) Build() Route {
|
func (b *RouteBuilder) Build() Route {
|
||||||
pathExpr, err := newPathExpression(b.currentPath)
|
pathExpr, err := newPathExpression(b.currentPath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Printf("Invalid path:%s because:%v", b.currentPath, err)
|
log.Printf("[restful] Invalid path:%s because:%v", b.currentPath, err)
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
}
|
}
|
||||||
if b.function == nil {
|
if b.function == nil {
|
||||||
log.Printf("No function specified for route:" + b.currentPath)
|
log.Printf("[restful] No function specified for route:" + b.currentPath)
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
}
|
}
|
||||||
operationName := b.operation
|
operationName := b.operation
|
||||||
@ -275,7 +254,6 @@ func (b *RouteBuilder) Build() Route {
|
|||||||
Consumes: b.consumes,
|
Consumes: b.consumes,
|
||||||
Function: b.function,
|
Function: b.function,
|
||||||
Filters: b.filters,
|
Filters: b.filters,
|
||||||
If: b.conditions,
|
|
||||||
relativePath: b.currentPath,
|
relativePath: b.currentPath,
|
||||||
pathExpr: pathExpr,
|
pathExpr: pathExpr,
|
||||||
Doc: b.doc,
|
Doc: b.doc,
|
||||||
@ -283,11 +261,9 @@ func (b *RouteBuilder) Build() Route {
|
|||||||
Operation: operationName,
|
Operation: operationName,
|
||||||
ParameterDocs: b.parameters,
|
ParameterDocs: b.parameters,
|
||||||
ResponseErrors: b.errorMap,
|
ResponseErrors: b.errorMap,
|
||||||
DefaultResponse: b.defaultResponse,
|
|
||||||
ReadSample: b.readSample,
|
ReadSample: b.readSample,
|
||||||
WriteSample: b.writeSample,
|
WriteSample: b.writeSample,
|
||||||
Metadata: b.metadata,
|
Metadata: b.metadata}
|
||||||
Deprecated: b.deprecated}
|
|
||||||
route.postBuild()
|
route.postBuild()
|
||||||
return route
|
return route
|
||||||
}
|
}
|
||||||
|
|||||||
2
vendor/github.com/emicklei/go-restful/router.go
generated
vendored
2
vendor/github.com/emicklei/go-restful/router.go
generated
vendored
@ -7,8 +7,6 @@ package restful
|
|||||||
import "net/http"
|
import "net/http"
|
||||||
|
|
||||||
// A RouteSelector finds the best matching Route given the input HTTP Request
|
// A RouteSelector finds the best matching Route given the input HTTP Request
|
||||||
// RouteSelectors can optionally also implement the PathProcessor interface to also calculate the
|
|
||||||
// path parameters after the route has been selected.
|
|
||||||
type RouteSelector interface {
|
type RouteSelector interface {
|
||||||
|
|
||||||
// SelectRoute finds a Route given the input HTTP Request and a list of WebServices.
|
// SelectRoute finds a Route given the input HTTP Request and a list of WebServices.
|
||||||
|
|||||||
6
vendor/github.com/emicklei/go-restful/web_service.go
generated
vendored
6
vendor/github.com/emicklei/go-restful/web_service.go
generated
vendored
@ -60,7 +60,7 @@ func reflectTypeName(sample interface{}) string {
|
|||||||
func (w *WebService) compilePathExpression() {
|
func (w *WebService) compilePathExpression() {
|
||||||
compiled, err := newPathExpression(w.rootPath)
|
compiled, err := newPathExpression(w.rootPath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Printf("invalid path:%s because:%v", w.rootPath, err)
|
log.Printf("[restful] invalid path:%s because:%v", w.rootPath, err)
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
}
|
}
|
||||||
w.pathExpr = compiled
|
w.pathExpr = compiled
|
||||||
@ -118,7 +118,7 @@ func (w *WebService) QueryParameter(name, description string) *Parameter {
|
|||||||
// QueryParameter creates a new Parameter of kind Query for documentation purposes.
|
// QueryParameter creates a new Parameter of kind Query for documentation purposes.
|
||||||
// It is initialized as not required with string as its DataType.
|
// It is initialized as not required with string as its DataType.
|
||||||
func QueryParameter(name, description string) *Parameter {
|
func QueryParameter(name, description string) *Parameter {
|
||||||
p := &Parameter{&ParameterData{Name: name, Description: description, Required: false, DataType: "string", CollectionFormat: CollectionFormatCSV.String()}}
|
p := &Parameter{&ParameterData{Name: name, Description: description, Required: false, DataType: "string"}}
|
||||||
p.beQuery()
|
p.beQuery()
|
||||||
return p
|
return p
|
||||||
}
|
}
|
||||||
@ -233,7 +233,7 @@ func (w *WebService) RootPath() string {
|
|||||||
return w.rootPath
|
return w.rootPath
|
||||||
}
|
}
|
||||||
|
|
||||||
// PathParameters return the path parameter names for (shared among its Routes)
|
// PathParameters return the path parameter names for (shared amoung its Routes)
|
||||||
func (w *WebService) PathParameters() []*Parameter {
|
func (w *WebService) PathParameters() []*Parameter {
|
||||||
return w.pathParameters
|
return w.pathParameters
|
||||||
}
|
}
|
||||||
|
|||||||
300
vendor/github.com/evanphx/json-patch/README.md
generated
vendored
300
vendor/github.com/evanphx/json-patch/README.md
generated
vendored
@ -1,29 +1,297 @@
|
|||||||
## JSON-Patch
|
# JSON-Patch
|
||||||
|
`jsonpatch` is a library which provides functionallity for both applying
|
||||||
Provides the ability to modify and test a JSON according to a
|
[RFC6902 JSON patches](http://tools.ietf.org/html/rfc6902) against documents, as
|
||||||
[RFC6902 JSON patch](http://tools.ietf.org/html/rfc6902) and [RFC7396 JSON Merge Patch](https://tools.ietf.org/html/rfc7396).
|
well as for calculating & applying [RFC7396 JSON merge patches](https://tools.ietf.org/html/rfc7396).
|
||||||
|
|
||||||
*Version*: **1.0**
|
|
||||||
|
|
||||||
[](http://godoc.org/github.com/evanphx/json-patch)
|
[](http://godoc.org/github.com/evanphx/json-patch)
|
||||||
|
|
||||||
[](https://travis-ci.org/evanphx/json-patch)
|
[](https://travis-ci.org/evanphx/json-patch)
|
||||||
|
[](https://goreportcard.com/report/github.com/evanphx/json-patch)
|
||||||
|
|
||||||
### API Usage
|
# Get It!
|
||||||
|
|
||||||
* Given a `[]byte`, obtain a Patch object
|
**Latest and greatest**:
|
||||||
|
```bash
|
||||||
|
go get -u github.com/evanphx/json-patch
|
||||||
|
```
|
||||||
|
|
||||||
`obj, err := jsonpatch.DecodePatch(patch)`
|
**Stable Versions**:
|
||||||
|
* Version 4: `go get -u gopkg.in/evanphx/json-patch.v4`
|
||||||
|
|
||||||
* Apply the patch and get a new document back
|
(previous versions below `v3` are unavailable)
|
||||||
|
|
||||||
`out, err := obj.Apply(doc)`
|
# Use It!
|
||||||
|
* [Create and apply a merge patch](#create-and-apply-a-merge-patch)
|
||||||
|
* [Create and apply a JSON Patch](#create-and-apply-a-json-patch)
|
||||||
|
* [Comparing JSON documents](#comparing-json-documents)
|
||||||
|
* [Combine merge patches](#combine-merge-patches)
|
||||||
|
|
||||||
* Create a JSON Merge Patch document based on two json documents (a to b):
|
|
||||||
|
|
||||||
`mergeDoc, err := jsonpatch.CreateMergePatch(a, b)`
|
# Configuration
|
||||||
|
|
||||||
* Bonus API: compare documents for structural equality
|
* There is a global configuration variable `jsonpatch.SupportNegativeIndices`.
|
||||||
|
This defaults to `true` and enables the non-standard practice of allowing
|
||||||
|
negative indices to mean indices starting at the end of an array. This
|
||||||
|
functionality can be disabled by setting `jsonpatch.SupportNegativeIndices =
|
||||||
|
false`.
|
||||||
|
|
||||||
`jsonpatch.Equal(doca, docb)`
|
* There is a global configuration variable `jsonpatch.AccumulatedCopySizeLimit`,
|
||||||
|
which limits the total size increase in bytes caused by "copy" operations in a
|
||||||
|
patch. It defaults to 0, which means there is no limit.
|
||||||
|
|
||||||
|
## Create and apply a merge patch
|
||||||
|
Given both an original JSON document and a modified JSON document, you can create
|
||||||
|
a [Merge Patch](https://tools.ietf.org/html/rfc7396) document.
|
||||||
|
|
||||||
|
It can describe the changes needed to convert from the original to the
|
||||||
|
modified JSON document.
|
||||||
|
|
||||||
|
Once you have a merge patch, you can apply it to other JSON documents using the
|
||||||
|
`jsonpatch.MergePatch(document, patch)` function.
|
||||||
|
|
||||||
|
```go
|
||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
|
||||||
|
jsonpatch "github.com/evanphx/json-patch"
|
||||||
|
)
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
// Let's create a merge patch from these two documents...
|
||||||
|
original := []byte(`{"name": "John", "age": 24, "height": 3.21}`)
|
||||||
|
target := []byte(`{"name": "Jane", "age": 24}`)
|
||||||
|
|
||||||
|
patch, err := jsonpatch.CreateMergePatch(original, target)
|
||||||
|
if err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Now lets apply the patch against a different JSON document...
|
||||||
|
|
||||||
|
alternative := []byte(`{"name": "Tina", "age": 28, "height": 3.75}`)
|
||||||
|
modifiedAlternative, err := jsonpatch.MergePatch(alternative, patch)
|
||||||
|
|
||||||
|
fmt.Printf("patch document: %s\n", patch)
|
||||||
|
fmt.Printf("updated alternative doc: %s\n", modifiedAlternative)
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
When ran, you get the following output:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ go run main.go
|
||||||
|
patch document: {"height":null,"name":"Jane"}
|
||||||
|
updated tina doc: {"age":28,"name":"Jane"}
|
||||||
|
```
|
||||||
|
|
||||||
|
## Create and apply a JSON Patch
|
||||||
|
You can create patch objects using `DecodePatch([]byte)`, which can then
|
||||||
|
be applied against JSON documents.
|
||||||
|
|
||||||
|
The following is an example of creating a patch from two operations, and
|
||||||
|
applying it against a JSON document.
|
||||||
|
|
||||||
|
```go
|
||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
|
||||||
|
jsonpatch "github.com/evanphx/json-patch"
|
||||||
|
)
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
original := []byte(`{"name": "John", "age": 24, "height": 3.21}`)
|
||||||
|
patchJSON := []byte(`[
|
||||||
|
{"op": "replace", "path": "/name", "value": "Jane"},
|
||||||
|
{"op": "remove", "path": "/height"}
|
||||||
|
]`)
|
||||||
|
|
||||||
|
patch, err := jsonpatch.DecodePatch(patchJSON)
|
||||||
|
if err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
modified, err := patch.Apply(original)
|
||||||
|
if err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
fmt.Printf("Original document: %s\n", original)
|
||||||
|
fmt.Printf("Modified document: %s\n", modified)
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
When ran, you get the following output:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ go run main.go
|
||||||
|
Original document: {"name": "John", "age": 24, "height": 3.21}
|
||||||
|
Modified document: {"age":24,"name":"Jane"}
|
||||||
|
```
|
||||||
|
|
||||||
|
## Comparing JSON documents
|
||||||
|
Due to potential whitespace and ordering differences, one cannot simply compare
|
||||||
|
JSON strings or byte-arrays directly.
|
||||||
|
|
||||||
|
As such, you can instead use `jsonpatch.Equal(document1, document2)` to
|
||||||
|
determine if two JSON documents are _structurally_ equal. This ignores
|
||||||
|
whitespace differences, and key-value ordering.
|
||||||
|
|
||||||
|
```go
|
||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
|
||||||
|
jsonpatch "github.com/evanphx/json-patch"
|
||||||
|
)
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
original := []byte(`{"name": "John", "age": 24, "height": 3.21}`)
|
||||||
|
similar := []byte(`
|
||||||
|
{
|
||||||
|
"age": 24,
|
||||||
|
"height": 3.21,
|
||||||
|
"name": "John"
|
||||||
|
}
|
||||||
|
`)
|
||||||
|
different := []byte(`{"name": "Jane", "age": 20, "height": 3.37}`)
|
||||||
|
|
||||||
|
if jsonpatch.Equal(original, similar) {
|
||||||
|
fmt.Println(`"original" is structurally equal to "similar"`)
|
||||||
|
}
|
||||||
|
|
||||||
|
if !jsonpatch.Equal(original, different) {
|
||||||
|
fmt.Println(`"original" is _not_ structurally equal to "similar"`)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
When ran, you get the following output:
|
||||||
|
```bash
|
||||||
|
$ go run main.go
|
||||||
|
"original" is structurally equal to "similar"
|
||||||
|
"original" is _not_ structurally equal to "similar"
|
||||||
|
```
|
||||||
|
|
||||||
|
## Combine merge patches
|
||||||
|
Given two JSON merge patch documents, it is possible to combine them into a
|
||||||
|
single merge patch which can describe both set of changes.
|
||||||
|
|
||||||
|
The resulting merge patch can be used such that applying it results in a
|
||||||
|
document structurally similar as merging each merge patch to the document
|
||||||
|
in succession.
|
||||||
|
|
||||||
|
```go
|
||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
|
||||||
|
jsonpatch "github.com/evanphx/json-patch"
|
||||||
|
)
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
original := []byte(`{"name": "John", "age": 24, "height": 3.21}`)
|
||||||
|
|
||||||
|
nameAndHeight := []byte(`{"height":null,"name":"Jane"}`)
|
||||||
|
ageAndEyes := []byte(`{"age":4.23,"eyes":"blue"}`)
|
||||||
|
|
||||||
|
// Let's combine these merge patch documents...
|
||||||
|
combinedPatch, err := jsonpatch.MergeMergePatches(nameAndHeight, ageAndEyes)
|
||||||
|
if err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Apply each patch individual against the original document
|
||||||
|
withoutCombinedPatch, err := jsonpatch.MergePatch(original, nameAndHeight)
|
||||||
|
if err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
withoutCombinedPatch, err = jsonpatch.MergePatch(withoutCombinedPatch, ageAndEyes)
|
||||||
|
if err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Apply the combined patch against the original document
|
||||||
|
|
||||||
|
withCombinedPatch, err := jsonpatch.MergePatch(original, combinedPatch)
|
||||||
|
if err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Do both result in the same thing? They should!
|
||||||
|
if jsonpatch.Equal(withCombinedPatch, withoutCombinedPatch) {
|
||||||
|
fmt.Println("Both JSON documents are structurally the same!")
|
||||||
|
}
|
||||||
|
|
||||||
|
fmt.Printf("combined merge patch: %s", combinedPatch)
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
When ran, you get the following output:
|
||||||
|
```bash
|
||||||
|
$ go run main.go
|
||||||
|
Both JSON documents are structurally the same!
|
||||||
|
combined merge patch: {"age":4.23,"eyes":"blue","height":null,"name":"Jane"}
|
||||||
|
```
|
||||||
|
|
||||||
|
# CLI for comparing JSON documents
|
||||||
|
You can install the commandline program `json-patch`.
|
||||||
|
|
||||||
|
This program can take multiple JSON patch documents as arguments,
|
||||||
|
and fed a JSON document from `stdin`. It will apply the patch(es) against
|
||||||
|
the document and output the modified doc.
|
||||||
|
|
||||||
|
**patch.1.json**
|
||||||
|
```json
|
||||||
|
[
|
||||||
|
{"op": "replace", "path": "/name", "value": "Jane"},
|
||||||
|
{"op": "remove", "path": "/height"}
|
||||||
|
]
|
||||||
|
```
|
||||||
|
|
||||||
|
**patch.2.json**
|
||||||
|
```json
|
||||||
|
[
|
||||||
|
{"op": "add", "path": "/address", "value": "123 Main St"},
|
||||||
|
{"op": "replace", "path": "/age", "value": "21"}
|
||||||
|
]
|
||||||
|
```
|
||||||
|
|
||||||
|
**document.json**
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"name": "John",
|
||||||
|
"age": 24,
|
||||||
|
"height": 3.21
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
You can then run:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ go install github.com/evanphx/json-patch/cmd/json-patch
|
||||||
|
$ cat document.json | json-patch -p patch.1.json -p patch.2.json
|
||||||
|
{"address":"123 Main St","age":"21","name":"Jane"}
|
||||||
|
```
|
||||||
|
|
||||||
|
# Help It!
|
||||||
|
Contributions are welcomed! Leave [an issue](https://github.com/evanphx/json-patch/issues)
|
||||||
|
or [create a PR](https://github.com/evanphx/json-patch/compare).
|
||||||
|
|
||||||
|
|
||||||
|
Before creating a pull request, we'd ask that you make sure tests are passing
|
||||||
|
and that you have added new tests when applicable.
|
||||||
|
|
||||||
|
Contributors can run tests using:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
go test -cover ./...
|
||||||
|
```
|
||||||
|
|
||||||
|
Builds for pull requests are tested automatically
|
||||||
|
using [TravisCI](https://travis-ci.org/evanphx/json-patch).
|
||||||
|
|||||||
38
vendor/github.com/evanphx/json-patch/errors.go
generated
vendored
Normal file
38
vendor/github.com/evanphx/json-patch/errors.go
generated
vendored
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
package jsonpatch
|
||||||
|
|
||||||
|
import "fmt"
|
||||||
|
|
||||||
|
// AccumulatedCopySizeError is an error type returned when the accumulated size
|
||||||
|
// increase caused by copy operations in a patch operation has exceeded the
|
||||||
|
// limit.
|
||||||
|
type AccumulatedCopySizeError struct {
|
||||||
|
limit int64
|
||||||
|
accumulated int64
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewAccumulatedCopySizeError returns an AccumulatedCopySizeError.
|
||||||
|
func NewAccumulatedCopySizeError(l, a int64) *AccumulatedCopySizeError {
|
||||||
|
return &AccumulatedCopySizeError{limit: l, accumulated: a}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Error implements the error interface.
|
||||||
|
func (a *AccumulatedCopySizeError) Error() string {
|
||||||
|
return fmt.Sprintf("Unable to complete the copy, the accumulated size increase of copy is %d, exceeding the limit %d", a.accumulated, a.limit)
|
||||||
|
}
|
||||||
|
|
||||||
|
// ArraySizeError is an error type returned when the array size has exceeded
|
||||||
|
// the limit.
|
||||||
|
type ArraySizeError struct {
|
||||||
|
limit int
|
||||||
|
size int
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewArraySizeError returns an ArraySizeError.
|
||||||
|
func NewArraySizeError(l, s int) *ArraySizeError {
|
||||||
|
return &ArraySizeError{limit: l, size: s}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Error implements the error interface.
|
||||||
|
func (a *ArraySizeError) Error() string {
|
||||||
|
return fmt.Sprintf("Unable to create array of size %d, limit is %d", a.size, a.limit)
|
||||||
|
}
|
||||||
117
vendor/github.com/evanphx/json-patch/patch.go
generated
vendored
117
vendor/github.com/evanphx/json-patch/patch.go
generated
vendored
@ -14,6 +14,16 @@ const (
|
|||||||
eAry
|
eAry
|
||||||
)
|
)
|
||||||
|
|
||||||
|
var (
|
||||||
|
// SupportNegativeIndices decides whether to support non-standard practice of
|
||||||
|
// allowing negative indices to mean indices starting at the end of an array.
|
||||||
|
// Default to true.
|
||||||
|
SupportNegativeIndices bool = true
|
||||||
|
// AccumulatedCopySizeLimit limits the total size increase in bytes caused by
|
||||||
|
// "copy" operations in a patch.
|
||||||
|
AccumulatedCopySizeLimit int64 = 0
|
||||||
|
)
|
||||||
|
|
||||||
type lazyNode struct {
|
type lazyNode struct {
|
||||||
raw *json.RawMessage
|
raw *json.RawMessage
|
||||||
doc partialDoc
|
doc partialDoc
|
||||||
@ -61,6 +71,20 @@ func (n *lazyNode) UnmarshalJSON(data []byte) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func deepCopy(src *lazyNode) (*lazyNode, int, error) {
|
||||||
|
if src == nil {
|
||||||
|
return nil, 0, nil
|
||||||
|
}
|
||||||
|
a, err := src.MarshalJSON()
|
||||||
|
if err != nil {
|
||||||
|
return nil, 0, err
|
||||||
|
}
|
||||||
|
sz := len(a)
|
||||||
|
ra := make(json.RawMessage, sz)
|
||||||
|
copy(ra, a)
|
||||||
|
return newLazyNode(&ra), sz, nil
|
||||||
|
}
|
||||||
|
|
||||||
func (n *lazyNode) intoDoc() (*partialDoc, error) {
|
func (n *lazyNode) intoDoc() (*partialDoc, error) {
|
||||||
if n.which == eDoc {
|
if n.which == eDoc {
|
||||||
return &n.doc, nil
|
return &n.doc, nil
|
||||||
@ -204,7 +228,7 @@ func (n *lazyNode) equal(o *lazyNode) bool {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (o operation) kind() string {
|
func (o operation) kind() string {
|
||||||
if obj, ok := o["op"]; ok {
|
if obj, ok := o["op"]; ok && obj != nil {
|
||||||
var op string
|
var op string
|
||||||
|
|
||||||
err := json.Unmarshal(*obj, &op)
|
err := json.Unmarshal(*obj, &op)
|
||||||
@ -220,7 +244,7 @@ func (o operation) kind() string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (o operation) path() string {
|
func (o operation) path() string {
|
||||||
if obj, ok := o["path"]; ok {
|
if obj, ok := o["path"]; ok && obj != nil {
|
||||||
var op string
|
var op string
|
||||||
|
|
||||||
err := json.Unmarshal(*obj, &op)
|
err := json.Unmarshal(*obj, &op)
|
||||||
@ -236,7 +260,7 @@ func (o operation) path() string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (o operation) from() string {
|
func (o operation) from() string {
|
||||||
if obj, ok := o["from"]; ok {
|
if obj, ok := o["from"]; ok && obj != nil {
|
||||||
var op string
|
var op string
|
||||||
|
|
||||||
err := json.Unmarshal(*obj, &op)
|
err := json.Unmarshal(*obj, &op)
|
||||||
@ -342,35 +366,14 @@ func (d *partialDoc) remove(key string) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// set should only be used to implement the "replace" operation, so "key" must
|
||||||
|
// be an already existing index in "d".
|
||||||
func (d *partialArray) set(key string, val *lazyNode) error {
|
func (d *partialArray) set(key string, val *lazyNode) error {
|
||||||
if key == "-" {
|
|
||||||
*d = append(*d, val)
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
idx, err := strconv.Atoi(key)
|
idx, err := strconv.Atoi(key)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
(*d)[idx] = val
|
||||||
sz := len(*d)
|
|
||||||
if idx+1 > sz {
|
|
||||||
sz = idx + 1
|
|
||||||
}
|
|
||||||
|
|
||||||
ary := make([]*lazyNode, sz)
|
|
||||||
|
|
||||||
cur := *d
|
|
||||||
|
|
||||||
copy(ary, cur)
|
|
||||||
|
|
||||||
if idx >= len(ary) {
|
|
||||||
return fmt.Errorf("Unable to access invalid index: %d", idx)
|
|
||||||
}
|
|
||||||
|
|
||||||
ary[idx] = val
|
|
||||||
|
|
||||||
*d = ary
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -385,17 +388,24 @@ func (d *partialArray) add(key string, val *lazyNode) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
ary := make([]*lazyNode, len(*d)+1)
|
sz := len(*d) + 1
|
||||||
|
|
||||||
|
ary := make([]*lazyNode, sz)
|
||||||
|
|
||||||
cur := *d
|
cur := *d
|
||||||
|
|
||||||
if idx < 0 {
|
if idx >= len(ary) {
|
||||||
idx *= -1
|
|
||||||
|
|
||||||
if idx > len(ary) {
|
|
||||||
return fmt.Errorf("Unable to access invalid index: %d", idx)
|
return fmt.Errorf("Unable to access invalid index: %d", idx)
|
||||||
}
|
}
|
||||||
idx = len(ary) - idx
|
|
||||||
|
if SupportNegativeIndices {
|
||||||
|
if idx < -len(ary) {
|
||||||
|
return fmt.Errorf("Unable to access invalid index: %d", idx)
|
||||||
|
}
|
||||||
|
|
||||||
|
if idx < 0 {
|
||||||
|
idx += len(ary)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
copy(ary[0:idx], cur[0:idx])
|
copy(ary[0:idx], cur[0:idx])
|
||||||
@ -429,7 +439,17 @@ func (d *partialArray) remove(key string) error {
|
|||||||
cur := *d
|
cur := *d
|
||||||
|
|
||||||
if idx >= len(cur) {
|
if idx >= len(cur) {
|
||||||
return fmt.Errorf("Unable to remove invalid index: %d", idx)
|
return fmt.Errorf("Unable to access invalid index: %d", idx)
|
||||||
|
}
|
||||||
|
|
||||||
|
if SupportNegativeIndices {
|
||||||
|
if idx < -len(cur) {
|
||||||
|
return fmt.Errorf("Unable to access invalid index: %d", idx)
|
||||||
|
}
|
||||||
|
|
||||||
|
if idx < 0 {
|
||||||
|
idx += len(cur)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ary := make([]*lazyNode, len(cur)-1)
|
ary := make([]*lazyNode, len(cur)-1)
|
||||||
@ -448,7 +468,7 @@ func (p Patch) add(doc *container, op operation) error {
|
|||||||
con, key := findObject(doc, path)
|
con, key := findObject(doc, path)
|
||||||
|
|
||||||
if con == nil {
|
if con == nil {
|
||||||
return fmt.Errorf("jsonpatch add operation does not apply: doc is missing path: %s", path)
|
return fmt.Errorf("jsonpatch add operation does not apply: doc is missing path: \"%s\"", path)
|
||||||
}
|
}
|
||||||
|
|
||||||
return con.add(key, op.value())
|
return con.add(key, op.value())
|
||||||
@ -460,7 +480,7 @@ func (p Patch) remove(doc *container, op operation) error {
|
|||||||
con, key := findObject(doc, path)
|
con, key := findObject(doc, path)
|
||||||
|
|
||||||
if con == nil {
|
if con == nil {
|
||||||
return fmt.Errorf("jsonpatch remove operation does not apply: doc is missing path: %s", path)
|
return fmt.Errorf("jsonpatch remove operation does not apply: doc is missing path: \"%s\"", path)
|
||||||
}
|
}
|
||||||
|
|
||||||
return con.remove(key)
|
return con.remove(key)
|
||||||
@ -475,8 +495,8 @@ func (p Patch) replace(doc *container, op operation) error {
|
|||||||
return fmt.Errorf("jsonpatch replace operation does not apply: doc is missing path: %s", path)
|
return fmt.Errorf("jsonpatch replace operation does not apply: doc is missing path: %s", path)
|
||||||
}
|
}
|
||||||
|
|
||||||
val, ok := con.get(key)
|
_, ok := con.get(key)
|
||||||
if val == nil || ok != nil {
|
if ok != nil {
|
||||||
return fmt.Errorf("jsonpatch replace operation does not apply: doc is missing key: %s", path)
|
return fmt.Errorf("jsonpatch replace operation does not apply: doc is missing key: %s", path)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -510,7 +530,7 @@ func (p Patch) move(doc *container, op operation) error {
|
|||||||
return fmt.Errorf("jsonpatch move operation does not apply: doc is missing destination path: %s", path)
|
return fmt.Errorf("jsonpatch move operation does not apply: doc is missing destination path: %s", path)
|
||||||
}
|
}
|
||||||
|
|
||||||
return con.set(key, val)
|
return con.add(key, val)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p Patch) test(doc *container, op operation) error {
|
func (p Patch) test(doc *container, op operation) error {
|
||||||
@ -533,6 +553,8 @@ func (p Patch) test(doc *container, op operation) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
return fmt.Errorf("Testing value %s failed", path)
|
return fmt.Errorf("Testing value %s failed", path)
|
||||||
|
} else if op.value() == nil {
|
||||||
|
return fmt.Errorf("Testing value %s failed", path)
|
||||||
}
|
}
|
||||||
|
|
||||||
if val.equal(op.value()) {
|
if val.equal(op.value()) {
|
||||||
@ -542,7 +564,7 @@ func (p Patch) test(doc *container, op operation) error {
|
|||||||
return fmt.Errorf("Testing value %s failed", path)
|
return fmt.Errorf("Testing value %s failed", path)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p Patch) copy(doc *container, op operation) error {
|
func (p Patch) copy(doc *container, op operation, accumulatedCopySize *int64) error {
|
||||||
from := op.from()
|
from := op.from()
|
||||||
|
|
||||||
con, key := findObject(doc, from)
|
con, key := findObject(doc, from)
|
||||||
@ -564,7 +586,16 @@ func (p Patch) copy(doc *container, op operation) error {
|
|||||||
return fmt.Errorf("jsonpatch copy operation does not apply: doc is missing destination path: %s", path)
|
return fmt.Errorf("jsonpatch copy operation does not apply: doc is missing destination path: %s", path)
|
||||||
}
|
}
|
||||||
|
|
||||||
return con.set(key, val)
|
valCopy, sz, err := deepCopy(val)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
(*accumulatedCopySize) += int64(sz)
|
||||||
|
if AccumulatedCopySizeLimit > 0 && *accumulatedCopySize > AccumulatedCopySizeLimit {
|
||||||
|
return NewAccumulatedCopySizeError(AccumulatedCopySizeLimit, *accumulatedCopySize)
|
||||||
|
}
|
||||||
|
|
||||||
|
return con.add(key, valCopy)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Equal indicates if 2 JSON documents have the same structural equality.
|
// Equal indicates if 2 JSON documents have the same structural equality.
|
||||||
@ -617,6 +648,8 @@ func (p Patch) ApplyIndent(doc []byte, indent string) ([]byte, error) {
|
|||||||
|
|
||||||
err = nil
|
err = nil
|
||||||
|
|
||||||
|
var accumulatedCopySize int64
|
||||||
|
|
||||||
for _, op := range p {
|
for _, op := range p {
|
||||||
switch op.kind() {
|
switch op.kind() {
|
||||||
case "add":
|
case "add":
|
||||||
@ -630,7 +663,7 @@ func (p Patch) ApplyIndent(doc []byte, indent string) ([]byte, error) {
|
|||||||
case "test":
|
case "test":
|
||||||
err = p.test(&pd, op)
|
err = p.test(&pd, op)
|
||||||
case "copy":
|
case "copy":
|
||||||
err = p.copy(&pd, op)
|
err = p.copy(&pd, op, &accumulatedCopySize)
|
||||||
default:
|
default:
|
||||||
err = fmt.Errorf("Unexpected kind: %s", op.kind())
|
err = fmt.Errorf("Unexpected kind: %s", op.kind())
|
||||||
}
|
}
|
||||||
|
|||||||
4
vendor/github.com/go-openapi/spec/.golangci.yml
generated
vendored
4
vendor/github.com/go-openapi/spec/.golangci.yml
generated
vendored
@ -4,7 +4,7 @@ linters-settings:
|
|||||||
golint:
|
golint:
|
||||||
min-confidence: 0
|
min-confidence: 0
|
||||||
gocyclo:
|
gocyclo:
|
||||||
min-complexity: 45
|
min-complexity: 25
|
||||||
maligned:
|
maligned:
|
||||||
suggest-new: true
|
suggest-new: true
|
||||||
dupl:
|
dupl:
|
||||||
@ -19,5 +19,3 @@ linters:
|
|||||||
- maligned
|
- maligned
|
||||||
- unparam
|
- unparam
|
||||||
- lll
|
- lll
|
||||||
- gochecknoinits
|
|
||||||
- gochecknoglobals
|
|
||||||
|
|||||||
89
vendor/github.com/go-openapi/spec/bindata.go
generated
vendored
89
vendor/github.com/go-openapi/spec/bindata.go
generated
vendored
@ -1,14 +1,14 @@
|
|||||||
// Code generated by go-bindata. DO NOT EDIT.
|
// Code generated by go-bindata.
|
||||||
// sources:
|
// sources:
|
||||||
// schemas/jsonschema-draft-04.json (4.357kB)
|
// schemas/jsonschema-draft-04.json
|
||||||
// schemas/v2/schema.json (40.249kB)
|
// schemas/v2/schema.json
|
||||||
|
// DO NOT EDIT!
|
||||||
|
|
||||||
package spec
|
package spec
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"compress/gzip"
|
"compress/gzip"
|
||||||
"crypto/sha256"
|
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
@ -41,7 +41,6 @@ func bindataRead(data []byte, name string) ([]byte, error) {
|
|||||||
type asset struct {
|
type asset struct {
|
||||||
bytes []byte
|
bytes []byte
|
||||||
info os.FileInfo
|
info os.FileInfo
|
||||||
digest [sha256.Size]byte
|
|
||||||
}
|
}
|
||||||
|
|
||||||
type bindataFileInfo struct {
|
type bindataFileInfo struct {
|
||||||
@ -85,8 +84,8 @@ func jsonschemaDraft04JSON() (*asset, error) {
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
info := bindataFileInfo{name: "jsonschema-draft-04.json", size: 4357, mode: os.FileMode(436), modTime: time.Unix(1540282154, 0)}
|
info := bindataFileInfo{name: "jsonschema-draft-04.json", size: 4357, mode: os.FileMode(420), modTime: time.Unix(1523760398, 0)}
|
||||||
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xe1, 0x48, 0x9d, 0xb, 0x47, 0x55, 0xf0, 0x27, 0x93, 0x30, 0x25, 0x91, 0xd3, 0xfc, 0xb8, 0xf0, 0x7b, 0x68, 0x93, 0xa8, 0x2a, 0x94, 0xf2, 0x48, 0x95, 0xf8, 0xe4, 0xed, 0xf1, 0x1b, 0x82, 0xe2}}
|
a := &asset{bytes: bytes, info: info}
|
||||||
return a, nil
|
return a, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -105,8 +104,8 @@ func v2SchemaJSON() (*asset, error) {
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
info := bindataFileInfo{name: "v2/schema.json", size: 40249, mode: os.FileMode(436), modTime: time.Unix(1540282154, 0)}
|
info := bindataFileInfo{name: "v2/schema.json", size: 40249, mode: os.FileMode(420), modTime: time.Unix(1523760397, 0)}
|
||||||
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xcb, 0x25, 0x27, 0xe8, 0x46, 0xae, 0x22, 0xc4, 0xf4, 0x8b, 0x1, 0x32, 0x4d, 0x1f, 0xf8, 0xdf, 0x75, 0x15, 0xc8, 0x2d, 0xc7, 0xed, 0xe, 0x7e, 0x0, 0x75, 0xc0, 0xf9, 0xd2, 0x1f, 0x75, 0x57}}
|
a := &asset{bytes: bytes, info: info}
|
||||||
return a, nil
|
return a, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -114,8 +113,8 @@ func v2SchemaJSON() (*asset, error) {
|
|||||||
// It returns an error if the asset could not be found or
|
// It returns an error if the asset could not be found or
|
||||||
// could not be loaded.
|
// could not be loaded.
|
||||||
func Asset(name string) ([]byte, error) {
|
func Asset(name string) ([]byte, error) {
|
||||||
canonicalName := strings.Replace(name, "\\", "/", -1)
|
cannonicalName := strings.Replace(name, "\\", "/", -1)
|
||||||
if f, ok := _bindata[canonicalName]; ok {
|
if f, ok := _bindata[cannonicalName]; ok {
|
||||||
a, err := f()
|
a, err := f()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("Asset %s can't read by error: %v", name, err)
|
return nil, fmt.Errorf("Asset %s can't read by error: %v", name, err)
|
||||||
@ -125,12 +124,6 @@ func Asset(name string) ([]byte, error) {
|
|||||||
return nil, fmt.Errorf("Asset %s not found", name)
|
return nil, fmt.Errorf("Asset %s not found", name)
|
||||||
}
|
}
|
||||||
|
|
||||||
// AssetString returns the asset contents as a string (instead of a []byte).
|
|
||||||
func AssetString(name string) (string, error) {
|
|
||||||
data, err := Asset(name)
|
|
||||||
return string(data), err
|
|
||||||
}
|
|
||||||
|
|
||||||
// MustAsset is like Asset but panics when Asset would return an error.
|
// MustAsset is like Asset but panics when Asset would return an error.
|
||||||
// It simplifies safe initialization of global variables.
|
// It simplifies safe initialization of global variables.
|
||||||
func MustAsset(name string) []byte {
|
func MustAsset(name string) []byte {
|
||||||
@ -142,18 +135,12 @@ func MustAsset(name string) []byte {
|
|||||||
return a
|
return a
|
||||||
}
|
}
|
||||||
|
|
||||||
// MustAssetString is like AssetString but panics when Asset would return an
|
|
||||||
// error. It simplifies safe initialization of global variables.
|
|
||||||
func MustAssetString(name string) string {
|
|
||||||
return string(MustAsset(name))
|
|
||||||
}
|
|
||||||
|
|
||||||
// AssetInfo loads and returns the asset info for the given name.
|
// AssetInfo loads and returns the asset info for the given name.
|
||||||
// It returns an error if the asset could not be found or
|
// It returns an error if the asset could not be found or
|
||||||
// could not be loaded.
|
// could not be loaded.
|
||||||
func AssetInfo(name string) (os.FileInfo, error) {
|
func AssetInfo(name string) (os.FileInfo, error) {
|
||||||
canonicalName := strings.Replace(name, "\\", "/", -1)
|
cannonicalName := strings.Replace(name, "\\", "/", -1)
|
||||||
if f, ok := _bindata[canonicalName]; ok {
|
if f, ok := _bindata[cannonicalName]; ok {
|
||||||
a, err := f()
|
a, err := f()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("AssetInfo %s can't read by error: %v", name, err)
|
return nil, fmt.Errorf("AssetInfo %s can't read by error: %v", name, err)
|
||||||
@ -163,33 +150,6 @@ func AssetInfo(name string) (os.FileInfo, error) {
|
|||||||
return nil, fmt.Errorf("AssetInfo %s not found", name)
|
return nil, fmt.Errorf("AssetInfo %s not found", name)
|
||||||
}
|
}
|
||||||
|
|
||||||
// AssetDigest returns the digest of the file with the given name. It returns an
|
|
||||||
// error if the asset could not be found or the digest could not be loaded.
|
|
||||||
func AssetDigest(name string) ([sha256.Size]byte, error) {
|
|
||||||
canonicalName := strings.Replace(name, "\\", "/", -1)
|
|
||||||
if f, ok := _bindata[canonicalName]; ok {
|
|
||||||
a, err := f()
|
|
||||||
if err != nil {
|
|
||||||
return [sha256.Size]byte{}, fmt.Errorf("AssetDigest %s can't read by error: %v", name, err)
|
|
||||||
}
|
|
||||||
return a.digest, nil
|
|
||||||
}
|
|
||||||
return [sha256.Size]byte{}, fmt.Errorf("AssetDigest %s not found", name)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Digests returns a map of all known files and their checksums.
|
|
||||||
func Digests() (map[string][sha256.Size]byte, error) {
|
|
||||||
mp := make(map[string][sha256.Size]byte, len(_bindata))
|
|
||||||
for name := range _bindata {
|
|
||||||
a, err := _bindata[name]()
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
mp[name] = a.digest
|
|
||||||
}
|
|
||||||
return mp, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// AssetNames returns the names of the assets.
|
// AssetNames returns the names of the assets.
|
||||||
func AssetNames() []string {
|
func AssetNames() []string {
|
||||||
names := make([]string, 0, len(_bindata))
|
names := make([]string, 0, len(_bindata))
|
||||||
@ -202,7 +162,6 @@ func AssetNames() []string {
|
|||||||
// _bindata is a table, holding each asset generator, mapped to its name.
|
// _bindata is a table, holding each asset generator, mapped to its name.
|
||||||
var _bindata = map[string]func() (*asset, error){
|
var _bindata = map[string]func() (*asset, error){
|
||||||
"jsonschema-draft-04.json": jsonschemaDraft04JSON,
|
"jsonschema-draft-04.json": jsonschemaDraft04JSON,
|
||||||
|
|
||||||
"v2/schema.json": v2SchemaJSON,
|
"v2/schema.json": v2SchemaJSON,
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -215,15 +174,15 @@ var _bindata = map[string]func() (*asset, error){
|
|||||||
// img/
|
// img/
|
||||||
// a.png
|
// a.png
|
||||||
// b.png
|
// b.png
|
||||||
// then AssetDir("data") would return []string{"foo.txt", "img"},
|
// then AssetDir("data") would return []string{"foo.txt", "img"}
|
||||||
// AssetDir("data/img") would return []string{"a.png", "b.png"},
|
// AssetDir("data/img") would return []string{"a.png", "b.png"}
|
||||||
// AssetDir("foo.txt") and AssetDir("notexist") would return an error, and
|
// AssetDir("foo.txt") and AssetDir("notexist") would return an error
|
||||||
// AssetDir("") will return []string{"data"}.
|
// AssetDir("") will return []string{"data"}.
|
||||||
func AssetDir(name string) ([]string, error) {
|
func AssetDir(name string) ([]string, error) {
|
||||||
node := _bintree
|
node := _bintree
|
||||||
if len(name) != 0 {
|
if len(name) != 0 {
|
||||||
canonicalName := strings.Replace(name, "\\", "/", -1)
|
cannonicalName := strings.Replace(name, "\\", "/", -1)
|
||||||
pathList := strings.Split(canonicalName, "/")
|
pathList := strings.Split(cannonicalName, "/")
|
||||||
for _, p := range pathList {
|
for _, p := range pathList {
|
||||||
node = node.Children[p]
|
node = node.Children[p]
|
||||||
if node == nil {
|
if node == nil {
|
||||||
@ -253,7 +212,7 @@ var _bintree = &bintree{nil, map[string]*bintree{
|
|||||||
}},
|
}},
|
||||||
}}
|
}}
|
||||||
|
|
||||||
// RestoreAsset restores an asset under the given directory.
|
// RestoreAsset restores an asset under the given directory
|
||||||
func RestoreAsset(dir, name string) error {
|
func RestoreAsset(dir, name string) error {
|
||||||
data, err := Asset(name)
|
data, err := Asset(name)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -271,10 +230,14 @@ func RestoreAsset(dir, name string) error {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
return os.Chtimes(_filePath(dir, name), info.ModTime(), info.ModTime())
|
err = os.Chtimes(_filePath(dir, name), info.ModTime(), info.ModTime())
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// RestoreAssets restores an asset under the given directory recursively.
|
// RestoreAssets restores an asset under the given directory recursively
|
||||||
func RestoreAssets(dir, name string) error {
|
func RestoreAssets(dir, name string) error {
|
||||||
children, err := AssetDir(name)
|
children, err := AssetDir(name)
|
||||||
// File
|
// File
|
||||||
@ -292,6 +255,6 @@ func RestoreAssets(dir, name string) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func _filePath(dir, name string) string {
|
func _filePath(dir, name string) string {
|
||||||
canonicalName := strings.Replace(name, "\\", "/", -1)
|
cannonicalName := strings.Replace(name, "\\", "/", -1)
|
||||||
return filepath.Join(append([]string{dir}, strings.Split(canonicalName, "/")...)...)
|
return filepath.Join(append([]string{dir}, strings.Split(cannonicalName, "/")...)...)
|
||||||
}
|
}
|
||||||
|
|||||||
60
vendor/github.com/go-openapi/spec/cache.go
generated
vendored
60
vendor/github.com/go-openapi/spec/cache.go
generated
vendored
@ -1,60 +0,0 @@
|
|||||||
// Copyright 2015 go-swagger maintainers
|
|
||||||
//
|
|
||||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
// you may not use this file except in compliance with the License.
|
|
||||||
// You may obtain a copy of the License at
|
|
||||||
//
|
|
||||||
// http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
//
|
|
||||||
// Unless required by applicable law or agreed to in writing, software
|
|
||||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
// See the License for the specific language governing permissions and
|
|
||||||
// limitations under the License.
|
|
||||||
|
|
||||||
package spec
|
|
||||||
|
|
||||||
import "sync"
|
|
||||||
|
|
||||||
// ResolutionCache a cache for resolving urls
|
|
||||||
type ResolutionCache interface {
|
|
||||||
Get(string) (interface{}, bool)
|
|
||||||
Set(string, interface{})
|
|
||||||
}
|
|
||||||
|
|
||||||
type simpleCache struct {
|
|
||||||
lock sync.RWMutex
|
|
||||||
store map[string]interface{}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Get retrieves a cached URI
|
|
||||||
func (s *simpleCache) Get(uri string) (interface{}, bool) {
|
|
||||||
debugLog("getting %q from resolution cache", uri)
|
|
||||||
s.lock.RLock()
|
|
||||||
v, ok := s.store[uri]
|
|
||||||
debugLog("got %q from resolution cache: %t", uri, ok)
|
|
||||||
|
|
||||||
s.lock.RUnlock()
|
|
||||||
return v, ok
|
|
||||||
}
|
|
||||||
|
|
||||||
// Set caches a URI
|
|
||||||
func (s *simpleCache) Set(uri string, data interface{}) {
|
|
||||||
s.lock.Lock()
|
|
||||||
s.store[uri] = data
|
|
||||||
s.lock.Unlock()
|
|
||||||
}
|
|
||||||
|
|
||||||
var resCache ResolutionCache
|
|
||||||
|
|
||||||
func init() {
|
|
||||||
resCache = initResolutionCache()
|
|
||||||
}
|
|
||||||
|
|
||||||
// initResolutionCache initializes the URI resolution cache
|
|
||||||
func initResolutionCache() ResolutionCache {
|
|
||||||
return &simpleCache{store: map[string]interface{}{
|
|
||||||
"http://swagger.io/v2/schema.json": MustLoadSwagger20Schema(),
|
|
||||||
"http://json-schema.org/draft-04/schema": MustLoadJSONSchemaDraft04(),
|
|
||||||
}}
|
|
||||||
}
|
|
||||||
4
vendor/github.com/go-openapi/spec/debug.go
generated
vendored
4
vendor/github.com/go-openapi/spec/debug.go
generated
vendored
@ -24,9 +24,9 @@ import (
|
|||||||
|
|
||||||
var (
|
var (
|
||||||
// Debug is true when the SWAGGER_DEBUG env var is not empty.
|
// Debug is true when the SWAGGER_DEBUG env var is not empty.
|
||||||
// It enables a more verbose logging of this package.
|
// It enables a more verbose logging of validators.
|
||||||
Debug = os.Getenv("SWAGGER_DEBUG") != ""
|
Debug = os.Getenv("SWAGGER_DEBUG") != ""
|
||||||
// specLogger is a debug logger for this package
|
// validateLogger is a debug logger for this package
|
||||||
specLogger *log.Logger
|
specLogger *log.Logger
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
789
vendor/github.com/go-openapi/spec/expander.go
generated
vendored
789
vendor/github.com/go-openapi/spec/expander.go
generated
vendored
File diff suppressed because it is too large
Load Diff
6
vendor/github.com/go-openapi/spec/header.go
generated
vendored
6
vendor/github.com/go-openapi/spec/header.go
generated
vendored
@ -22,10 +22,6 @@ import (
|
|||||||
"github.com/go-openapi/swag"
|
"github.com/go-openapi/swag"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
|
||||||
jsonArray = "array"
|
|
||||||
)
|
|
||||||
|
|
||||||
// HeaderProps describes a response header
|
// HeaderProps describes a response header
|
||||||
type HeaderProps struct {
|
type HeaderProps struct {
|
||||||
Description string `json:"description,omitempty"`
|
Description string `json:"description,omitempty"`
|
||||||
@ -61,7 +57,7 @@ func (h *Header) Typed(tpe, format string) *Header {
|
|||||||
|
|
||||||
// CollectionOf a fluent builder method for an array item
|
// CollectionOf a fluent builder method for an array item
|
||||||
func (h *Header) CollectionOf(items *Items, format string) *Header {
|
func (h *Header) CollectionOf(items *Items, format string) *Header {
|
||||||
h.Type = jsonArray
|
h.Type = "array"
|
||||||
h.Items = items
|
h.Items = items
|
||||||
h.CollectionFormat = format
|
h.CollectionFormat = format
|
||||||
return h
|
return h
|
||||||
|
|||||||
5
vendor/github.com/go-openapi/spec/info.go
generated
vendored
5
vendor/github.com/go-openapi/spec/info.go
generated
vendored
@ -161,5 +161,8 @@ func (i *Info) UnmarshalJSON(data []byte) error {
|
|||||||
if err := json.Unmarshal(data, &i.InfoProps); err != nil {
|
if err := json.Unmarshal(data, &i.InfoProps); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
return json.Unmarshal(data, &i.VendorExtensible)
|
if err := json.Unmarshal(data, &i.VendorExtensible); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
return nil
|
||||||
}
|
}
|
||||||
|
|||||||
8
vendor/github.com/go-openapi/spec/items.go
generated
vendored
8
vendor/github.com/go-openapi/spec/items.go
generated
vendored
@ -22,10 +22,6 @@ import (
|
|||||||
"github.com/go-openapi/swag"
|
"github.com/go-openapi/swag"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
|
||||||
jsonRef = "$ref"
|
|
||||||
)
|
|
||||||
|
|
||||||
// SimpleSchema describe swagger simple schemas for parameters and headers
|
// SimpleSchema describe swagger simple schemas for parameters and headers
|
||||||
type SimpleSchema struct {
|
type SimpleSchema struct {
|
||||||
Type string `json:"type,omitempty"`
|
Type string `json:"type,omitempty"`
|
||||||
@ -93,7 +89,7 @@ func (i *Items) Typed(tpe, format string) *Items {
|
|||||||
|
|
||||||
// CollectionOf a fluent builder method for an array item
|
// CollectionOf a fluent builder method for an array item
|
||||||
func (i *Items) CollectionOf(items *Items, format string) *Items {
|
func (i *Items) CollectionOf(items *Items, format string) *Items {
|
||||||
i.Type = jsonArray
|
i.Type = "array"
|
||||||
i.Items = items
|
i.Items = items
|
||||||
i.CollectionFormat = format
|
i.CollectionFormat = format
|
||||||
return i
|
return i
|
||||||
@ -221,7 +217,7 @@ func (i Items) MarshalJSON() ([]byte, error) {
|
|||||||
|
|
||||||
// JSONLookup look up a value by the json property name
|
// JSONLookup look up a value by the json property name
|
||||||
func (i Items) JSONLookup(token string) (interface{}, error) {
|
func (i Items) JSONLookup(token string) (interface{}, error) {
|
||||||
if token == jsonRef {
|
if token == "$ref" {
|
||||||
return &i.Ref, nil
|
return &i.Ref, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
152
vendor/github.com/go-openapi/spec/normalizer.go
generated
vendored
152
vendor/github.com/go-openapi/spec/normalizer.go
generated
vendored
@ -1,152 +0,0 @@
|
|||||||
// Copyright 2015 go-swagger maintainers
|
|
||||||
//
|
|
||||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
// you may not use this file except in compliance with the License.
|
|
||||||
// You may obtain a copy of the License at
|
|
||||||
//
|
|
||||||
// http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
//
|
|
||||||
// Unless required by applicable law or agreed to in writing, software
|
|
||||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
// See the License for the specific language governing permissions and
|
|
||||||
// limitations under the License.
|
|
||||||
|
|
||||||
package spec
|
|
||||||
|
|
||||||
import (
|
|
||||||
"fmt"
|
|
||||||
"net/url"
|
|
||||||
"os"
|
|
||||||
"path"
|
|
||||||
"path/filepath"
|
|
||||||
"strings"
|
|
||||||
)
|
|
||||||
|
|
||||||
// normalize absolute path for cache.
|
|
||||||
// on Windows, drive letters should be converted to lower as scheme in net/url.URL
|
|
||||||
func normalizeAbsPath(path string) string {
|
|
||||||
u, err := url.Parse(path)
|
|
||||||
if err != nil {
|
|
||||||
debugLog("normalize absolute path failed: %s", err)
|
|
||||||
return path
|
|
||||||
}
|
|
||||||
return u.String()
|
|
||||||
}
|
|
||||||
|
|
||||||
// base or refPath could be a file path or a URL
|
|
||||||
// given a base absolute path and a ref path, return the absolute path of refPath
|
|
||||||
// 1) if refPath is absolute, return it
|
|
||||||
// 2) if refPath is relative, join it with basePath keeping the scheme, hosts, and ports if exists
|
|
||||||
// base could be a directory or a full file path
|
|
||||||
func normalizePaths(refPath, base string) string {
|
|
||||||
refURL, _ := url.Parse(refPath)
|
|
||||||
if path.IsAbs(refURL.Path) || filepath.IsAbs(refPath) {
|
|
||||||
// refPath is actually absolute
|
|
||||||
if refURL.Host != "" {
|
|
||||||
return refPath
|
|
||||||
}
|
|
||||||
parts := strings.Split(refPath, "#")
|
|
||||||
result := filepath.FromSlash(parts[0])
|
|
||||||
if len(parts) == 2 {
|
|
||||||
result += "#" + parts[1]
|
|
||||||
}
|
|
||||||
return result
|
|
||||||
}
|
|
||||||
|
|
||||||
// relative refPath
|
|
||||||
baseURL, _ := url.Parse(base)
|
|
||||||
if !strings.HasPrefix(refPath, "#") {
|
|
||||||
// combining paths
|
|
||||||
if baseURL.Host != "" {
|
|
||||||
baseURL.Path = path.Join(path.Dir(baseURL.Path), refURL.Path)
|
|
||||||
} else { // base is a file
|
|
||||||
newBase := fmt.Sprintf("%s#%s", filepath.Join(filepath.Dir(base), filepath.FromSlash(refURL.Path)), refURL.Fragment)
|
|
||||||
return newBase
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
// copying fragment from ref to base
|
|
||||||
baseURL.Fragment = refURL.Fragment
|
|
||||||
return baseURL.String()
|
|
||||||
}
|
|
||||||
|
|
||||||
// denormalizePaths returns to simplest notation on file $ref,
|
|
||||||
// i.e. strips the absolute path and sets a path relative to the base path.
|
|
||||||
//
|
|
||||||
// This is currently used when we rewrite ref after a circular ref has been detected
|
|
||||||
func denormalizeFileRef(ref *Ref, relativeBase, originalRelativeBase string) *Ref {
|
|
||||||
debugLog("denormalizeFileRef for: %s", ref.String())
|
|
||||||
|
|
||||||
if ref.String() == "" || ref.IsRoot() || ref.HasFragmentOnly {
|
|
||||||
return ref
|
|
||||||
}
|
|
||||||
// strip relativeBase from URI
|
|
||||||
relativeBaseURL, _ := url.Parse(relativeBase)
|
|
||||||
relativeBaseURL.Fragment = ""
|
|
||||||
|
|
||||||
if relativeBaseURL.IsAbs() && strings.HasPrefix(ref.String(), relativeBase) {
|
|
||||||
// this should work for absolute URI (e.g. http://...): we have an exact match, just trim prefix
|
|
||||||
r, _ := NewRef(strings.TrimPrefix(ref.String(), relativeBase))
|
|
||||||
return &r
|
|
||||||
}
|
|
||||||
|
|
||||||
if relativeBaseURL.IsAbs() {
|
|
||||||
// other absolute URL get unchanged (i.e. with a non-empty scheme)
|
|
||||||
return ref
|
|
||||||
}
|
|
||||||
|
|
||||||
// for relative file URIs:
|
|
||||||
originalRelativeBaseURL, _ := url.Parse(originalRelativeBase)
|
|
||||||
originalRelativeBaseURL.Fragment = ""
|
|
||||||
if strings.HasPrefix(ref.String(), originalRelativeBaseURL.String()) {
|
|
||||||
// the resulting ref is in the expanded spec: return a local ref
|
|
||||||
r, _ := NewRef(strings.TrimPrefix(ref.String(), originalRelativeBaseURL.String()))
|
|
||||||
return &r
|
|
||||||
}
|
|
||||||
|
|
||||||
// check if we may set a relative path, considering the original base path for this spec.
|
|
||||||
// Example:
|
|
||||||
// spec is located at /mypath/spec.json
|
|
||||||
// my normalized ref points to: /mypath/item.json#/target
|
|
||||||
// expected result: item.json#/target
|
|
||||||
parts := strings.Split(ref.String(), "#")
|
|
||||||
relativePath, err := filepath.Rel(path.Dir(originalRelativeBaseURL.String()), parts[0])
|
|
||||||
if err != nil {
|
|
||||||
// there is no common ancestor (e.g. different drives on windows)
|
|
||||||
// leaves the ref unchanged
|
|
||||||
return ref
|
|
||||||
}
|
|
||||||
if len(parts) == 2 {
|
|
||||||
relativePath += "#" + parts[1]
|
|
||||||
}
|
|
||||||
r, _ := NewRef(relativePath)
|
|
||||||
return &r
|
|
||||||
}
|
|
||||||
|
|
||||||
// relativeBase could be an ABSOLUTE file path or an ABSOLUTE URL
|
|
||||||
func normalizeFileRef(ref *Ref, relativeBase string) *Ref {
|
|
||||||
// This is important for when the reference is pointing to the root schema
|
|
||||||
if ref.String() == "" {
|
|
||||||
r, _ := NewRef(relativeBase)
|
|
||||||
return &r
|
|
||||||
}
|
|
||||||
|
|
||||||
debugLog("normalizing %s against %s", ref.String(), relativeBase)
|
|
||||||
|
|
||||||
s := normalizePaths(ref.String(), relativeBase)
|
|
||||||
r, _ := NewRef(s)
|
|
||||||
return &r
|
|
||||||
}
|
|
||||||
|
|
||||||
// absPath returns the absolute path of a file
|
|
||||||
func absPath(fname string) (string, error) {
|
|
||||||
if strings.HasPrefix(fname, "http") {
|
|
||||||
return fname, nil
|
|
||||||
}
|
|
||||||
if filepath.IsAbs(fname) {
|
|
||||||
return fname, nil
|
|
||||||
}
|
|
||||||
wd, err := os.Getwd()
|
|
||||||
return filepath.Join(wd, fname), err
|
|
||||||
}
|
|
||||||
159
vendor/github.com/go-openapi/spec/operation.go
generated
vendored
159
vendor/github.com/go-openapi/spec/operation.go
generated
vendored
@ -15,37 +15,24 @@
|
|||||||
package spec
|
package spec
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"bytes"
|
|
||||||
"encoding/gob"
|
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"sort"
|
|
||||||
|
|
||||||
"github.com/go-openapi/jsonpointer"
|
"github.com/go-openapi/jsonpointer"
|
||||||
"github.com/go-openapi/swag"
|
"github.com/go-openapi/swag"
|
||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
|
||||||
//gob.Register(map[string][]interface{}{})
|
|
||||||
gob.Register(map[string]interface{}{})
|
|
||||||
gob.Register([]interface{}{})
|
|
||||||
}
|
|
||||||
|
|
||||||
// OperationProps describes an operation
|
// OperationProps describes an operation
|
||||||
//
|
|
||||||
// NOTES:
|
|
||||||
// - schemes, when present must be from [http, https, ws, wss]: see validate
|
|
||||||
// - Security is handled as a special case: see MarshalJSON function
|
|
||||||
type OperationProps struct {
|
type OperationProps struct {
|
||||||
Description string `json:"description,omitempty"`
|
Description string `json:"description,omitempty"`
|
||||||
Consumes []string `json:"consumes,omitempty"`
|
Consumes []string `json:"consumes,omitempty"`
|
||||||
Produces []string `json:"produces,omitempty"`
|
Produces []string `json:"produces,omitempty"`
|
||||||
Schemes []string `json:"schemes,omitempty"`
|
Schemes []string `json:"schemes,omitempty"` // the scheme, when present must be from [http, https, ws, wss]
|
||||||
Tags []string `json:"tags,omitempty"`
|
Tags []string `json:"tags,omitempty"`
|
||||||
Summary string `json:"summary,omitempty"`
|
Summary string `json:"summary,omitempty"`
|
||||||
ExternalDocs *ExternalDocumentation `json:"externalDocs,omitempty"`
|
ExternalDocs *ExternalDocumentation `json:"externalDocs,omitempty"`
|
||||||
ID string `json:"operationId,omitempty"`
|
ID string `json:"operationId,omitempty"`
|
||||||
Deprecated bool `json:"deprecated,omitempty"`
|
Deprecated bool `json:"deprecated,omitempty"`
|
||||||
Security []map[string][]string `json:"security,omitempty"`
|
Security []map[string][]string `json:"security,omitempty"` //Special case, see MarshalJSON function
|
||||||
Parameters []Parameter `json:"parameters,omitempty"`
|
Parameters []Parameter `json:"parameters,omitempty"`
|
||||||
Responses *Responses `json:"responses,omitempty"`
|
Responses *Responses `json:"responses,omitempty"`
|
||||||
}
|
}
|
||||||
@ -89,17 +76,11 @@ func (o *Operation) SuccessResponse() (*Response, int, bool) {
|
|||||||
return nil, 0, false
|
return nil, 0, false
|
||||||
}
|
}
|
||||||
|
|
||||||
responseCodes := make([]int, 0, len(o.Responses.StatusCodeResponses))
|
for k, v := range o.Responses.StatusCodeResponses {
|
||||||
for k := range o.Responses.StatusCodeResponses {
|
if k/100 == 2 {
|
||||||
if k >= 200 && k < 300 {
|
return &v, k, true
|
||||||
responseCodes = append(responseCodes, k)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if len(responseCodes) > 0 {
|
|
||||||
sort.Ints(responseCodes)
|
|
||||||
v := o.Responses.StatusCodeResponses[responseCodes[0]]
|
|
||||||
return &v, responseCodes[0], true
|
|
||||||
}
|
|
||||||
|
|
||||||
return o.Responses.Default, 0, false
|
return o.Responses.Default, 0, false
|
||||||
}
|
}
|
||||||
@ -118,7 +99,10 @@ func (o *Operation) UnmarshalJSON(data []byte) error {
|
|||||||
if err := json.Unmarshal(data, &o.OperationProps); err != nil {
|
if err := json.Unmarshal(data, &o.OperationProps); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
return json.Unmarshal(data, &o.VendorExtensible)
|
if err := json.Unmarshal(data, &o.VendorExtensible); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// MarshalJSON converts this items object to JSON
|
// MarshalJSON converts this items object to JSON
|
||||||
@ -232,7 +216,7 @@ func (o *Operation) AddParam(param *Parameter) *Operation {
|
|||||||
// RemoveParam removes a parameter from the operation
|
// RemoveParam removes a parameter from the operation
|
||||||
func (o *Operation) RemoveParam(name, in string) *Operation {
|
func (o *Operation) RemoveParam(name, in string) *Operation {
|
||||||
for i, p := range o.Parameters {
|
for i, p := range o.Parameters {
|
||||||
if p.Name == name && p.In == in {
|
if p.Name == name && p.In == name {
|
||||||
o.Parameters = append(o.Parameters[:i], o.Parameters[i+1:]...)
|
o.Parameters = append(o.Parameters[:i], o.Parameters[i+1:]...)
|
||||||
return o
|
return o
|
||||||
}
|
}
|
||||||
@ -273,126 +257,3 @@ func (o *Operation) RespondsWith(code int, response *Response) *Operation {
|
|||||||
o.Responses.StatusCodeResponses[code] = *response
|
o.Responses.StatusCodeResponses[code] = *response
|
||||||
return o
|
return o
|
||||||
}
|
}
|
||||||
|
|
||||||
type opsAlias OperationProps
|
|
||||||
|
|
||||||
type gobAlias struct {
|
|
||||||
Security []map[string]struct {
|
|
||||||
List []string
|
|
||||||
Pad bool
|
|
||||||
}
|
|
||||||
Alias *opsAlias
|
|
||||||
SecurityIsEmpty bool
|
|
||||||
}
|
|
||||||
|
|
||||||
// GobEncode provides a safe gob encoder for Operation, including empty security requirements
|
|
||||||
func (o Operation) GobEncode() ([]byte, error) {
|
|
||||||
raw := struct {
|
|
||||||
Ext VendorExtensible
|
|
||||||
Props OperationProps
|
|
||||||
}{
|
|
||||||
Ext: o.VendorExtensible,
|
|
||||||
Props: o.OperationProps,
|
|
||||||
}
|
|
||||||
var b bytes.Buffer
|
|
||||||
err := gob.NewEncoder(&b).Encode(raw)
|
|
||||||
return b.Bytes(), err
|
|
||||||
}
|
|
||||||
|
|
||||||
// GobDecode provides a safe gob decoder for Operation, including empty security requirements
|
|
||||||
func (o *Operation) GobDecode(b []byte) error {
|
|
||||||
var raw struct {
|
|
||||||
Ext VendorExtensible
|
|
||||||
Props OperationProps
|
|
||||||
}
|
|
||||||
|
|
||||||
buf := bytes.NewBuffer(b)
|
|
||||||
err := gob.NewDecoder(buf).Decode(&raw)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
o.VendorExtensible = raw.Ext
|
|
||||||
o.OperationProps = raw.Props
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// GobEncode provides a safe gob encoder for Operation, including empty security requirements
|
|
||||||
func (op OperationProps) GobEncode() ([]byte, error) {
|
|
||||||
raw := gobAlias{
|
|
||||||
Alias: (*opsAlias)(&op),
|
|
||||||
}
|
|
||||||
|
|
||||||
var b bytes.Buffer
|
|
||||||
if op.Security == nil {
|
|
||||||
// nil security requirement
|
|
||||||
err := gob.NewEncoder(&b).Encode(raw)
|
|
||||||
return b.Bytes(), err
|
|
||||||
}
|
|
||||||
|
|
||||||
if len(op.Security) == 0 {
|
|
||||||
// empty, but non-nil security requirement
|
|
||||||
raw.SecurityIsEmpty = true
|
|
||||||
raw.Alias.Security = nil
|
|
||||||
err := gob.NewEncoder(&b).Encode(raw)
|
|
||||||
return b.Bytes(), err
|
|
||||||
}
|
|
||||||
|
|
||||||
raw.Security = make([]map[string]struct {
|
|
||||||
List []string
|
|
||||||
Pad bool
|
|
||||||
}, 0, len(op.Security))
|
|
||||||
for _, req := range op.Security {
|
|
||||||
v := make(map[string]struct {
|
|
||||||
List []string
|
|
||||||
Pad bool
|
|
||||||
}, len(req))
|
|
||||||
for k, val := range req {
|
|
||||||
v[k] = struct {
|
|
||||||
List []string
|
|
||||||
Pad bool
|
|
||||||
}{
|
|
||||||
List: val,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
raw.Security = append(raw.Security, v)
|
|
||||||
}
|
|
||||||
|
|
||||||
err := gob.NewEncoder(&b).Encode(raw)
|
|
||||||
return b.Bytes(), err
|
|
||||||
}
|
|
||||||
|
|
||||||
// GobDecode provides a safe gob decoder for Operation, including empty security requirements
|
|
||||||
func (op *OperationProps) GobDecode(b []byte) error {
|
|
||||||
var raw gobAlias
|
|
||||||
|
|
||||||
buf := bytes.NewBuffer(b)
|
|
||||||
err := gob.NewDecoder(buf).Decode(&raw)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
if raw.Alias == nil {
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
switch {
|
|
||||||
case raw.SecurityIsEmpty:
|
|
||||||
// empty, but non-nil security requirement
|
|
||||||
raw.Alias.Security = []map[string][]string{}
|
|
||||||
case len(raw.Alias.Security) == 0:
|
|
||||||
// nil security requirement
|
|
||||||
raw.Alias.Security = nil
|
|
||||||
default:
|
|
||||||
raw.Alias.Security = make([]map[string][]string, 0, len(raw.Security))
|
|
||||||
for _, req := range raw.Security {
|
|
||||||
v := make(map[string][]string, len(req))
|
|
||||||
for k, val := range req {
|
|
||||||
v[k] = make([]string, 0, len(val.List))
|
|
||||||
v[k] = append(v[k], val.List...)
|
|
||||||
}
|
|
||||||
raw.Alias.Security = append(raw.Alias.Security, v)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
*op = *(*OperationProps)(raw.Alias)
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|||||||
51
vendor/github.com/go-openapi/spec/parameter.go
generated
vendored
51
vendor/github.com/go-openapi/spec/parameter.go
generated
vendored
@ -39,8 +39,7 @@ func PathParam(name string) *Parameter {
|
|||||||
|
|
||||||
// BodyParam creates a body parameter
|
// BodyParam creates a body parameter
|
||||||
func BodyParam(name string, schema *Schema) *Parameter {
|
func BodyParam(name string, schema *Schema) *Parameter {
|
||||||
return &Parameter{ParamProps: ParamProps{Name: name, In: "body", Schema: schema},
|
return &Parameter{ParamProps: ParamProps{Name: name, In: "body", Schema: schema}, SimpleSchema: SimpleSchema{Type: "object"}}
|
||||||
SimpleSchema: SimpleSchema{Type: "object"}}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// FormDataParam creates a body parameter
|
// FormDataParam creates a body parameter
|
||||||
@ -50,15 +49,12 @@ func FormDataParam(name string) *Parameter {
|
|||||||
|
|
||||||
// FileParam creates a body parameter
|
// FileParam creates a body parameter
|
||||||
func FileParam(name string) *Parameter {
|
func FileParam(name string) *Parameter {
|
||||||
return &Parameter{ParamProps: ParamProps{Name: name, In: "formData"},
|
return &Parameter{ParamProps: ParamProps{Name: name, In: "formData"}, SimpleSchema: SimpleSchema{Type: "file"}}
|
||||||
SimpleSchema: SimpleSchema{Type: "file"}}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// SimpleArrayParam creates a param for a simple array (string, int, date etc)
|
// SimpleArrayParam creates a param for a simple array (string, int, date etc)
|
||||||
func SimpleArrayParam(name, tpe, fmt string) *Parameter {
|
func SimpleArrayParam(name, tpe, fmt string) *Parameter {
|
||||||
return &Parameter{ParamProps: ParamProps{Name: name},
|
return &Parameter{ParamProps: ParamProps{Name: name}, SimpleSchema: SimpleSchema{Type: "array", CollectionFormat: "csv", Items: &Items{SimpleSchema: SimpleSchema{Type: "string", Format: fmt}}}}
|
||||||
SimpleSchema: SimpleSchema{Type: jsonArray, CollectionFormat: "csv",
|
|
||||||
Items: &Items{SimpleSchema: SimpleSchema{Type: "string", Format: fmt}}}}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ParamRef creates a parameter that's a json reference
|
// ParamRef creates a parameter that's a json reference
|
||||||
@ -69,43 +65,25 @@ func ParamRef(uri string) *Parameter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ParamProps describes the specific attributes of an operation parameter
|
// ParamProps describes the specific attributes of an operation parameter
|
||||||
//
|
|
||||||
// NOTE:
|
|
||||||
// - Schema is defined when "in" == "body": see validate
|
|
||||||
// - AllowEmptyValue is allowed where "in" == "query" || "formData"
|
|
||||||
type ParamProps struct {
|
type ParamProps struct {
|
||||||
Description string `json:"description,omitempty"`
|
Description string `json:"description,omitempty"`
|
||||||
Name string `json:"name,omitempty"`
|
Name string `json:"name,omitempty"`
|
||||||
In string `json:"in,omitempty"`
|
In string `json:"in,omitempty"`
|
||||||
Required bool `json:"required,omitempty"`
|
Required bool `json:"required,omitempty"`
|
||||||
Schema *Schema `json:"schema,omitempty"`
|
Schema *Schema `json:"schema,omitempty"` // when in == "body"
|
||||||
AllowEmptyValue bool `json:"allowEmptyValue,omitempty"`
|
AllowEmptyValue bool `json:"allowEmptyValue,omitempty"` // when in == "query" || "formData"
|
||||||
}
|
}
|
||||||
|
|
||||||
// Parameter a unique parameter is defined by a combination of a [name](#parameterName) and [location](#parameterIn).
|
// Parameter a unique parameter is defined by a combination of a [name](#parameterName) and [location](#parameterIn).
|
||||||
//
|
//
|
||||||
// There are five possible parameter types.
|
// There are five possible parameter types.
|
||||||
// * Path - Used together with [Path Templating](#pathTemplating), where the parameter value is actually part
|
// * Path - Used together with [Path Templating](#pathTemplating), where the parameter value is actually part of the operation's URL. This does not include the host or base path of the API. For example, in `/items/{itemId}`, the path parameter is `itemId`.
|
||||||
// of the operation's URL. This does not include the host or base path of the API. For example, in `/items/{itemId}`,
|
|
||||||
// the path parameter is `itemId`.
|
|
||||||
// * Query - Parameters that are appended to the URL. For example, in `/items?id=###`, the query parameter is `id`.
|
// * Query - Parameters that are appended to the URL. For example, in `/items?id=###`, the query parameter is `id`.
|
||||||
// * Header - Custom headers that are expected as part of the request.
|
// * Header - Custom headers that are expected as part of the request.
|
||||||
// * Body - The payload that's appended to the HTTP request. Since there can only be one payload, there can only be
|
// * Body - The payload that's appended to the HTTP request. Since there can only be one payload, there can only be *one* body parameter. The name of the body parameter has no effect on the parameter itself and is used for documentation purposes only. Since Form parameters are also in the payload, body and form parameters cannot exist together for the same operation.
|
||||||
// _one_ body parameter. The name of the body parameter has no effect on the parameter itself and is used for
|
// * Form - Used to describe the payload of an HTTP request when either `application/x-www-form-urlencoded` or `multipart/form-data` are used as the content type of the request (in Swagger's definition, the [`consumes`](#operationConsumes) property of an operation). This is the only parameter type that can be used to send files, thus supporting the `file` type. Since form parameters are sent in the payload, they cannot be declared together with a body parameter for the same operation. Form parameters have a different format based on the content-type used (for further details, consult http://www.w3.org/TR/html401/interact/forms.html#h-17.13.4):
|
||||||
// documentation purposes only. Since Form parameters are also in the payload, body and form parameters cannot exist
|
// * `application/x-www-form-urlencoded` - Similar to the format of Query parameters but as a payload. For example, `foo=1&bar=swagger` - both `foo` and `bar` are form parameters. This is normally used for simple parameters that are being transferred.
|
||||||
// together for the same operation.
|
// * `multipart/form-data` - each parameter takes a section in the payload with an internal header. For example, for the header `Content-Disposition: form-data; name="submit-name"` the name of the parameter is `submit-name`. This type of form parameters is more commonly used for file transfers.
|
||||||
// * Form - Used to describe the payload of an HTTP request when either `application/x-www-form-urlencoded` or
|
|
||||||
// `multipart/form-data` are used as the content type of the request (in Swagger's definition,
|
|
||||||
// the [`consumes`](#operationConsumes) property of an operation). This is the only parameter type that can be used
|
|
||||||
// to send files, thus supporting the `file` type. Since form parameters are sent in the payload, they cannot be
|
|
||||||
// declared together with a body parameter for the same operation. Form parameters have a different format based on
|
|
||||||
// the content-type used (for further details, consult http://www.w3.org/TR/html401/interact/forms.html#h-17.13.4).
|
|
||||||
// * `application/x-www-form-urlencoded` - Similar to the format of Query parameters but as a payload.
|
|
||||||
// For example, `foo=1&bar=swagger` - both `foo` and `bar` are form parameters. This is normally used for simple
|
|
||||||
// parameters that are being transferred.
|
|
||||||
// * `multipart/form-data` - each parameter takes a section in the payload with an internal header.
|
|
||||||
// For example, for the header `Content-Disposition: form-data; name="submit-name"` the name of the parameter is
|
|
||||||
// `submit-name`. This type of form parameters is more commonly used for file transfers.
|
|
||||||
//
|
//
|
||||||
// For more information: http://goo.gl/8us55a#parameterObject
|
// For more information: http://goo.gl/8us55a#parameterObject
|
||||||
type Parameter struct {
|
type Parameter struct {
|
||||||
@ -121,7 +99,7 @@ func (p Parameter) JSONLookup(token string) (interface{}, error) {
|
|||||||
if ex, ok := p.Extensions[token]; ok {
|
if ex, ok := p.Extensions[token]; ok {
|
||||||
return &ex, nil
|
return &ex, nil
|
||||||
}
|
}
|
||||||
if token == jsonRef {
|
if token == "$ref" {
|
||||||
return &p.Ref, nil
|
return &p.Ref, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -170,7 +148,7 @@ func (p *Parameter) Typed(tpe, format string) *Parameter {
|
|||||||
|
|
||||||
// CollectionOf a fluent builder method for an array parameter
|
// CollectionOf a fluent builder method for an array parameter
|
||||||
func (p *Parameter) CollectionOf(items *Items, format string) *Parameter {
|
func (p *Parameter) CollectionOf(items *Items, format string) *Parameter {
|
||||||
p.Type = jsonArray
|
p.Type = "array"
|
||||||
p.Items = items
|
p.Items = items
|
||||||
p.CollectionFormat = format
|
p.CollectionFormat = format
|
||||||
return p
|
return p
|
||||||
@ -292,7 +270,10 @@ func (p *Parameter) UnmarshalJSON(data []byte) error {
|
|||||||
if err := json.Unmarshal(data, &p.VendorExtensible); err != nil {
|
if err := json.Unmarshal(data, &p.VendorExtensible); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
return json.Unmarshal(data, &p.ParamProps)
|
if err := json.Unmarshal(data, &p.ParamProps); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// MarshalJSON converts this items object to JSON
|
// MarshalJSON converts this items object to JSON
|
||||||
|
|||||||
7
vendor/github.com/go-openapi/spec/path_item.go
generated
vendored
7
vendor/github.com/go-openapi/spec/path_item.go
generated
vendored
@ -50,7 +50,7 @@ func (p PathItem) JSONLookup(token string) (interface{}, error) {
|
|||||||
if ex, ok := p.Extensions[token]; ok {
|
if ex, ok := p.Extensions[token]; ok {
|
||||||
return &ex, nil
|
return &ex, nil
|
||||||
}
|
}
|
||||||
if token == jsonRef {
|
if token == "$ref" {
|
||||||
return &p.Ref, nil
|
return &p.Ref, nil
|
||||||
}
|
}
|
||||||
r, _, err := jsonpointer.GetForToken(p.PathItemProps, token)
|
r, _, err := jsonpointer.GetForToken(p.PathItemProps, token)
|
||||||
@ -65,7 +65,10 @@ func (p *PathItem) UnmarshalJSON(data []byte) error {
|
|||||||
if err := json.Unmarshal(data, &p.VendorExtensible); err != nil {
|
if err := json.Unmarshal(data, &p.VendorExtensible); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
return json.Unmarshal(data, &p.PathItemProps)
|
if err := json.Unmarshal(data, &p.PathItemProps); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// MarshalJSON converts this items object to JSON
|
// MarshalJSON converts this items object to JSON
|
||||||
|
|||||||
24
vendor/github.com/go-openapi/spec/ref.go
generated
vendored
24
vendor/github.com/go-openapi/spec/ref.go
generated
vendored
@ -15,8 +15,6 @@
|
|||||||
package spec
|
package spec
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"bytes"
|
|
||||||
"encoding/gob"
|
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"net/http"
|
"net/http"
|
||||||
"os"
|
"os"
|
||||||
@ -150,28 +148,6 @@ func (r *Ref) UnmarshalJSON(d []byte) error {
|
|||||||
return r.fromMap(v)
|
return r.fromMap(v)
|
||||||
}
|
}
|
||||||
|
|
||||||
// GobEncode provides a safe gob encoder for Ref
|
|
||||||
func (r Ref) GobEncode() ([]byte, error) {
|
|
||||||
var b bytes.Buffer
|
|
||||||
raw, err := r.MarshalJSON()
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
err = gob.NewEncoder(&b).Encode(raw)
|
|
||||||
return b.Bytes(), err
|
|
||||||
}
|
|
||||||
|
|
||||||
// GobDecode provides a safe gob decoder for Ref
|
|
||||||
func (r *Ref) GobDecode(b []byte) error {
|
|
||||||
var raw []byte
|
|
||||||
buf := bytes.NewBuffer(b)
|
|
||||||
err := gob.NewDecoder(buf).Decode(&raw)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
return json.Unmarshal(raw, r)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (r *Ref) fromMap(v map[string]interface{}) error {
|
func (r *Ref) fromMap(v map[string]interface{}) error {
|
||||||
if v == nil {
|
if v == nil {
|
||||||
return nil
|
return nil
|
||||||
|
|||||||
5
vendor/github.com/go-openapi/spec/response.go
generated
vendored
5
vendor/github.com/go-openapi/spec/response.go
generated
vendored
@ -58,7 +58,10 @@ func (r *Response) UnmarshalJSON(data []byte) error {
|
|||||||
if err := json.Unmarshal(data, &r.Refable); err != nil {
|
if err := json.Unmarshal(data, &r.Refable); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
return json.Unmarshal(data, &r.VendorExtensible)
|
if err := json.Unmarshal(data, &r.VendorExtensible); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// MarshalJSON converts this items object to JSON
|
// MarshalJSON converts this items object to JSON
|
||||||
|
|||||||
53
vendor/github.com/go-openapi/spec/schema.go
generated
vendored
53
vendor/github.com/go-openapi/spec/schema.go
generated
vendored
@ -89,8 +89,7 @@ func DateTimeProperty() *Schema {
|
|||||||
|
|
||||||
// MapProperty creates a map property
|
// MapProperty creates a map property
|
||||||
func MapProperty(property *Schema) *Schema {
|
func MapProperty(property *Schema) *Schema {
|
||||||
return &Schema{SchemaProps: SchemaProps{Type: []string{"object"},
|
return &Schema{SchemaProps: SchemaProps{Type: []string{"object"}, AdditionalProperties: &SchemaOrBool{Allows: true, Schema: property}}}
|
||||||
AdditionalProperties: &SchemaOrBool{Allows: true, Schema: property}}}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// RefProperty creates a ref property
|
// RefProperty creates a ref property
|
||||||
@ -156,6 +155,54 @@ func (r *SchemaURL) fromMap(v map[string]interface{}) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// type ExtraSchemaProps map[string]interface{}
|
||||||
|
|
||||||
|
// // JSONSchema represents a structure that is a json schema draft 04
|
||||||
|
// type JSONSchema struct {
|
||||||
|
// SchemaProps
|
||||||
|
// ExtraSchemaProps
|
||||||
|
// }
|
||||||
|
|
||||||
|
// // MarshalJSON marshal this to JSON
|
||||||
|
// func (s JSONSchema) MarshalJSON() ([]byte, error) {
|
||||||
|
// b1, err := json.Marshal(s.SchemaProps)
|
||||||
|
// if err != nil {
|
||||||
|
// return nil, err
|
||||||
|
// }
|
||||||
|
// b2, err := s.Ref.MarshalJSON()
|
||||||
|
// if err != nil {
|
||||||
|
// return nil, err
|
||||||
|
// }
|
||||||
|
// b3, err := s.Schema.MarshalJSON()
|
||||||
|
// if err != nil {
|
||||||
|
// return nil, err
|
||||||
|
// }
|
||||||
|
// b4, err := json.Marshal(s.ExtraSchemaProps)
|
||||||
|
// if err != nil {
|
||||||
|
// return nil, err
|
||||||
|
// }
|
||||||
|
// return swag.ConcatJSON(b1, b2, b3, b4), nil
|
||||||
|
// }
|
||||||
|
|
||||||
|
// // UnmarshalJSON marshal this from JSON
|
||||||
|
// func (s *JSONSchema) UnmarshalJSON(data []byte) error {
|
||||||
|
// var sch JSONSchema
|
||||||
|
// if err := json.Unmarshal(data, &sch.SchemaProps); err != nil {
|
||||||
|
// return err
|
||||||
|
// }
|
||||||
|
// if err := json.Unmarshal(data, &sch.Ref); err != nil {
|
||||||
|
// return err
|
||||||
|
// }
|
||||||
|
// if err := json.Unmarshal(data, &sch.Schema); err != nil {
|
||||||
|
// return err
|
||||||
|
// }
|
||||||
|
// if err := json.Unmarshal(data, &sch.ExtraSchemaProps); err != nil {
|
||||||
|
// return err
|
||||||
|
// }
|
||||||
|
// *s = sch
|
||||||
|
// return nil
|
||||||
|
// }
|
||||||
|
|
||||||
// SchemaProps describes a JSON schema (draft 4)
|
// SchemaProps describes a JSON schema (draft 4)
|
||||||
type SchemaProps struct {
|
type SchemaProps struct {
|
||||||
ID string `json:"id,omitempty"`
|
ID string `json:"id,omitempty"`
|
||||||
@ -304,7 +351,7 @@ func (s *Schema) AddType(tpe, format string) *Schema {
|
|||||||
|
|
||||||
// CollectionOf a fluent builder method for an array parameter
|
// CollectionOf a fluent builder method for an array parameter
|
||||||
func (s *Schema) CollectionOf(items Schema) *Schema {
|
func (s *Schema) CollectionOf(items Schema) *Schema {
|
||||||
s.Type = []string{jsonArray}
|
s.Type = []string{"array"}
|
||||||
s.Items = &SchemaOrArray{Schema: &items}
|
s.Items = &SchemaOrArray{Schema: &items}
|
||||||
return s
|
return s
|
||||||
}
|
}
|
||||||
|
|||||||
275
vendor/github.com/go-openapi/spec/schema_loader.go
generated
vendored
275
vendor/github.com/go-openapi/spec/schema_loader.go
generated
vendored
@ -1,275 +0,0 @@
|
|||||||
// Copyright 2015 go-swagger maintainers
|
|
||||||
//
|
|
||||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
// you may not use this file except in compliance with the License.
|
|
||||||
// You may obtain a copy of the License at
|
|
||||||
//
|
|
||||||
// http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
//
|
|
||||||
// Unless required by applicable law or agreed to in writing, software
|
|
||||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
// See the License for the specific language governing permissions and
|
|
||||||
// limitations under the License.
|
|
||||||
|
|
||||||
package spec
|
|
||||||
|
|
||||||
import (
|
|
||||||
"encoding/json"
|
|
||||||
"fmt"
|
|
||||||
"log"
|
|
||||||
"net/url"
|
|
||||||
"reflect"
|
|
||||||
"strings"
|
|
||||||
|
|
||||||
"github.com/go-openapi/swag"
|
|
||||||
)
|
|
||||||
|
|
||||||
// PathLoader function to use when loading remote refs
|
|
||||||
var PathLoader func(string) (json.RawMessage, error)
|
|
||||||
|
|
||||||
func init() {
|
|
||||||
PathLoader = func(path string) (json.RawMessage, error) {
|
|
||||||
data, err := swag.LoadFromFileOrHTTP(path)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
return json.RawMessage(data), nil
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// resolverContext allows to share a context during spec processing.
|
|
||||||
// At the moment, it just holds the index of circular references found.
|
|
||||||
type resolverContext struct {
|
|
||||||
// circulars holds all visited circular references, which allows shortcuts.
|
|
||||||
// NOTE: this is not just a performance improvement: it is required to figure out
|
|
||||||
// circular references which participate several cycles.
|
|
||||||
// This structure is privately instantiated and needs not be locked against
|
|
||||||
// concurrent access, unless we chose to implement a parallel spec walking.
|
|
||||||
circulars map[string]bool
|
|
||||||
basePath string
|
|
||||||
}
|
|
||||||
|
|
||||||
func newResolverContext(originalBasePath string) *resolverContext {
|
|
||||||
return &resolverContext{
|
|
||||||
circulars: make(map[string]bool),
|
|
||||||
basePath: originalBasePath, // keep the root base path in context
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
type schemaLoader struct {
|
|
||||||
root interface{}
|
|
||||||
options *ExpandOptions
|
|
||||||
cache ResolutionCache
|
|
||||||
context *resolverContext
|
|
||||||
loadDoc func(string) (json.RawMessage, error)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (r *schemaLoader) transitiveResolver(basePath string, ref Ref) (*schemaLoader, error) {
|
|
||||||
if ref.IsRoot() || ref.HasFragmentOnly {
|
|
||||||
return r, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
baseRef, _ := NewRef(basePath)
|
|
||||||
currentRef := normalizeFileRef(&ref, basePath)
|
|
||||||
if strings.HasPrefix(currentRef.String(), baseRef.String()) {
|
|
||||||
return r, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// Set a new root to resolve against
|
|
||||||
rootURL := currentRef.GetURL()
|
|
||||||
rootURL.Fragment = ""
|
|
||||||
root, _ := r.cache.Get(rootURL.String())
|
|
||||||
|
|
||||||
// shallow copy of resolver options to set a new RelativeBase when
|
|
||||||
// traversing multiple documents
|
|
||||||
newOptions := r.options
|
|
||||||
newOptions.RelativeBase = rootURL.String()
|
|
||||||
debugLog("setting new root: %s", newOptions.RelativeBase)
|
|
||||||
resolver, err := defaultSchemaLoader(root, newOptions, r.cache, r.context)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
return resolver, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (r *schemaLoader) updateBasePath(transitive *schemaLoader, basePath string) string {
|
|
||||||
if transitive != r {
|
|
||||||
debugLog("got a new resolver")
|
|
||||||
if transitive.options != nil && transitive.options.RelativeBase != "" {
|
|
||||||
basePath, _ = absPath(transitive.options.RelativeBase)
|
|
||||||
debugLog("new basePath = %s", basePath)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return basePath
|
|
||||||
}
|
|
||||||
|
|
||||||
func (r *schemaLoader) resolveRef(ref *Ref, target interface{}, basePath string) error {
|
|
||||||
tgt := reflect.ValueOf(target)
|
|
||||||
if tgt.Kind() != reflect.Ptr {
|
|
||||||
return fmt.Errorf("resolve ref: target needs to be a pointer")
|
|
||||||
}
|
|
||||||
|
|
||||||
refURL := ref.GetURL()
|
|
||||||
if refURL == nil {
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
var res interface{}
|
|
||||||
var data interface{}
|
|
||||||
var err error
|
|
||||||
// Resolve against the root if it isn't nil, and if ref is pointing at the root, or has a fragment only which means
|
|
||||||
// it is pointing somewhere in the root.
|
|
||||||
root := r.root
|
|
||||||
if (ref.IsRoot() || ref.HasFragmentOnly) && root == nil && basePath != "" {
|
|
||||||
if baseRef, erb := NewRef(basePath); erb == nil {
|
|
||||||
root, _, _, _ = r.load(baseRef.GetURL())
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (ref.IsRoot() || ref.HasFragmentOnly) && root != nil {
|
|
||||||
data = root
|
|
||||||
} else {
|
|
||||||
baseRef := normalizeFileRef(ref, basePath)
|
|
||||||
debugLog("current ref is: %s", ref.String())
|
|
||||||
debugLog("current ref normalized file: %s", baseRef.String())
|
|
||||||
data, _, _, err = r.load(baseRef.GetURL())
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
res = data
|
|
||||||
if ref.String() != "" {
|
|
||||||
res, _, err = ref.GetPointer().Get(data)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return swag.DynamicJSONToStruct(res, target)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (r *schemaLoader) load(refURL *url.URL) (interface{}, url.URL, bool, error) {
|
|
||||||
debugLog("loading schema from url: %s", refURL)
|
|
||||||
toFetch := *refURL
|
|
||||||
toFetch.Fragment = ""
|
|
||||||
|
|
||||||
normalized := normalizeAbsPath(toFetch.String())
|
|
||||||
|
|
||||||
data, fromCache := r.cache.Get(normalized)
|
|
||||||
if !fromCache {
|
|
||||||
b, err := r.loadDoc(normalized)
|
|
||||||
if err != nil {
|
|
||||||
return nil, url.URL{}, false, err
|
|
||||||
}
|
|
||||||
|
|
||||||
if err := json.Unmarshal(b, &data); err != nil {
|
|
||||||
return nil, url.URL{}, false, err
|
|
||||||
}
|
|
||||||
r.cache.Set(normalized, data)
|
|
||||||
}
|
|
||||||
|
|
||||||
return data, toFetch, fromCache, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// isCircular detects cycles in sequences of $ref.
|
|
||||||
// It relies on a private context (which needs not be locked).
|
|
||||||
func (r *schemaLoader) isCircular(ref *Ref, basePath string, parentRefs ...string) (foundCycle bool) {
|
|
||||||
normalizedRef := normalizePaths(ref.String(), basePath)
|
|
||||||
if _, ok := r.context.circulars[normalizedRef]; ok {
|
|
||||||
// circular $ref has been already detected in another explored cycle
|
|
||||||
foundCycle = true
|
|
||||||
return
|
|
||||||
}
|
|
||||||
foundCycle = swag.ContainsStringsCI(parentRefs, normalizedRef)
|
|
||||||
if foundCycle {
|
|
||||||
r.context.circulars[normalizedRef] = true
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// Resolve resolves a reference against basePath and stores the result in target
|
|
||||||
// Resolve is not in charge of following references, it only resolves ref by following its URL
|
|
||||||
// if the schema that ref is referring to has more refs in it. Resolve doesn't resolve them
|
|
||||||
// if basePath is an empty string, ref is resolved against the root schema stored in the schemaLoader struct
|
|
||||||
func (r *schemaLoader) Resolve(ref *Ref, target interface{}, basePath string) error {
|
|
||||||
return r.resolveRef(ref, target, basePath)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (r *schemaLoader) deref(input interface{}, parentRefs []string, basePath string) error {
|
|
||||||
var ref *Ref
|
|
||||||
switch refable := input.(type) {
|
|
||||||
case *Schema:
|
|
||||||
ref = &refable.Ref
|
|
||||||
case *Parameter:
|
|
||||||
ref = &refable.Ref
|
|
||||||
case *Response:
|
|
||||||
ref = &refable.Ref
|
|
||||||
case *PathItem:
|
|
||||||
ref = &refable.Ref
|
|
||||||
default:
|
|
||||||
return fmt.Errorf("deref: unsupported type %T", input)
|
|
||||||
}
|
|
||||||
|
|
||||||
curRef := ref.String()
|
|
||||||
if curRef != "" {
|
|
||||||
normalizedRef := normalizeFileRef(ref, basePath)
|
|
||||||
normalizedBasePath := normalizedRef.RemoteURI()
|
|
||||||
|
|
||||||
if r.isCircular(normalizedRef, basePath, parentRefs...) {
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
if err := r.resolveRef(ref, input, basePath); r.shouldStopOnError(err) {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
// NOTE(fredbi): removed basePath check => needs more testing
|
|
||||||
if ref.String() != "" && ref.String() != curRef {
|
|
||||||
parentRefs = append(parentRefs, normalizedRef.String())
|
|
||||||
return r.deref(input, parentRefs, normalizedBasePath)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (r *schemaLoader) shouldStopOnError(err error) bool {
|
|
||||||
if err != nil && !r.options.ContinueOnError {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
|
|
||||||
if err != nil {
|
|
||||||
log.Println(err)
|
|
||||||
}
|
|
||||||
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
|
|
||||||
func defaultSchemaLoader(
|
|
||||||
root interface{},
|
|
||||||
expandOptions *ExpandOptions,
|
|
||||||
cache ResolutionCache,
|
|
||||||
context *resolverContext) (*schemaLoader, error) {
|
|
||||||
|
|
||||||
if cache == nil {
|
|
||||||
cache = resCache
|
|
||||||
}
|
|
||||||
if expandOptions == nil {
|
|
||||||
expandOptions = &ExpandOptions{}
|
|
||||||
}
|
|
||||||
absBase, _ := absPath(expandOptions.RelativeBase)
|
|
||||||
if context == nil {
|
|
||||||
context = newResolverContext(absBase)
|
|
||||||
}
|
|
||||||
return &schemaLoader{
|
|
||||||
root: root,
|
|
||||||
options: expandOptions,
|
|
||||||
cache: cache,
|
|
||||||
context: context,
|
|
||||||
loadDoc: func(path string) (json.RawMessage, error) {
|
|
||||||
debugLog("fetching document at %q", path)
|
|
||||||
return PathLoader(path)
|
|
||||||
},
|
|
||||||
}, nil
|
|
||||||
}
|
|
||||||
5
vendor/github.com/go-openapi/spec/security_scheme.go
generated
vendored
5
vendor/github.com/go-openapi/spec/security_scheme.go
generated
vendored
@ -136,5 +136,8 @@ func (s *SecurityScheme) UnmarshalJSON(data []byte) error {
|
|||||||
if err := json.Unmarshal(data, &s.SecuritySchemeProps); err != nil {
|
if err := json.Unmarshal(data, &s.SecuritySchemeProps); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
return json.Unmarshal(data, &s.VendorExtensible)
|
if err := json.Unmarshal(data, &s.VendorExtensible); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
return nil
|
||||||
}
|
}
|
||||||
|
|||||||
18
vendor/github.com/go-openapi/spec/swagger.go
generated
vendored
18
vendor/github.com/go-openapi/spec/swagger.go
generated
vendored
@ -24,8 +24,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
// Swagger this is the root document object for the API specification.
|
// Swagger this is the root document object for the API specification.
|
||||||
// It combines what previously was the Resource Listing and API Declaration (version 1.2 and earlier)
|
// It combines what previously was the Resource Listing and API Declaration (version 1.2 and earlier) together into one document.
|
||||||
// together into one document.
|
|
||||||
//
|
//
|
||||||
// For more information: http://goo.gl/8us55a#swagger-object-
|
// For more information: http://goo.gl/8us55a#swagger-object-
|
||||||
type Swagger struct {
|
type Swagger struct {
|
||||||
@ -69,21 +68,16 @@ func (s *Swagger) UnmarshalJSON(data []byte) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// SwaggerProps captures the top-level properties of an Api specification
|
// SwaggerProps captures the top-level properties of an Api specification
|
||||||
//
|
|
||||||
// NOTE: validation rules
|
|
||||||
// - the scheme, when present must be from [http, https, ws, wss]
|
|
||||||
// - BasePath must start with a leading "/"
|
|
||||||
// - Paths is required
|
|
||||||
type SwaggerProps struct {
|
type SwaggerProps struct {
|
||||||
ID string `json:"id,omitempty"`
|
ID string `json:"id,omitempty"`
|
||||||
Consumes []string `json:"consumes,omitempty"`
|
Consumes []string `json:"consumes,omitempty"`
|
||||||
Produces []string `json:"produces,omitempty"`
|
Produces []string `json:"produces,omitempty"`
|
||||||
Schemes []string `json:"schemes,omitempty"`
|
Schemes []string `json:"schemes,omitempty"` // the scheme, when present must be from [http, https, ws, wss]
|
||||||
Swagger string `json:"swagger,omitempty"`
|
Swagger string `json:"swagger,omitempty"`
|
||||||
Info *Info `json:"info,omitempty"`
|
Info *Info `json:"info,omitempty"`
|
||||||
Host string `json:"host,omitempty"`
|
Host string `json:"host,omitempty"`
|
||||||
BasePath string `json:"basePath,omitempty"`
|
BasePath string `json:"basePath,omitempty"` // must start with a leading "/"
|
||||||
Paths *Paths `json:"paths"`
|
Paths *Paths `json:"paths"` // required
|
||||||
Definitions Definitions `json:"definitions,omitempty"`
|
Definitions Definitions `json:"definitions,omitempty"`
|
||||||
Parameters map[string]Parameter `json:"parameters,omitempty"`
|
Parameters map[string]Parameter `json:"parameters,omitempty"`
|
||||||
Responses map[string]Response `json:"responses,omitempty"`
|
Responses map[string]Response `json:"responses,omitempty"`
|
||||||
@ -250,9 +244,9 @@ func (s *StringOrArray) UnmarshalJSON(data []byte) error {
|
|||||||
if single == nil {
|
if single == nil {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
switch v := single.(type) {
|
switch single.(type) {
|
||||||
case string:
|
case string:
|
||||||
*s = StringOrArray([]string{v})
|
*s = StringOrArray([]string{single.(string)})
|
||||||
return nil
|
return nil
|
||||||
default:
|
default:
|
||||||
return fmt.Errorf("only string or array is allowed, not %T", single)
|
return fmt.Errorf("only string or array is allowed, not %T", single)
|
||||||
|
|||||||
5
vendor/github.com/go-openapi/spec/tag.go
generated
vendored
5
vendor/github.com/go-openapi/spec/tag.go
generated
vendored
@ -30,11 +30,10 @@ type TagProps struct {
|
|||||||
|
|
||||||
// NewTag creates a new tag
|
// NewTag creates a new tag
|
||||||
func NewTag(name, description string, externalDocs *ExternalDocumentation) Tag {
|
func NewTag(name, description string, externalDocs *ExternalDocumentation) Tag {
|
||||||
return Tag{TagProps: TagProps{Description: description, Name: name, ExternalDocs: externalDocs}}
|
return Tag{TagProps: TagProps{description, name, externalDocs}}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Tag allows adding meta data to a single tag that is used by the
|
// Tag allows adding meta data to a single tag that is used by the [Operation Object](http://goo.gl/8us55a#operationObject).
|
||||||
// [Operation Object](http://goo.gl/8us55a#operationObject).
|
|
||||||
// It is not mandatory to have a Tag Object per tag used there.
|
// It is not mandatory to have a Tag Object per tag used there.
|
||||||
//
|
//
|
||||||
// For more information: http://goo.gl/8us55a#tagObject
|
// For more information: http://goo.gl/8us55a#tagObject
|
||||||
|
|||||||
174
vendor/github.com/go-openapi/spec/unused.go
generated
vendored
174
vendor/github.com/go-openapi/spec/unused.go
generated
vendored
@ -1,174 +0,0 @@
|
|||||||
// Copyright 2015 go-swagger maintainers
|
|
||||||
//
|
|
||||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
// you may not use this file except in compliance with the License.
|
|
||||||
// You may obtain a copy of the License at
|
|
||||||
//
|
|
||||||
// http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
//
|
|
||||||
// Unless required by applicable law or agreed to in writing, software
|
|
||||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
// See the License for the specific language governing permissions and
|
|
||||||
// limitations under the License.
|
|
||||||
|
|
||||||
package spec
|
|
||||||
|
|
||||||
/*
|
|
||||||
|
|
||||||
import (
|
|
||||||
"net/url"
|
|
||||||
"os"
|
|
||||||
"path"
|
|
||||||
"path/filepath"
|
|
||||||
|
|
||||||
"github.com/go-openapi/jsonpointer"
|
|
||||||
)
|
|
||||||
|
|
||||||
// Some currently unused functions and definitions that
|
|
||||||
// used to be part of the expander.
|
|
||||||
|
|
||||||
// Moved here for the record and possible future reuse
|
|
||||||
|
|
||||||
var (
|
|
||||||
idPtr, _ = jsonpointer.New("/id")
|
|
||||||
refPtr, _ = jsonpointer.New("/$ref")
|
|
||||||
)
|
|
||||||
|
|
||||||
func idFromNode(node interface{}) (*Ref, error) {
|
|
||||||
if idValue, _, err := idPtr.Get(node); err == nil {
|
|
||||||
if refStr, ok := idValue.(string); ok && refStr != "" {
|
|
||||||
idRef, err := NewRef(refStr)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
return &idRef, nil
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return nil, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func nextRef(startingNode interface{}, startingRef *Ref, ptr *jsonpointer.Pointer) *Ref {
|
|
||||||
if startingRef == nil {
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
if ptr == nil {
|
|
||||||
return startingRef
|
|
||||||
}
|
|
||||||
|
|
||||||
ret := startingRef
|
|
||||||
var idRef *Ref
|
|
||||||
node := startingNode
|
|
||||||
|
|
||||||
for _, tok := range ptr.DecodedTokens() {
|
|
||||||
node, _, _ = jsonpointer.GetForToken(node, tok)
|
|
||||||
if node == nil {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
|
|
||||||
idRef, _ = idFromNode(node)
|
|
||||||
if idRef != nil {
|
|
||||||
nw, err := ret.Inherits(*idRef)
|
|
||||||
if err != nil {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
ret = nw
|
|
||||||
}
|
|
||||||
|
|
||||||
refRef, _, _ := refPtr.Get(node)
|
|
||||||
if refRef != nil {
|
|
||||||
var rf Ref
|
|
||||||
switch value := refRef.(type) {
|
|
||||||
case string:
|
|
||||||
rf, _ = NewRef(value)
|
|
||||||
}
|
|
||||||
nw, err := ret.Inherits(rf)
|
|
||||||
if err != nil {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
nwURL := nw.GetURL()
|
|
||||||
if nwURL.Scheme == "file" || (nwURL.Scheme == "" && nwURL.Host == "") {
|
|
||||||
nwpt := filepath.ToSlash(nwURL.Path)
|
|
||||||
if filepath.IsAbs(nwpt) {
|
|
||||||
_, err := os.Stat(nwpt)
|
|
||||||
if err != nil {
|
|
||||||
nwURL.Path = filepath.Join(".", nwpt)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
ret = nw
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
return ret
|
|
||||||
}
|
|
||||||
|
|
||||||
// basePathFromSchemaID returns a new basePath based on an existing basePath and a schema ID
|
|
||||||
func basePathFromSchemaID(oldBasePath, id string) string {
|
|
||||||
u, err := url.Parse(oldBasePath)
|
|
||||||
if err != nil {
|
|
||||||
panic(err)
|
|
||||||
}
|
|
||||||
uid, err := url.Parse(id)
|
|
||||||
if err != nil {
|
|
||||||
panic(err)
|
|
||||||
}
|
|
||||||
|
|
||||||
if path.IsAbs(uid.Path) {
|
|
||||||
return id
|
|
||||||
}
|
|
||||||
u.Path = path.Join(path.Dir(u.Path), uid.Path)
|
|
||||||
return u.String()
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
// type ExtraSchemaProps map[string]interface{}
|
|
||||||
|
|
||||||
// // JSONSchema represents a structure that is a json schema draft 04
|
|
||||||
// type JSONSchema struct {
|
|
||||||
// SchemaProps
|
|
||||||
// ExtraSchemaProps
|
|
||||||
// }
|
|
||||||
|
|
||||||
// // MarshalJSON marshal this to JSON
|
|
||||||
// func (s JSONSchema) MarshalJSON() ([]byte, error) {
|
|
||||||
// b1, err := json.Marshal(s.SchemaProps)
|
|
||||||
// if err != nil {
|
|
||||||
// return nil, err
|
|
||||||
// }
|
|
||||||
// b2, err := s.Ref.MarshalJSON()
|
|
||||||
// if err != nil {
|
|
||||||
// return nil, err
|
|
||||||
// }
|
|
||||||
// b3, err := s.Schema.MarshalJSON()
|
|
||||||
// if err != nil {
|
|
||||||
// return nil, err
|
|
||||||
// }
|
|
||||||
// b4, err := json.Marshal(s.ExtraSchemaProps)
|
|
||||||
// if err != nil {
|
|
||||||
// return nil, err
|
|
||||||
// }
|
|
||||||
// return swag.ConcatJSON(b1, b2, b3, b4), nil
|
|
||||||
// }
|
|
||||||
|
|
||||||
// // UnmarshalJSON marshal this from JSON
|
|
||||||
// func (s *JSONSchema) UnmarshalJSON(data []byte) error {
|
|
||||||
// var sch JSONSchema
|
|
||||||
// if err := json.Unmarshal(data, &sch.SchemaProps); err != nil {
|
|
||||||
// return err
|
|
||||||
// }
|
|
||||||
// if err := json.Unmarshal(data, &sch.Ref); err != nil {
|
|
||||||
// return err
|
|
||||||
// }
|
|
||||||
// if err := json.Unmarshal(data, &sch.Schema); err != nil {
|
|
||||||
// return err
|
|
||||||
// }
|
|
||||||
// if err := json.Unmarshal(data, &sch.ExtraSchemaProps); err != nil {
|
|
||||||
// return err
|
|
||||||
// }
|
|
||||||
// *s = sch
|
|
||||||
// return nil
|
|
||||||
// }
|
|
||||||
2
vendor/github.com/go-openapi/swag/.golangci.yml
generated
vendored
2
vendor/github.com/go-openapi/swag/.golangci.yml
generated
vendored
@ -18,5 +18,3 @@ linters:
|
|||||||
disable:
|
disable:
|
||||||
- maligned
|
- maligned
|
||||||
- lll
|
- lll
|
||||||
- gochecknoinits
|
|
||||||
- gochecknoglobals
|
|
||||||
|
|||||||
7
vendor/github.com/go-openapi/swag/json.go
generated
vendored
7
vendor/github.com/go-openapi/swag/json.go
generated
vendored
@ -68,16 +68,15 @@ func WriteJSON(data interface{}) ([]byte, error) {
|
|||||||
// ReadJSON reads json data, prefers finding an appropriate interface to short-circuit the unmarshaller
|
// ReadJSON reads json data, prefers finding an appropriate interface to short-circuit the unmarshaller
|
||||||
// so it takes the fastes option available
|
// so it takes the fastes option available
|
||||||
func ReadJSON(data []byte, value interface{}) error {
|
func ReadJSON(data []byte, value interface{}) error {
|
||||||
trimmedData := bytes.Trim(data, "\x00")
|
|
||||||
if d, ok := value.(ejUnmarshaler); ok {
|
if d, ok := value.(ejUnmarshaler); ok {
|
||||||
jl := &jlexer.Lexer{Data: trimmedData}
|
jl := &jlexer.Lexer{Data: data}
|
||||||
d.UnmarshalEasyJSON(jl)
|
d.UnmarshalEasyJSON(jl)
|
||||||
return jl.Error()
|
return jl.Error()
|
||||||
}
|
}
|
||||||
if d, ok := value.(json.Unmarshaler); ok {
|
if d, ok := value.(json.Unmarshaler); ok {
|
||||||
return d.UnmarshalJSON(trimmedData)
|
return d.UnmarshalJSON(data)
|
||||||
}
|
}
|
||||||
return json.Unmarshal(trimmedData, value)
|
return json.Unmarshal(data, value)
|
||||||
}
|
}
|
||||||
|
|
||||||
// DynamicJSONToStruct converts an untyped json structure into a struct
|
// DynamicJSONToStruct converts an untyped json structure into a struct
|
||||||
|
|||||||
14
vendor/github.com/go-openapi/swag/net.go
generated
vendored
14
vendor/github.com/go-openapi/swag/net.go
generated
vendored
@ -1,17 +1,3 @@
|
|||||||
// Copyright 2015 go-swagger maintainers
|
|
||||||
//
|
|
||||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
// you may not use this file except in compliance with the License.
|
|
||||||
// You may obtain a copy of the License at
|
|
||||||
//
|
|
||||||
// http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
//
|
|
||||||
// Unless required by applicable law or agreed to in writing, software
|
|
||||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
// See the License for the specific language governing permissions and
|
|
||||||
// limitations under the License.
|
|
||||||
|
|
||||||
package swag
|
package swag
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
|||||||
14
vendor/github.com/go-openapi/swag/post_go18.go
generated
vendored
14
vendor/github.com/go-openapi/swag/post_go18.go
generated
vendored
@ -1,17 +1,3 @@
|
|||||||
// Copyright 2015 go-swagger maintainers
|
|
||||||
//
|
|
||||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
// you may not use this file except in compliance with the License.
|
|
||||||
// You may obtain a copy of the License at
|
|
||||||
//
|
|
||||||
// http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
//
|
|
||||||
// Unless required by applicable law or agreed to in writing, software
|
|
||||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
// See the License for the specific language governing permissions and
|
|
||||||
// limitations under the License.
|
|
||||||
|
|
||||||
// +build go1.8
|
// +build go1.8
|
||||||
|
|
||||||
package swag
|
package swag
|
||||||
|
|||||||
16
vendor/github.com/go-openapi/swag/post_go19.go
generated
vendored
16
vendor/github.com/go-openapi/swag/post_go19.go
generated
vendored
@ -1,17 +1,3 @@
|
|||||||
// Copyright 2015 go-swagger maintainers
|
|
||||||
//
|
|
||||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
// you may not use this file except in compliance with the License.
|
|
||||||
// You may obtain a copy of the License at
|
|
||||||
//
|
|
||||||
// http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
//
|
|
||||||
// Unless required by applicable law or agreed to in writing, software
|
|
||||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
// See the License for the specific language governing permissions and
|
|
||||||
// limitations under the License.
|
|
||||||
|
|
||||||
// +build go1.9
|
// +build go1.9
|
||||||
|
|
||||||
package swag
|
package swag
|
||||||
@ -62,6 +48,6 @@ func (m *indexOfInitialisms) sorted() (result []string) {
|
|||||||
result = append(result, k)
|
result = append(result, k)
|
||||||
return true
|
return true
|
||||||
})
|
})
|
||||||
sort.Sort(sort.Reverse(byInitialism(result)))
|
sort.Sort(sort.Reverse(byLength(result)))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
14
vendor/github.com/go-openapi/swag/pre_go18.go
generated
vendored
14
vendor/github.com/go-openapi/swag/pre_go18.go
generated
vendored
@ -1,17 +1,3 @@
|
|||||||
// Copyright 2015 go-swagger maintainers
|
|
||||||
//
|
|
||||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
// you may not use this file except in compliance with the License.
|
|
||||||
// You may obtain a copy of the License at
|
|
||||||
//
|
|
||||||
// http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
//
|
|
||||||
// Unless required by applicable law or agreed to in writing, software
|
|
||||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
// See the License for the specific language governing permissions and
|
|
||||||
// limitations under the License.
|
|
||||||
|
|
||||||
// +build !go1.8
|
// +build !go1.8
|
||||||
|
|
||||||
package swag
|
package swag
|
||||||
|
|||||||
16
vendor/github.com/go-openapi/swag/pre_go19.go
generated
vendored
16
vendor/github.com/go-openapi/swag/pre_go19.go
generated
vendored
@ -1,17 +1,3 @@
|
|||||||
// Copyright 2015 go-swagger maintainers
|
|
||||||
//
|
|
||||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
// you may not use this file except in compliance with the License.
|
|
||||||
// You may obtain a copy of the License at
|
|
||||||
//
|
|
||||||
// http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
//
|
|
||||||
// Unless required by applicable law or agreed to in writing, software
|
|
||||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
// See the License for the specific language governing permissions and
|
|
||||||
// limitations under the License.
|
|
||||||
|
|
||||||
// +build !go1.9
|
// +build !go1.9
|
||||||
|
|
||||||
package swag
|
package swag
|
||||||
@ -64,6 +50,6 @@ func (m *indexOfInitialisms) sorted() (result []string) {
|
|||||||
for k := range m.index {
|
for k := range m.index {
|
||||||
result = append(result, k)
|
result = append(result, k)
|
||||||
}
|
}
|
||||||
sort.Sort(sort.Reverse(byInitialism(result)))
|
sort.Sort(sort.Reverse(byLength(result)))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
55
vendor/github.com/go-openapi/swag/util.go
generated
vendored
55
vendor/github.com/go-openapi/swag/util.go
generated
vendored
@ -33,12 +33,6 @@ var once sync.Once
|
|||||||
|
|
||||||
var isInitialism func(string) bool
|
var isInitialism func(string) bool
|
||||||
|
|
||||||
var (
|
|
||||||
splitRex1 *regexp.Regexp
|
|
||||||
splitRex2 *regexp.Regexp
|
|
||||||
splitReplacer *strings.Replacer
|
|
||||||
)
|
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
// Taken from https://github.com/golang/lint/blob/3390df4df2787994aea98de825b964ac7944b817/lint.go#L732-L769
|
// Taken from https://github.com/golang/lint/blob/3390df4df2787994aea98de825b964ac7944b817/lint.go#L732-L769
|
||||||
var configuredInitialisms = map[string]bool{
|
var configuredInitialisms = map[string]bool{
|
||||||
@ -159,29 +153,21 @@ func SplitByFormat(data, format string) []string {
|
|||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
|
|
||||||
type byInitialism []string
|
type byLength []string
|
||||||
|
|
||||||
func (s byInitialism) Len() int {
|
func (s byLength) Len() int {
|
||||||
return len(s)
|
return len(s)
|
||||||
}
|
}
|
||||||
func (s byInitialism) Swap(i, j int) {
|
func (s byLength) Swap(i, j int) {
|
||||||
s[i], s[j] = s[j], s[i]
|
s[i], s[j] = s[j], s[i]
|
||||||
}
|
}
|
||||||
func (s byInitialism) Less(i, j int) bool {
|
func (s byLength) Less(i, j int) bool {
|
||||||
if len(s[i]) != len(s[j]) {
|
|
||||||
return len(s[i]) < len(s[j])
|
return len(s[i]) < len(s[j])
|
||||||
}
|
}
|
||||||
|
|
||||||
return strings.Compare(s[i], s[j]) > 0
|
|
||||||
}
|
|
||||||
|
|
||||||
// Prepares strings by splitting by caps, spaces, dashes, and underscore
|
// Prepares strings by splitting by caps, spaces, dashes, and underscore
|
||||||
func split(str string) []string {
|
func split(str string) []string {
|
||||||
// check if consecutive single char things make up an initialism
|
repl := strings.NewReplacer(
|
||||||
once.Do(func() {
|
|
||||||
splitRex1 = regexp.MustCompile(`(\p{Lu})`)
|
|
||||||
splitRex2 = regexp.MustCompile(`(\pL|\pM|\pN|\p{Pc})+`)
|
|
||||||
splitReplacer = strings.NewReplacer(
|
|
||||||
"@", "At ",
|
"@", "At ",
|
||||||
"&", "And ",
|
"&", "And ",
|
||||||
"|", "Pipe ",
|
"|", "Pipe ",
|
||||||
@ -190,23 +176,26 @@ func split(str string) []string {
|
|||||||
"-", " ",
|
"-", " ",
|
||||||
"_", " ",
|
"_", " ",
|
||||||
)
|
)
|
||||||
ensureSorted()
|
|
||||||
})
|
rex1 := regexp.MustCompile(`(\p{Lu})`)
|
||||||
|
rex2 := regexp.MustCompile(`(\pL|\pM|\pN|\p{Pc})+`)
|
||||||
|
|
||||||
str = trim(str)
|
str = trim(str)
|
||||||
|
|
||||||
// Convert dash and underscore to spaces
|
// Convert dash and underscore to spaces
|
||||||
str = splitReplacer.Replace(str)
|
str = repl.Replace(str)
|
||||||
|
|
||||||
// Split when uppercase is found (needed for Snake)
|
// Split when uppercase is found (needed for Snake)
|
||||||
str = splitRex1.ReplaceAllString(str, " $1")
|
str = rex1.ReplaceAllString(str, " $1")
|
||||||
|
|
||||||
|
// check if consecutive single char things make up an initialism
|
||||||
|
once.Do(ensureSorted)
|
||||||
for _, k := range initialisms {
|
for _, k := range initialisms {
|
||||||
str = strings.Replace(str, splitRex1.ReplaceAllString(k, " $1"), " "+k, -1)
|
str = strings.Replace(str, rex1.ReplaceAllString(k, " $1"), " "+k, -1)
|
||||||
}
|
}
|
||||||
// Get the final list of words
|
// Get the final list of words
|
||||||
//words = rex2.FindAllString(str, -1)
|
//words = rex2.FindAllString(str, -1)
|
||||||
return splitRex2.FindAllString(str, -1)
|
return rex2.FindAllString(str, -1)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Removes leading whitespaces
|
// Removes leading whitespaces
|
||||||
@ -226,7 +215,7 @@ func lower(str string) string {
|
|||||||
|
|
||||||
// Camelize an uppercased word
|
// Camelize an uppercased word
|
||||||
func Camelize(word string) (camelized string) {
|
func Camelize(word string) (camelized string) {
|
||||||
for pos, ru := range []rune(word) {
|
for pos, ru := range word {
|
||||||
if pos > 0 {
|
if pos > 0 {
|
||||||
camelized += string(unicode.ToLower(ru))
|
camelized += string(unicode.ToLower(ru))
|
||||||
} else {
|
} else {
|
||||||
@ -282,7 +271,7 @@ func ToHumanNameTitle(name string) string {
|
|||||||
for _, w := range in {
|
for _, w := range in {
|
||||||
uw := upper(w)
|
uw := upper(w)
|
||||||
if !isInitialism(uw) {
|
if !isInitialism(uw) {
|
||||||
out = append(out, Camelize(w))
|
out = append(out, upper(w[:1])+lower(w[1:]))
|
||||||
} else {
|
} else {
|
||||||
out = append(out, w)
|
out = append(out, w)
|
||||||
}
|
}
|
||||||
@ -300,7 +289,7 @@ func ToJSONName(name string) string {
|
|||||||
out = append(out, lower(w))
|
out = append(out, lower(w))
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
out = append(out, Camelize(w))
|
out = append(out, upper(w[:1])+lower(w[1:]))
|
||||||
}
|
}
|
||||||
return strings.Join(out, "")
|
return strings.Join(out, "")
|
||||||
}
|
}
|
||||||
@ -326,15 +315,19 @@ func ToGoName(name string) string {
|
|||||||
uw := upper(w)
|
uw := upper(w)
|
||||||
mod := int(math.Min(float64(len(uw)), 2))
|
mod := int(math.Min(float64(len(uw)), 2))
|
||||||
if !isInitialism(uw) && !isInitialism(uw[:len(uw)-mod]) {
|
if !isInitialism(uw) && !isInitialism(uw[:len(uw)-mod]) {
|
||||||
uw = Camelize(w)
|
uw = upper(w[:1]) + lower(w[1:])
|
||||||
}
|
}
|
||||||
out = append(out, uw)
|
out = append(out, uw)
|
||||||
}
|
}
|
||||||
|
|
||||||
result := strings.Join(out, "")
|
result := strings.Join(out, "")
|
||||||
if len(result) > 0 {
|
if len(result) > 0 {
|
||||||
if !unicode.IsUpper([]rune(result)[0]) {
|
ud := upper(result[:1])
|
||||||
result = "X" + result
|
ru := []rune(ud)
|
||||||
|
if unicode.IsUpper(ru[0]) {
|
||||||
|
result = ud + result[1:]
|
||||||
|
} else {
|
||||||
|
result = "X" + ud + result[1:]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return result
|
return result
|
||||||
|
|||||||
1
vendor/github.com/go-openapi/swag/yaml.go
generated
vendored
1
vendor/github.com/go-openapi/swag/yaml.go
generated
vendored
@ -22,6 +22,7 @@ import (
|
|||||||
|
|
||||||
"github.com/mailru/easyjson/jlexer"
|
"github.com/mailru/easyjson/jlexer"
|
||||||
"github.com/mailru/easyjson/jwriter"
|
"github.com/mailru/easyjson/jwriter"
|
||||||
|
|
||||||
yaml "gopkg.in/yaml.v2"
|
yaml "gopkg.in/yaml.v2"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
110
vendor/github.com/gogo/protobuf/gogoproto/gogo.pb.go
generated
vendored
110
vendor/github.com/gogo/protobuf/gogoproto/gogo.pb.go
generated
vendored
@ -1,14 +1,12 @@
|
|||||||
// Code generated by protoc-gen-gogo. DO NOT EDIT.
|
// Code generated by protoc-gen-gogo. DO NOT EDIT.
|
||||||
// source: gogo.proto
|
// source: gogo.proto
|
||||||
|
|
||||||
package gogoproto
|
package gogoproto // import "github.com/gogo/protobuf/gogoproto"
|
||||||
|
|
||||||
import (
|
import proto "github.com/gogo/protobuf/proto"
|
||||||
fmt "fmt"
|
import fmt "fmt"
|
||||||
proto "github.com/gogo/protobuf/proto"
|
import math "math"
|
||||||
descriptor "github.com/gogo/protobuf/protoc-gen-gogo/descriptor"
|
import descriptor "github.com/gogo/protobuf/protoc-gen-gogo/descriptor"
|
||||||
math "math"
|
|
||||||
)
|
|
||||||
|
|
||||||
// Reference imports to suppress errors if they are not otherwise used.
|
// Reference imports to suppress errors if they are not otherwise used.
|
||||||
var _ = proto.Marshal
|
var _ = proto.Marshal
|
||||||
@ -26,7 +24,7 @@ var E_GoprotoEnumPrefix = &proto.ExtensionDesc{
|
|||||||
ExtensionType: (*bool)(nil),
|
ExtensionType: (*bool)(nil),
|
||||||
Field: 62001,
|
Field: 62001,
|
||||||
Name: "gogoproto.goproto_enum_prefix",
|
Name: "gogoproto.goproto_enum_prefix",
|
||||||
Tag: "varint,62001,opt,name=goproto_enum_prefix",
|
Tag: "varint,62001,opt,name=goproto_enum_prefix,json=goprotoEnumPrefix",
|
||||||
Filename: "gogo.proto",
|
Filename: "gogo.proto",
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -35,7 +33,7 @@ var E_GoprotoEnumStringer = &proto.ExtensionDesc{
|
|||||||
ExtensionType: (*bool)(nil),
|
ExtensionType: (*bool)(nil),
|
||||||
Field: 62021,
|
Field: 62021,
|
||||||
Name: "gogoproto.goproto_enum_stringer",
|
Name: "gogoproto.goproto_enum_stringer",
|
||||||
Tag: "varint,62021,opt,name=goproto_enum_stringer",
|
Tag: "varint,62021,opt,name=goproto_enum_stringer,json=goprotoEnumStringer",
|
||||||
Filename: "gogo.proto",
|
Filename: "gogo.proto",
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -44,7 +42,7 @@ var E_EnumStringer = &proto.ExtensionDesc{
|
|||||||
ExtensionType: (*bool)(nil),
|
ExtensionType: (*bool)(nil),
|
||||||
Field: 62022,
|
Field: 62022,
|
||||||
Name: "gogoproto.enum_stringer",
|
Name: "gogoproto.enum_stringer",
|
||||||
Tag: "varint,62022,opt,name=enum_stringer",
|
Tag: "varint,62022,opt,name=enum_stringer,json=enumStringer",
|
||||||
Filename: "gogo.proto",
|
Filename: "gogo.proto",
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -53,7 +51,7 @@ var E_EnumCustomname = &proto.ExtensionDesc{
|
|||||||
ExtensionType: (*string)(nil),
|
ExtensionType: (*string)(nil),
|
||||||
Field: 62023,
|
Field: 62023,
|
||||||
Name: "gogoproto.enum_customname",
|
Name: "gogoproto.enum_customname",
|
||||||
Tag: "bytes,62023,opt,name=enum_customname",
|
Tag: "bytes,62023,opt,name=enum_customname,json=enumCustomname",
|
||||||
Filename: "gogo.proto",
|
Filename: "gogo.proto",
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -71,7 +69,7 @@ var E_EnumvalueCustomname = &proto.ExtensionDesc{
|
|||||||
ExtensionType: (*string)(nil),
|
ExtensionType: (*string)(nil),
|
||||||
Field: 66001,
|
Field: 66001,
|
||||||
Name: "gogoproto.enumvalue_customname",
|
Name: "gogoproto.enumvalue_customname",
|
||||||
Tag: "bytes,66001,opt,name=enumvalue_customname",
|
Tag: "bytes,66001,opt,name=enumvalue_customname,json=enumvalueCustomname",
|
||||||
Filename: "gogo.proto",
|
Filename: "gogo.proto",
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -80,7 +78,7 @@ var E_GoprotoGettersAll = &proto.ExtensionDesc{
|
|||||||
ExtensionType: (*bool)(nil),
|
ExtensionType: (*bool)(nil),
|
||||||
Field: 63001,
|
Field: 63001,
|
||||||
Name: "gogoproto.goproto_getters_all",
|
Name: "gogoproto.goproto_getters_all",
|
||||||
Tag: "varint,63001,opt,name=goproto_getters_all",
|
Tag: "varint,63001,opt,name=goproto_getters_all,json=goprotoGettersAll",
|
||||||
Filename: "gogo.proto",
|
Filename: "gogo.proto",
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -89,7 +87,7 @@ var E_GoprotoEnumPrefixAll = &proto.ExtensionDesc{
|
|||||||
ExtensionType: (*bool)(nil),
|
ExtensionType: (*bool)(nil),
|
||||||
Field: 63002,
|
Field: 63002,
|
||||||
Name: "gogoproto.goproto_enum_prefix_all",
|
Name: "gogoproto.goproto_enum_prefix_all",
|
||||||
Tag: "varint,63002,opt,name=goproto_enum_prefix_all",
|
Tag: "varint,63002,opt,name=goproto_enum_prefix_all,json=goprotoEnumPrefixAll",
|
||||||
Filename: "gogo.proto",
|
Filename: "gogo.proto",
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -98,7 +96,7 @@ var E_GoprotoStringerAll = &proto.ExtensionDesc{
|
|||||||
ExtensionType: (*bool)(nil),
|
ExtensionType: (*bool)(nil),
|
||||||
Field: 63003,
|
Field: 63003,
|
||||||
Name: "gogoproto.goproto_stringer_all",
|
Name: "gogoproto.goproto_stringer_all",
|
||||||
Tag: "varint,63003,opt,name=goproto_stringer_all",
|
Tag: "varint,63003,opt,name=goproto_stringer_all,json=goprotoStringerAll",
|
||||||
Filename: "gogo.proto",
|
Filename: "gogo.proto",
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -107,7 +105,7 @@ var E_VerboseEqualAll = &proto.ExtensionDesc{
|
|||||||
ExtensionType: (*bool)(nil),
|
ExtensionType: (*bool)(nil),
|
||||||
Field: 63004,
|
Field: 63004,
|
||||||
Name: "gogoproto.verbose_equal_all",
|
Name: "gogoproto.verbose_equal_all",
|
||||||
Tag: "varint,63004,opt,name=verbose_equal_all",
|
Tag: "varint,63004,opt,name=verbose_equal_all,json=verboseEqualAll",
|
||||||
Filename: "gogo.proto",
|
Filename: "gogo.proto",
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -116,7 +114,7 @@ var E_FaceAll = &proto.ExtensionDesc{
|
|||||||
ExtensionType: (*bool)(nil),
|
ExtensionType: (*bool)(nil),
|
||||||
Field: 63005,
|
Field: 63005,
|
||||||
Name: "gogoproto.face_all",
|
Name: "gogoproto.face_all",
|
||||||
Tag: "varint,63005,opt,name=face_all",
|
Tag: "varint,63005,opt,name=face_all,json=faceAll",
|
||||||
Filename: "gogo.proto",
|
Filename: "gogo.proto",
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -125,7 +123,7 @@ var E_GostringAll = &proto.ExtensionDesc{
|
|||||||
ExtensionType: (*bool)(nil),
|
ExtensionType: (*bool)(nil),
|
||||||
Field: 63006,
|
Field: 63006,
|
||||||
Name: "gogoproto.gostring_all",
|
Name: "gogoproto.gostring_all",
|
||||||
Tag: "varint,63006,opt,name=gostring_all",
|
Tag: "varint,63006,opt,name=gostring_all,json=gostringAll",
|
||||||
Filename: "gogo.proto",
|
Filename: "gogo.proto",
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -134,7 +132,7 @@ var E_PopulateAll = &proto.ExtensionDesc{
|
|||||||
ExtensionType: (*bool)(nil),
|
ExtensionType: (*bool)(nil),
|
||||||
Field: 63007,
|
Field: 63007,
|
||||||
Name: "gogoproto.populate_all",
|
Name: "gogoproto.populate_all",
|
||||||
Tag: "varint,63007,opt,name=populate_all",
|
Tag: "varint,63007,opt,name=populate_all,json=populateAll",
|
||||||
Filename: "gogo.proto",
|
Filename: "gogo.proto",
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -143,7 +141,7 @@ var E_StringerAll = &proto.ExtensionDesc{
|
|||||||
ExtensionType: (*bool)(nil),
|
ExtensionType: (*bool)(nil),
|
||||||
Field: 63008,
|
Field: 63008,
|
||||||
Name: "gogoproto.stringer_all",
|
Name: "gogoproto.stringer_all",
|
||||||
Tag: "varint,63008,opt,name=stringer_all",
|
Tag: "varint,63008,opt,name=stringer_all,json=stringerAll",
|
||||||
Filename: "gogo.proto",
|
Filename: "gogo.proto",
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -152,7 +150,7 @@ var E_OnlyoneAll = &proto.ExtensionDesc{
|
|||||||
ExtensionType: (*bool)(nil),
|
ExtensionType: (*bool)(nil),
|
||||||
Field: 63009,
|
Field: 63009,
|
||||||
Name: "gogoproto.onlyone_all",
|
Name: "gogoproto.onlyone_all",
|
||||||
Tag: "varint,63009,opt,name=onlyone_all",
|
Tag: "varint,63009,opt,name=onlyone_all,json=onlyoneAll",
|
||||||
Filename: "gogo.proto",
|
Filename: "gogo.proto",
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -161,7 +159,7 @@ var E_EqualAll = &proto.ExtensionDesc{
|
|||||||
ExtensionType: (*bool)(nil),
|
ExtensionType: (*bool)(nil),
|
||||||
Field: 63013,
|
Field: 63013,
|
||||||
Name: "gogoproto.equal_all",
|
Name: "gogoproto.equal_all",
|
||||||
Tag: "varint,63013,opt,name=equal_all",
|
Tag: "varint,63013,opt,name=equal_all,json=equalAll",
|
||||||
Filename: "gogo.proto",
|
Filename: "gogo.proto",
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -170,7 +168,7 @@ var E_DescriptionAll = &proto.ExtensionDesc{
|
|||||||
ExtensionType: (*bool)(nil),
|
ExtensionType: (*bool)(nil),
|
||||||
Field: 63014,
|
Field: 63014,
|
||||||
Name: "gogoproto.description_all",
|
Name: "gogoproto.description_all",
|
||||||
Tag: "varint,63014,opt,name=description_all",
|
Tag: "varint,63014,opt,name=description_all,json=descriptionAll",
|
||||||
Filename: "gogo.proto",
|
Filename: "gogo.proto",
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -179,7 +177,7 @@ var E_TestgenAll = &proto.ExtensionDesc{
|
|||||||
ExtensionType: (*bool)(nil),
|
ExtensionType: (*bool)(nil),
|
||||||
Field: 63015,
|
Field: 63015,
|
||||||
Name: "gogoproto.testgen_all",
|
Name: "gogoproto.testgen_all",
|
||||||
Tag: "varint,63015,opt,name=testgen_all",
|
Tag: "varint,63015,opt,name=testgen_all,json=testgenAll",
|
||||||
Filename: "gogo.proto",
|
Filename: "gogo.proto",
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -188,7 +186,7 @@ var E_BenchgenAll = &proto.ExtensionDesc{
|
|||||||
ExtensionType: (*bool)(nil),
|
ExtensionType: (*bool)(nil),
|
||||||
Field: 63016,
|
Field: 63016,
|
||||||
Name: "gogoproto.benchgen_all",
|
Name: "gogoproto.benchgen_all",
|
||||||
Tag: "varint,63016,opt,name=benchgen_all",
|
Tag: "varint,63016,opt,name=benchgen_all,json=benchgenAll",
|
||||||
Filename: "gogo.proto",
|
Filename: "gogo.proto",
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -197,7 +195,7 @@ var E_MarshalerAll = &proto.ExtensionDesc{
|
|||||||
ExtensionType: (*bool)(nil),
|
ExtensionType: (*bool)(nil),
|
||||||
Field: 63017,
|
Field: 63017,
|
||||||
Name: "gogoproto.marshaler_all",
|
Name: "gogoproto.marshaler_all",
|
||||||
Tag: "varint,63017,opt,name=marshaler_all",
|
Tag: "varint,63017,opt,name=marshaler_all,json=marshalerAll",
|
||||||
Filename: "gogo.proto",
|
Filename: "gogo.proto",
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -206,7 +204,7 @@ var E_UnmarshalerAll = &proto.ExtensionDesc{
|
|||||||
ExtensionType: (*bool)(nil),
|
ExtensionType: (*bool)(nil),
|
||||||
Field: 63018,
|
Field: 63018,
|
||||||
Name: "gogoproto.unmarshaler_all",
|
Name: "gogoproto.unmarshaler_all",
|
||||||
Tag: "varint,63018,opt,name=unmarshaler_all",
|
Tag: "varint,63018,opt,name=unmarshaler_all,json=unmarshalerAll",
|
||||||
Filename: "gogo.proto",
|
Filename: "gogo.proto",
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -215,7 +213,7 @@ var E_StableMarshalerAll = &proto.ExtensionDesc{
|
|||||||
ExtensionType: (*bool)(nil),
|
ExtensionType: (*bool)(nil),
|
||||||
Field: 63019,
|
Field: 63019,
|
||||||
Name: "gogoproto.stable_marshaler_all",
|
Name: "gogoproto.stable_marshaler_all",
|
||||||
Tag: "varint,63019,opt,name=stable_marshaler_all",
|
Tag: "varint,63019,opt,name=stable_marshaler_all,json=stableMarshalerAll",
|
||||||
Filename: "gogo.proto",
|
Filename: "gogo.proto",
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -224,7 +222,7 @@ var E_SizerAll = &proto.ExtensionDesc{
|
|||||||
ExtensionType: (*bool)(nil),
|
ExtensionType: (*bool)(nil),
|
||||||
Field: 63020,
|
Field: 63020,
|
||||||
Name: "gogoproto.sizer_all",
|
Name: "gogoproto.sizer_all",
|
||||||
Tag: "varint,63020,opt,name=sizer_all",
|
Tag: "varint,63020,opt,name=sizer_all,json=sizerAll",
|
||||||
Filename: "gogo.proto",
|
Filename: "gogo.proto",
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -233,7 +231,7 @@ var E_GoprotoEnumStringerAll = &proto.ExtensionDesc{
|
|||||||
ExtensionType: (*bool)(nil),
|
ExtensionType: (*bool)(nil),
|
||||||
Field: 63021,
|
Field: 63021,
|
||||||
Name: "gogoproto.goproto_enum_stringer_all",
|
Name: "gogoproto.goproto_enum_stringer_all",
|
||||||
Tag: "varint,63021,opt,name=goproto_enum_stringer_all",
|
Tag: "varint,63021,opt,name=goproto_enum_stringer_all,json=goprotoEnumStringerAll",
|
||||||
Filename: "gogo.proto",
|
Filename: "gogo.proto",
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -242,7 +240,7 @@ var E_EnumStringerAll = &proto.ExtensionDesc{
|
|||||||
ExtensionType: (*bool)(nil),
|
ExtensionType: (*bool)(nil),
|
||||||
Field: 63022,
|
Field: 63022,
|
||||||
Name: "gogoproto.enum_stringer_all",
|
Name: "gogoproto.enum_stringer_all",
|
||||||
Tag: "varint,63022,opt,name=enum_stringer_all",
|
Tag: "varint,63022,opt,name=enum_stringer_all,json=enumStringerAll",
|
||||||
Filename: "gogo.proto",
|
Filename: "gogo.proto",
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -251,7 +249,7 @@ var E_UnsafeMarshalerAll = &proto.ExtensionDesc{
|
|||||||
ExtensionType: (*bool)(nil),
|
ExtensionType: (*bool)(nil),
|
||||||
Field: 63023,
|
Field: 63023,
|
||||||
Name: "gogoproto.unsafe_marshaler_all",
|
Name: "gogoproto.unsafe_marshaler_all",
|
||||||
Tag: "varint,63023,opt,name=unsafe_marshaler_all",
|
Tag: "varint,63023,opt,name=unsafe_marshaler_all,json=unsafeMarshalerAll",
|
||||||
Filename: "gogo.proto",
|
Filename: "gogo.proto",
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -260,7 +258,7 @@ var E_UnsafeUnmarshalerAll = &proto.ExtensionDesc{
|
|||||||
ExtensionType: (*bool)(nil),
|
ExtensionType: (*bool)(nil),
|
||||||
Field: 63024,
|
Field: 63024,
|
||||||
Name: "gogoproto.unsafe_unmarshaler_all",
|
Name: "gogoproto.unsafe_unmarshaler_all",
|
||||||
Tag: "varint,63024,opt,name=unsafe_unmarshaler_all",
|
Tag: "varint,63024,opt,name=unsafe_unmarshaler_all,json=unsafeUnmarshalerAll",
|
||||||
Filename: "gogo.proto",
|
Filename: "gogo.proto",
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -269,7 +267,7 @@ var E_GoprotoExtensionsMapAll = &proto.ExtensionDesc{
|
|||||||
ExtensionType: (*bool)(nil),
|
ExtensionType: (*bool)(nil),
|
||||||
Field: 63025,
|
Field: 63025,
|
||||||
Name: "gogoproto.goproto_extensions_map_all",
|
Name: "gogoproto.goproto_extensions_map_all",
|
||||||
Tag: "varint,63025,opt,name=goproto_extensions_map_all",
|
Tag: "varint,63025,opt,name=goproto_extensions_map_all,json=goprotoExtensionsMapAll",
|
||||||
Filename: "gogo.proto",
|
Filename: "gogo.proto",
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -278,7 +276,7 @@ var E_GoprotoUnrecognizedAll = &proto.ExtensionDesc{
|
|||||||
ExtensionType: (*bool)(nil),
|
ExtensionType: (*bool)(nil),
|
||||||
Field: 63026,
|
Field: 63026,
|
||||||
Name: "gogoproto.goproto_unrecognized_all",
|
Name: "gogoproto.goproto_unrecognized_all",
|
||||||
Tag: "varint,63026,opt,name=goproto_unrecognized_all",
|
Tag: "varint,63026,opt,name=goproto_unrecognized_all,json=goprotoUnrecognizedAll",
|
||||||
Filename: "gogo.proto",
|
Filename: "gogo.proto",
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -287,7 +285,7 @@ var E_GogoprotoImport = &proto.ExtensionDesc{
|
|||||||
ExtensionType: (*bool)(nil),
|
ExtensionType: (*bool)(nil),
|
||||||
Field: 63027,
|
Field: 63027,
|
||||||
Name: "gogoproto.gogoproto_import",
|
Name: "gogoproto.gogoproto_import",
|
||||||
Tag: "varint,63027,opt,name=gogoproto_import",
|
Tag: "varint,63027,opt,name=gogoproto_import,json=gogoprotoImport",
|
||||||
Filename: "gogo.proto",
|
Filename: "gogo.proto",
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -296,7 +294,7 @@ var E_ProtosizerAll = &proto.ExtensionDesc{
|
|||||||
ExtensionType: (*bool)(nil),
|
ExtensionType: (*bool)(nil),
|
||||||
Field: 63028,
|
Field: 63028,
|
||||||
Name: "gogoproto.protosizer_all",
|
Name: "gogoproto.protosizer_all",
|
||||||
Tag: "varint,63028,opt,name=protosizer_all",
|
Tag: "varint,63028,opt,name=protosizer_all,json=protosizerAll",
|
||||||
Filename: "gogo.proto",
|
Filename: "gogo.proto",
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -305,7 +303,7 @@ var E_CompareAll = &proto.ExtensionDesc{
|
|||||||
ExtensionType: (*bool)(nil),
|
ExtensionType: (*bool)(nil),
|
||||||
Field: 63029,
|
Field: 63029,
|
||||||
Name: "gogoproto.compare_all",
|
Name: "gogoproto.compare_all",
|
||||||
Tag: "varint,63029,opt,name=compare_all",
|
Tag: "varint,63029,opt,name=compare_all,json=compareAll",
|
||||||
Filename: "gogo.proto",
|
Filename: "gogo.proto",
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -314,7 +312,7 @@ var E_TypedeclAll = &proto.ExtensionDesc{
|
|||||||
ExtensionType: (*bool)(nil),
|
ExtensionType: (*bool)(nil),
|
||||||
Field: 63030,
|
Field: 63030,
|
||||||
Name: "gogoproto.typedecl_all",
|
Name: "gogoproto.typedecl_all",
|
||||||
Tag: "varint,63030,opt,name=typedecl_all",
|
Tag: "varint,63030,opt,name=typedecl_all,json=typedeclAll",
|
||||||
Filename: "gogo.proto",
|
Filename: "gogo.proto",
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -323,7 +321,7 @@ var E_EnumdeclAll = &proto.ExtensionDesc{
|
|||||||
ExtensionType: (*bool)(nil),
|
ExtensionType: (*bool)(nil),
|
||||||
Field: 63031,
|
Field: 63031,
|
||||||
Name: "gogoproto.enumdecl_all",
|
Name: "gogoproto.enumdecl_all",
|
||||||
Tag: "varint,63031,opt,name=enumdecl_all",
|
Tag: "varint,63031,opt,name=enumdecl_all,json=enumdeclAll",
|
||||||
Filename: "gogo.proto",
|
Filename: "gogo.proto",
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -332,7 +330,7 @@ var E_GoprotoRegistration = &proto.ExtensionDesc{
|
|||||||
ExtensionType: (*bool)(nil),
|
ExtensionType: (*bool)(nil),
|
||||||
Field: 63032,
|
Field: 63032,
|
||||||
Name: "gogoproto.goproto_registration",
|
Name: "gogoproto.goproto_registration",
|
||||||
Tag: "varint,63032,opt,name=goproto_registration",
|
Tag: "varint,63032,opt,name=goproto_registration,json=goprotoRegistration",
|
||||||
Filename: "gogo.proto",
|
Filename: "gogo.proto",
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -341,7 +339,7 @@ var E_MessagenameAll = &proto.ExtensionDesc{
|
|||||||
ExtensionType: (*bool)(nil),
|
ExtensionType: (*bool)(nil),
|
||||||
Field: 63033,
|
Field: 63033,
|
||||||
Name: "gogoproto.messagename_all",
|
Name: "gogoproto.messagename_all",
|
||||||
Tag: "varint,63033,opt,name=messagename_all",
|
Tag: "varint,63033,opt,name=messagename_all,json=messagenameAll",
|
||||||
Filename: "gogo.proto",
|
Filename: "gogo.proto",
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -350,7 +348,7 @@ var E_GoprotoSizecacheAll = &proto.ExtensionDesc{
|
|||||||
ExtensionType: (*bool)(nil),
|
ExtensionType: (*bool)(nil),
|
||||||
Field: 63034,
|
Field: 63034,
|
||||||
Name: "gogoproto.goproto_sizecache_all",
|
Name: "gogoproto.goproto_sizecache_all",
|
||||||
Tag: "varint,63034,opt,name=goproto_sizecache_all",
|
Tag: "varint,63034,opt,name=goproto_sizecache_all,json=goprotoSizecacheAll",
|
||||||
Filename: "gogo.proto",
|
Filename: "gogo.proto",
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -359,7 +357,7 @@ var E_GoprotoUnkeyedAll = &proto.ExtensionDesc{
|
|||||||
ExtensionType: (*bool)(nil),
|
ExtensionType: (*bool)(nil),
|
||||||
Field: 63035,
|
Field: 63035,
|
||||||
Name: "gogoproto.goproto_unkeyed_all",
|
Name: "gogoproto.goproto_unkeyed_all",
|
||||||
Tag: "varint,63035,opt,name=goproto_unkeyed_all",
|
Tag: "varint,63035,opt,name=goproto_unkeyed_all,json=goprotoUnkeyedAll",
|
||||||
Filename: "gogo.proto",
|
Filename: "gogo.proto",
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -368,7 +366,7 @@ var E_GoprotoGetters = &proto.ExtensionDesc{
|
|||||||
ExtensionType: (*bool)(nil),
|
ExtensionType: (*bool)(nil),
|
||||||
Field: 64001,
|
Field: 64001,
|
||||||
Name: "gogoproto.goproto_getters",
|
Name: "gogoproto.goproto_getters",
|
||||||
Tag: "varint,64001,opt,name=goproto_getters",
|
Tag: "varint,64001,opt,name=goproto_getters,json=goprotoGetters",
|
||||||
Filename: "gogo.proto",
|
Filename: "gogo.proto",
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -377,7 +375,7 @@ var E_GoprotoStringer = &proto.ExtensionDesc{
|
|||||||
ExtensionType: (*bool)(nil),
|
ExtensionType: (*bool)(nil),
|
||||||
Field: 64003,
|
Field: 64003,
|
||||||
Name: "gogoproto.goproto_stringer",
|
Name: "gogoproto.goproto_stringer",
|
||||||
Tag: "varint,64003,opt,name=goproto_stringer",
|
Tag: "varint,64003,opt,name=goproto_stringer,json=goprotoStringer",
|
||||||
Filename: "gogo.proto",
|
Filename: "gogo.proto",
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -386,7 +384,7 @@ var E_VerboseEqual = &proto.ExtensionDesc{
|
|||||||
ExtensionType: (*bool)(nil),
|
ExtensionType: (*bool)(nil),
|
||||||
Field: 64004,
|
Field: 64004,
|
||||||
Name: "gogoproto.verbose_equal",
|
Name: "gogoproto.verbose_equal",
|
||||||
Tag: "varint,64004,opt,name=verbose_equal",
|
Tag: "varint,64004,opt,name=verbose_equal,json=verboseEqual",
|
||||||
Filename: "gogo.proto",
|
Filename: "gogo.proto",
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -494,7 +492,7 @@ var E_StableMarshaler = &proto.ExtensionDesc{
|
|||||||
ExtensionType: (*bool)(nil),
|
ExtensionType: (*bool)(nil),
|
||||||
Field: 64019,
|
Field: 64019,
|
||||||
Name: "gogoproto.stable_marshaler",
|
Name: "gogoproto.stable_marshaler",
|
||||||
Tag: "varint,64019,opt,name=stable_marshaler",
|
Tag: "varint,64019,opt,name=stable_marshaler,json=stableMarshaler",
|
||||||
Filename: "gogo.proto",
|
Filename: "gogo.proto",
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -512,7 +510,7 @@ var E_UnsafeMarshaler = &proto.ExtensionDesc{
|
|||||||
ExtensionType: (*bool)(nil),
|
ExtensionType: (*bool)(nil),
|
||||||
Field: 64023,
|
Field: 64023,
|
||||||
Name: "gogoproto.unsafe_marshaler",
|
Name: "gogoproto.unsafe_marshaler",
|
||||||
Tag: "varint,64023,opt,name=unsafe_marshaler",
|
Tag: "varint,64023,opt,name=unsafe_marshaler,json=unsafeMarshaler",
|
||||||
Filename: "gogo.proto",
|
Filename: "gogo.proto",
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -521,7 +519,7 @@ var E_UnsafeUnmarshaler = &proto.ExtensionDesc{
|
|||||||
ExtensionType: (*bool)(nil),
|
ExtensionType: (*bool)(nil),
|
||||||
Field: 64024,
|
Field: 64024,
|
||||||
Name: "gogoproto.unsafe_unmarshaler",
|
Name: "gogoproto.unsafe_unmarshaler",
|
||||||
Tag: "varint,64024,opt,name=unsafe_unmarshaler",
|
Tag: "varint,64024,opt,name=unsafe_unmarshaler,json=unsafeUnmarshaler",
|
||||||
Filename: "gogo.proto",
|
Filename: "gogo.proto",
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -530,7 +528,7 @@ var E_GoprotoExtensionsMap = &proto.ExtensionDesc{
|
|||||||
ExtensionType: (*bool)(nil),
|
ExtensionType: (*bool)(nil),
|
||||||
Field: 64025,
|
Field: 64025,
|
||||||
Name: "gogoproto.goproto_extensions_map",
|
Name: "gogoproto.goproto_extensions_map",
|
||||||
Tag: "varint,64025,opt,name=goproto_extensions_map",
|
Tag: "varint,64025,opt,name=goproto_extensions_map,json=goprotoExtensionsMap",
|
||||||
Filename: "gogo.proto",
|
Filename: "gogo.proto",
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -539,7 +537,7 @@ var E_GoprotoUnrecognized = &proto.ExtensionDesc{
|
|||||||
ExtensionType: (*bool)(nil),
|
ExtensionType: (*bool)(nil),
|
||||||
Field: 64026,
|
Field: 64026,
|
||||||
Name: "gogoproto.goproto_unrecognized",
|
Name: "gogoproto.goproto_unrecognized",
|
||||||
Tag: "varint,64026,opt,name=goproto_unrecognized",
|
Tag: "varint,64026,opt,name=goproto_unrecognized,json=goprotoUnrecognized",
|
||||||
Filename: "gogo.proto",
|
Filename: "gogo.proto",
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -584,7 +582,7 @@ var E_GoprotoSizecache = &proto.ExtensionDesc{
|
|||||||
ExtensionType: (*bool)(nil),
|
ExtensionType: (*bool)(nil),
|
||||||
Field: 64034,
|
Field: 64034,
|
||||||
Name: "gogoproto.goproto_sizecache",
|
Name: "gogoproto.goproto_sizecache",
|
||||||
Tag: "varint,64034,opt,name=goproto_sizecache",
|
Tag: "varint,64034,opt,name=goproto_sizecache,json=goprotoSizecache",
|
||||||
Filename: "gogo.proto",
|
Filename: "gogo.proto",
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -593,7 +591,7 @@ var E_GoprotoUnkeyed = &proto.ExtensionDesc{
|
|||||||
ExtensionType: (*bool)(nil),
|
ExtensionType: (*bool)(nil),
|
||||||
Field: 64035,
|
Field: 64035,
|
||||||
Name: "gogoproto.goproto_unkeyed",
|
Name: "gogoproto.goproto_unkeyed",
|
||||||
Tag: "varint,64035,opt,name=goproto_unkeyed",
|
Tag: "varint,64035,opt,name=goproto_unkeyed,json=goprotoUnkeyed",
|
||||||
Filename: "gogo.proto",
|
Filename: "gogo.proto",
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -784,9 +782,9 @@ func init() {
|
|||||||
proto.RegisterExtension(E_Wktpointer)
|
proto.RegisterExtension(E_Wktpointer)
|
||||||
}
|
}
|
||||||
|
|
||||||
func init() { proto.RegisterFile("gogo.proto", fileDescriptor_592445b5231bc2b9) }
|
func init() { proto.RegisterFile("gogo.proto", fileDescriptor_gogo_b95f77e237336c7c) }
|
||||||
|
|
||||||
var fileDescriptor_592445b5231bc2b9 = []byte{
|
var fileDescriptor_gogo_b95f77e237336c7c = []byte{
|
||||||
// 1328 bytes of a gzipped FileDescriptorProto
|
// 1328 bytes of a gzipped FileDescriptorProto
|
||||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x98, 0x49, 0x6f, 0x1c, 0x45,
|
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x98, 0x49, 0x6f, 0x1c, 0x45,
|
||||||
0x14, 0x80, 0x85, 0x48, 0x64, 0x4f, 0x79, 0x8b, 0xc7, 0xc6, 0x84, 0x08, 0x44, 0xe0, 0xc4, 0xc9,
|
0x14, 0x80, 0x85, 0x48, 0x64, 0x4f, 0x79, 0x8b, 0xc7, 0xc6, 0x84, 0x08, 0x44, 0xe0, 0xc4, 0xc9,
|
||||||
|
|||||||
1
vendor/github.com/gogo/protobuf/proto/decode.go
generated
vendored
1
vendor/github.com/gogo/protobuf/proto/decode.go
generated
vendored
@ -186,6 +186,7 @@ func (p *Buffer) DecodeVarint() (x uint64, err error) {
|
|||||||
if b&0x80 == 0 {
|
if b&0x80 == 0 {
|
||||||
goto done
|
goto done
|
||||||
}
|
}
|
||||||
|
// x -= 0x80 << 63 // Always zero.
|
||||||
|
|
||||||
return 0, errOverflow
|
return 0, errOverflow
|
||||||
|
|
||||||
|
|||||||
63
vendor/github.com/gogo/protobuf/proto/deprecated.go
generated
vendored
63
vendor/github.com/gogo/protobuf/proto/deprecated.go
generated
vendored
@ -1,63 +0,0 @@
|
|||||||
// Go support for Protocol Buffers - Google's data interchange format
|
|
||||||
//
|
|
||||||
// Copyright 2018 The Go Authors. All rights reserved.
|
|
||||||
// https://github.com/golang/protobuf
|
|
||||||
//
|
|
||||||
// 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.
|
|
||||||
|
|
||||||
package proto
|
|
||||||
|
|
||||||
import "errors"
|
|
||||||
|
|
||||||
// Deprecated: do not use.
|
|
||||||
type Stats struct{ Emalloc, Dmalloc, Encode, Decode, Chit, Cmiss, Size uint64 }
|
|
||||||
|
|
||||||
// Deprecated: do not use.
|
|
||||||
func GetStats() Stats { return Stats{} }
|
|
||||||
|
|
||||||
// Deprecated: do not use.
|
|
||||||
func MarshalMessageSet(interface{}) ([]byte, error) {
|
|
||||||
return nil, errors.New("proto: not implemented")
|
|
||||||
}
|
|
||||||
|
|
||||||
// Deprecated: do not use.
|
|
||||||
func UnmarshalMessageSet([]byte, interface{}) error {
|
|
||||||
return errors.New("proto: not implemented")
|
|
||||||
}
|
|
||||||
|
|
||||||
// Deprecated: do not use.
|
|
||||||
func MarshalMessageSetJSON(interface{}) ([]byte, error) {
|
|
||||||
return nil, errors.New("proto: not implemented")
|
|
||||||
}
|
|
||||||
|
|
||||||
// Deprecated: do not use.
|
|
||||||
func UnmarshalMessageSetJSON([]byte, interface{}) error {
|
|
||||||
return errors.New("proto: not implemented")
|
|
||||||
}
|
|
||||||
|
|
||||||
// Deprecated: do not use.
|
|
||||||
func RegisterMessageSetType(Message, int32, string) {}
|
|
||||||
2
vendor/github.com/gogo/protobuf/proto/extensions.go
generated
vendored
2
vendor/github.com/gogo/protobuf/proto/extensions.go
generated
vendored
@ -544,7 +544,7 @@ func SetExtension(pb Message, extension *ExtensionDesc, value interface{}) error
|
|||||||
}
|
}
|
||||||
typ := reflect.TypeOf(extension.ExtensionType)
|
typ := reflect.TypeOf(extension.ExtensionType)
|
||||||
if typ != reflect.TypeOf(value) {
|
if typ != reflect.TypeOf(value) {
|
||||||
return fmt.Errorf("proto: bad extension value type. got: %T, want: %T", value, extension.ExtensionType)
|
return errors.New("proto: bad extension value type")
|
||||||
}
|
}
|
||||||
// nil extension values need to be caught early, because the
|
// nil extension values need to be caught early, because the
|
||||||
// encoder can't distinguish an ErrNil due to a nil extension
|
// encoder can't distinguish an ErrNil due to a nil extension
|
||||||
|
|||||||
20
vendor/github.com/gogo/protobuf/proto/lib.go
generated
vendored
20
vendor/github.com/gogo/protobuf/proto/lib.go
generated
vendored
@ -341,6 +341,26 @@ type Message interface {
|
|||||||
ProtoMessage()
|
ProtoMessage()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Stats records allocation details about the protocol buffer encoders
|
||||||
|
// and decoders. Useful for tuning the library itself.
|
||||||
|
type Stats struct {
|
||||||
|
Emalloc uint64 // mallocs in encode
|
||||||
|
Dmalloc uint64 // mallocs in decode
|
||||||
|
Encode uint64 // number of encodes
|
||||||
|
Decode uint64 // number of decodes
|
||||||
|
Chit uint64 // number of cache hits
|
||||||
|
Cmiss uint64 // number of cache misses
|
||||||
|
Size uint64 // number of sizes
|
||||||
|
}
|
||||||
|
|
||||||
|
// Set to true to enable stats collection.
|
||||||
|
const collectStats = false
|
||||||
|
|
||||||
|
var stats Stats
|
||||||
|
|
||||||
|
// GetStats returns a copy of the global Stats structure.
|
||||||
|
func GetStats() Stats { return stats }
|
||||||
|
|
||||||
// A Buffer is a buffer manager for marshaling and unmarshaling
|
// A Buffer is a buffer manager for marshaling and unmarshaling
|
||||||
// protocol buffers. It may be reused between invocations to
|
// protocol buffers. It may be reused between invocations to
|
||||||
// reduce memory usage. It is not necessary to use a Buffer;
|
// reduce memory usage. It is not necessary to use a Buffer;
|
||||||
|
|||||||
137
vendor/github.com/gogo/protobuf/proto/message_set.go
generated
vendored
137
vendor/github.com/gogo/protobuf/proto/message_set.go
generated
vendored
@ -36,7 +36,13 @@ package proto
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"bytes"
|
||||||
|
"encoding/json"
|
||||||
"errors"
|
"errors"
|
||||||
|
"fmt"
|
||||||
|
"reflect"
|
||||||
|
"sort"
|
||||||
|
"sync"
|
||||||
)
|
)
|
||||||
|
|
||||||
// errNoMessageTypeID occurs when a protocol buffer does not have a message type ID.
|
// errNoMessageTypeID occurs when a protocol buffer does not have a message type ID.
|
||||||
@ -139,9 +145,46 @@ func skipVarint(buf []byte) []byte {
|
|||||||
return buf[i+1:]
|
return buf[i+1:]
|
||||||
}
|
}
|
||||||
|
|
||||||
// unmarshalMessageSet decodes the extension map encoded in buf in the message set wire format.
|
// MarshalMessageSet encodes the extension map represented by m in the message set wire format.
|
||||||
|
// It is called by generated Marshal methods on protocol buffer messages with the message_set_wire_format option.
|
||||||
|
func MarshalMessageSet(exts interface{}) ([]byte, error) {
|
||||||
|
return marshalMessageSet(exts, false)
|
||||||
|
}
|
||||||
|
|
||||||
|
// marshaMessageSet implements above function, with the opt to turn on / off deterministic during Marshal.
|
||||||
|
func marshalMessageSet(exts interface{}, deterministic bool) ([]byte, error) {
|
||||||
|
switch exts := exts.(type) {
|
||||||
|
case *XXX_InternalExtensions:
|
||||||
|
var u marshalInfo
|
||||||
|
siz := u.sizeMessageSet(exts)
|
||||||
|
b := make([]byte, 0, siz)
|
||||||
|
return u.appendMessageSet(b, exts, deterministic)
|
||||||
|
|
||||||
|
case map[int32]Extension:
|
||||||
|
// This is an old-style extension map.
|
||||||
|
// Wrap it in a new-style XXX_InternalExtensions.
|
||||||
|
ie := XXX_InternalExtensions{
|
||||||
|
p: &struct {
|
||||||
|
mu sync.Mutex
|
||||||
|
extensionMap map[int32]Extension
|
||||||
|
}{
|
||||||
|
extensionMap: exts,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
var u marshalInfo
|
||||||
|
siz := u.sizeMessageSet(&ie)
|
||||||
|
b := make([]byte, 0, siz)
|
||||||
|
return u.appendMessageSet(b, &ie, deterministic)
|
||||||
|
|
||||||
|
default:
|
||||||
|
return nil, errors.New("proto: not an extension map")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// UnmarshalMessageSet decodes the extension map encoded in buf in the message set wire format.
|
||||||
// It is called by Unmarshal methods on protocol buffer messages with the message_set_wire_format option.
|
// It is called by Unmarshal methods on protocol buffer messages with the message_set_wire_format option.
|
||||||
func unmarshalMessageSet(buf []byte, exts interface{}) error {
|
func UnmarshalMessageSet(buf []byte, exts interface{}) error {
|
||||||
var m map[int32]Extension
|
var m map[int32]Extension
|
||||||
switch exts := exts.(type) {
|
switch exts := exts.(type) {
|
||||||
case *XXX_InternalExtensions:
|
case *XXX_InternalExtensions:
|
||||||
@ -179,3 +222,93 @@ func unmarshalMessageSet(buf []byte, exts interface{}) error {
|
|||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// MarshalMessageSetJSON encodes the extension map represented by m in JSON format.
|
||||||
|
// It is called by generated MarshalJSON methods on protocol buffer messages with the message_set_wire_format option.
|
||||||
|
func MarshalMessageSetJSON(exts interface{}) ([]byte, error) {
|
||||||
|
var m map[int32]Extension
|
||||||
|
switch exts := exts.(type) {
|
||||||
|
case *XXX_InternalExtensions:
|
||||||
|
var mu sync.Locker
|
||||||
|
m, mu = exts.extensionsRead()
|
||||||
|
if m != nil {
|
||||||
|
// Keep the extensions map locked until we're done marshaling to prevent
|
||||||
|
// races between marshaling and unmarshaling the lazily-{en,de}coded
|
||||||
|
// values.
|
||||||
|
mu.Lock()
|
||||||
|
defer mu.Unlock()
|
||||||
|
}
|
||||||
|
case map[int32]Extension:
|
||||||
|
m = exts
|
||||||
|
default:
|
||||||
|
return nil, errors.New("proto: not an extension map")
|
||||||
|
}
|
||||||
|
var b bytes.Buffer
|
||||||
|
b.WriteByte('{')
|
||||||
|
|
||||||
|
// Process the map in key order for deterministic output.
|
||||||
|
ids := make([]int32, 0, len(m))
|
||||||
|
for id := range m {
|
||||||
|
ids = append(ids, id)
|
||||||
|
}
|
||||||
|
sort.Sort(int32Slice(ids)) // int32Slice defined in text.go
|
||||||
|
|
||||||
|
for i, id := range ids {
|
||||||
|
ext := m[id]
|
||||||
|
msd, ok := messageSetMap[id]
|
||||||
|
if !ok {
|
||||||
|
// Unknown type; we can't render it, so skip it.
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
if i > 0 && b.Len() > 1 {
|
||||||
|
b.WriteByte(',')
|
||||||
|
}
|
||||||
|
|
||||||
|
fmt.Fprintf(&b, `"[%s]":`, msd.name)
|
||||||
|
|
||||||
|
x := ext.value
|
||||||
|
if x == nil {
|
||||||
|
x = reflect.New(msd.t.Elem()).Interface()
|
||||||
|
if err := Unmarshal(ext.enc, x.(Message)); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
d, err := json.Marshal(x)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
b.Write(d)
|
||||||
|
}
|
||||||
|
b.WriteByte('}')
|
||||||
|
return b.Bytes(), nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// UnmarshalMessageSetJSON decodes the extension map encoded in buf in JSON format.
|
||||||
|
// It is called by generated UnmarshalJSON methods on protocol buffer messages with the message_set_wire_format option.
|
||||||
|
func UnmarshalMessageSetJSON(buf []byte, exts interface{}) error {
|
||||||
|
// Common-case fast path.
|
||||||
|
if len(buf) == 0 || bytes.Equal(buf, []byte("{}")) {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// This is fairly tricky, and it's not clear that it is needed.
|
||||||
|
return errors.New("TODO: UnmarshalMessageSetJSON not yet implemented")
|
||||||
|
}
|
||||||
|
|
||||||
|
// A global registry of types that can be used in a MessageSet.
|
||||||
|
|
||||||
|
var messageSetMap = make(map[int32]messageSetDesc)
|
||||||
|
|
||||||
|
type messageSetDesc struct {
|
||||||
|
t reflect.Type // pointer to struct
|
||||||
|
name string
|
||||||
|
}
|
||||||
|
|
||||||
|
// RegisterMessageSetType is called from the generated code.
|
||||||
|
func RegisterMessageSetType(m Message, fieldNum int32, name string) {
|
||||||
|
messageSetMap[fieldNum] = messageSetDesc{
|
||||||
|
t: reflect.TypeOf(m),
|
||||||
|
name: name,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
9
vendor/github.com/gogo/protobuf/proto/properties.go
generated
vendored
9
vendor/github.com/gogo/protobuf/proto/properties.go
generated
vendored
@ -391,6 +391,9 @@ func GetProperties(t reflect.Type) *StructProperties {
|
|||||||
sprop, ok := propertiesMap[t]
|
sprop, ok := propertiesMap[t]
|
||||||
propertiesMu.RUnlock()
|
propertiesMu.RUnlock()
|
||||||
if ok {
|
if ok {
|
||||||
|
if collectStats {
|
||||||
|
stats.Chit++
|
||||||
|
}
|
||||||
return sprop
|
return sprop
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -403,8 +406,14 @@ func GetProperties(t reflect.Type) *StructProperties {
|
|||||||
// getPropertiesLocked requires that propertiesMu is held.
|
// getPropertiesLocked requires that propertiesMu is held.
|
||||||
func getPropertiesLocked(t reflect.Type) *StructProperties {
|
func getPropertiesLocked(t reflect.Type) *StructProperties {
|
||||||
if prop, ok := propertiesMap[t]; ok {
|
if prop, ok := propertiesMap[t]; ok {
|
||||||
|
if collectStats {
|
||||||
|
stats.Chit++
|
||||||
|
}
|
||||||
return prop
|
return prop
|
||||||
}
|
}
|
||||||
|
if collectStats {
|
||||||
|
stats.Cmiss++
|
||||||
|
}
|
||||||
|
|
||||||
prop := new(StructProperties)
|
prop := new(StructProperties)
|
||||||
// in case of recursive protos, fill this in now.
|
// in case of recursive protos, fill this in now.
|
||||||
|
|||||||
2
vendor/github.com/gogo/protobuf/proto/table_marshal.go
generated
vendored
2
vendor/github.com/gogo/protobuf/proto/table_marshal.go
generated
vendored
@ -491,7 +491,7 @@ func (fi *marshalFieldInfo) computeMarshalFieldInfo(f *reflect.StructField) {
|
|||||||
|
|
||||||
func (fi *marshalFieldInfo) computeOneofFieldInfo(f *reflect.StructField, oneofImplementers []interface{}) {
|
func (fi *marshalFieldInfo) computeOneofFieldInfo(f *reflect.StructField, oneofImplementers []interface{}) {
|
||||||
fi.field = toField(f)
|
fi.field = toField(f)
|
||||||
fi.wiretag = math.MaxInt32 // Use a large tag number, make oneofs sorted at the end. This tag will not appear on the wire.
|
fi.wiretag = 1<<31 - 1 // Use a large tag number, make oneofs sorted at the end. This tag will not appear on the wire.
|
||||||
fi.isPointer = true
|
fi.isPointer = true
|
||||||
fi.sizer, fi.marshaler = makeOneOfMarshaler(fi, f)
|
fi.sizer, fi.marshaler = makeOneOfMarshaler(fi, f)
|
||||||
fi.oneofElems = make(map[reflect.Type]*marshalElemInfo)
|
fi.oneofElems = make(map[reflect.Type]*marshalElemInfo)
|
||||||
|
|||||||
4
vendor/github.com/gogo/protobuf/proto/table_unmarshal.go
generated
vendored
4
vendor/github.com/gogo/protobuf/proto/table_unmarshal.go
generated
vendored
@ -138,7 +138,7 @@ func (u *unmarshalInfo) unmarshal(m pointer, b []byte) error {
|
|||||||
u.computeUnmarshalInfo()
|
u.computeUnmarshalInfo()
|
||||||
}
|
}
|
||||||
if u.isMessageSet {
|
if u.isMessageSet {
|
||||||
return unmarshalMessageSet(b, m.offset(u.extensions).toExtensions())
|
return UnmarshalMessageSet(b, m.offset(u.extensions).toExtensions())
|
||||||
}
|
}
|
||||||
var reqMask uint64 // bitmask of required fields we've seen.
|
var reqMask uint64 // bitmask of required fields we've seen.
|
||||||
var errLater error
|
var errLater error
|
||||||
@ -2142,7 +2142,7 @@ func encodeVarint(b []byte, x uint64) []byte {
|
|||||||
// If there is an error, it returns 0,0.
|
// If there is an error, it returns 0,0.
|
||||||
func decodeVarint(b []byte) (uint64, int) {
|
func decodeVarint(b []byte) (uint64, int) {
|
||||||
var x, y uint64
|
var x, y uint64
|
||||||
if len(b) == 0 {
|
if len(b) <= 0 {
|
||||||
goto bad
|
goto bad
|
||||||
}
|
}
|
||||||
x = uint64(b[0])
|
x = uint64(b[0])
|
||||||
|
|||||||
565
vendor/github.com/gogo/protobuf/protoc-gen-gogo/descriptor/descriptor.pb.go
generated
vendored
565
vendor/github.com/gogo/protobuf/protoc-gen-gogo/descriptor/descriptor.pb.go
generated
vendored
File diff suppressed because it is too large
Load Diff
26
vendor/github.com/gogo/protobuf/protoc-gen-gogo/descriptor/descriptor_gostring.gen.go
generated
vendored
26
vendor/github.com/gogo/protobuf/protoc-gen-gogo/descriptor/descriptor_gostring.gen.go
generated
vendored
@ -3,16 +3,14 @@
|
|||||||
|
|
||||||
package descriptor
|
package descriptor
|
||||||
|
|
||||||
import (
|
import fmt "fmt"
|
||||||
fmt "fmt"
|
import strings "strings"
|
||||||
github_com_gogo_protobuf_proto "github.com/gogo/protobuf/proto"
|
import github_com_gogo_protobuf_proto "github.com/gogo/protobuf/proto"
|
||||||
proto "github.com/gogo/protobuf/proto"
|
import sort "sort"
|
||||||
math "math"
|
import strconv "strconv"
|
||||||
reflect "reflect"
|
import reflect "reflect"
|
||||||
sort "sort"
|
import proto "github.com/gogo/protobuf/proto"
|
||||||
strconv "strconv"
|
import math "math"
|
||||||
strings "strings"
|
|
||||||
)
|
|
||||||
|
|
||||||
// Reference imports to suppress errors if they are not otherwise used.
|
// Reference imports to suppress errors if they are not otherwise used.
|
||||||
var _ = proto.Marshal
|
var _ = proto.Marshal
|
||||||
@ -360,7 +358,7 @@ func (this *FileOptions) GoString() string {
|
|||||||
if this == nil {
|
if this == nil {
|
||||||
return "nil"
|
return "nil"
|
||||||
}
|
}
|
||||||
s := make([]string, 0, 25)
|
s := make([]string, 0, 23)
|
||||||
s = append(s, "&descriptor.FileOptions{")
|
s = append(s, "&descriptor.FileOptions{")
|
||||||
if this.JavaPackage != nil {
|
if this.JavaPackage != nil {
|
||||||
s = append(s, "JavaPackage: "+valueToGoStringDescriptor(this.JavaPackage, "string")+",\n")
|
s = append(s, "JavaPackage: "+valueToGoStringDescriptor(this.JavaPackage, "string")+",\n")
|
||||||
@ -416,12 +414,6 @@ func (this *FileOptions) GoString() string {
|
|||||||
if this.PhpNamespace != nil {
|
if this.PhpNamespace != nil {
|
||||||
s = append(s, "PhpNamespace: "+valueToGoStringDescriptor(this.PhpNamespace, "string")+",\n")
|
s = append(s, "PhpNamespace: "+valueToGoStringDescriptor(this.PhpNamespace, "string")+",\n")
|
||||||
}
|
}
|
||||||
if this.PhpMetadataNamespace != nil {
|
|
||||||
s = append(s, "PhpMetadataNamespace: "+valueToGoStringDescriptor(this.PhpMetadataNamespace, "string")+",\n")
|
|
||||||
}
|
|
||||||
if this.RubyPackage != nil {
|
|
||||||
s = append(s, "RubyPackage: "+valueToGoStringDescriptor(this.RubyPackage, "string")+",\n")
|
|
||||||
}
|
|
||||||
if this.UninterpretedOption != nil {
|
if this.UninterpretedOption != nil {
|
||||||
s = append(s, "UninterpretedOption: "+fmt.Sprintf("%#v", this.UninterpretedOption)+",\n")
|
s = append(s, "UninterpretedOption: "+fmt.Sprintf("%#v", this.UninterpretedOption)+",\n")
|
||||||
}
|
}
|
||||||
|
|||||||
14
vendor/github.com/golang/groupcache/lru/lru.go
generated
vendored
14
vendor/github.com/golang/groupcache/lru/lru.go
generated
vendored
@ -25,7 +25,7 @@ type Cache struct {
|
|||||||
// an item is evicted. Zero means no limit.
|
// an item is evicted. Zero means no limit.
|
||||||
MaxEntries int
|
MaxEntries int
|
||||||
|
|
||||||
// OnEvicted optionally specifies a callback function to be
|
// OnEvicted optionally specificies a callback function to be
|
||||||
// executed when an entry is purged from the cache.
|
// executed when an entry is purged from the cache.
|
||||||
OnEvicted func(key Key, value interface{})
|
OnEvicted func(key Key, value interface{})
|
||||||
|
|
||||||
@ -119,15 +119,3 @@ func (c *Cache) Len() int {
|
|||||||
}
|
}
|
||||||
return c.ll.Len()
|
return c.ll.Len()
|
||||||
}
|
}
|
||||||
|
|
||||||
// Clear purges all stored items from the cache.
|
|
||||||
func (c *Cache) Clear() {
|
|
||||||
if c.OnEvicted != nil {
|
|
||||||
for _, e := range c.cache {
|
|
||||||
kv := e.Value.(*entry)
|
|
||||||
c.OnEvicted(kv.key, kv.value)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
c.ll = nil
|
|
||||||
c.cache = nil
|
|
||||||
}
|
|
||||||
|
|||||||
1
vendor/github.com/golang/protobuf/proto/decode.go
generated
vendored
1
vendor/github.com/golang/protobuf/proto/decode.go
generated
vendored
@ -186,6 +186,7 @@ func (p *Buffer) DecodeVarint() (x uint64, err error) {
|
|||||||
if b&0x80 == 0 {
|
if b&0x80 == 0 {
|
||||||
goto done
|
goto done
|
||||||
}
|
}
|
||||||
|
// x -= 0x80 << 63 // Always zero.
|
||||||
|
|
||||||
return 0, errOverflow
|
return 0, errOverflow
|
||||||
|
|
||||||
|
|||||||
63
vendor/github.com/golang/protobuf/proto/deprecated.go
generated
vendored
63
vendor/github.com/golang/protobuf/proto/deprecated.go
generated
vendored
@ -1,63 +0,0 @@
|
|||||||
// Go support for Protocol Buffers - Google's data interchange format
|
|
||||||
//
|
|
||||||
// Copyright 2018 The Go Authors. All rights reserved.
|
|
||||||
// https://github.com/golang/protobuf
|
|
||||||
//
|
|
||||||
// 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.
|
|
||||||
|
|
||||||
package proto
|
|
||||||
|
|
||||||
import "errors"
|
|
||||||
|
|
||||||
// Deprecated: do not use.
|
|
||||||
type Stats struct{ Emalloc, Dmalloc, Encode, Decode, Chit, Cmiss, Size uint64 }
|
|
||||||
|
|
||||||
// Deprecated: do not use.
|
|
||||||
func GetStats() Stats { return Stats{} }
|
|
||||||
|
|
||||||
// Deprecated: do not use.
|
|
||||||
func MarshalMessageSet(interface{}) ([]byte, error) {
|
|
||||||
return nil, errors.New("proto: not implemented")
|
|
||||||
}
|
|
||||||
|
|
||||||
// Deprecated: do not use.
|
|
||||||
func UnmarshalMessageSet([]byte, interface{}) error {
|
|
||||||
return errors.New("proto: not implemented")
|
|
||||||
}
|
|
||||||
|
|
||||||
// Deprecated: do not use.
|
|
||||||
func MarshalMessageSetJSON(interface{}) ([]byte, error) {
|
|
||||||
return nil, errors.New("proto: not implemented")
|
|
||||||
}
|
|
||||||
|
|
||||||
// Deprecated: do not use.
|
|
||||||
func UnmarshalMessageSetJSON([]byte, interface{}) error {
|
|
||||||
return errors.New("proto: not implemented")
|
|
||||||
}
|
|
||||||
|
|
||||||
// Deprecated: do not use.
|
|
||||||
func RegisterMessageSetType(Message, int32, string) {}
|
|
||||||
3
vendor/github.com/golang/protobuf/proto/equal.go
generated
vendored
3
vendor/github.com/golang/protobuf/proto/equal.go
generated
vendored
@ -246,8 +246,7 @@ func equalExtMap(base reflect.Type, em1, em2 map[int32]Extension) bool {
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
m1 := extensionAsLegacyType(e1.value)
|
m1, m2 := e1.value, e2.value
|
||||||
m2 := extensionAsLegacyType(e2.value)
|
|
||||||
|
|
||||||
if m1 == nil && m2 == nil {
|
if m1 == nil && m2 == nil {
|
||||||
// Both have only encoded form.
|
// Both have only encoded form.
|
||||||
|
|||||||
74
vendor/github.com/golang/protobuf/proto/extensions.go
generated
vendored
74
vendor/github.com/golang/protobuf/proto/extensions.go
generated
vendored
@ -186,23 +186,7 @@ type Extension struct {
|
|||||||
// accessed using GetExtension (or GetExtensions) desc and value
|
// accessed using GetExtension (or GetExtensions) desc and value
|
||||||
// will be set.
|
// will be set.
|
||||||
desc *ExtensionDesc
|
desc *ExtensionDesc
|
||||||
|
|
||||||
// value is a concrete value for the extension field. Let the type of
|
|
||||||
// desc.ExtensionType be the "API type" and the type of Extension.value
|
|
||||||
// be the "storage type". The API type and storage type are the same except:
|
|
||||||
// * For scalars (except []byte), the API type uses *T,
|
|
||||||
// while the storage type uses T.
|
|
||||||
// * For repeated fields, the API type uses []T, while the storage type
|
|
||||||
// uses *[]T.
|
|
||||||
//
|
|
||||||
// The reason for the divergence is so that the storage type more naturally
|
|
||||||
// matches what is expected of when retrieving the values through the
|
|
||||||
// protobuf reflection APIs.
|
|
||||||
//
|
|
||||||
// The value may only be populated if desc is also populated.
|
|
||||||
value interface{}
|
value interface{}
|
||||||
|
|
||||||
// enc is the raw bytes for the extension field.
|
|
||||||
enc []byte
|
enc []byte
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -350,7 +334,7 @@ func GetExtension(pb Message, extension *ExtensionDesc) (interface{}, error) {
|
|||||||
// descriptors with the same field number.
|
// descriptors with the same field number.
|
||||||
return nil, errors.New("proto: descriptor conflict")
|
return nil, errors.New("proto: descriptor conflict")
|
||||||
}
|
}
|
||||||
return extensionAsLegacyType(e.value), nil
|
return e.value, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
if extension.ExtensionType == nil {
|
if extension.ExtensionType == nil {
|
||||||
@ -365,11 +349,11 @@ func GetExtension(pb Message, extension *ExtensionDesc) (interface{}, error) {
|
|||||||
|
|
||||||
// Remember the decoded version and drop the encoded version.
|
// Remember the decoded version and drop the encoded version.
|
||||||
// That way it is safe to mutate what we return.
|
// That way it is safe to mutate what we return.
|
||||||
e.value = extensionAsStorageType(v)
|
e.value = v
|
||||||
e.desc = extension
|
e.desc = extension
|
||||||
e.enc = nil
|
e.enc = nil
|
||||||
emap[extension.Field] = e
|
emap[extension.Field] = e
|
||||||
return extensionAsLegacyType(e.value), nil
|
return e.value, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// defaultExtensionValue returns the default value for extension.
|
// defaultExtensionValue returns the default value for extension.
|
||||||
@ -504,7 +488,7 @@ func SetExtension(pb Message, extension *ExtensionDesc, value interface{}) error
|
|||||||
}
|
}
|
||||||
typ := reflect.TypeOf(extension.ExtensionType)
|
typ := reflect.TypeOf(extension.ExtensionType)
|
||||||
if typ != reflect.TypeOf(value) {
|
if typ != reflect.TypeOf(value) {
|
||||||
return fmt.Errorf("proto: bad extension value type. got: %T, want: %T", value, extension.ExtensionType)
|
return errors.New("proto: bad extension value type")
|
||||||
}
|
}
|
||||||
// nil extension values need to be caught early, because the
|
// nil extension values need to be caught early, because the
|
||||||
// encoder can't distinguish an ErrNil due to a nil extension
|
// encoder can't distinguish an ErrNil due to a nil extension
|
||||||
@ -516,7 +500,7 @@ func SetExtension(pb Message, extension *ExtensionDesc, value interface{}) error
|
|||||||
}
|
}
|
||||||
|
|
||||||
extmap := epb.extensionsWrite()
|
extmap := epb.extensionsWrite()
|
||||||
extmap[extension.Field] = Extension{desc: extension, value: extensionAsStorageType(value)}
|
extmap[extension.Field] = Extension{desc: extension, value: value}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -557,51 +541,3 @@ func RegisterExtension(desc *ExtensionDesc) {
|
|||||||
func RegisteredExtensions(pb Message) map[int32]*ExtensionDesc {
|
func RegisteredExtensions(pb Message) map[int32]*ExtensionDesc {
|
||||||
return extensionMaps[reflect.TypeOf(pb).Elem()]
|
return extensionMaps[reflect.TypeOf(pb).Elem()]
|
||||||
}
|
}
|
||||||
|
|
||||||
// extensionAsLegacyType converts an value in the storage type as the API type.
|
|
||||||
// See Extension.value.
|
|
||||||
func extensionAsLegacyType(v interface{}) interface{} {
|
|
||||||
switch rv := reflect.ValueOf(v); rv.Kind() {
|
|
||||||
case reflect.Bool, reflect.Int32, reflect.Int64, reflect.Uint32, reflect.Uint64, reflect.Float32, reflect.Float64, reflect.String:
|
|
||||||
// Represent primitive types as a pointer to the value.
|
|
||||||
rv2 := reflect.New(rv.Type())
|
|
||||||
rv2.Elem().Set(rv)
|
|
||||||
v = rv2.Interface()
|
|
||||||
case reflect.Ptr:
|
|
||||||
// Represent slice types as the value itself.
|
|
||||||
switch rv.Type().Elem().Kind() {
|
|
||||||
case reflect.Slice:
|
|
||||||
if rv.IsNil() {
|
|
||||||
v = reflect.Zero(rv.Type().Elem()).Interface()
|
|
||||||
} else {
|
|
||||||
v = rv.Elem().Interface()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return v
|
|
||||||
}
|
|
||||||
|
|
||||||
// extensionAsStorageType converts an value in the API type as the storage type.
|
|
||||||
// See Extension.value.
|
|
||||||
func extensionAsStorageType(v interface{}) interface{} {
|
|
||||||
switch rv := reflect.ValueOf(v); rv.Kind() {
|
|
||||||
case reflect.Ptr:
|
|
||||||
// Represent slice types as the value itself.
|
|
||||||
switch rv.Type().Elem().Kind() {
|
|
||||||
case reflect.Bool, reflect.Int32, reflect.Int64, reflect.Uint32, reflect.Uint64, reflect.Float32, reflect.Float64, reflect.String:
|
|
||||||
if rv.IsNil() {
|
|
||||||
v = reflect.Zero(rv.Type().Elem()).Interface()
|
|
||||||
} else {
|
|
||||||
v = rv.Elem().Interface()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
case reflect.Slice:
|
|
||||||
// Represent slice types as a pointer to the value.
|
|
||||||
if rv.Type().Elem().Kind() != reflect.Uint8 {
|
|
||||||
rv2 := reflect.New(rv.Type())
|
|
||||||
rv2.Elem().Set(rv)
|
|
||||||
v = rv2.Interface()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return v
|
|
||||||
}
|
|
||||||
|
|||||||
30
vendor/github.com/golang/protobuf/proto/lib.go
generated
vendored
30
vendor/github.com/golang/protobuf/proto/lib.go
generated
vendored
@ -341,6 +341,26 @@ type Message interface {
|
|||||||
ProtoMessage()
|
ProtoMessage()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Stats records allocation details about the protocol buffer encoders
|
||||||
|
// and decoders. Useful for tuning the library itself.
|
||||||
|
type Stats struct {
|
||||||
|
Emalloc uint64 // mallocs in encode
|
||||||
|
Dmalloc uint64 // mallocs in decode
|
||||||
|
Encode uint64 // number of encodes
|
||||||
|
Decode uint64 // number of decodes
|
||||||
|
Chit uint64 // number of cache hits
|
||||||
|
Cmiss uint64 // number of cache misses
|
||||||
|
Size uint64 // number of sizes
|
||||||
|
}
|
||||||
|
|
||||||
|
// Set to true to enable stats collection.
|
||||||
|
const collectStats = false
|
||||||
|
|
||||||
|
var stats Stats
|
||||||
|
|
||||||
|
// GetStats returns a copy of the global Stats structure.
|
||||||
|
func GetStats() Stats { return stats }
|
||||||
|
|
||||||
// A Buffer is a buffer manager for marshaling and unmarshaling
|
// A Buffer is a buffer manager for marshaling and unmarshaling
|
||||||
// protocol buffers. It may be reused between invocations to
|
// protocol buffers. It may be reused between invocations to
|
||||||
// reduce memory usage. It is not necessary to use a Buffer;
|
// reduce memory usage. It is not necessary to use a Buffer;
|
||||||
@ -940,19 +960,13 @@ func isProto3Zero(v reflect.Value) bool {
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
const (
|
|
||||||
// ProtoPackageIsVersion3 is referenced from generated protocol buffer files
|
|
||||||
// to assert that that code is compatible with this version of the proto package.
|
|
||||||
ProtoPackageIsVersion3 = true
|
|
||||||
|
|
||||||
// ProtoPackageIsVersion2 is referenced from generated protocol buffer files
|
// ProtoPackageIsVersion2 is referenced from generated protocol buffer files
|
||||||
// to assert that that code is compatible with this version of the proto package.
|
// to assert that that code is compatible with this version of the proto package.
|
||||||
ProtoPackageIsVersion2 = true
|
const ProtoPackageIsVersion2 = true
|
||||||
|
|
||||||
// ProtoPackageIsVersion1 is referenced from generated protocol buffer files
|
// ProtoPackageIsVersion1 is referenced from generated protocol buffer files
|
||||||
// to assert that that code is compatible with this version of the proto package.
|
// to assert that that code is compatible with this version of the proto package.
|
||||||
ProtoPackageIsVersion1 = true
|
const ProtoPackageIsVersion1 = true
|
||||||
)
|
|
||||||
|
|
||||||
// InternalMessageInfo is a type used internally by generated .pb.go files.
|
// InternalMessageInfo is a type used internally by generated .pb.go files.
|
||||||
// This type is not intended to be used by non-generated code.
|
// This type is not intended to be used by non-generated code.
|
||||||
|
|||||||
137
vendor/github.com/golang/protobuf/proto/message_set.go
generated
vendored
137
vendor/github.com/golang/protobuf/proto/message_set.go
generated
vendored
@ -36,7 +36,13 @@ package proto
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"bytes"
|
||||||
|
"encoding/json"
|
||||||
"errors"
|
"errors"
|
||||||
|
"fmt"
|
||||||
|
"reflect"
|
||||||
|
"sort"
|
||||||
|
"sync"
|
||||||
)
|
)
|
||||||
|
|
||||||
// errNoMessageTypeID occurs when a protocol buffer does not have a message type ID.
|
// errNoMessageTypeID occurs when a protocol buffer does not have a message type ID.
|
||||||
@ -139,9 +145,46 @@ func skipVarint(buf []byte) []byte {
|
|||||||
return buf[i+1:]
|
return buf[i+1:]
|
||||||
}
|
}
|
||||||
|
|
||||||
// unmarshalMessageSet decodes the extension map encoded in buf in the message set wire format.
|
// MarshalMessageSet encodes the extension map represented by m in the message set wire format.
|
||||||
|
// It is called by generated Marshal methods on protocol buffer messages with the message_set_wire_format option.
|
||||||
|
func MarshalMessageSet(exts interface{}) ([]byte, error) {
|
||||||
|
return marshalMessageSet(exts, false)
|
||||||
|
}
|
||||||
|
|
||||||
|
// marshaMessageSet implements above function, with the opt to turn on / off deterministic during Marshal.
|
||||||
|
func marshalMessageSet(exts interface{}, deterministic bool) ([]byte, error) {
|
||||||
|
switch exts := exts.(type) {
|
||||||
|
case *XXX_InternalExtensions:
|
||||||
|
var u marshalInfo
|
||||||
|
siz := u.sizeMessageSet(exts)
|
||||||
|
b := make([]byte, 0, siz)
|
||||||
|
return u.appendMessageSet(b, exts, deterministic)
|
||||||
|
|
||||||
|
case map[int32]Extension:
|
||||||
|
// This is an old-style extension map.
|
||||||
|
// Wrap it in a new-style XXX_InternalExtensions.
|
||||||
|
ie := XXX_InternalExtensions{
|
||||||
|
p: &struct {
|
||||||
|
mu sync.Mutex
|
||||||
|
extensionMap map[int32]Extension
|
||||||
|
}{
|
||||||
|
extensionMap: exts,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
var u marshalInfo
|
||||||
|
siz := u.sizeMessageSet(&ie)
|
||||||
|
b := make([]byte, 0, siz)
|
||||||
|
return u.appendMessageSet(b, &ie, deterministic)
|
||||||
|
|
||||||
|
default:
|
||||||
|
return nil, errors.New("proto: not an extension map")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// UnmarshalMessageSet decodes the extension map encoded in buf in the message set wire format.
|
||||||
// It is called by Unmarshal methods on protocol buffer messages with the message_set_wire_format option.
|
// It is called by Unmarshal methods on protocol buffer messages with the message_set_wire_format option.
|
||||||
func unmarshalMessageSet(buf []byte, exts interface{}) error {
|
func UnmarshalMessageSet(buf []byte, exts interface{}) error {
|
||||||
var m map[int32]Extension
|
var m map[int32]Extension
|
||||||
switch exts := exts.(type) {
|
switch exts := exts.(type) {
|
||||||
case *XXX_InternalExtensions:
|
case *XXX_InternalExtensions:
|
||||||
@ -179,3 +222,93 @@ func unmarshalMessageSet(buf []byte, exts interface{}) error {
|
|||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// MarshalMessageSetJSON encodes the extension map represented by m in JSON format.
|
||||||
|
// It is called by generated MarshalJSON methods on protocol buffer messages with the message_set_wire_format option.
|
||||||
|
func MarshalMessageSetJSON(exts interface{}) ([]byte, error) {
|
||||||
|
var m map[int32]Extension
|
||||||
|
switch exts := exts.(type) {
|
||||||
|
case *XXX_InternalExtensions:
|
||||||
|
var mu sync.Locker
|
||||||
|
m, mu = exts.extensionsRead()
|
||||||
|
if m != nil {
|
||||||
|
// Keep the extensions map locked until we're done marshaling to prevent
|
||||||
|
// races between marshaling and unmarshaling the lazily-{en,de}coded
|
||||||
|
// values.
|
||||||
|
mu.Lock()
|
||||||
|
defer mu.Unlock()
|
||||||
|
}
|
||||||
|
case map[int32]Extension:
|
||||||
|
m = exts
|
||||||
|
default:
|
||||||
|
return nil, errors.New("proto: not an extension map")
|
||||||
|
}
|
||||||
|
var b bytes.Buffer
|
||||||
|
b.WriteByte('{')
|
||||||
|
|
||||||
|
// Process the map in key order for deterministic output.
|
||||||
|
ids := make([]int32, 0, len(m))
|
||||||
|
for id := range m {
|
||||||
|
ids = append(ids, id)
|
||||||
|
}
|
||||||
|
sort.Sort(int32Slice(ids)) // int32Slice defined in text.go
|
||||||
|
|
||||||
|
for i, id := range ids {
|
||||||
|
ext := m[id]
|
||||||
|
msd, ok := messageSetMap[id]
|
||||||
|
if !ok {
|
||||||
|
// Unknown type; we can't render it, so skip it.
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
if i > 0 && b.Len() > 1 {
|
||||||
|
b.WriteByte(',')
|
||||||
|
}
|
||||||
|
|
||||||
|
fmt.Fprintf(&b, `"[%s]":`, msd.name)
|
||||||
|
|
||||||
|
x := ext.value
|
||||||
|
if x == nil {
|
||||||
|
x = reflect.New(msd.t.Elem()).Interface()
|
||||||
|
if err := Unmarshal(ext.enc, x.(Message)); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
d, err := json.Marshal(x)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
b.Write(d)
|
||||||
|
}
|
||||||
|
b.WriteByte('}')
|
||||||
|
return b.Bytes(), nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// UnmarshalMessageSetJSON decodes the extension map encoded in buf in JSON format.
|
||||||
|
// It is called by generated UnmarshalJSON methods on protocol buffer messages with the message_set_wire_format option.
|
||||||
|
func UnmarshalMessageSetJSON(buf []byte, exts interface{}) error {
|
||||||
|
// Common-case fast path.
|
||||||
|
if len(buf) == 0 || bytes.Equal(buf, []byte("{}")) {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// This is fairly tricky, and it's not clear that it is needed.
|
||||||
|
return errors.New("TODO: UnmarshalMessageSetJSON not yet implemented")
|
||||||
|
}
|
||||||
|
|
||||||
|
// A global registry of types that can be used in a MessageSet.
|
||||||
|
|
||||||
|
var messageSetMap = make(map[int32]messageSetDesc)
|
||||||
|
|
||||||
|
type messageSetDesc struct {
|
||||||
|
t reflect.Type // pointer to struct
|
||||||
|
name string
|
||||||
|
}
|
||||||
|
|
||||||
|
// RegisterMessageSetType is called from the generated code.
|
||||||
|
func RegisterMessageSetType(m Message, fieldNum int32, name string) {
|
||||||
|
messageSetMap[fieldNum] = messageSetDesc{
|
||||||
|
t: reflect.TypeOf(m),
|
||||||
|
name: name,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
5
vendor/github.com/golang/protobuf/proto/pointer_reflect.go
generated
vendored
5
vendor/github.com/golang/protobuf/proto/pointer_reflect.go
generated
vendored
@ -79,13 +79,10 @@ func toPointer(i *Message) pointer {
|
|||||||
|
|
||||||
// toAddrPointer converts an interface to a pointer that points to
|
// toAddrPointer converts an interface to a pointer that points to
|
||||||
// the interface data.
|
// the interface data.
|
||||||
func toAddrPointer(i *interface{}, isptr, deref bool) pointer {
|
func toAddrPointer(i *interface{}, isptr bool) pointer {
|
||||||
v := reflect.ValueOf(*i)
|
v := reflect.ValueOf(*i)
|
||||||
u := reflect.New(v.Type())
|
u := reflect.New(v.Type())
|
||||||
u.Elem().Set(v)
|
u.Elem().Set(v)
|
||||||
if deref {
|
|
||||||
u = u.Elem()
|
|
||||||
}
|
|
||||||
return pointer{v: u}
|
return pointer{v: u}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
13
vendor/github.com/golang/protobuf/proto/pointer_unsafe.go
generated
vendored
13
vendor/github.com/golang/protobuf/proto/pointer_unsafe.go
generated
vendored
@ -85,21 +85,16 @@ func toPointer(i *Message) pointer {
|
|||||||
|
|
||||||
// toAddrPointer converts an interface to a pointer that points to
|
// toAddrPointer converts an interface to a pointer that points to
|
||||||
// the interface data.
|
// the interface data.
|
||||||
func toAddrPointer(i *interface{}, isptr, deref bool) (p pointer) {
|
func toAddrPointer(i *interface{}, isptr bool) pointer {
|
||||||
// Super-tricky - read or get the address of data word of interface value.
|
// Super-tricky - read or get the address of data word of interface value.
|
||||||
if isptr {
|
if isptr {
|
||||||
// The interface is of pointer type, thus it is a direct interface.
|
// The interface is of pointer type, thus it is a direct interface.
|
||||||
// The data word is the pointer data itself. We take its address.
|
// The data word is the pointer data itself. We take its address.
|
||||||
p = pointer{p: unsafe.Pointer(uintptr(unsafe.Pointer(i)) + ptrSize)}
|
return pointer{p: unsafe.Pointer(uintptr(unsafe.Pointer(i)) + ptrSize)}
|
||||||
} else {
|
}
|
||||||
// The interface is not of pointer type. The data word is the pointer
|
// The interface is not of pointer type. The data word is the pointer
|
||||||
// to the data.
|
// to the data.
|
||||||
p = pointer{p: (*[2]unsafe.Pointer)(unsafe.Pointer(i))[1]}
|
return pointer{p: (*[2]unsafe.Pointer)(unsafe.Pointer(i))[1]}
|
||||||
}
|
|
||||||
if deref {
|
|
||||||
p.p = *(*unsafe.Pointer)(p.p)
|
|
||||||
}
|
|
||||||
return p
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// valToPointer converts v to a pointer. v must be of pointer type.
|
// valToPointer converts v to a pointer. v must be of pointer type.
|
||||||
|
|||||||
31
vendor/github.com/golang/protobuf/proto/properties.go
generated
vendored
31
vendor/github.com/golang/protobuf/proto/properties.go
generated
vendored
@ -334,6 +334,9 @@ func GetProperties(t reflect.Type) *StructProperties {
|
|||||||
sprop, ok := propertiesMap[t]
|
sprop, ok := propertiesMap[t]
|
||||||
propertiesMu.RUnlock()
|
propertiesMu.RUnlock()
|
||||||
if ok {
|
if ok {
|
||||||
|
if collectStats {
|
||||||
|
stats.Chit++
|
||||||
|
}
|
||||||
return sprop
|
return sprop
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -343,20 +346,17 @@ func GetProperties(t reflect.Type) *StructProperties {
|
|||||||
return sprop
|
return sprop
|
||||||
}
|
}
|
||||||
|
|
||||||
type (
|
|
||||||
oneofFuncsIface interface {
|
|
||||||
XXX_OneofFuncs() (func(Message, *Buffer) error, func(Message, int, int, *Buffer) (bool, error), func(Message) int, []interface{})
|
|
||||||
}
|
|
||||||
oneofWrappersIface interface {
|
|
||||||
XXX_OneofWrappers() []interface{}
|
|
||||||
}
|
|
||||||
)
|
|
||||||
|
|
||||||
// getPropertiesLocked requires that propertiesMu is held.
|
// getPropertiesLocked requires that propertiesMu is held.
|
||||||
func getPropertiesLocked(t reflect.Type) *StructProperties {
|
func getPropertiesLocked(t reflect.Type) *StructProperties {
|
||||||
if prop, ok := propertiesMap[t]; ok {
|
if prop, ok := propertiesMap[t]; ok {
|
||||||
|
if collectStats {
|
||||||
|
stats.Chit++
|
||||||
|
}
|
||||||
return prop
|
return prop
|
||||||
}
|
}
|
||||||
|
if collectStats {
|
||||||
|
stats.Cmiss++
|
||||||
|
}
|
||||||
|
|
||||||
prop := new(StructProperties)
|
prop := new(StructProperties)
|
||||||
// in case of recursive protos, fill this in now.
|
// in case of recursive protos, fill this in now.
|
||||||
@ -391,14 +391,13 @@ func getPropertiesLocked(t reflect.Type) *StructProperties {
|
|||||||
// Re-order prop.order.
|
// Re-order prop.order.
|
||||||
sort.Sort(prop)
|
sort.Sort(prop)
|
||||||
|
|
||||||
var oots []interface{}
|
type oneofMessage interface {
|
||||||
switch m := reflect.Zero(reflect.PtrTo(t)).Interface().(type) {
|
XXX_OneofFuncs() (func(Message, *Buffer) error, func(Message, int, int, *Buffer) (bool, error), func(Message) int, []interface{})
|
||||||
case oneofFuncsIface:
|
|
||||||
_, _, _, oots = m.XXX_OneofFuncs()
|
|
||||||
case oneofWrappersIface:
|
|
||||||
oots = m.XXX_OneofWrappers()
|
|
||||||
}
|
}
|
||||||
if len(oots) > 0 {
|
if om, ok := reflect.Zero(reflect.PtrTo(t)).Interface().(oneofMessage); ok {
|
||||||
|
var oots []interface{}
|
||||||
|
_, _, _, oots = om.XXX_OneofFuncs()
|
||||||
|
|
||||||
// Interpret oneof metadata.
|
// Interpret oneof metadata.
|
||||||
prop.OneofTypes = make(map[string]*OneofProperties)
|
prop.OneofTypes = make(map[string]*OneofProperties)
|
||||||
for _, oot := range oots {
|
for _, oot := range oots {
|
||||||
|
|||||||
45
vendor/github.com/golang/protobuf/proto/table_marshal.go
generated
vendored
45
vendor/github.com/golang/protobuf/proto/table_marshal.go
generated
vendored
@ -87,7 +87,6 @@ type marshalElemInfo struct {
|
|||||||
sizer sizer
|
sizer sizer
|
||||||
marshaler marshaler
|
marshaler marshaler
|
||||||
isptr bool // elem is pointer typed, thus interface of this type is a direct interface (extension only)
|
isptr bool // elem is pointer typed, thus interface of this type is a direct interface (extension only)
|
||||||
deref bool // dereference the pointer before operating on it; implies isptr
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
@ -321,11 +320,8 @@ func (u *marshalInfo) computeMarshalInfo() {
|
|||||||
|
|
||||||
// get oneof implementers
|
// get oneof implementers
|
||||||
var oneofImplementers []interface{}
|
var oneofImplementers []interface{}
|
||||||
switch m := reflect.Zero(reflect.PtrTo(t)).Interface().(type) {
|
if m, ok := reflect.Zero(reflect.PtrTo(t)).Interface().(oneofMessage); ok {
|
||||||
case oneofFuncsIface:
|
|
||||||
_, _, _, oneofImplementers = m.XXX_OneofFuncs()
|
_, _, _, oneofImplementers = m.XXX_OneofFuncs()
|
||||||
case oneofWrappersIface:
|
|
||||||
oneofImplementers = m.XXX_OneofWrappers()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
n := t.NumField()
|
n := t.NumField()
|
||||||
@ -411,22 +407,13 @@ func (u *marshalInfo) getExtElemInfo(desc *ExtensionDesc) *marshalElemInfo {
|
|||||||
panic("tag is not an integer")
|
panic("tag is not an integer")
|
||||||
}
|
}
|
||||||
wt := wiretype(tags[0])
|
wt := wiretype(tags[0])
|
||||||
if t.Kind() == reflect.Ptr && t.Elem().Kind() != reflect.Struct {
|
|
||||||
t = t.Elem()
|
|
||||||
}
|
|
||||||
sizer, marshaler := typeMarshaler(t, tags, false, false)
|
sizer, marshaler := typeMarshaler(t, tags, false, false)
|
||||||
var deref bool
|
|
||||||
if t.Kind() == reflect.Slice && t.Elem().Kind() != reflect.Uint8 {
|
|
||||||
t = reflect.PtrTo(t)
|
|
||||||
deref = true
|
|
||||||
}
|
|
||||||
e = &marshalElemInfo{
|
e = &marshalElemInfo{
|
||||||
wiretag: uint64(tag)<<3 | wt,
|
wiretag: uint64(tag)<<3 | wt,
|
||||||
tagsize: SizeVarint(uint64(tag) << 3),
|
tagsize: SizeVarint(uint64(tag) << 3),
|
||||||
sizer: sizer,
|
sizer: sizer,
|
||||||
marshaler: marshaler,
|
marshaler: marshaler,
|
||||||
isptr: t.Kind() == reflect.Ptr,
|
isptr: t.Kind() == reflect.Ptr,
|
||||||
deref: deref,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// update cache
|
// update cache
|
||||||
@ -461,7 +448,7 @@ func (fi *marshalFieldInfo) computeMarshalFieldInfo(f *reflect.StructField) {
|
|||||||
|
|
||||||
func (fi *marshalFieldInfo) computeOneofFieldInfo(f *reflect.StructField, oneofImplementers []interface{}) {
|
func (fi *marshalFieldInfo) computeOneofFieldInfo(f *reflect.StructField, oneofImplementers []interface{}) {
|
||||||
fi.field = toField(f)
|
fi.field = toField(f)
|
||||||
fi.wiretag = math.MaxInt32 // Use a large tag number, make oneofs sorted at the end. This tag will not appear on the wire.
|
fi.wiretag = 1<<31 - 1 // Use a large tag number, make oneofs sorted at the end. This tag will not appear on the wire.
|
||||||
fi.isPointer = true
|
fi.isPointer = true
|
||||||
fi.sizer, fi.marshaler = makeOneOfMarshaler(fi, f)
|
fi.sizer, fi.marshaler = makeOneOfMarshaler(fi, f)
|
||||||
fi.oneofElems = make(map[reflect.Type]*marshalElemInfo)
|
fi.oneofElems = make(map[reflect.Type]*marshalElemInfo)
|
||||||
@ -489,6 +476,10 @@ func (fi *marshalFieldInfo) computeOneofFieldInfo(f *reflect.StructField, oneofI
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type oneofMessage interface {
|
||||||
|
XXX_OneofFuncs() (func(Message, *Buffer) error, func(Message, int, int, *Buffer) (bool, error), func(Message) int, []interface{})
|
||||||
|
}
|
||||||
|
|
||||||
// wiretype returns the wire encoding of the type.
|
// wiretype returns the wire encoding of the type.
|
||||||
func wiretype(encoding string) uint64 {
|
func wiretype(encoding string) uint64 {
|
||||||
switch encoding {
|
switch encoding {
|
||||||
@ -2319,8 +2310,8 @@ func makeMapMarshaler(f *reflect.StructField) (sizer, marshaler) {
|
|||||||
for _, k := range m.MapKeys() {
|
for _, k := range m.MapKeys() {
|
||||||
ki := k.Interface()
|
ki := k.Interface()
|
||||||
vi := m.MapIndex(k).Interface()
|
vi := m.MapIndex(k).Interface()
|
||||||
kaddr := toAddrPointer(&ki, false, false) // pointer to key
|
kaddr := toAddrPointer(&ki, false) // pointer to key
|
||||||
vaddr := toAddrPointer(&vi, valIsPtr, false) // pointer to value
|
vaddr := toAddrPointer(&vi, valIsPtr) // pointer to value
|
||||||
siz := keySizer(kaddr, 1) + valSizer(vaddr, 1) // tag of key = 1 (size=1), tag of val = 2 (size=1)
|
siz := keySizer(kaddr, 1) + valSizer(vaddr, 1) // tag of key = 1 (size=1), tag of val = 2 (size=1)
|
||||||
n += siz + SizeVarint(uint64(siz)) + tagsize
|
n += siz + SizeVarint(uint64(siz)) + tagsize
|
||||||
}
|
}
|
||||||
@ -2338,8 +2329,8 @@ func makeMapMarshaler(f *reflect.StructField) (sizer, marshaler) {
|
|||||||
for _, k := range keys {
|
for _, k := range keys {
|
||||||
ki := k.Interface()
|
ki := k.Interface()
|
||||||
vi := m.MapIndex(k).Interface()
|
vi := m.MapIndex(k).Interface()
|
||||||
kaddr := toAddrPointer(&ki, false, false) // pointer to key
|
kaddr := toAddrPointer(&ki, false) // pointer to key
|
||||||
vaddr := toAddrPointer(&vi, valIsPtr, false) // pointer to value
|
vaddr := toAddrPointer(&vi, valIsPtr) // pointer to value
|
||||||
b = appendVarint(b, tag)
|
b = appendVarint(b, tag)
|
||||||
siz := keySizer(kaddr, 1) + valCachedSizer(vaddr, 1) // tag of key = 1 (size=1), tag of val = 2 (size=1)
|
siz := keySizer(kaddr, 1) + valCachedSizer(vaddr, 1) // tag of key = 1 (size=1), tag of val = 2 (size=1)
|
||||||
b = appendVarint(b, uint64(siz))
|
b = appendVarint(b, uint64(siz))
|
||||||
@ -2408,7 +2399,7 @@ func (u *marshalInfo) sizeExtensions(ext *XXX_InternalExtensions) int {
|
|||||||
// the last time this function was called.
|
// the last time this function was called.
|
||||||
ei := u.getExtElemInfo(e.desc)
|
ei := u.getExtElemInfo(e.desc)
|
||||||
v := e.value
|
v := e.value
|
||||||
p := toAddrPointer(&v, ei.isptr, ei.deref)
|
p := toAddrPointer(&v, ei.isptr)
|
||||||
n += ei.sizer(p, ei.tagsize)
|
n += ei.sizer(p, ei.tagsize)
|
||||||
}
|
}
|
||||||
mu.Unlock()
|
mu.Unlock()
|
||||||
@ -2443,7 +2434,7 @@ func (u *marshalInfo) appendExtensions(b []byte, ext *XXX_InternalExtensions, de
|
|||||||
|
|
||||||
ei := u.getExtElemInfo(e.desc)
|
ei := u.getExtElemInfo(e.desc)
|
||||||
v := e.value
|
v := e.value
|
||||||
p := toAddrPointer(&v, ei.isptr, ei.deref)
|
p := toAddrPointer(&v, ei.isptr)
|
||||||
b, err = ei.marshaler(b, p, ei.wiretag, deterministic)
|
b, err = ei.marshaler(b, p, ei.wiretag, deterministic)
|
||||||
if !nerr.Merge(err) {
|
if !nerr.Merge(err) {
|
||||||
return b, err
|
return b, err
|
||||||
@ -2474,7 +2465,7 @@ func (u *marshalInfo) appendExtensions(b []byte, ext *XXX_InternalExtensions, de
|
|||||||
|
|
||||||
ei := u.getExtElemInfo(e.desc)
|
ei := u.getExtElemInfo(e.desc)
|
||||||
v := e.value
|
v := e.value
|
||||||
p := toAddrPointer(&v, ei.isptr, ei.deref)
|
p := toAddrPointer(&v, ei.isptr)
|
||||||
b, err = ei.marshaler(b, p, ei.wiretag, deterministic)
|
b, err = ei.marshaler(b, p, ei.wiretag, deterministic)
|
||||||
if !nerr.Merge(err) {
|
if !nerr.Merge(err) {
|
||||||
return b, err
|
return b, err
|
||||||
@ -2519,7 +2510,7 @@ func (u *marshalInfo) sizeMessageSet(ext *XXX_InternalExtensions) int {
|
|||||||
|
|
||||||
ei := u.getExtElemInfo(e.desc)
|
ei := u.getExtElemInfo(e.desc)
|
||||||
v := e.value
|
v := e.value
|
||||||
p := toAddrPointer(&v, ei.isptr, ei.deref)
|
p := toAddrPointer(&v, ei.isptr)
|
||||||
n += ei.sizer(p, 1) // message, tag = 3 (size=1)
|
n += ei.sizer(p, 1) // message, tag = 3 (size=1)
|
||||||
}
|
}
|
||||||
mu.Unlock()
|
mu.Unlock()
|
||||||
@ -2562,7 +2553,7 @@ func (u *marshalInfo) appendMessageSet(b []byte, ext *XXX_InternalExtensions, de
|
|||||||
|
|
||||||
ei := u.getExtElemInfo(e.desc)
|
ei := u.getExtElemInfo(e.desc)
|
||||||
v := e.value
|
v := e.value
|
||||||
p := toAddrPointer(&v, ei.isptr, ei.deref)
|
p := toAddrPointer(&v, ei.isptr)
|
||||||
b, err = ei.marshaler(b, p, 3<<3|WireBytes, deterministic)
|
b, err = ei.marshaler(b, p, 3<<3|WireBytes, deterministic)
|
||||||
if !nerr.Merge(err) {
|
if !nerr.Merge(err) {
|
||||||
return b, err
|
return b, err
|
||||||
@ -2600,7 +2591,7 @@ func (u *marshalInfo) appendMessageSet(b []byte, ext *XXX_InternalExtensions, de
|
|||||||
|
|
||||||
ei := u.getExtElemInfo(e.desc)
|
ei := u.getExtElemInfo(e.desc)
|
||||||
v := e.value
|
v := e.value
|
||||||
p := toAddrPointer(&v, ei.isptr, ei.deref)
|
p := toAddrPointer(&v, ei.isptr)
|
||||||
b, err = ei.marshaler(b, p, 3<<3|WireBytes, deterministic)
|
b, err = ei.marshaler(b, p, 3<<3|WireBytes, deterministic)
|
||||||
b = append(b, 1<<3|WireEndGroup)
|
b = append(b, 1<<3|WireEndGroup)
|
||||||
if !nerr.Merge(err) {
|
if !nerr.Merge(err) {
|
||||||
@ -2630,7 +2621,7 @@ func (u *marshalInfo) sizeV1Extensions(m map[int32]Extension) int {
|
|||||||
|
|
||||||
ei := u.getExtElemInfo(e.desc)
|
ei := u.getExtElemInfo(e.desc)
|
||||||
v := e.value
|
v := e.value
|
||||||
p := toAddrPointer(&v, ei.isptr, ei.deref)
|
p := toAddrPointer(&v, ei.isptr)
|
||||||
n += ei.sizer(p, ei.tagsize)
|
n += ei.sizer(p, ei.tagsize)
|
||||||
}
|
}
|
||||||
return n
|
return n
|
||||||
@ -2665,7 +2656,7 @@ func (u *marshalInfo) appendV1Extensions(b []byte, m map[int32]Extension, determ
|
|||||||
|
|
||||||
ei := u.getExtElemInfo(e.desc)
|
ei := u.getExtElemInfo(e.desc)
|
||||||
v := e.value
|
v := e.value
|
||||||
p := toAddrPointer(&v, ei.isptr, ei.deref)
|
p := toAddrPointer(&v, ei.isptr)
|
||||||
b, err = ei.marshaler(b, p, ei.wiretag, deterministic)
|
b, err = ei.marshaler(b, p, ei.wiretag, deterministic)
|
||||||
if !nerr.Merge(err) {
|
if !nerr.Merge(err) {
|
||||||
return b, err
|
return b, err
|
||||||
|
|||||||
24
vendor/github.com/golang/protobuf/proto/table_unmarshal.go
generated
vendored
24
vendor/github.com/golang/protobuf/proto/table_unmarshal.go
generated
vendored
@ -136,7 +136,7 @@ func (u *unmarshalInfo) unmarshal(m pointer, b []byte) error {
|
|||||||
u.computeUnmarshalInfo()
|
u.computeUnmarshalInfo()
|
||||||
}
|
}
|
||||||
if u.isMessageSet {
|
if u.isMessageSet {
|
||||||
return unmarshalMessageSet(b, m.offset(u.extensions).toExtensions())
|
return UnmarshalMessageSet(b, m.offset(u.extensions).toExtensions())
|
||||||
}
|
}
|
||||||
var reqMask uint64 // bitmask of required fields we've seen.
|
var reqMask uint64 // bitmask of required fields we've seen.
|
||||||
var errLater error
|
var errLater error
|
||||||
@ -362,15 +362,13 @@ func (u *unmarshalInfo) computeUnmarshalInfo() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Find any types associated with oneof fields.
|
// Find any types associated with oneof fields.
|
||||||
var oneofImplementers []interface{}
|
// TODO: XXX_OneofFuncs returns more info than we need. Get rid of some of it?
|
||||||
switch m := reflect.Zero(reflect.PtrTo(t)).Interface().(type) {
|
fn := reflect.Zero(reflect.PtrTo(t)).MethodByName("XXX_OneofFuncs")
|
||||||
case oneofFuncsIface:
|
if fn.IsValid() {
|
||||||
_, _, _, oneofImplementers = m.XXX_OneofFuncs()
|
res := fn.Call(nil)[3] // last return value from XXX_OneofFuncs: []interface{}
|
||||||
case oneofWrappersIface:
|
for i := res.Len() - 1; i >= 0; i-- {
|
||||||
oneofImplementers = m.XXX_OneofWrappers()
|
v := res.Index(i) // interface{}
|
||||||
}
|
tptr := reflect.ValueOf(v.Interface()).Type() // *Msg_X
|
||||||
for _, v := range oneofImplementers {
|
|
||||||
tptr := reflect.TypeOf(v) // *Msg_X
|
|
||||||
typ := tptr.Elem() // Msg_X
|
typ := tptr.Elem() // Msg_X
|
||||||
|
|
||||||
f := typ.Field(0) // oneof implementers have one field
|
f := typ.Field(0) // oneof implementers have one field
|
||||||
@ -399,11 +397,11 @@ func (u *unmarshalInfo) computeUnmarshalInfo() {
|
|||||||
u.setTag(fieldNum, of.field, unmarshal, 0, name)
|
u.setTag(fieldNum, of.field, unmarshal, 0, name)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get extension ranges, if any.
|
// Get extension ranges, if any.
|
||||||
fn := reflect.Zero(reflect.PtrTo(t)).MethodByName("ExtensionRangeArray")
|
fn = reflect.Zero(reflect.PtrTo(t)).MethodByName("ExtensionRangeArray")
|
||||||
if fn.IsValid() {
|
if fn.IsValid() {
|
||||||
if !u.extensions.IsValid() && !u.oldExtensions.IsValid() {
|
if !u.extensions.IsValid() && !u.oldExtensions.IsValid() {
|
||||||
panic("a message with extensions, but no extensions field in " + t.Name())
|
panic("a message with extensions, but no extensions field in " + t.Name())
|
||||||
@ -1950,7 +1948,7 @@ func encodeVarint(b []byte, x uint64) []byte {
|
|||||||
// If there is an error, it returns 0,0.
|
// If there is an error, it returns 0,0.
|
||||||
func decodeVarint(b []byte) (uint64, int) {
|
func decodeVarint(b []byte) (uint64, int) {
|
||||||
var x, y uint64
|
var x, y uint64
|
||||||
if len(b) == 0 {
|
if len(b) <= 0 {
|
||||||
goto bad
|
goto bad
|
||||||
}
|
}
|
||||||
x = uint64(b[0])
|
x = uint64(b[0])
|
||||||
|
|||||||
603
vendor/github.com/golang/protobuf/protoc-gen-go/descriptor/descriptor.pb.go
generated
vendored
603
vendor/github.com/golang/protobuf/protoc-gen-go/descriptor/descriptor.pb.go
generated
vendored
File diff suppressed because it is too large
Load Diff
11
vendor/github.com/golang/protobuf/protoc-gen-go/descriptor/descriptor.proto
generated
vendored
11
vendor/github.com/golang/protobuf/protoc-gen-go/descriptor/descriptor.proto
generated
vendored
@ -417,17 +417,6 @@ message FileOptions {
|
|||||||
// determining the namespace.
|
// determining the namespace.
|
||||||
optional string php_namespace = 41;
|
optional string php_namespace = 41;
|
||||||
|
|
||||||
|
|
||||||
// Use this option to change the namespace of php generated metadata classes.
|
|
||||||
// Default is empty. When this option is empty, the proto file name will be used
|
|
||||||
// for determining the namespace.
|
|
||||||
optional string php_metadata_namespace = 44;
|
|
||||||
|
|
||||||
// Use this option to change the package of ruby generated classes. Default
|
|
||||||
// is empty. When this option is not set, the package name will be used for
|
|
||||||
// determining the ruby package.
|
|
||||||
optional string ruby_package = 45;
|
|
||||||
|
|
||||||
// The parser stores options it doesn't recognize here.
|
// The parser stores options it doesn't recognize here.
|
||||||
// See the documentation for the "Options" section above.
|
// See the documentation for the "Options" section above.
|
||||||
repeated UninterpretedOption uninterpreted_option = 999;
|
repeated UninterpretedOption uninterpreted_option = 999;
|
||||||
|
|||||||
45
vendor/github.com/golang/protobuf/ptypes/any/any.pb.go
generated
vendored
45
vendor/github.com/golang/protobuf/ptypes/any/any.pb.go
generated
vendored
@ -1,13 +1,11 @@
|
|||||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||||
// source: google/protobuf/any.proto
|
// source: google/protobuf/any.proto
|
||||||
|
|
||||||
package any
|
package any // import "github.com/golang/protobuf/ptypes/any"
|
||||||
|
|
||||||
import (
|
import proto "github.com/golang/protobuf/proto"
|
||||||
fmt "fmt"
|
import fmt "fmt"
|
||||||
proto "github.com/golang/protobuf/proto"
|
import math "math"
|
||||||
math "math"
|
|
||||||
)
|
|
||||||
|
|
||||||
// Reference imports to suppress errors if they are not otherwise used.
|
// Reference imports to suppress errors if they are not otherwise used.
|
||||||
var _ = proto.Marshal
|
var _ = proto.Marshal
|
||||||
@ -18,7 +16,7 @@ var _ = math.Inf
|
|||||||
// is compatible with the proto package it is being compiled against.
|
// is compatible with the proto package it is being compiled against.
|
||||||
// A compilation error at this line likely means your copy of the
|
// A compilation error at this line likely means your copy of the
|
||||||
// proto package needs to be updated.
|
// proto package needs to be updated.
|
||||||
const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
|
const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
|
||||||
|
|
||||||
// `Any` contains an arbitrary serialized protocol buffer message along with a
|
// `Any` contains an arbitrary serialized protocol buffer message along with a
|
||||||
// URL that describes the type of the serialized message.
|
// URL that describes the type of the serialized message.
|
||||||
@ -101,18 +99,17 @@ const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
|
|||||||
// }
|
// }
|
||||||
//
|
//
|
||||||
type Any struct {
|
type Any struct {
|
||||||
// A URL/resource name that uniquely identifies the type of the serialized
|
// A URL/resource name whose content describes the type of the
|
||||||
// protocol buffer message. The last segment of the URL's path must represent
|
// serialized protocol buffer message.
|
||||||
// the fully qualified name of the type (as in
|
|
||||||
// `path/google.protobuf.Duration`). The name should be in a canonical form
|
|
||||||
// (e.g., leading "." is not accepted).
|
|
||||||
//
|
//
|
||||||
// In practice, teams usually precompile into the binary all types that they
|
// For URLs which use the scheme `http`, `https`, or no scheme, the
|
||||||
// expect it to use in the context of Any. However, for URLs which use the
|
// following restrictions and interpretations apply:
|
||||||
// scheme `http`, `https`, or no scheme, one can optionally set up a type
|
|
||||||
// server that maps type URLs to message definitions as follows:
|
|
||||||
//
|
//
|
||||||
// * If no scheme is provided, `https` is assumed.
|
// * If no scheme is provided, `https` is assumed.
|
||||||
|
// * The last segment of the URL's path must represent the fully
|
||||||
|
// qualified name of the type (as in `path/google.protobuf.Duration`).
|
||||||
|
// The name should be in a canonical form (e.g., leading "." is
|
||||||
|
// not accepted).
|
||||||
// * An HTTP GET on the URL must yield a [google.protobuf.Type][]
|
// * An HTTP GET on the URL must yield a [google.protobuf.Type][]
|
||||||
// value in binary format, or produce an error.
|
// value in binary format, or produce an error.
|
||||||
// * Applications are allowed to cache lookup results based on the
|
// * Applications are allowed to cache lookup results based on the
|
||||||
@ -121,10 +118,6 @@ type Any struct {
|
|||||||
// on changes to types. (Use versioned type names to manage
|
// on changes to types. (Use versioned type names to manage
|
||||||
// breaking changes.)
|
// breaking changes.)
|
||||||
//
|
//
|
||||||
// Note: this functionality is not currently available in the official
|
|
||||||
// protobuf release, and it is not used for type URLs beginning with
|
|
||||||
// type.googleapis.com.
|
|
||||||
//
|
|
||||||
// Schemes other than `http`, `https` (or the empty scheme) might be
|
// Schemes other than `http`, `https` (or the empty scheme) might be
|
||||||
// used with implementation specific semantics.
|
// used with implementation specific semantics.
|
||||||
//
|
//
|
||||||
@ -140,19 +133,17 @@ func (m *Any) Reset() { *m = Any{} }
|
|||||||
func (m *Any) String() string { return proto.CompactTextString(m) }
|
func (m *Any) String() string { return proto.CompactTextString(m) }
|
||||||
func (*Any) ProtoMessage() {}
|
func (*Any) ProtoMessage() {}
|
||||||
func (*Any) Descriptor() ([]byte, []int) {
|
func (*Any) Descriptor() ([]byte, []int) {
|
||||||
return fileDescriptor_b53526c13ae22eb4, []int{0}
|
return fileDescriptor_any_744b9ca530f228db, []int{0}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (*Any) XXX_WellKnownType() string { return "Any" }
|
func (*Any) XXX_WellKnownType() string { return "Any" }
|
||||||
|
|
||||||
func (m *Any) XXX_Unmarshal(b []byte) error {
|
func (m *Any) XXX_Unmarshal(b []byte) error {
|
||||||
return xxx_messageInfo_Any.Unmarshal(m, b)
|
return xxx_messageInfo_Any.Unmarshal(m, b)
|
||||||
}
|
}
|
||||||
func (m *Any) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
func (m *Any) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||||
return xxx_messageInfo_Any.Marshal(b, m, deterministic)
|
return xxx_messageInfo_Any.Marshal(b, m, deterministic)
|
||||||
}
|
}
|
||||||
func (m *Any) XXX_Merge(src proto.Message) {
|
func (dst *Any) XXX_Merge(src proto.Message) {
|
||||||
xxx_messageInfo_Any.Merge(m, src)
|
xxx_messageInfo_Any.Merge(dst, src)
|
||||||
}
|
}
|
||||||
func (m *Any) XXX_Size() int {
|
func (m *Any) XXX_Size() int {
|
||||||
return xxx_messageInfo_Any.Size(m)
|
return xxx_messageInfo_Any.Size(m)
|
||||||
@ -181,9 +172,9 @@ func init() {
|
|||||||
proto.RegisterType((*Any)(nil), "google.protobuf.Any")
|
proto.RegisterType((*Any)(nil), "google.protobuf.Any")
|
||||||
}
|
}
|
||||||
|
|
||||||
func init() { proto.RegisterFile("google/protobuf/any.proto", fileDescriptor_b53526c13ae22eb4) }
|
func init() { proto.RegisterFile("google/protobuf/any.proto", fileDescriptor_any_744b9ca530f228db) }
|
||||||
|
|
||||||
var fileDescriptor_b53526c13ae22eb4 = []byte{
|
var fileDescriptor_any_744b9ca530f228db = []byte{
|
||||||
// 185 bytes of a gzipped FileDescriptorProto
|
// 185 bytes of a gzipped FileDescriptorProto
|
||||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x4c, 0xcf, 0xcf, 0x4f,
|
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x4c, 0xcf, 0xcf, 0x4f,
|
||||||
0xcf, 0x49, 0xd5, 0x2f, 0x28, 0xca, 0x2f, 0xc9, 0x4f, 0x2a, 0x4d, 0xd3, 0x4f, 0xcc, 0xab, 0xd4,
|
0xcf, 0x49, 0xd5, 0x2f, 0x28, 0xca, 0x2f, 0xc9, 0x4f, 0x2a, 0x4d, 0xd3, 0x4f, 0xcc, 0xab, 0xd4,
|
||||||
|
|||||||
21
vendor/github.com/golang/protobuf/ptypes/any/any.proto
generated
vendored
21
vendor/github.com/golang/protobuf/ptypes/any/any.proto
generated
vendored
@ -120,18 +120,17 @@ option objc_class_prefix = "GPB";
|
|||||||
// }
|
// }
|
||||||
//
|
//
|
||||||
message Any {
|
message Any {
|
||||||
// A URL/resource name that uniquely identifies the type of the serialized
|
// A URL/resource name whose content describes the type of the
|
||||||
// protocol buffer message. The last segment of the URL's path must represent
|
// serialized protocol buffer message.
|
||||||
// the fully qualified name of the type (as in
|
|
||||||
// `path/google.protobuf.Duration`). The name should be in a canonical form
|
|
||||||
// (e.g., leading "." is not accepted).
|
|
||||||
//
|
//
|
||||||
// In practice, teams usually precompile into the binary all types that they
|
// For URLs which use the scheme `http`, `https`, or no scheme, the
|
||||||
// expect it to use in the context of Any. However, for URLs which use the
|
// following restrictions and interpretations apply:
|
||||||
// scheme `http`, `https`, or no scheme, one can optionally set up a type
|
|
||||||
// server that maps type URLs to message definitions as follows:
|
|
||||||
//
|
//
|
||||||
// * If no scheme is provided, `https` is assumed.
|
// * If no scheme is provided, `https` is assumed.
|
||||||
|
// * The last segment of the URL's path must represent the fully
|
||||||
|
// qualified name of the type (as in `path/google.protobuf.Duration`).
|
||||||
|
// The name should be in a canonical form (e.g., leading "." is
|
||||||
|
// not accepted).
|
||||||
// * An HTTP GET on the URL must yield a [google.protobuf.Type][]
|
// * An HTTP GET on the URL must yield a [google.protobuf.Type][]
|
||||||
// value in binary format, or produce an error.
|
// value in binary format, or produce an error.
|
||||||
// * Applications are allowed to cache lookup results based on the
|
// * Applications are allowed to cache lookup results based on the
|
||||||
@ -140,10 +139,6 @@ message Any {
|
|||||||
// on changes to types. (Use versioned type names to manage
|
// on changes to types. (Use versioned type names to manage
|
||||||
// breaking changes.)
|
// breaking changes.)
|
||||||
//
|
//
|
||||||
// Note: this functionality is not currently available in the official
|
|
||||||
// protobuf release, and it is not used for type URLs beginning with
|
|
||||||
// type.googleapis.com.
|
|
||||||
//
|
|
||||||
// Schemes other than `http`, `https` (or the empty scheme) might be
|
// Schemes other than `http`, `https` (or the empty scheme) might be
|
||||||
// used with implementation specific semantics.
|
// used with implementation specific semantics.
|
||||||
//
|
//
|
||||||
|
|||||||
2
vendor/github.com/golang/protobuf/ptypes/duration.go
generated
vendored
2
vendor/github.com/golang/protobuf/ptypes/duration.go
generated
vendored
@ -82,7 +82,7 @@ func Duration(p *durpb.Duration) (time.Duration, error) {
|
|||||||
return 0, fmt.Errorf("duration: %v is out of range for time.Duration", p)
|
return 0, fmt.Errorf("duration: %v is out of range for time.Duration", p)
|
||||||
}
|
}
|
||||||
if p.Nanos != 0 {
|
if p.Nanos != 0 {
|
||||||
d += time.Duration(p.Nanos) * time.Nanosecond
|
d += time.Duration(p.Nanos)
|
||||||
if (d < 0) != (p.Nanos < 0) {
|
if (d < 0) != (p.Nanos < 0) {
|
||||||
return 0, fmt.Errorf("duration: %v is out of range for time.Duration", p)
|
return 0, fmt.Errorf("duration: %v is out of range for time.Duration", p)
|
||||||
}
|
}
|
||||||
|
|||||||
26
vendor/github.com/golang/protobuf/ptypes/duration/duration.pb.go
generated
vendored
26
vendor/github.com/golang/protobuf/ptypes/duration/duration.pb.go
generated
vendored
@ -1,13 +1,11 @@
|
|||||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||||
// source: google/protobuf/duration.proto
|
// source: google/protobuf/duration.proto
|
||||||
|
|
||||||
package duration
|
package duration // import "github.com/golang/protobuf/ptypes/duration"
|
||||||
|
|
||||||
import (
|
import proto "github.com/golang/protobuf/proto"
|
||||||
fmt "fmt"
|
import fmt "fmt"
|
||||||
proto "github.com/golang/protobuf/proto"
|
import math "math"
|
||||||
math "math"
|
|
||||||
)
|
|
||||||
|
|
||||||
// Reference imports to suppress errors if they are not otherwise used.
|
// Reference imports to suppress errors if they are not otherwise used.
|
||||||
var _ = proto.Marshal
|
var _ = proto.Marshal
|
||||||
@ -18,7 +16,7 @@ var _ = math.Inf
|
|||||||
// is compatible with the proto package it is being compiled against.
|
// is compatible with the proto package it is being compiled against.
|
||||||
// A compilation error at this line likely means your copy of the
|
// A compilation error at this line likely means your copy of the
|
||||||
// proto package needs to be updated.
|
// proto package needs to be updated.
|
||||||
const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
|
const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
|
||||||
|
|
||||||
// A Duration represents a signed, fixed-length span of time represented
|
// A Duration represents a signed, fixed-length span of time represented
|
||||||
// as a count of seconds and fractions of seconds at nanosecond
|
// as a count of seconds and fractions of seconds at nanosecond
|
||||||
@ -101,19 +99,17 @@ func (m *Duration) Reset() { *m = Duration{} }
|
|||||||
func (m *Duration) String() string { return proto.CompactTextString(m) }
|
func (m *Duration) String() string { return proto.CompactTextString(m) }
|
||||||
func (*Duration) ProtoMessage() {}
|
func (*Duration) ProtoMessage() {}
|
||||||
func (*Duration) Descriptor() ([]byte, []int) {
|
func (*Duration) Descriptor() ([]byte, []int) {
|
||||||
return fileDescriptor_23597b2ebd7ac6c5, []int{0}
|
return fileDescriptor_duration_e7d612259e3f0613, []int{0}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (*Duration) XXX_WellKnownType() string { return "Duration" }
|
func (*Duration) XXX_WellKnownType() string { return "Duration" }
|
||||||
|
|
||||||
func (m *Duration) XXX_Unmarshal(b []byte) error {
|
func (m *Duration) XXX_Unmarshal(b []byte) error {
|
||||||
return xxx_messageInfo_Duration.Unmarshal(m, b)
|
return xxx_messageInfo_Duration.Unmarshal(m, b)
|
||||||
}
|
}
|
||||||
func (m *Duration) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
func (m *Duration) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||||
return xxx_messageInfo_Duration.Marshal(b, m, deterministic)
|
return xxx_messageInfo_Duration.Marshal(b, m, deterministic)
|
||||||
}
|
}
|
||||||
func (m *Duration) XXX_Merge(src proto.Message) {
|
func (dst *Duration) XXX_Merge(src proto.Message) {
|
||||||
xxx_messageInfo_Duration.Merge(m, src)
|
xxx_messageInfo_Duration.Merge(dst, src)
|
||||||
}
|
}
|
||||||
func (m *Duration) XXX_Size() int {
|
func (m *Duration) XXX_Size() int {
|
||||||
return xxx_messageInfo_Duration.Size(m)
|
return xxx_messageInfo_Duration.Size(m)
|
||||||
@ -142,9 +138,11 @@ func init() {
|
|||||||
proto.RegisterType((*Duration)(nil), "google.protobuf.Duration")
|
proto.RegisterType((*Duration)(nil), "google.protobuf.Duration")
|
||||||
}
|
}
|
||||||
|
|
||||||
func init() { proto.RegisterFile("google/protobuf/duration.proto", fileDescriptor_23597b2ebd7ac6c5) }
|
func init() {
|
||||||
|
proto.RegisterFile("google/protobuf/duration.proto", fileDescriptor_duration_e7d612259e3f0613)
|
||||||
|
}
|
||||||
|
|
||||||
var fileDescriptor_23597b2ebd7ac6c5 = []byte{
|
var fileDescriptor_duration_e7d612259e3f0613 = []byte{
|
||||||
// 190 bytes of a gzipped FileDescriptorProto
|
// 190 bytes of a gzipped FileDescriptorProto
|
||||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x4b, 0xcf, 0xcf, 0x4f,
|
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x4b, 0xcf, 0xcf, 0x4f,
|
||||||
0xcf, 0x49, 0xd5, 0x2f, 0x28, 0xca, 0x2f, 0xc9, 0x4f, 0x2a, 0x4d, 0xd3, 0x4f, 0x29, 0x2d, 0x4a,
|
0xcf, 0x49, 0xd5, 0x2f, 0x28, 0xca, 0x2f, 0xc9, 0x4f, 0x2a, 0x4d, 0xd3, 0x4f, 0x29, 0x2d, 0x4a,
|
||||||
|
|||||||
6
vendor/github.com/golang/protobuf/ptypes/timestamp.go
generated
vendored
6
vendor/github.com/golang/protobuf/ptypes/timestamp.go
generated
vendored
@ -111,9 +111,11 @@ func TimestampNow() *tspb.Timestamp {
|
|||||||
// TimestampProto converts the time.Time to a google.protobuf.Timestamp proto.
|
// TimestampProto converts the time.Time to a google.protobuf.Timestamp proto.
|
||||||
// It returns an error if the resulting Timestamp is invalid.
|
// It returns an error if the resulting Timestamp is invalid.
|
||||||
func TimestampProto(t time.Time) (*tspb.Timestamp, error) {
|
func TimestampProto(t time.Time) (*tspb.Timestamp, error) {
|
||||||
|
seconds := t.Unix()
|
||||||
|
nanos := int32(t.Sub(time.Unix(seconds, 0)))
|
||||||
ts := &tspb.Timestamp{
|
ts := &tspb.Timestamp{
|
||||||
Seconds: t.Unix(),
|
Seconds: seconds,
|
||||||
Nanos: int32(t.Nanosecond()),
|
Nanos: nanos,
|
||||||
}
|
}
|
||||||
if err := validateTimestamp(ts); err != nil {
|
if err := validateTimestamp(ts); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
|||||||
34
vendor/github.com/golang/protobuf/ptypes/timestamp/timestamp.pb.go
generated
vendored
34
vendor/github.com/golang/protobuf/ptypes/timestamp/timestamp.pb.go
generated
vendored
@ -1,13 +1,11 @@
|
|||||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||||
// source: google/protobuf/timestamp.proto
|
// source: google/protobuf/timestamp.proto
|
||||||
|
|
||||||
package timestamp
|
package timestamp // import "github.com/golang/protobuf/ptypes/timestamp"
|
||||||
|
|
||||||
import (
|
import proto "github.com/golang/protobuf/proto"
|
||||||
fmt "fmt"
|
import fmt "fmt"
|
||||||
proto "github.com/golang/protobuf/proto"
|
import math "math"
|
||||||
math "math"
|
|
||||||
)
|
|
||||||
|
|
||||||
// Reference imports to suppress errors if they are not otherwise used.
|
// Reference imports to suppress errors if they are not otherwise used.
|
||||||
var _ = proto.Marshal
|
var _ = proto.Marshal
|
||||||
@ -18,7 +16,7 @@ var _ = math.Inf
|
|||||||
// is compatible with the proto package it is being compiled against.
|
// is compatible with the proto package it is being compiled against.
|
||||||
// A compilation error at this line likely means your copy of the
|
// A compilation error at this line likely means your copy of the
|
||||||
// proto package needs to be updated.
|
// proto package needs to be updated.
|
||||||
const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
|
const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
|
||||||
|
|
||||||
// A Timestamp represents a point in time independent of any time zone
|
// A Timestamp represents a point in time independent of any time zone
|
||||||
// or calendar, represented as seconds and fractions of seconds at
|
// or calendar, represented as seconds and fractions of seconds at
|
||||||
@ -83,9 +81,7 @@ const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
|
|||||||
// {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional
|
// {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional
|
||||||
// seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution),
|
// seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution),
|
||||||
// are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone
|
// are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone
|
||||||
// is required. A proto3 JSON serializer should always use UTC (as indicated by
|
// is required, though only UTC (as indicated by "Z") is presently supported.
|
||||||
// "Z") when printing the Timestamp type and a proto3 JSON parser should be
|
|
||||||
// able to accept both UTC and other timezones (as indicated by an offset).
|
|
||||||
//
|
//
|
||||||
// For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past
|
// For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past
|
||||||
// 01:30 UTC on January 15, 2017.
|
// 01:30 UTC on January 15, 2017.
|
||||||
@ -96,8 +92,8 @@ const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
|
|||||||
// to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime)
|
// to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime)
|
||||||
// with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one
|
// with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one
|
||||||
// can use the Joda Time's [`ISODateTimeFormat.dateTime()`](
|
// can use the Joda Time's [`ISODateTimeFormat.dateTime()`](
|
||||||
// http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime--
|
// http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime--)
|
||||||
// ) to obtain a formatter capable of generating timestamps in this format.
|
// to obtain a formatter capable of generating timestamps in this format.
|
||||||
//
|
//
|
||||||
//
|
//
|
||||||
type Timestamp struct {
|
type Timestamp struct {
|
||||||
@ -119,19 +115,17 @@ func (m *Timestamp) Reset() { *m = Timestamp{} }
|
|||||||
func (m *Timestamp) String() string { return proto.CompactTextString(m) }
|
func (m *Timestamp) String() string { return proto.CompactTextString(m) }
|
||||||
func (*Timestamp) ProtoMessage() {}
|
func (*Timestamp) ProtoMessage() {}
|
||||||
func (*Timestamp) Descriptor() ([]byte, []int) {
|
func (*Timestamp) Descriptor() ([]byte, []int) {
|
||||||
return fileDescriptor_292007bbfe81227e, []int{0}
|
return fileDescriptor_timestamp_b826e8e5fba671a8, []int{0}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (*Timestamp) XXX_WellKnownType() string { return "Timestamp" }
|
func (*Timestamp) XXX_WellKnownType() string { return "Timestamp" }
|
||||||
|
|
||||||
func (m *Timestamp) XXX_Unmarshal(b []byte) error {
|
func (m *Timestamp) XXX_Unmarshal(b []byte) error {
|
||||||
return xxx_messageInfo_Timestamp.Unmarshal(m, b)
|
return xxx_messageInfo_Timestamp.Unmarshal(m, b)
|
||||||
}
|
}
|
||||||
func (m *Timestamp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
func (m *Timestamp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||||
return xxx_messageInfo_Timestamp.Marshal(b, m, deterministic)
|
return xxx_messageInfo_Timestamp.Marshal(b, m, deterministic)
|
||||||
}
|
}
|
||||||
func (m *Timestamp) XXX_Merge(src proto.Message) {
|
func (dst *Timestamp) XXX_Merge(src proto.Message) {
|
||||||
xxx_messageInfo_Timestamp.Merge(m, src)
|
xxx_messageInfo_Timestamp.Merge(dst, src)
|
||||||
}
|
}
|
||||||
func (m *Timestamp) XXX_Size() int {
|
func (m *Timestamp) XXX_Size() int {
|
||||||
return xxx_messageInfo_Timestamp.Size(m)
|
return xxx_messageInfo_Timestamp.Size(m)
|
||||||
@ -160,9 +154,11 @@ func init() {
|
|||||||
proto.RegisterType((*Timestamp)(nil), "google.protobuf.Timestamp")
|
proto.RegisterType((*Timestamp)(nil), "google.protobuf.Timestamp")
|
||||||
}
|
}
|
||||||
|
|
||||||
func init() { proto.RegisterFile("google/protobuf/timestamp.proto", fileDescriptor_292007bbfe81227e) }
|
func init() {
|
||||||
|
proto.RegisterFile("google/protobuf/timestamp.proto", fileDescriptor_timestamp_b826e8e5fba671a8)
|
||||||
|
}
|
||||||
|
|
||||||
var fileDescriptor_292007bbfe81227e = []byte{
|
var fileDescriptor_timestamp_b826e8e5fba671a8 = []byte{
|
||||||
// 191 bytes of a gzipped FileDescriptorProto
|
// 191 bytes of a gzipped FileDescriptorProto
|
||||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x4f, 0xcf, 0xcf, 0x4f,
|
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x4f, 0xcf, 0xcf, 0x4f,
|
||||||
0xcf, 0x49, 0xd5, 0x2f, 0x28, 0xca, 0x2f, 0xc9, 0x4f, 0x2a, 0x4d, 0xd3, 0x2f, 0xc9, 0xcc, 0x4d,
|
0xcf, 0x49, 0xd5, 0x2f, 0x28, 0xca, 0x2f, 0xc9, 0x4f, 0x2a, 0x4d, 0xd3, 0x2f, 0xc9, 0xcc, 0x4d,
|
||||||
|
|||||||
8
vendor/github.com/golang/protobuf/ptypes/timestamp/timestamp.proto
generated
vendored
8
vendor/github.com/golang/protobuf/ptypes/timestamp/timestamp.proto
generated
vendored
@ -103,9 +103,7 @@ option objc_class_prefix = "GPB";
|
|||||||
// {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional
|
// {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional
|
||||||
// seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution),
|
// seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution),
|
||||||
// are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone
|
// are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone
|
||||||
// is required. A proto3 JSON serializer should always use UTC (as indicated by
|
// is required, though only UTC (as indicated by "Z") is presently supported.
|
||||||
// "Z") when printing the Timestamp type and a proto3 JSON parser should be
|
|
||||||
// able to accept both UTC and other timezones (as indicated by an offset).
|
|
||||||
//
|
//
|
||||||
// For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past
|
// For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past
|
||||||
// 01:30 UTC on January 15, 2017.
|
// 01:30 UTC on January 15, 2017.
|
||||||
@ -116,8 +114,8 @@ option objc_class_prefix = "GPB";
|
|||||||
// to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime)
|
// to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime)
|
||||||
// with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one
|
// with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one
|
||||||
// can use the Joda Time's [`ISODateTimeFormat.dateTime()`](
|
// can use the Joda Time's [`ISODateTimeFormat.dateTime()`](
|
||||||
// http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime--
|
// http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime--)
|
||||||
// ) to obtain a formatter capable of generating timestamps in this format.
|
// to obtain a formatter capable of generating timestamps in this format.
|
||||||
//
|
//
|
||||||
//
|
//
|
||||||
message Timestamp {
|
message Timestamp {
|
||||||
|
|||||||
90
vendor/github.com/golang/protobuf/ptypes/wrappers/wrappers.pb.go
generated
vendored
90
vendor/github.com/golang/protobuf/ptypes/wrappers/wrappers.pb.go
generated
vendored
@ -1,13 +1,11 @@
|
|||||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||||
// source: google/protobuf/wrappers.proto
|
// source: google/protobuf/wrappers.proto
|
||||||
|
|
||||||
package wrappers
|
package wrappers // import "github.com/golang/protobuf/ptypes/wrappers"
|
||||||
|
|
||||||
import (
|
import proto "github.com/golang/protobuf/proto"
|
||||||
fmt "fmt"
|
import fmt "fmt"
|
||||||
proto "github.com/golang/protobuf/proto"
|
import math "math"
|
||||||
math "math"
|
|
||||||
)
|
|
||||||
|
|
||||||
// Reference imports to suppress errors if they are not otherwise used.
|
// Reference imports to suppress errors if they are not otherwise used.
|
||||||
var _ = proto.Marshal
|
var _ = proto.Marshal
|
||||||
@ -18,7 +16,7 @@ var _ = math.Inf
|
|||||||
// is compatible with the proto package it is being compiled against.
|
// is compatible with the proto package it is being compiled against.
|
||||||
// A compilation error at this line likely means your copy of the
|
// A compilation error at this line likely means your copy of the
|
||||||
// proto package needs to be updated.
|
// proto package needs to be updated.
|
||||||
const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
|
const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
|
||||||
|
|
||||||
// Wrapper message for `double`.
|
// Wrapper message for `double`.
|
||||||
//
|
//
|
||||||
@ -35,19 +33,17 @@ func (m *DoubleValue) Reset() { *m = DoubleValue{} }
|
|||||||
func (m *DoubleValue) String() string { return proto.CompactTextString(m) }
|
func (m *DoubleValue) String() string { return proto.CompactTextString(m) }
|
||||||
func (*DoubleValue) ProtoMessage() {}
|
func (*DoubleValue) ProtoMessage() {}
|
||||||
func (*DoubleValue) Descriptor() ([]byte, []int) {
|
func (*DoubleValue) Descriptor() ([]byte, []int) {
|
||||||
return fileDescriptor_5377b62bda767935, []int{0}
|
return fileDescriptor_wrappers_16c7c35c009f3253, []int{0}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (*DoubleValue) XXX_WellKnownType() string { return "DoubleValue" }
|
func (*DoubleValue) XXX_WellKnownType() string { return "DoubleValue" }
|
||||||
|
|
||||||
func (m *DoubleValue) XXX_Unmarshal(b []byte) error {
|
func (m *DoubleValue) XXX_Unmarshal(b []byte) error {
|
||||||
return xxx_messageInfo_DoubleValue.Unmarshal(m, b)
|
return xxx_messageInfo_DoubleValue.Unmarshal(m, b)
|
||||||
}
|
}
|
||||||
func (m *DoubleValue) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
func (m *DoubleValue) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||||
return xxx_messageInfo_DoubleValue.Marshal(b, m, deterministic)
|
return xxx_messageInfo_DoubleValue.Marshal(b, m, deterministic)
|
||||||
}
|
}
|
||||||
func (m *DoubleValue) XXX_Merge(src proto.Message) {
|
func (dst *DoubleValue) XXX_Merge(src proto.Message) {
|
||||||
xxx_messageInfo_DoubleValue.Merge(m, src)
|
xxx_messageInfo_DoubleValue.Merge(dst, src)
|
||||||
}
|
}
|
||||||
func (m *DoubleValue) XXX_Size() int {
|
func (m *DoubleValue) XXX_Size() int {
|
||||||
return xxx_messageInfo_DoubleValue.Size(m)
|
return xxx_messageInfo_DoubleValue.Size(m)
|
||||||
@ -80,19 +76,17 @@ func (m *FloatValue) Reset() { *m = FloatValue{} }
|
|||||||
func (m *FloatValue) String() string { return proto.CompactTextString(m) }
|
func (m *FloatValue) String() string { return proto.CompactTextString(m) }
|
||||||
func (*FloatValue) ProtoMessage() {}
|
func (*FloatValue) ProtoMessage() {}
|
||||||
func (*FloatValue) Descriptor() ([]byte, []int) {
|
func (*FloatValue) Descriptor() ([]byte, []int) {
|
||||||
return fileDescriptor_5377b62bda767935, []int{1}
|
return fileDescriptor_wrappers_16c7c35c009f3253, []int{1}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (*FloatValue) XXX_WellKnownType() string { return "FloatValue" }
|
func (*FloatValue) XXX_WellKnownType() string { return "FloatValue" }
|
||||||
|
|
||||||
func (m *FloatValue) XXX_Unmarshal(b []byte) error {
|
func (m *FloatValue) XXX_Unmarshal(b []byte) error {
|
||||||
return xxx_messageInfo_FloatValue.Unmarshal(m, b)
|
return xxx_messageInfo_FloatValue.Unmarshal(m, b)
|
||||||
}
|
}
|
||||||
func (m *FloatValue) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
func (m *FloatValue) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||||
return xxx_messageInfo_FloatValue.Marshal(b, m, deterministic)
|
return xxx_messageInfo_FloatValue.Marshal(b, m, deterministic)
|
||||||
}
|
}
|
||||||
func (m *FloatValue) XXX_Merge(src proto.Message) {
|
func (dst *FloatValue) XXX_Merge(src proto.Message) {
|
||||||
xxx_messageInfo_FloatValue.Merge(m, src)
|
xxx_messageInfo_FloatValue.Merge(dst, src)
|
||||||
}
|
}
|
||||||
func (m *FloatValue) XXX_Size() int {
|
func (m *FloatValue) XXX_Size() int {
|
||||||
return xxx_messageInfo_FloatValue.Size(m)
|
return xxx_messageInfo_FloatValue.Size(m)
|
||||||
@ -125,19 +119,17 @@ func (m *Int64Value) Reset() { *m = Int64Value{} }
|
|||||||
func (m *Int64Value) String() string { return proto.CompactTextString(m) }
|
func (m *Int64Value) String() string { return proto.CompactTextString(m) }
|
||||||
func (*Int64Value) ProtoMessage() {}
|
func (*Int64Value) ProtoMessage() {}
|
||||||
func (*Int64Value) Descriptor() ([]byte, []int) {
|
func (*Int64Value) Descriptor() ([]byte, []int) {
|
||||||
return fileDescriptor_5377b62bda767935, []int{2}
|
return fileDescriptor_wrappers_16c7c35c009f3253, []int{2}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (*Int64Value) XXX_WellKnownType() string { return "Int64Value" }
|
func (*Int64Value) XXX_WellKnownType() string { return "Int64Value" }
|
||||||
|
|
||||||
func (m *Int64Value) XXX_Unmarshal(b []byte) error {
|
func (m *Int64Value) XXX_Unmarshal(b []byte) error {
|
||||||
return xxx_messageInfo_Int64Value.Unmarshal(m, b)
|
return xxx_messageInfo_Int64Value.Unmarshal(m, b)
|
||||||
}
|
}
|
||||||
func (m *Int64Value) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
func (m *Int64Value) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||||
return xxx_messageInfo_Int64Value.Marshal(b, m, deterministic)
|
return xxx_messageInfo_Int64Value.Marshal(b, m, deterministic)
|
||||||
}
|
}
|
||||||
func (m *Int64Value) XXX_Merge(src proto.Message) {
|
func (dst *Int64Value) XXX_Merge(src proto.Message) {
|
||||||
xxx_messageInfo_Int64Value.Merge(m, src)
|
xxx_messageInfo_Int64Value.Merge(dst, src)
|
||||||
}
|
}
|
||||||
func (m *Int64Value) XXX_Size() int {
|
func (m *Int64Value) XXX_Size() int {
|
||||||
return xxx_messageInfo_Int64Value.Size(m)
|
return xxx_messageInfo_Int64Value.Size(m)
|
||||||
@ -170,19 +162,17 @@ func (m *UInt64Value) Reset() { *m = UInt64Value{} }
|
|||||||
func (m *UInt64Value) String() string { return proto.CompactTextString(m) }
|
func (m *UInt64Value) String() string { return proto.CompactTextString(m) }
|
||||||
func (*UInt64Value) ProtoMessage() {}
|
func (*UInt64Value) ProtoMessage() {}
|
||||||
func (*UInt64Value) Descriptor() ([]byte, []int) {
|
func (*UInt64Value) Descriptor() ([]byte, []int) {
|
||||||
return fileDescriptor_5377b62bda767935, []int{3}
|
return fileDescriptor_wrappers_16c7c35c009f3253, []int{3}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (*UInt64Value) XXX_WellKnownType() string { return "UInt64Value" }
|
func (*UInt64Value) XXX_WellKnownType() string { return "UInt64Value" }
|
||||||
|
|
||||||
func (m *UInt64Value) XXX_Unmarshal(b []byte) error {
|
func (m *UInt64Value) XXX_Unmarshal(b []byte) error {
|
||||||
return xxx_messageInfo_UInt64Value.Unmarshal(m, b)
|
return xxx_messageInfo_UInt64Value.Unmarshal(m, b)
|
||||||
}
|
}
|
||||||
func (m *UInt64Value) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
func (m *UInt64Value) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||||
return xxx_messageInfo_UInt64Value.Marshal(b, m, deterministic)
|
return xxx_messageInfo_UInt64Value.Marshal(b, m, deterministic)
|
||||||
}
|
}
|
||||||
func (m *UInt64Value) XXX_Merge(src proto.Message) {
|
func (dst *UInt64Value) XXX_Merge(src proto.Message) {
|
||||||
xxx_messageInfo_UInt64Value.Merge(m, src)
|
xxx_messageInfo_UInt64Value.Merge(dst, src)
|
||||||
}
|
}
|
||||||
func (m *UInt64Value) XXX_Size() int {
|
func (m *UInt64Value) XXX_Size() int {
|
||||||
return xxx_messageInfo_UInt64Value.Size(m)
|
return xxx_messageInfo_UInt64Value.Size(m)
|
||||||
@ -215,19 +205,17 @@ func (m *Int32Value) Reset() { *m = Int32Value{} }
|
|||||||
func (m *Int32Value) String() string { return proto.CompactTextString(m) }
|
func (m *Int32Value) String() string { return proto.CompactTextString(m) }
|
||||||
func (*Int32Value) ProtoMessage() {}
|
func (*Int32Value) ProtoMessage() {}
|
||||||
func (*Int32Value) Descriptor() ([]byte, []int) {
|
func (*Int32Value) Descriptor() ([]byte, []int) {
|
||||||
return fileDescriptor_5377b62bda767935, []int{4}
|
return fileDescriptor_wrappers_16c7c35c009f3253, []int{4}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (*Int32Value) XXX_WellKnownType() string { return "Int32Value" }
|
func (*Int32Value) XXX_WellKnownType() string { return "Int32Value" }
|
||||||
|
|
||||||
func (m *Int32Value) XXX_Unmarshal(b []byte) error {
|
func (m *Int32Value) XXX_Unmarshal(b []byte) error {
|
||||||
return xxx_messageInfo_Int32Value.Unmarshal(m, b)
|
return xxx_messageInfo_Int32Value.Unmarshal(m, b)
|
||||||
}
|
}
|
||||||
func (m *Int32Value) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
func (m *Int32Value) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||||
return xxx_messageInfo_Int32Value.Marshal(b, m, deterministic)
|
return xxx_messageInfo_Int32Value.Marshal(b, m, deterministic)
|
||||||
}
|
}
|
||||||
func (m *Int32Value) XXX_Merge(src proto.Message) {
|
func (dst *Int32Value) XXX_Merge(src proto.Message) {
|
||||||
xxx_messageInfo_Int32Value.Merge(m, src)
|
xxx_messageInfo_Int32Value.Merge(dst, src)
|
||||||
}
|
}
|
||||||
func (m *Int32Value) XXX_Size() int {
|
func (m *Int32Value) XXX_Size() int {
|
||||||
return xxx_messageInfo_Int32Value.Size(m)
|
return xxx_messageInfo_Int32Value.Size(m)
|
||||||
@ -260,19 +248,17 @@ func (m *UInt32Value) Reset() { *m = UInt32Value{} }
|
|||||||
func (m *UInt32Value) String() string { return proto.CompactTextString(m) }
|
func (m *UInt32Value) String() string { return proto.CompactTextString(m) }
|
||||||
func (*UInt32Value) ProtoMessage() {}
|
func (*UInt32Value) ProtoMessage() {}
|
||||||
func (*UInt32Value) Descriptor() ([]byte, []int) {
|
func (*UInt32Value) Descriptor() ([]byte, []int) {
|
||||||
return fileDescriptor_5377b62bda767935, []int{5}
|
return fileDescriptor_wrappers_16c7c35c009f3253, []int{5}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (*UInt32Value) XXX_WellKnownType() string { return "UInt32Value" }
|
func (*UInt32Value) XXX_WellKnownType() string { return "UInt32Value" }
|
||||||
|
|
||||||
func (m *UInt32Value) XXX_Unmarshal(b []byte) error {
|
func (m *UInt32Value) XXX_Unmarshal(b []byte) error {
|
||||||
return xxx_messageInfo_UInt32Value.Unmarshal(m, b)
|
return xxx_messageInfo_UInt32Value.Unmarshal(m, b)
|
||||||
}
|
}
|
||||||
func (m *UInt32Value) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
func (m *UInt32Value) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||||
return xxx_messageInfo_UInt32Value.Marshal(b, m, deterministic)
|
return xxx_messageInfo_UInt32Value.Marshal(b, m, deterministic)
|
||||||
}
|
}
|
||||||
func (m *UInt32Value) XXX_Merge(src proto.Message) {
|
func (dst *UInt32Value) XXX_Merge(src proto.Message) {
|
||||||
xxx_messageInfo_UInt32Value.Merge(m, src)
|
xxx_messageInfo_UInt32Value.Merge(dst, src)
|
||||||
}
|
}
|
||||||
func (m *UInt32Value) XXX_Size() int {
|
func (m *UInt32Value) XXX_Size() int {
|
||||||
return xxx_messageInfo_UInt32Value.Size(m)
|
return xxx_messageInfo_UInt32Value.Size(m)
|
||||||
@ -305,19 +291,17 @@ func (m *BoolValue) Reset() { *m = BoolValue{} }
|
|||||||
func (m *BoolValue) String() string { return proto.CompactTextString(m) }
|
func (m *BoolValue) String() string { return proto.CompactTextString(m) }
|
||||||
func (*BoolValue) ProtoMessage() {}
|
func (*BoolValue) ProtoMessage() {}
|
||||||
func (*BoolValue) Descriptor() ([]byte, []int) {
|
func (*BoolValue) Descriptor() ([]byte, []int) {
|
||||||
return fileDescriptor_5377b62bda767935, []int{6}
|
return fileDescriptor_wrappers_16c7c35c009f3253, []int{6}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (*BoolValue) XXX_WellKnownType() string { return "BoolValue" }
|
func (*BoolValue) XXX_WellKnownType() string { return "BoolValue" }
|
||||||
|
|
||||||
func (m *BoolValue) XXX_Unmarshal(b []byte) error {
|
func (m *BoolValue) XXX_Unmarshal(b []byte) error {
|
||||||
return xxx_messageInfo_BoolValue.Unmarshal(m, b)
|
return xxx_messageInfo_BoolValue.Unmarshal(m, b)
|
||||||
}
|
}
|
||||||
func (m *BoolValue) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
func (m *BoolValue) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||||
return xxx_messageInfo_BoolValue.Marshal(b, m, deterministic)
|
return xxx_messageInfo_BoolValue.Marshal(b, m, deterministic)
|
||||||
}
|
}
|
||||||
func (m *BoolValue) XXX_Merge(src proto.Message) {
|
func (dst *BoolValue) XXX_Merge(src proto.Message) {
|
||||||
xxx_messageInfo_BoolValue.Merge(m, src)
|
xxx_messageInfo_BoolValue.Merge(dst, src)
|
||||||
}
|
}
|
||||||
func (m *BoolValue) XXX_Size() int {
|
func (m *BoolValue) XXX_Size() int {
|
||||||
return xxx_messageInfo_BoolValue.Size(m)
|
return xxx_messageInfo_BoolValue.Size(m)
|
||||||
@ -350,19 +334,17 @@ func (m *StringValue) Reset() { *m = StringValue{} }
|
|||||||
func (m *StringValue) String() string { return proto.CompactTextString(m) }
|
func (m *StringValue) String() string { return proto.CompactTextString(m) }
|
||||||
func (*StringValue) ProtoMessage() {}
|
func (*StringValue) ProtoMessage() {}
|
||||||
func (*StringValue) Descriptor() ([]byte, []int) {
|
func (*StringValue) Descriptor() ([]byte, []int) {
|
||||||
return fileDescriptor_5377b62bda767935, []int{7}
|
return fileDescriptor_wrappers_16c7c35c009f3253, []int{7}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (*StringValue) XXX_WellKnownType() string { return "StringValue" }
|
func (*StringValue) XXX_WellKnownType() string { return "StringValue" }
|
||||||
|
|
||||||
func (m *StringValue) XXX_Unmarshal(b []byte) error {
|
func (m *StringValue) XXX_Unmarshal(b []byte) error {
|
||||||
return xxx_messageInfo_StringValue.Unmarshal(m, b)
|
return xxx_messageInfo_StringValue.Unmarshal(m, b)
|
||||||
}
|
}
|
||||||
func (m *StringValue) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
func (m *StringValue) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||||
return xxx_messageInfo_StringValue.Marshal(b, m, deterministic)
|
return xxx_messageInfo_StringValue.Marshal(b, m, deterministic)
|
||||||
}
|
}
|
||||||
func (m *StringValue) XXX_Merge(src proto.Message) {
|
func (dst *StringValue) XXX_Merge(src proto.Message) {
|
||||||
xxx_messageInfo_StringValue.Merge(m, src)
|
xxx_messageInfo_StringValue.Merge(dst, src)
|
||||||
}
|
}
|
||||||
func (m *StringValue) XXX_Size() int {
|
func (m *StringValue) XXX_Size() int {
|
||||||
return xxx_messageInfo_StringValue.Size(m)
|
return xxx_messageInfo_StringValue.Size(m)
|
||||||
@ -395,19 +377,17 @@ func (m *BytesValue) Reset() { *m = BytesValue{} }
|
|||||||
func (m *BytesValue) String() string { return proto.CompactTextString(m) }
|
func (m *BytesValue) String() string { return proto.CompactTextString(m) }
|
||||||
func (*BytesValue) ProtoMessage() {}
|
func (*BytesValue) ProtoMessage() {}
|
||||||
func (*BytesValue) Descriptor() ([]byte, []int) {
|
func (*BytesValue) Descriptor() ([]byte, []int) {
|
||||||
return fileDescriptor_5377b62bda767935, []int{8}
|
return fileDescriptor_wrappers_16c7c35c009f3253, []int{8}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (*BytesValue) XXX_WellKnownType() string { return "BytesValue" }
|
func (*BytesValue) XXX_WellKnownType() string { return "BytesValue" }
|
||||||
|
|
||||||
func (m *BytesValue) XXX_Unmarshal(b []byte) error {
|
func (m *BytesValue) XXX_Unmarshal(b []byte) error {
|
||||||
return xxx_messageInfo_BytesValue.Unmarshal(m, b)
|
return xxx_messageInfo_BytesValue.Unmarshal(m, b)
|
||||||
}
|
}
|
||||||
func (m *BytesValue) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
func (m *BytesValue) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||||
return xxx_messageInfo_BytesValue.Marshal(b, m, deterministic)
|
return xxx_messageInfo_BytesValue.Marshal(b, m, deterministic)
|
||||||
}
|
}
|
||||||
func (m *BytesValue) XXX_Merge(src proto.Message) {
|
func (dst *BytesValue) XXX_Merge(src proto.Message) {
|
||||||
xxx_messageInfo_BytesValue.Merge(m, src)
|
xxx_messageInfo_BytesValue.Merge(dst, src)
|
||||||
}
|
}
|
||||||
func (m *BytesValue) XXX_Size() int {
|
func (m *BytesValue) XXX_Size() int {
|
||||||
return xxx_messageInfo_BytesValue.Size(m)
|
return xxx_messageInfo_BytesValue.Size(m)
|
||||||
@ -437,9 +417,11 @@ func init() {
|
|||||||
proto.RegisterType((*BytesValue)(nil), "google.protobuf.BytesValue")
|
proto.RegisterType((*BytesValue)(nil), "google.protobuf.BytesValue")
|
||||||
}
|
}
|
||||||
|
|
||||||
func init() { proto.RegisterFile("google/protobuf/wrappers.proto", fileDescriptor_5377b62bda767935) }
|
func init() {
|
||||||
|
proto.RegisterFile("google/protobuf/wrappers.proto", fileDescriptor_wrappers_16c7c35c009f3253)
|
||||||
|
}
|
||||||
|
|
||||||
var fileDescriptor_5377b62bda767935 = []byte{
|
var fileDescriptor_wrappers_16c7c35c009f3253 = []byte{
|
||||||
// 259 bytes of a gzipped FileDescriptorProto
|
// 259 bytes of a gzipped FileDescriptorProto
|
||||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x4b, 0xcf, 0xcf, 0x4f,
|
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x4b, 0xcf, 0xcf, 0x4f,
|
||||||
0xcf, 0x49, 0xd5, 0x2f, 0x28, 0xca, 0x2f, 0xc9, 0x4f, 0x2a, 0x4d, 0xd3, 0x2f, 0x2f, 0x4a, 0x2c,
|
0xcf, 0x49, 0xd5, 0x2f, 0x28, 0xca, 0x2f, 0xc9, 0x4f, 0x2a, 0x4d, 0xd3, 0x2f, 0x2f, 0x4a, 0x2c,
|
||||||
|
|||||||
385
vendor/github.com/google/btree/btree.go
generated
vendored
385
vendor/github.com/google/btree/btree.go
generated
vendored
@ -22,7 +22,7 @@
|
|||||||
// See some discussion on the matter here:
|
// See some discussion on the matter here:
|
||||||
// http://google-opensource.blogspot.com/2013/01/c-containers-that-save-memory-and-time.html
|
// http://google-opensource.blogspot.com/2013/01/c-containers-that-save-memory-and-time.html
|
||||||
// Note, though, that this project is in no way related to the C++ B-Tree
|
// Note, though, that this project is in no way related to the C++ B-Tree
|
||||||
// implementation written about there.
|
// implmentation written about there.
|
||||||
//
|
//
|
||||||
// Within this tree, each node contains a slice of items and a (possibly nil)
|
// Within this tree, each node contains a slice of items and a (possibly nil)
|
||||||
// slice of children. For basic numeric values or raw structs, this can cause
|
// slice of children. For basic numeric values or raw structs, this can cause
|
||||||
@ -44,7 +44,7 @@
|
|||||||
// widely used ordered tree implementation in the Go ecosystem currently.
|
// widely used ordered tree implementation in the Go ecosystem currently.
|
||||||
// Its functions, therefore, exactly mirror those of
|
// Its functions, therefore, exactly mirror those of
|
||||||
// llrb.LLRB where possible. Unlike gollrb, though, we currently don't
|
// llrb.LLRB where possible. Unlike gollrb, though, we currently don't
|
||||||
// support storing multiple equivalent values.
|
// support storing multiple equivalent values or backwards iteration.
|
||||||
package btree
|
package btree
|
||||||
|
|
||||||
import (
|
import (
|
||||||
@ -52,7 +52,6 @@ import (
|
|||||||
"io"
|
"io"
|
||||||
"sort"
|
"sort"
|
||||||
"strings"
|
"strings"
|
||||||
"sync"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// Item represents a single object in the tree.
|
// Item represents a single object in the tree.
|
||||||
@ -69,17 +68,11 @@ const (
|
|||||||
DefaultFreeListSize = 32
|
DefaultFreeListSize = 32
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
|
||||||
nilItems = make(items, 16)
|
|
||||||
nilChildren = make(children, 16)
|
|
||||||
)
|
|
||||||
|
|
||||||
// FreeList represents a free list of btree nodes. By default each
|
// FreeList represents a free list of btree nodes. By default each
|
||||||
// BTree has its own FreeList, but multiple BTrees can share the same
|
// BTree has its own FreeList, but multiple BTrees can share the same
|
||||||
// FreeList.
|
// FreeList.
|
||||||
// Two Btrees using the same freelist are safe for concurrent write access.
|
// Two Btrees using the same freelist are not safe for concurrent write access.
|
||||||
type FreeList struct {
|
type FreeList struct {
|
||||||
mu sync.Mutex
|
|
||||||
freelist []*node
|
freelist []*node
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -90,29 +83,18 @@ func NewFreeList(size int) *FreeList {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (f *FreeList) newNode() (n *node) {
|
func (f *FreeList) newNode() (n *node) {
|
||||||
f.mu.Lock()
|
|
||||||
index := len(f.freelist) - 1
|
index := len(f.freelist) - 1
|
||||||
if index < 0 {
|
if index < 0 {
|
||||||
f.mu.Unlock()
|
|
||||||
return new(node)
|
return new(node)
|
||||||
}
|
}
|
||||||
n = f.freelist[index]
|
f.freelist, n = f.freelist[:index], f.freelist[index]
|
||||||
f.freelist[index] = nil
|
|
||||||
f.freelist = f.freelist[:index]
|
|
||||||
f.mu.Unlock()
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// freeNode adds the given node to the list, returning true if it was added
|
func (f *FreeList) freeNode(n *node) {
|
||||||
// and false if it was discarded.
|
|
||||||
func (f *FreeList) freeNode(n *node) (out bool) {
|
|
||||||
f.mu.Lock()
|
|
||||||
if len(f.freelist) < cap(f.freelist) {
|
if len(f.freelist) < cap(f.freelist) {
|
||||||
f.freelist = append(f.freelist, n)
|
f.freelist = append(f.freelist, n)
|
||||||
out = true
|
|
||||||
}
|
}
|
||||||
f.mu.Unlock()
|
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ItemIterator allows callers of Ascend* to iterate in-order over portions of
|
// ItemIterator allows callers of Ascend* to iterate in-order over portions of
|
||||||
@ -135,7 +117,7 @@ func NewWithFreeList(degree int, f *FreeList) *BTree {
|
|||||||
}
|
}
|
||||||
return &BTree{
|
return &BTree{
|
||||||
degree: degree,
|
degree: degree,
|
||||||
cow: ©OnWriteContext{freelist: f},
|
freelist: f,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -156,8 +138,8 @@ func (s *items) insertAt(index int, item Item) {
|
|||||||
// back.
|
// back.
|
||||||
func (s *items) removeAt(index int) Item {
|
func (s *items) removeAt(index int) Item {
|
||||||
item := (*s)[index]
|
item := (*s)[index]
|
||||||
|
(*s)[index] = nil
|
||||||
copy((*s)[index:], (*s)[index+1:])
|
copy((*s)[index:], (*s)[index+1:])
|
||||||
(*s)[len(*s)-1] = nil
|
|
||||||
*s = (*s)[:len(*s)-1]
|
*s = (*s)[:len(*s)-1]
|
||||||
return item
|
return item
|
||||||
}
|
}
|
||||||
@ -171,16 +153,6 @@ func (s *items) pop() (out Item) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// truncate truncates this instance at index so that it contains only the
|
|
||||||
// first index items. index must be less than or equal to length.
|
|
||||||
func (s *items) truncate(index int) {
|
|
||||||
var toClear items
|
|
||||||
*s, toClear = (*s)[:index], (*s)[index:]
|
|
||||||
for len(toClear) > 0 {
|
|
||||||
toClear = toClear[copy(toClear, nilItems):]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// find returns the index where the given item should be inserted into this
|
// find returns the index where the given item should be inserted into this
|
||||||
// list. 'found' is true if the item already exists in the list at the given
|
// list. 'found' is true if the item already exists in the list at the given
|
||||||
// index.
|
// index.
|
||||||
@ -211,8 +183,8 @@ func (s *children) insertAt(index int, n *node) {
|
|||||||
// back.
|
// back.
|
||||||
func (s *children) removeAt(index int) *node {
|
func (s *children) removeAt(index int) *node {
|
||||||
n := (*s)[index]
|
n := (*s)[index]
|
||||||
|
(*s)[index] = nil
|
||||||
copy((*s)[index:], (*s)[index+1:])
|
copy((*s)[index:], (*s)[index+1:])
|
||||||
(*s)[len(*s)-1] = nil
|
|
||||||
*s = (*s)[:len(*s)-1]
|
*s = (*s)[:len(*s)-1]
|
||||||
return n
|
return n
|
||||||
}
|
}
|
||||||
@ -226,16 +198,6 @@ func (s *children) pop() (out *node) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// truncate truncates this instance at index so that it contains only the
|
|
||||||
// first index children. index must be less than or equal to length.
|
|
||||||
func (s *children) truncate(index int) {
|
|
||||||
var toClear children
|
|
||||||
*s, toClear = (*s)[:index], (*s)[index:]
|
|
||||||
for len(toClear) > 0 {
|
|
||||||
toClear = toClear[copy(toClear, nilChildren):]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// node is an internal node in a tree.
|
// node is an internal node in a tree.
|
||||||
//
|
//
|
||||||
// It must at all times maintain the invariant that either
|
// It must at all times maintain the invariant that either
|
||||||
@ -244,34 +206,7 @@ func (s *children) truncate(index int) {
|
|||||||
type node struct {
|
type node struct {
|
||||||
items items
|
items items
|
||||||
children children
|
children children
|
||||||
cow *copyOnWriteContext
|
t *BTree
|
||||||
}
|
|
||||||
|
|
||||||
func (n *node) mutableFor(cow *copyOnWriteContext) *node {
|
|
||||||
if n.cow == cow {
|
|
||||||
return n
|
|
||||||
}
|
|
||||||
out := cow.newNode()
|
|
||||||
if cap(out.items) >= len(n.items) {
|
|
||||||
out.items = out.items[:len(n.items)]
|
|
||||||
} else {
|
|
||||||
out.items = make(items, len(n.items), cap(n.items))
|
|
||||||
}
|
|
||||||
copy(out.items, n.items)
|
|
||||||
// Copy children
|
|
||||||
if cap(out.children) >= len(n.children) {
|
|
||||||
out.children = out.children[:len(n.children)]
|
|
||||||
} else {
|
|
||||||
out.children = make(children, len(n.children), cap(n.children))
|
|
||||||
}
|
|
||||||
copy(out.children, n.children)
|
|
||||||
return out
|
|
||||||
}
|
|
||||||
|
|
||||||
func (n *node) mutableChild(i int) *node {
|
|
||||||
c := n.children[i].mutableFor(n.cow)
|
|
||||||
n.children[i] = c
|
|
||||||
return c
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// split splits the given node at the given index. The current node shrinks,
|
// split splits the given node at the given index. The current node shrinks,
|
||||||
@ -279,12 +214,12 @@ func (n *node) mutableChild(i int) *node {
|
|||||||
// containing all items/children after it.
|
// containing all items/children after it.
|
||||||
func (n *node) split(i int) (Item, *node) {
|
func (n *node) split(i int) (Item, *node) {
|
||||||
item := n.items[i]
|
item := n.items[i]
|
||||||
next := n.cow.newNode()
|
next := n.t.newNode()
|
||||||
next.items = append(next.items, n.items[i+1:]...)
|
next.items = append(next.items, n.items[i+1:]...)
|
||||||
n.items.truncate(i)
|
n.items = n.items[:i]
|
||||||
if len(n.children) > 0 {
|
if len(n.children) > 0 {
|
||||||
next.children = append(next.children, n.children[i+1:]...)
|
next.children = append(next.children, n.children[i+1:]...)
|
||||||
n.children.truncate(i + 1)
|
n.children = n.children[:i+1]
|
||||||
}
|
}
|
||||||
return item, next
|
return item, next
|
||||||
}
|
}
|
||||||
@ -295,7 +230,7 @@ func (n *node) maybeSplitChild(i, maxItems int) bool {
|
|||||||
if len(n.children[i].items) < maxItems {
|
if len(n.children[i].items) < maxItems {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
first := n.mutableChild(i)
|
first := n.children[i]
|
||||||
item, second := first.split(maxItems / 2)
|
item, second := first.split(maxItems / 2)
|
||||||
n.items.insertAt(i, item)
|
n.items.insertAt(i, item)
|
||||||
n.children.insertAt(i+1, second)
|
n.children.insertAt(i+1, second)
|
||||||
@ -329,7 +264,7 @@ func (n *node) insert(item Item, maxItems int) Item {
|
|||||||
return out
|
return out
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return n.mutableChild(i).insert(item, maxItems)
|
return n.children[i].insert(item, maxItems)
|
||||||
}
|
}
|
||||||
|
|
||||||
// get finds the given key in the subtree and returns it.
|
// get finds the given key in the subtree and returns it.
|
||||||
@ -407,10 +342,10 @@ func (n *node) remove(item Item, minItems int, typ toRemove) Item {
|
|||||||
panic("invalid type")
|
panic("invalid type")
|
||||||
}
|
}
|
||||||
// If we get to here, we have children.
|
// If we get to here, we have children.
|
||||||
if len(n.children[i].items) <= minItems {
|
child := n.children[i]
|
||||||
|
if len(child.items) <= minItems {
|
||||||
return n.growChildAndRemove(i, item, minItems, typ)
|
return n.growChildAndRemove(i, item, minItems, typ)
|
||||||
}
|
}
|
||||||
child := n.mutableChild(i)
|
|
||||||
// Either we had enough items to begin with, or we've done some
|
// Either we had enough items to begin with, or we've done some
|
||||||
// merging/stealing, because we've got enough now and we're ready to return
|
// merging/stealing, because we've got enough now and we're ready to return
|
||||||
// stuff.
|
// stuff.
|
||||||
@ -449,10 +384,10 @@ func (n *node) remove(item Item, minItems int, typ toRemove) Item {
|
|||||||
// whether we're in case 1 or 2), we'll have enough items and can guarantee
|
// whether we're in case 1 or 2), we'll have enough items and can guarantee
|
||||||
// that we hit case A.
|
// that we hit case A.
|
||||||
func (n *node) growChildAndRemove(i int, item Item, minItems int, typ toRemove) Item {
|
func (n *node) growChildAndRemove(i int, item Item, minItems int, typ toRemove) Item {
|
||||||
|
child := n.children[i]
|
||||||
if i > 0 && len(n.children[i-1].items) > minItems {
|
if i > 0 && len(n.children[i-1].items) > minItems {
|
||||||
// Steal from left child
|
// Steal from left child
|
||||||
child := n.mutableChild(i)
|
stealFrom := n.children[i-1]
|
||||||
stealFrom := n.mutableChild(i - 1)
|
|
||||||
stolenItem := stealFrom.items.pop()
|
stolenItem := stealFrom.items.pop()
|
||||||
child.items.insertAt(0, n.items[i-1])
|
child.items.insertAt(0, n.items[i-1])
|
||||||
n.items[i-1] = stolenItem
|
n.items[i-1] = stolenItem
|
||||||
@ -461,8 +396,7 @@ func (n *node) growChildAndRemove(i int, item Item, minItems int, typ toRemove)
|
|||||||
}
|
}
|
||||||
} else if i < len(n.items) && len(n.children[i+1].items) > minItems {
|
} else if i < len(n.items) && len(n.children[i+1].items) > minItems {
|
||||||
// steal from right child
|
// steal from right child
|
||||||
child := n.mutableChild(i)
|
stealFrom := n.children[i+1]
|
||||||
stealFrom := n.mutableChild(i + 1)
|
|
||||||
stolenItem := stealFrom.items.removeAt(0)
|
stolenItem := stealFrom.items.removeAt(0)
|
||||||
child.items = append(child.items, n.items[i])
|
child.items = append(child.items, n.items[i])
|
||||||
n.items[i] = stolenItem
|
n.items[i] = stolenItem
|
||||||
@ -472,99 +406,47 @@ func (n *node) growChildAndRemove(i int, item Item, minItems int, typ toRemove)
|
|||||||
} else {
|
} else {
|
||||||
if i >= len(n.items) {
|
if i >= len(n.items) {
|
||||||
i--
|
i--
|
||||||
|
child = n.children[i]
|
||||||
}
|
}
|
||||||
child := n.mutableChild(i)
|
|
||||||
// merge with right child
|
// merge with right child
|
||||||
mergeItem := n.items.removeAt(i)
|
mergeItem := n.items.removeAt(i)
|
||||||
mergeChild := n.children.removeAt(i + 1)
|
mergeChild := n.children.removeAt(i + 1)
|
||||||
child.items = append(child.items, mergeItem)
|
child.items = append(child.items, mergeItem)
|
||||||
child.items = append(child.items, mergeChild.items...)
|
child.items = append(child.items, mergeChild.items...)
|
||||||
child.children = append(child.children, mergeChild.children...)
|
child.children = append(child.children, mergeChild.children...)
|
||||||
n.cow.freeNode(mergeChild)
|
n.t.freeNode(mergeChild)
|
||||||
}
|
}
|
||||||
return n.remove(item, minItems, typ)
|
return n.remove(item, minItems, typ)
|
||||||
}
|
}
|
||||||
|
|
||||||
type direction int
|
|
||||||
|
|
||||||
const (
|
|
||||||
descend = direction(-1)
|
|
||||||
ascend = direction(+1)
|
|
||||||
)
|
|
||||||
|
|
||||||
// iterate provides a simple method for iterating over elements in the tree.
|
// iterate provides a simple method for iterating over elements in the tree.
|
||||||
|
// It could probably use some work to be extra-efficient (it calls from() a
|
||||||
|
// little more than it should), but it works pretty well for now.
|
||||||
//
|
//
|
||||||
// When ascending, the 'start' should be less than 'stop' and when descending,
|
// It requires that 'from' and 'to' both return true for values we should hit
|
||||||
// the 'start' should be greater than 'stop'. Setting 'includeStart' to true
|
// with the iterator. It should also be the case that 'from' returns true for
|
||||||
// will force the iterator to include the first item when it equals 'start',
|
// values less than or equal to values 'to' returns true for, and 'to'
|
||||||
// thus creating a "greaterOrEqual" or "lessThanEqual" rather than just a
|
// returns true for values greater than or equal to those that 'from'
|
||||||
// "greaterThan" or "lessThan" queries.
|
// does.
|
||||||
func (n *node) iterate(dir direction, start, stop Item, includeStart bool, hit bool, iter ItemIterator) (bool, bool) {
|
func (n *node) iterate(from, to func(Item) bool, iter ItemIterator) bool {
|
||||||
var ok, found bool
|
for i, item := range n.items {
|
||||||
var index int
|
if !from(item) {
|
||||||
switch dir {
|
|
||||||
case ascend:
|
|
||||||
if start != nil {
|
|
||||||
index, _ = n.items.find(start)
|
|
||||||
}
|
|
||||||
for i := index; i < len(n.items); i++ {
|
|
||||||
if len(n.children) > 0 {
|
|
||||||
if hit, ok = n.children[i].iterate(dir, start, stop, includeStart, hit, iter); !ok {
|
|
||||||
return hit, false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if !includeStart && !hit && start != nil && !start.Less(n.items[i]) {
|
|
||||||
hit = true
|
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
hit = true
|
if len(n.children) > 0 && !n.children[i].iterate(from, to, iter) {
|
||||||
if stop != nil && !n.items[i].Less(stop) {
|
return false
|
||||||
return hit, false
|
|
||||||
}
|
}
|
||||||
if !iter(n.items[i]) {
|
if !to(item) {
|
||||||
return hit, false
|
return false
|
||||||
|
}
|
||||||
|
if !iter(item) {
|
||||||
|
return false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if len(n.children) > 0 {
|
if len(n.children) > 0 {
|
||||||
if hit, ok = n.children[len(n.children)-1].iterate(dir, start, stop, includeStart, hit, iter); !ok {
|
return n.children[len(n.children)-1].iterate(from, to, iter)
|
||||||
return hit, false
|
|
||||||
}
|
}
|
||||||
}
|
return true
|
||||||
case descend:
|
|
||||||
if start != nil {
|
|
||||||
index, found = n.items.find(start)
|
|
||||||
if !found {
|
|
||||||
index = index - 1
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
index = len(n.items) - 1
|
|
||||||
}
|
|
||||||
for i := index; i >= 0; i-- {
|
|
||||||
if start != nil && !n.items[i].Less(start) {
|
|
||||||
if !includeStart || hit || start.Less(n.items[i]) {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if len(n.children) > 0 {
|
|
||||||
if hit, ok = n.children[i+1].iterate(dir, start, stop, includeStart, hit, iter); !ok {
|
|
||||||
return hit, false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if stop != nil && !stop.Less(n.items[i]) {
|
|
||||||
return hit, false // continue
|
|
||||||
}
|
|
||||||
hit = true
|
|
||||||
if !iter(n.items[i]) {
|
|
||||||
return hit, false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if len(n.children) > 0 {
|
|
||||||
if hit, ok = n.children[0].iterate(dir, start, stop, includeStart, hit, iter); !ok {
|
|
||||||
return hit, false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return hit, true
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Used for testing/debugging purposes.
|
// Used for testing/debugging purposes.
|
||||||
@ -586,51 +468,9 @@ type BTree struct {
|
|||||||
degree int
|
degree int
|
||||||
length int
|
length int
|
||||||
root *node
|
root *node
|
||||||
cow *copyOnWriteContext
|
|
||||||
}
|
|
||||||
|
|
||||||
// copyOnWriteContext pointers determine node ownership... a tree with a write
|
|
||||||
// context equivalent to a node's write context is allowed to modify that node.
|
|
||||||
// A tree whose write context does not match a node's is not allowed to modify
|
|
||||||
// it, and must create a new, writable copy (IE: it's a Clone).
|
|
||||||
//
|
|
||||||
// When doing any write operation, we maintain the invariant that the current
|
|
||||||
// node's context is equal to the context of the tree that requested the write.
|
|
||||||
// We do this by, before we descend into any node, creating a copy with the
|
|
||||||
// correct context if the contexts don't match.
|
|
||||||
//
|
|
||||||
// Since the node we're currently visiting on any write has the requesting
|
|
||||||
// tree's context, that node is modifiable in place. Children of that node may
|
|
||||||
// not share context, but before we descend into them, we'll make a mutable
|
|
||||||
// copy.
|
|
||||||
type copyOnWriteContext struct {
|
|
||||||
freelist *FreeList
|
freelist *FreeList
|
||||||
}
|
}
|
||||||
|
|
||||||
// Clone clones the btree, lazily. Clone should not be called concurrently,
|
|
||||||
// but the original tree (t) and the new tree (t2) can be used concurrently
|
|
||||||
// once the Clone call completes.
|
|
||||||
//
|
|
||||||
// The internal tree structure of b is marked read-only and shared between t and
|
|
||||||
// t2. Writes to both t and t2 use copy-on-write logic, creating new nodes
|
|
||||||
// whenever one of b's original nodes would have been modified. Read operations
|
|
||||||
// should have no performance degredation. Write operations for both t and t2
|
|
||||||
// will initially experience minor slow-downs caused by additional allocs and
|
|
||||||
// copies due to the aforementioned copy-on-write logic, but should converge to
|
|
||||||
// the original performance characteristics of the original tree.
|
|
||||||
func (t *BTree) Clone() (t2 *BTree) {
|
|
||||||
// Create two entirely new copy-on-write contexts.
|
|
||||||
// This operation effectively creates three trees:
|
|
||||||
// the original, shared nodes (old b.cow)
|
|
||||||
// the new b.cow nodes
|
|
||||||
// the new out.cow nodes
|
|
||||||
cow1, cow2 := *t.cow, *t.cow
|
|
||||||
out := *t
|
|
||||||
t.cow = &cow1
|
|
||||||
out.cow = &cow2
|
|
||||||
return &out
|
|
||||||
}
|
|
||||||
|
|
||||||
// maxItems returns the max number of items to allow per node.
|
// maxItems returns the max number of items to allow per node.
|
||||||
func (t *BTree) maxItems() int {
|
func (t *BTree) maxItems() int {
|
||||||
return t.degree*2 - 1
|
return t.degree*2 - 1
|
||||||
@ -642,37 +482,23 @@ func (t *BTree) minItems() int {
|
|||||||
return t.degree - 1
|
return t.degree - 1
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *copyOnWriteContext) newNode() (n *node) {
|
func (t *BTree) newNode() (n *node) {
|
||||||
n = c.freelist.newNode()
|
n = t.freelist.newNode()
|
||||||
n.cow = c
|
n.t = t
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
type freeType int
|
func (t *BTree) freeNode(n *node) {
|
||||||
|
for i := range n.items {
|
||||||
const (
|
n.items[i] = nil // clear to allow GC
|
||||||
ftFreelistFull freeType = iota // node was freed (available for GC, not stored in freelist)
|
|
||||||
ftStored // node was stored in the freelist for later use
|
|
||||||
ftNotOwned // node was ignored by COW, since it's owned by another one
|
|
||||||
)
|
|
||||||
|
|
||||||
// freeNode frees a node within a given COW context, if it's owned by that
|
|
||||||
// context. It returns what happened to the node (see freeType const
|
|
||||||
// documentation).
|
|
||||||
func (c *copyOnWriteContext) freeNode(n *node) freeType {
|
|
||||||
if n.cow == c {
|
|
||||||
// clear to allow GC
|
|
||||||
n.items.truncate(0)
|
|
||||||
n.children.truncate(0)
|
|
||||||
n.cow = nil
|
|
||||||
if c.freelist.freeNode(n) {
|
|
||||||
return ftStored
|
|
||||||
} else {
|
|
||||||
return ftFreelistFull
|
|
||||||
}
|
}
|
||||||
} else {
|
n.items = n.items[:0]
|
||||||
return ftNotOwned
|
for i := range n.children {
|
||||||
|
n.children[i] = nil // clear to allow GC
|
||||||
}
|
}
|
||||||
|
n.children = n.children[:0]
|
||||||
|
n.t = nil // clear to allow GC
|
||||||
|
t.freelist.freeNode(n)
|
||||||
}
|
}
|
||||||
|
|
||||||
// ReplaceOrInsert adds the given item to the tree. If an item in the tree
|
// ReplaceOrInsert adds the given item to the tree. If an item in the tree
|
||||||
@ -685,20 +511,17 @@ func (t *BTree) ReplaceOrInsert(item Item) Item {
|
|||||||
panic("nil item being added to BTree")
|
panic("nil item being added to BTree")
|
||||||
}
|
}
|
||||||
if t.root == nil {
|
if t.root == nil {
|
||||||
t.root = t.cow.newNode()
|
t.root = t.newNode()
|
||||||
t.root.items = append(t.root.items, item)
|
t.root.items = append(t.root.items, item)
|
||||||
t.length++
|
t.length++
|
||||||
return nil
|
return nil
|
||||||
} else {
|
} else if len(t.root.items) >= t.maxItems() {
|
||||||
t.root = t.root.mutableFor(t.cow)
|
|
||||||
if len(t.root.items) >= t.maxItems() {
|
|
||||||
item2, second := t.root.split(t.maxItems() / 2)
|
item2, second := t.root.split(t.maxItems() / 2)
|
||||||
oldroot := t.root
|
oldroot := t.root
|
||||||
t.root = t.cow.newNode()
|
t.root = t.newNode()
|
||||||
t.root.items = append(t.root.items, item2)
|
t.root.items = append(t.root.items, item2)
|
||||||
t.root.children = append(t.root.children, oldroot, second)
|
t.root.children = append(t.root.children, oldroot, second)
|
||||||
}
|
}
|
||||||
}
|
|
||||||
out := t.root.insert(item, t.maxItems())
|
out := t.root.insert(item, t.maxItems())
|
||||||
if out == nil {
|
if out == nil {
|
||||||
t.length++
|
t.length++
|
||||||
@ -728,12 +551,11 @@ func (t *BTree) deleteItem(item Item, typ toRemove) Item {
|
|||||||
if t.root == nil || len(t.root.items) == 0 {
|
if t.root == nil || len(t.root.items) == 0 {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
t.root = t.root.mutableFor(t.cow)
|
|
||||||
out := t.root.remove(item, t.minItems(), typ)
|
out := t.root.remove(item, t.minItems(), typ)
|
||||||
if len(t.root.items) == 0 && len(t.root.children) > 0 {
|
if len(t.root.items) == 0 && len(t.root.children) > 0 {
|
||||||
oldroot := t.root
|
oldroot := t.root
|
||||||
t.root = t.root.children[0]
|
t.root = t.root.children[0]
|
||||||
t.cow.freeNode(oldroot)
|
t.freeNode(oldroot)
|
||||||
}
|
}
|
||||||
if out != nil {
|
if out != nil {
|
||||||
t.length--
|
t.length--
|
||||||
@ -747,7 +569,10 @@ func (t *BTree) AscendRange(greaterOrEqual, lessThan Item, iterator ItemIterator
|
|||||||
if t.root == nil {
|
if t.root == nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
t.root.iterate(ascend, greaterOrEqual, lessThan, true, false, iterator)
|
t.root.iterate(
|
||||||
|
func(a Item) bool { return !a.Less(greaterOrEqual) },
|
||||||
|
func(a Item) bool { return a.Less(lessThan) },
|
||||||
|
iterator)
|
||||||
}
|
}
|
||||||
|
|
||||||
// AscendLessThan calls the iterator for every value in the tree within the range
|
// AscendLessThan calls the iterator for every value in the tree within the range
|
||||||
@ -756,7 +581,10 @@ func (t *BTree) AscendLessThan(pivot Item, iterator ItemIterator) {
|
|||||||
if t.root == nil {
|
if t.root == nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
t.root.iterate(ascend, nil, pivot, false, false, iterator)
|
t.root.iterate(
|
||||||
|
func(a Item) bool { return true },
|
||||||
|
func(a Item) bool { return a.Less(pivot) },
|
||||||
|
iterator)
|
||||||
}
|
}
|
||||||
|
|
||||||
// AscendGreaterOrEqual calls the iterator for every value in the tree within
|
// AscendGreaterOrEqual calls the iterator for every value in the tree within
|
||||||
@ -765,7 +593,10 @@ func (t *BTree) AscendGreaterOrEqual(pivot Item, iterator ItemIterator) {
|
|||||||
if t.root == nil {
|
if t.root == nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
t.root.iterate(ascend, pivot, nil, true, false, iterator)
|
t.root.iterate(
|
||||||
|
func(a Item) bool { return !a.Less(pivot) },
|
||||||
|
func(a Item) bool { return true },
|
||||||
|
iterator)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Ascend calls the iterator for every value in the tree within the range
|
// Ascend calls the iterator for every value in the tree within the range
|
||||||
@ -774,43 +605,10 @@ func (t *BTree) Ascend(iterator ItemIterator) {
|
|||||||
if t.root == nil {
|
if t.root == nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
t.root.iterate(ascend, nil, nil, false, false, iterator)
|
t.root.iterate(
|
||||||
}
|
func(a Item) bool { return true },
|
||||||
|
func(a Item) bool { return true },
|
||||||
// DescendRange calls the iterator for every value in the tree within the range
|
iterator)
|
||||||
// [lessOrEqual, greaterThan), until iterator returns false.
|
|
||||||
func (t *BTree) DescendRange(lessOrEqual, greaterThan Item, iterator ItemIterator) {
|
|
||||||
if t.root == nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
t.root.iterate(descend, lessOrEqual, greaterThan, true, false, iterator)
|
|
||||||
}
|
|
||||||
|
|
||||||
// DescendLessOrEqual calls the iterator for every value in the tree within the range
|
|
||||||
// [pivot, first], until iterator returns false.
|
|
||||||
func (t *BTree) DescendLessOrEqual(pivot Item, iterator ItemIterator) {
|
|
||||||
if t.root == nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
t.root.iterate(descend, pivot, nil, true, false, iterator)
|
|
||||||
}
|
|
||||||
|
|
||||||
// DescendGreaterThan calls the iterator for every value in the tree within
|
|
||||||
// the range (pivot, last], until iterator returns false.
|
|
||||||
func (t *BTree) DescendGreaterThan(pivot Item, iterator ItemIterator) {
|
|
||||||
if t.root == nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
t.root.iterate(descend, nil, pivot, false, false, iterator)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Descend calls the iterator for every value in the tree within the range
|
|
||||||
// [last, first], until iterator returns false.
|
|
||||||
func (t *BTree) Descend(iterator ItemIterator) {
|
|
||||||
if t.root == nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
t.root.iterate(descend, nil, nil, false, false, iterator)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get looks for the key item in the tree, returning it. It returns nil if
|
// Get looks for the key item in the tree, returning it. It returns nil if
|
||||||
@ -842,45 +640,6 @@ func (t *BTree) Len() int {
|
|||||||
return t.length
|
return t.length
|
||||||
}
|
}
|
||||||
|
|
||||||
// Clear removes all items from the btree. If addNodesToFreelist is true,
|
|
||||||
// t's nodes are added to its freelist as part of this call, until the freelist
|
|
||||||
// is full. Otherwise, the root node is simply dereferenced and the subtree
|
|
||||||
// left to Go's normal GC processes.
|
|
||||||
//
|
|
||||||
// This can be much faster
|
|
||||||
// than calling Delete on all elements, because that requires finding/removing
|
|
||||||
// each element in the tree and updating the tree accordingly. It also is
|
|
||||||
// somewhat faster than creating a new tree to replace the old one, because
|
|
||||||
// nodes from the old tree are reclaimed into the freelist for use by the new
|
|
||||||
// one, instead of being lost to the garbage collector.
|
|
||||||
//
|
|
||||||
// This call takes:
|
|
||||||
// O(1): when addNodesToFreelist is false, this is a single operation.
|
|
||||||
// O(1): when the freelist is already full, it breaks out immediately
|
|
||||||
// O(freelist size): when the freelist is empty and the nodes are all owned
|
|
||||||
// by this tree, nodes are added to the freelist until full.
|
|
||||||
// O(tree size): when all nodes are owned by another tree, all nodes are
|
|
||||||
// iterated over looking for nodes to add to the freelist, and due to
|
|
||||||
// ownership, none are.
|
|
||||||
func (t *BTree) Clear(addNodesToFreelist bool) {
|
|
||||||
if t.root != nil && addNodesToFreelist {
|
|
||||||
t.root.reset(t.cow)
|
|
||||||
}
|
|
||||||
t.root, t.length = nil, 0
|
|
||||||
}
|
|
||||||
|
|
||||||
// reset returns a subtree to the freelist. It breaks out immediately if the
|
|
||||||
// freelist is full, since the only benefit of iterating is to fill that
|
|
||||||
// freelist up. Returns true if parent reset call should continue.
|
|
||||||
func (n *node) reset(c *copyOnWriteContext) bool {
|
|
||||||
for _, child := range n.children {
|
|
||||||
if !child.reset(c) {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return c.freeNode(n) != ftFreelistFull
|
|
||||||
}
|
|
||||||
|
|
||||||
// Int implements the Item interface for integers.
|
// Int implements the Item interface for integers.
|
||||||
type Int int
|
type Int int
|
||||||
|
|
||||||
|
|||||||
3
vendor/github.com/google/gofuzz/go.mod
generated
vendored
3
vendor/github.com/google/gofuzz/go.mod
generated
vendored
@ -1,3 +0,0 @@
|
|||||||
module github.com/google/gofuzz
|
|
||||||
|
|
||||||
go 1.12
|
|
||||||
1
vendor/github.com/google/uuid/go.mod
generated
vendored
1
vendor/github.com/google/uuid/go.mod
generated
vendored
@ -1 +0,0 @@
|
|||||||
module github.com/google/uuid
|
|
||||||
1
vendor/github.com/google/uuid/node.go
generated
vendored
1
vendor/github.com/google/uuid/node.go
generated
vendored
@ -48,7 +48,6 @@ func setNodeInterface(name string) bool {
|
|||||||
// does not specify a specific interface generate a random Node ID
|
// does not specify a specific interface generate a random Node ID
|
||||||
// (section 4.1.6)
|
// (section 4.1.6)
|
||||||
if name == "" {
|
if name == "" {
|
||||||
ifname = "random"
|
|
||||||
randomBits(nodeID[:])
|
randomBits(nodeID[:])
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|||||||
73
vendor/github.com/google/uuid/uuid.go
generated
vendored
73
vendor/github.com/google/uuid/uuid.go
generated
vendored
@ -1,4 +1,4 @@
|
|||||||
// Copyright 2018 Google Inc. All rights reserved.
|
// Copyright 2016 Google Inc. All rights reserved.
|
||||||
// Use of this source code is governed by a BSD-style
|
// Use of this source code is governed by a BSD-style
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
@ -35,43 +35,20 @@ const (
|
|||||||
|
|
||||||
var rander = rand.Reader // random function
|
var rander = rand.Reader // random function
|
||||||
|
|
||||||
// Parse decodes s into a UUID or returns an error. Both the standard UUID
|
// Parse decodes s into a UUID or returns an error. Both the UUID form of
|
||||||
// forms of xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx and
|
// xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx and
|
||||||
// urn:uuid:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx are decoded as well as the
|
// urn:uuid:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx are decoded.
|
||||||
// Microsoft encoding {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx} and the raw hex
|
|
||||||
// encoding: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.
|
|
||||||
func Parse(s string) (UUID, error) {
|
func Parse(s string) (UUID, error) {
|
||||||
var uuid UUID
|
var uuid UUID
|
||||||
switch len(s) {
|
if len(s) != 36 {
|
||||||
// xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
|
if len(s) != 36+9 {
|
||||||
case 36:
|
return uuid, fmt.Errorf("invalid UUID length: %d", len(s))
|
||||||
|
}
|
||||||
// urn:uuid:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
|
|
||||||
case 36 + 9:
|
|
||||||
if strings.ToLower(s[:9]) != "urn:uuid:" {
|
if strings.ToLower(s[:9]) != "urn:uuid:" {
|
||||||
return uuid, fmt.Errorf("invalid urn prefix: %q", s[:9])
|
return uuid, fmt.Errorf("invalid urn prefix: %q", s[:9])
|
||||||
}
|
}
|
||||||
s = s[9:]
|
s = s[9:]
|
||||||
|
|
||||||
// {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}
|
|
||||||
case 36 + 2:
|
|
||||||
s = s[1:]
|
|
||||||
|
|
||||||
// xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
|
|
||||||
case 32:
|
|
||||||
var ok bool
|
|
||||||
for i := range uuid {
|
|
||||||
uuid[i], ok = xtob(s[i*2], s[i*2+1])
|
|
||||||
if !ok {
|
|
||||||
return uuid, errors.New("invalid UUID format")
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
return uuid, nil
|
|
||||||
default:
|
|
||||||
return uuid, fmt.Errorf("invalid UUID length: %d", len(s))
|
|
||||||
}
|
|
||||||
// s is now at least 36 bytes long
|
|
||||||
// it must be of the form xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
|
|
||||||
if s[8] != '-' || s[13] != '-' || s[18] != '-' || s[23] != '-' {
|
if s[8] != '-' || s[13] != '-' || s[18] != '-' || s[23] != '-' {
|
||||||
return uuid, errors.New("invalid UUID format")
|
return uuid, errors.New("invalid UUID format")
|
||||||
}
|
}
|
||||||
@ -93,29 +70,15 @@ func Parse(s string) (UUID, error) {
|
|||||||
// ParseBytes is like Parse, except it parses a byte slice instead of a string.
|
// ParseBytes is like Parse, except it parses a byte slice instead of a string.
|
||||||
func ParseBytes(b []byte) (UUID, error) {
|
func ParseBytes(b []byte) (UUID, error) {
|
||||||
var uuid UUID
|
var uuid UUID
|
||||||
switch len(b) {
|
if len(b) != 36 {
|
||||||
case 36: // xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
|
if len(b) != 36+9 {
|
||||||
case 36 + 9: // urn:uuid:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
|
return uuid, fmt.Errorf("invalid UUID length: %d", len(b))
|
||||||
|
}
|
||||||
if !bytes.Equal(bytes.ToLower(b[:9]), []byte("urn:uuid:")) {
|
if !bytes.Equal(bytes.ToLower(b[:9]), []byte("urn:uuid:")) {
|
||||||
return uuid, fmt.Errorf("invalid urn prefix: %q", b[:9])
|
return uuid, fmt.Errorf("invalid urn prefix: %q", b[:9])
|
||||||
}
|
}
|
||||||
b = b[9:]
|
b = b[9:]
|
||||||
case 36 + 2: // {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}
|
|
||||||
b = b[1:]
|
|
||||||
case 32: // xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
|
|
||||||
var ok bool
|
|
||||||
for i := 0; i < 32; i += 2 {
|
|
||||||
uuid[i/2], ok = xtob(b[i], b[i+1])
|
|
||||||
if !ok {
|
|
||||||
return uuid, errors.New("invalid UUID format")
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
return uuid, nil
|
|
||||||
default:
|
|
||||||
return uuid, fmt.Errorf("invalid UUID length: %d", len(b))
|
|
||||||
}
|
|
||||||
// s is now at least 36 bytes long
|
|
||||||
// it must be of the form xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
|
|
||||||
if b[8] != '-' || b[13] != '-' || b[18] != '-' || b[23] != '-' {
|
if b[8] != '-' || b[13] != '-' || b[18] != '-' || b[23] != '-' {
|
||||||
return uuid, errors.New("invalid UUID format")
|
return uuid, errors.New("invalid UUID format")
|
||||||
}
|
}
|
||||||
@ -134,16 +97,6 @@ func ParseBytes(b []byte) (UUID, error) {
|
|||||||
return uuid, nil
|
return uuid, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// MustParse is like Parse but panics if the string cannot be parsed.
|
|
||||||
// It simplifies safe initialization of global variables holding compiled UUIDs.
|
|
||||||
func MustParse(s string) UUID {
|
|
||||||
uuid, err := Parse(s)
|
|
||||||
if err != nil {
|
|
||||||
panic(`uuid: Parse(` + s + `): ` + err.Error())
|
|
||||||
}
|
|
||||||
return uuid
|
|
||||||
}
|
|
||||||
|
|
||||||
// FromBytes creates a new UUID from a byte slice. Returns an error if the slice
|
// FromBytes creates a new UUID from a byte slice. Returns an error if the slice
|
||||||
// does not have a length of 16. The bytes are copied from the slice.
|
// does not have a length of 16. The bytes are copied from the slice.
|
||||||
func FromBytes(b []byte) (uuid UUID, err error) {
|
func FromBytes(b []byte) (uuid UUID, err error) {
|
||||||
@ -177,7 +130,7 @@ func (uuid UUID) URN() string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func encodeHex(dst []byte, uuid UUID) {
|
func encodeHex(dst []byte, uuid UUID) {
|
||||||
hex.Encode(dst, uuid[:4])
|
hex.Encode(dst[:], uuid[:4])
|
||||||
dst[8] = '-'
|
dst[8] = '-'
|
||||||
hex.Encode(dst[9:13], uuid[4:6])
|
hex.Encode(dst[9:13], uuid[4:6])
|
||||||
dst[13] = '-'
|
dst[13] = '-'
|
||||||
|
|||||||
616
vendor/github.com/googleapis/gnostic/OpenAPIv2/OpenAPIv2.go
generated
vendored
616
vendor/github.com/googleapis/gnostic/OpenAPIv2/OpenAPIv2.go
generated
vendored
File diff suppressed because it is too large
Load Diff
5
vendor/github.com/googleapis/gnostic/OpenAPIv2/OpenAPIv2.pb.go
generated
vendored
5
vendor/github.com/googleapis/gnostic/OpenAPIv2/OpenAPIv2.pb.go
generated
vendored
@ -1,5 +1,6 @@
|
|||||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
// Code generated by protoc-gen-go.
|
||||||
// source: OpenAPIv2/OpenAPIv2.proto
|
// source: OpenAPIv2/OpenAPIv2.proto
|
||||||
|
// DO NOT EDIT!
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Package openapi_v2 is a generated protocol buffer package.
|
Package openapi_v2 is a generated protocol buffer package.
|
||||||
@ -4256,7 +4257,7 @@ func init() { proto.RegisterFile("OpenAPIv2/OpenAPIv2.proto", fileDescriptor0) }
|
|||||||
|
|
||||||
var fileDescriptor0 = []byte{
|
var fileDescriptor0 = []byte{
|
||||||
// 3129 bytes of a gzipped FileDescriptorProto
|
// 3129 bytes of a gzipped FileDescriptorProto
|
||||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x3b, 0x4b, 0x73, 0x1c, 0x57,
|
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xec, 0x3b, 0x4b, 0x73, 0x1c, 0x57,
|
||||||
0xd5, 0xf3, 0x7e, 0x1c, 0x69, 0x46, 0xa3, 0x96, 0x2c, 0xb7, 0x24, 0xc7, 0x71, 0xe4, 0x3c, 0x6c,
|
0xd5, 0xf3, 0x7e, 0x1c, 0x69, 0x46, 0xa3, 0x96, 0x2c, 0xb7, 0x24, 0xc7, 0x71, 0xe4, 0x3c, 0x6c,
|
||||||
0xe7, 0xb3, 0x9c, 0x4f, 0x29, 0x48, 0x05, 0x2a, 0x05, 0xf2, 0xab, 0xc6, 0xc4, 0x44, 0x4a, 0xcb,
|
0xe7, 0xb3, 0x9c, 0x4f, 0x29, 0x48, 0x05, 0x2a, 0x05, 0xf2, 0xab, 0xc6, 0xc4, 0x44, 0x4a, 0xcb,
|
||||||
0x0e, 0x09, 0x04, 0xba, 0xae, 0x66, 0xee, 0x48, 0x9d, 0x74, 0xf7, 0x6d, 0x77, 0xf7, 0xc8, 0x1a,
|
0x0e, 0x09, 0x04, 0xba, 0xae, 0x66, 0xee, 0x48, 0x9d, 0x74, 0xf7, 0x6d, 0x77, 0xf7, 0xc8, 0x1a,
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user