From 417594ea7aa9a6bb2fedb5008bcb4b6ddd3ed6a1 Mon Sep 17 00:00:00 2001 From: kumarashit Date: Fri, 26 Mar 2021 14:20:27 +0530 Subject: [PATCH 1/3] Updating vendor files --- go.sum | 13 + .../go-git/go-git/v5/COMPATIBILITY.md | 2 +- vendor/github.com/go-git/go-git/v5/README.md | 8 +- .../go-git/go-git/v5/config/config.go | 157 ++ .../go-git/go-git/v5/config/refspec.go | 9 +- vendor/github.com/go-git/go-git/v5/go.mod | 1 + vendor/github.com/go-git/go-git/v5/go.sum | 2 + vendor/github.com/go-git/go-git/v5/options.go | 49 +- .../plumbing/format/diff/unified_encoder.go | 397 ++-- .../v5/plumbing/format/packfile/diff_delta.go | 10 +- .../v5/plumbing/format/packfile/encoder.go | 10 +- .../v5/plumbing/format/packfile/packfile.go | 5 +- .../v5/plumbing/format/packfile/parser.go | 15 +- .../plumbing/format/packfile/patch_delta.go | 7 +- .../go-git/go-git/v5/plumbing/hash.go | 10 + .../go-git/v5/plumbing/object/change.go | 4 +- .../go-git/v5/plumbing/object/commit.go | 15 +- .../go-git/v5/plumbing/object/difftree.go | 67 +- .../go-git/go-git/v5/plumbing/object/patch.go | 2 +- .../go-git/go-git/v5/plumbing/object/tree.go | 35 +- .../v5/plumbing/protocol/packp/advrefs.go | 8 + .../transport/internal/common/common.go | 7 + .../v5/plumbing/transport/server/server.go | 12 +- vendor/github.com/go-git/go-git/v5/remote.go | 42 +- .../github.com/go-git/go-git/v5/repository.go | 69 +- .../go-git/v5/storage/filesystem/config.go | 17 +- .../v5/storage/filesystem/dotgit/dotgit.go | 11 + .../go-git/v5/storage/filesystem/object.go | 2 + .../github.com/go-git/go-git/v5/submodule.go | 2 +- .../go-git/v5/utils/merkletrie/difftree.go | 12 +- vendor/github.com/imdario/mergo/map.go | 7 +- vendor/github.com/imdario/mergo/merge.go | 233 ++- .../radoshttpd/rados/striper.go | 2 +- .../mattn/go-ieproxy/proxyMiddleman_unix.go | 2 +- vendor/github.com/micro/go-micro/v2/README.md | 38 +- .../micro/go-micro/v2/README.zh-cn.md | 36 - .../github.com/micro/go-micro/v2/auth/auth.go | 103 +- .../micro/go-micro/v2/auth/default.go | 26 +- .../micro/go-micro/v2/auth/jwt/jwt.go | 115 +- .../micro/go-micro/v2/auth/options.go | 74 +- .../go-micro/v2/auth/service/proto/auth.pb.go | 250 +-- .../go-micro/v2/auth/service/proto/auth.proto | 25 +- .../micro/go-micro/v2/auth/service/service.go | 283 +-- .../micro/go-micro/v2/auth/token/jwt/jwt.go | 22 +- .../micro/go-micro/v2/client/grpc/grpc.go | 54 +- .../micro/go-micro/v2/client/options.go | 24 +- .../micro/go-micro/v2/client/rpc_client.go | 6 +- .../micro/go-micro/v2/client/rpc_stream.go | 6 +- .../micro/go-micro/v2/config/cmd/cmd.go | 174 +- .../micro/go-micro/v2/config/cmd/options.go | 6 + .../micro/go-micro/v2/config/default.go | 11 +- .../v2/config/loader/memory/memory.go | 86 +- .../go-micro/v2/config/source/options.go | 12 + .../v2/config/source/service/service.go | 14 +- .../v2/debug/service/handler/debug.go | 12 +- .../v2/debug/service/proto/debug.pb.go | 190 +- .../v2/debug/service/proto/debug.pb.micro.go | 17 + .../v2/debug/service/proto/debug.proto | 13 +- vendor/github.com/micro/go-micro/v2/go.mod | 20 +- vendor/github.com/micro/go-micro/v2/go.sum | 57 +- .../micro/go-micro/v2/logger/default.go | 24 +- .../github.com/micro/go-micro/v2/options.go | 11 +- .../go-micro/v2/registry/mdns_registry.go | 19 +- .../go-micro/v2/registry/service/service.go | 40 +- .../micro/go-micro/v2/router/default.go | 125 +- .../micro/go-micro/v2/runtime/default.go | 282 ++- .../v2/runtime/kubernetes/kubernetes.go | 16 +- .../go-micro/v2/runtime/kubernetes/service.go | 3 + .../go-micro/v2/runtime/local/git/git.go | 25 +- .../v2/runtime/local/process/os/os.go | 17 +- .../micro/go-micro/v2/runtime/options.go | 11 + .../micro/go-micro/v2/runtime/runtime.go | 10 +- .../micro/go-micro/v2/runtime/service.go | 55 +- .../v2/runtime/service/proto/runtime.pb.go | 281 ++- .../v2/runtime/service/proto/runtime.proto | 20 +- .../go-micro/v2/runtime/service/service.go | 15 +- .../micro/go-micro/v2/server/grpc/grpc.go | 33 +- .../micro/go-micro/v2/server/grpc/server.go | 16 +- .../micro/go-micro/v2/server/rpc_router.go | 16 +- .../micro/go-micro/v2/server/rpc_server.go | 46 +- .../micro/go-micro/v2/server/server.go | 16 +- .../github.com/micro/go-micro/v2/service.go | 24 +- .../micro/go-micro/v2/store/memory/memory.go | 37 +- .../micro/go-micro/v2/store/options.go | 11 + .../v2/store/service/proto/store.pb.go | 1732 +++++++++++------ .../v2/store/service/proto/store.proto | 9 + .../go-micro/v2/store/service/service.go | 41 +- .../micro/go-micro/v2/store/store.go | 9 +- .../micro/go-micro/v2/util/addr/addr.go | 11 +- .../micro/go-micro/v2/util/config/config.go | 90 - .../micro/go-micro/v2/util/jitter/jitter.go | 17 - .../v2/util/kubernetes/api/request.go | 5 +- .../v2/util/kubernetes/client/templates.go | 11 +- .../micro/go-micro/v2/util/mdns/client.go | 9 +- .../micro/go-micro/v2/util/mdns/server.go | 73 +- .../micro/go-micro/v2/util/net/net.go | 15 +- .../micro/go-micro/v2/util/ring/buffer.go | 11 +- .../micro/go-micro/v2/util/socket/pool.go | 12 +- .../micro/go-micro/v2/util/wrapper/wrapper.go | 177 +- .../micro/go-micro/v2/web/service.go | 42 +- .../github.com/micro/go-micro/v2/web/web.go | 2 +- vendor/github.com/webrtcn/s3client/README.md | 4 + vendor/golang.org/x/net/http2/transport.go | 66 +- vendor/golang.org/x/sys/cpu/cpu_aix_ppc64.go | 34 - vendor/golang.org/x/sys/cpu/cpu_arm64.go | 8 +- vendor/golang.org/x/sys/unix/README.md | 4 +- vendor/golang.org/x/sys/unix/mkerrors.sh | 8 +- .../x/sys/unix/syscall_darwin.1_13.go | 21 +- .../golang.org/x/sys/unix/syscall_darwin.go | 1 + .../x/sys/unix/syscall_darwin_386.go | 11 - .../x/sys/unix/syscall_darwin_amd64.go | 11 - .../x/sys/unix/syscall_darwin_arm.go | 11 - .../x/sys/unix/syscall_darwin_arm64.go | 11 - vendor/golang.org/x/sys/unix/syscall_linux.go | 13 +- .../x/sys/unix/syscall_linux_386.go | 2 +- .../x/sys/unix/syscall_linux_amd64.go | 2 +- .../x/sys/unix/syscall_linux_arm.go | 2 +- .../x/sys/unix/syscall_linux_arm64.go | 28 +- .../x/sys/unix/syscall_linux_mips64x.go | 2 +- .../x/sys/unix/syscall_linux_mipsx.go | 2 +- .../x/sys/unix/syscall_linux_ppc64x.go | 2 +- .../x/sys/unix/syscall_linux_riscv64.go | 8 +- .../x/sys/unix/syscall_linux_s390x.go | 2 +- .../x/sys/unix/syscall_linux_sparc64.go | 2 +- vendor/golang.org/x/sys/unix/syscall_unix.go | 17 +- vendor/golang.org/x/sys/unix/zerrors_linux.go | 27 +- .../x/sys/unix/zerrors_linux_386.go | 4 + .../x/sys/unix/zerrors_linux_amd64.go | 4 + .../x/sys/unix/zerrors_linux_arm.go | 4 + .../x/sys/unix/zerrors_linux_arm64.go | 4 + .../x/sys/unix/zerrors_linux_mips.go | 4 + .../x/sys/unix/zerrors_linux_mips64.go | 4 + .../x/sys/unix/zerrors_linux_mips64le.go | 4 + .../x/sys/unix/zerrors_linux_mipsle.go | 4 + .../x/sys/unix/zerrors_linux_ppc64.go | 4 + .../x/sys/unix/zerrors_linux_ppc64le.go | 4 + .../x/sys/unix/zerrors_linux_riscv64.go | 4 + .../x/sys/unix/zerrors_linux_s390x.go | 4 + .../x/sys/unix/zerrors_linux_sparc64.go | 4 + .../x/sys/unix/zsyscall_darwin_386.1_11.go | 22 +- .../x/sys/unix/zsyscall_darwin_386.go | 32 +- .../x/sys/unix/zsyscall_darwin_amd64.1_11.go | 22 +- .../x/sys/unix/zsyscall_darwin_amd64.go | 32 +- .../x/sys/unix/zsyscall_darwin_arm.1_11.go | 22 +- .../x/sys/unix/zsyscall_darwin_arm.go | 32 +- .../x/sys/unix/zsyscall_darwin_arm64.1_11.go | 22 +- .../x/sys/unix/zsyscall_darwin_arm64.go | 32 +- .../golang.org/x/sys/unix/zsyscall_linux.go | 31 + .../x/sys/unix/zsyscall_linux_386.go | 2 +- .../x/sys/unix/zsyscall_linux_amd64.go | 2 +- .../x/sys/unix/zsyscall_linux_arm.go | 2 +- .../x/sys/unix/zsyscall_linux_arm64.go | 4 +- .../x/sys/unix/zsyscall_linux_mips.go | 2 +- .../x/sys/unix/zsyscall_linux_mips64.go | 2 +- .../x/sys/unix/zsyscall_linux_mips64le.go | 2 +- .../x/sys/unix/zsyscall_linux_mipsle.go | 2 +- .../x/sys/unix/zsyscall_linux_ppc64.go | 2 +- .../x/sys/unix/zsyscall_linux_ppc64le.go | 2 +- .../x/sys/unix/zsyscall_linux_s390x.go | 2 +- .../x/sys/unix/zsyscall_linux_sparc64.go | 2 +- .../x/sys/unix/zsysctl_openbsd_386.go | 3 +- .../x/sys/unix/zsysctl_openbsd_amd64.go | 1 + .../x/sys/unix/zsysctl_openbsd_arm.go | 1 + .../x/sys/unix/zsysnum_linux_386.go | 2 + .../x/sys/unix/zsysnum_linux_amd64.go | 2 + .../x/sys/unix/zsysnum_linux_arm.go | 2 + .../x/sys/unix/zsysnum_linux_arm64.go | 2 + .../x/sys/unix/zsysnum_linux_mips.go | 2 + .../x/sys/unix/zsysnum_linux_mips64.go | 2 + .../x/sys/unix/zsysnum_linux_mips64le.go | 2 + .../x/sys/unix/zsysnum_linux_mipsle.go | 2 + .../x/sys/unix/zsysnum_linux_ppc64.go | 2 + .../x/sys/unix/zsysnum_linux_ppc64le.go | 2 + .../x/sys/unix/zsysnum_linux_riscv64.go | 2 + .../x/sys/unix/zsysnum_linux_s390x.go | 2 + .../x/sys/unix/zsysnum_linux_sparc64.go | 2 + vendor/golang.org/x/sys/unix/ztypes_linux.go | 56 +- .../golang.org/x/sys/unix/ztypes_linux_386.go | 1 + .../x/sys/unix/ztypes_linux_amd64.go | 1 + .../golang.org/x/sys/unix/ztypes_linux_arm.go | 1 + .../x/sys/unix/ztypes_linux_arm64.go | 1 + .../x/sys/unix/ztypes_linux_mips.go | 1 + .../x/sys/unix/ztypes_linux_mips64.go | 1 + .../x/sys/unix/ztypes_linux_mips64le.go | 1 + .../x/sys/unix/ztypes_linux_mipsle.go | 1 + .../x/sys/unix/ztypes_linux_ppc64.go | 1 + .../x/sys/unix/ztypes_linux_ppc64le.go | 1 + .../x/sys/unix/ztypes_linux_riscv64.go | 1 + .../x/sys/unix/ztypes_linux_s390x.go | 1 + .../x/sys/unix/ztypes_linux_sparc64.go | 1 + .../golang.org/x/sys/windows/dll_windows.go | 29 + .../golang.org/x/sys/windows/env_windows.go | 11 +- .../x/sys/windows/security_windows.go | 20 +- .../x/sys/windows/syscall_windows.go | 37 +- vendor/modules.txt | 27 +- 195 files changed, 4539 insertions(+), 2646 deletions(-) delete mode 100644 vendor/github.com/micro/go-micro/v2/README.zh-cn.md delete mode 100644 vendor/github.com/micro/go-micro/v2/util/config/config.go delete mode 100644 vendor/github.com/micro/go-micro/v2/util/jitter/jitter.go delete mode 100644 vendor/golang.org/x/sys/cpu/cpu_aix_ppc64.go diff --git a/go.sum b/go.sum index c10b1e689..6552c7b79 100644 --- a/go.sum +++ b/go.sum @@ -111,6 +111,7 @@ github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghf github.com/cheekybits/genny v1.0.0/go.mod h1:+tQajlRqAUrPI7DOSpB0XAqZYtQakVtB7wXkRAgjxjQ= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cloudflare/cloudflare-go v0.10.2/go.mod h1:qhVI5MKwBGhdNU89ZRz2plgYutcJ5PCekLxXn56w6SY= +github.com/confluentinc/confluent-kafka-go v1.1.0 h1:HIW7Nkm8IeKRotC34mGY06DwQMf9Mp9PZMyqDxid2wI= github.com/confluentinc/confluent-kafka-go v1.1.0/go.mod h1:u2zNLny2xq+5rWeTQjFHbDzzNuba4P1vo31r9r4uAdg= github.com/containerd/cgroups v0.0.0-20190919134610-bf292b21730f/go.mod h1:OApqhQ4XNSNC13gXIwDjhOQxjWa/NxkwZXJ1EvqT0ko= github.com/containerd/console v0.0.0-20180822173158-c12b1e7919c1/go.mod h1:Tj/on1eG8kiEhd0+fhSDzsPAFESxzBBvdyEgyryXffw= @@ -368,6 +369,7 @@ github.com/klauspost/cpuid v1.2.3/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgo github.com/kolo/xmlrpc v0.0.0-20190717152603-07c4ee3fd181/go.mod h1:o03bZfuBwAXHetKXuInt4S7omeXUu62/A845kiycsSQ= 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.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/konsorten/go-windows-terminal-sequences v1.0.3 h1:CE8S1cTafDpPvMhIxNJKvHsGVBgn1xWYf1NbHQhywc8= github.com/konsorten/go-windows-terminal-sequences v1.0.3/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/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= @@ -375,6 +377,7 @@ github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/pty v1.1.5/go.mod h1:9r2w37qlBe7rQ6e1fg1S/9xpWHSnaqNdHD3WcMdbPDA= github.com/kr/pty v1.1.8/go.mod h1:O1sed60cT9XZ5uDucP5qwvh+TE3NnUj51EiZO/lmSfw= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/labbsr0x/bindman-dns-webhook v1.0.2/go.mod h1:p6b+VCXIR8NYKpDr8/dg1HKfQoRHCdcsROXKvmoehKA= github.com/labbsr0x/goh v1.0.1/go.mod h1:8K2UhVoaWXcCU7Lxoa2omWnC8gyW8px7/lmO61c027w= @@ -446,6 +449,7 @@ github.com/nats-io/nkeys v0.1.4/go.mod h1:XdZpAbhgyyODYqjTawOnIOI7VlbKSarI9Gfy1t github.com/nats-io/nuid v1.0.1 h1:5iA8DT8V7q8WK2EScv2padNa/rTESc1KdnPw4TC2paw= github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c= github.com/nbio/st v0.0.0-20140626010706-e9e8d9816f32/go.mod h1:9wM+0iRr9ahx58uYLpLIr5fm8diHn0JbqRycJi6w0Ms= +github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/nlopes/slack v0.6.1-0.20191106133607-d06c2a2b3249/go.mod h1:JzQ9m3PMAqcpeCam7UaHSuBuupz7CmpjehYMayT6YOk= github.com/nrdcg/auroradns v1.0.0/go.mod h1:6JPXKzIRzZzMqtTDgueIhTi6rFf1QvYE/HzqidhOhjw= @@ -489,6 +493,7 @@ github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINE github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= @@ -560,10 +565,12 @@ github.com/spf13/viper v1.6.3/go.mod h1:jUMtyi0/lB5yZH/FjyGAoH7IMNrIhlBf6pXZmbMD github.com/src-d/gcfg v1.4.0/go.mod h1:p/UMsR43ujA89BJY9duynAwIpvqEujIH/jFlfL7jWoI= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.2.0 h1:Hbg2NidpLE8veEBkEZTL3CvlkUIVzuU9jDplZO54c48= github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= +github.com/stretchr/testify v1.5.1 h1:nOGnQDM7FYENwehXlg/kFVnos3rEvtKTjRvOWSzb6H4= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/subosito/gotenv v1.2.0 h1:Slr1R9HxAlEKefgq5jn9U+DnETlIUa6HfgEzj0g5d7s= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= @@ -610,6 +617,7 @@ go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/ go.uber.org/multierr v1.3.0 h1:sFPn2GLc3poCkfrpIXGhBD2X0CMIo4Q/zSULXrj/+uc= go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= go.uber.org/ratelimit v0.0.0-20180316092928-c15da0234277/go.mod h1:2X8KaoNd1J0lZV+PxJk/5+DGbO/tpwLR1m++a7FnB/Y= +go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee h1:0mgffUl7nfd+FpvXMVz4IDEaUSmT1ysygQC7qYo7sG4= go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.13.0 h1:nR6NoDBgAf67s68NhaXbsojM+2gxp3S1hWkHDl27pVU= @@ -648,6 +656,7 @@ golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHl golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f h1:J5lckAjkw6qYlOZNj90mLYNTEKDvWeuc1yieZ8qUzUE= golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= @@ -773,6 +782,7 @@ golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtn golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191203134012-c197fd4bf371/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191216052735-49a3e744a425/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20191216173652-a0e659d51361 h1:RIIXAeV6GvDBuADKumTODatUqANFZ+5BPMnzsy4hulY= golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -787,6 +797,7 @@ google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsb google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.6.1 h1:QzqyMA1tlu6CgqCDUtU9V+ZKhLFT2dkJuANu5QaxI3I= google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20180831171423-11092d34479b/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= @@ -823,6 +834,7 @@ gopkg.in/asn1-ber.v1 v1.0.0-20181015200546-f715ec2f112d/go.mod h1:cuepJuh7vyXfUy gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f h1:BLraFXnmrev5lT+xlilqcH8XK9/i0At2xKjWk4p6zsU= gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/fsnotify.v1 v1.4.7 h1:xOHLXZwVvI9hhs+cLKq5+I5onOuwQLhQwiu63xxlHs4= @@ -862,6 +874,7 @@ honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWh honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.1-2019.2.3 h1:3JgtbtFHMiCmsznwGVTUWbgGov+pVqnlf1dEJTNAXeM= honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= k8s.io/apimachinery v0.18.5 h1:Lh6tgsM9FMkC12K5T5QjRm7rDs6aQN5JHkA0JomULDM= k8s.io/apimachinery v0.18.5/go.mod h1:OaXp26zu/5J7p0f92ASynJa1pZo06YlV9fG7BoWbCko= diff --git a/vendor/github.com/go-git/go-git/v5/COMPATIBILITY.md b/vendor/github.com/go-git/go-git/v5/COMPATIBILITY.md index 395088b7b..2a72b501e 100644 --- a/vendor/github.com/go-git/go-git/v5/COMPATIBILITY.md +++ b/vendor/github.com/go-git/go-git/v5/COMPATIBILITY.md @@ -101,7 +101,7 @@ is supported by go-git. | http(s):// (smart) | ✔ | | git:// | ✔ | | ssh:// | ✔ | -| file:// | ✔ | +| file:// | partial | Warning: this is not pure Golang. This shells out to the `git` binary. | | custom | ✔ | | **other features** | | gitignore | ✔ | diff --git a/vendor/github.com/go-git/go-git/v5/README.md b/vendor/github.com/go-git/go-git/v5/README.md index bca3277a0..ff0c9b72b 100644 --- a/vendor/github.com/go-git/go-git/v5/README.md +++ b/vendor/github.com/go-git/go-git/v5/README.md @@ -1,9 +1,9 @@ ![go-git logo](https://cdn.rawgit.com/src-d/artwork/02036484/go-git/files/go-git-github-readme-header.png) -[![GoDoc](https://godoc.org/github.com/go-git/go-git/v5?status.svg)](https://godoc.org/github.com/src-d/go-git) [![Build Status](https://github.com/go-git/go-git/workflows/Test%20&%20Coverage/badge.svg)](https://github.com/go-git/go-git/actions) [![Go Report Card](https://goreportcard.com/badge/github.com/src-d/go-git)](https://goreportcard.com/report/github.com/src-d/go-git) +[![GoDoc](https://godoc.org/github.com/go-git/go-git/v5?status.svg)](https://pkg.go.dev/github.com/go-git/go-git/v5) [![Build Status](https://github.com/go-git/go-git/workflows/Test/badge.svg)](https://github.com/go-git/go-git/actions) [![Go Report Card](https://goreportcard.com/badge/github.com/go-git/go-git)](https://goreportcard.com/report/github.com/go-git/go-git) *go-git* is a highly extensible git implementation library written in **pure Go**. -It can be used to manipulate git repositories at low level *(plumbing)* or high level *(porcelain)*, through an idiomatic Go API. It also supports several types of storage, such as in-memory filesystems, or custom implementations, thanks to the [`Storer`](https://godoc.org/github.com/go-git/go-git/v5/plumbing/storer) interface. +It can be used to manipulate git repositories at low level *(plumbing)* or high level *(porcelain)*, through an idiomatic Go API. It also supports several types of storage, such as in-memory filesystems, or custom implementations, thanks to the [`Storer`](https://pkg.go.dev/github.com/go-git/go-git/v5/plumbing/storer) interface. It's being actively developed since 2015 and is being used extensively by [Keybase](https://keybase.io/blog/encrypted-git-for-everyone), [Gitea](https://gitea.io/en-us/) or [Pulumi](https://github.com/search?q=org%3Apulumi+go-git&type=Code), and by many other libraries and tools. @@ -12,7 +12,7 @@ Project Status After the legal issues with the [`src-d`](https://github.com/src-d) organization, the lack of update for four months and the requirement to make a hard fork, the project is **now back to normality**. -The project is currently actively maintained by individual contributors, including several of the original authors, but also backed by a new company `gitsigth` where `go-git` is a critical component used at scale. +The project is currently actively maintained by individual contributors, including several of the original authors, but also backed by a new company, [gitsight](https://github.com/gitsight), where `go-git` is a critical component used at scale. Comparison with git @@ -37,7 +37,7 @@ import "github.com/go-git/go-git" // with go modules disabled Examples -------- -> Please note that the `CheckIfError` and `Info` functions used in the examples are from the [examples package](https://github.com/src-d/go-git/blob/master/_examples/common.go#L17) just to be used in the examples. +> Please note that the `CheckIfError` and `Info` functions used in the examples are from the [examples package](https://github.com/go-git/go-git/blob/master/_examples/common.go#L19) just to be used in the examples. ### Basic example diff --git a/vendor/github.com/go-git/go-git/v5/config/config.go b/vendor/github.com/go-git/go-git/v5/config/config.go index bec35b0c2..7d6ab5886 100644 --- a/vendor/github.com/go-git/go-git/v5/config/config.go +++ b/vendor/github.com/go-git/go-git/v5/config/config.go @@ -5,11 +5,16 @@ import ( "bytes" "errors" "fmt" + "io" + "io/ioutil" + "os" + "path/filepath" "sort" "strconv" "github.com/go-git/go-git/v5/internal/url" format "github.com/go-git/go-git/v5/plumbing/format/config" + "github.com/mitchellh/go-homedir" ) const ( @@ -32,6 +37,16 @@ var ( ErrRemoteConfigEmptyName = errors.New("remote config: empty name") ) +// Scope defines the scope of a config file, such as local, global or system. +type Scope int + +// Available ConfigScope's +const ( + LocalScope Scope = iota + GlobalScope + SystemScope +) + // Config contains the repository configuration // https://www.kernel.org/pub/software/scm/git/docs/git-config.html#FILES type Config struct { @@ -46,6 +61,27 @@ type Config struct { CommentChar string } + User struct { + // Name is the personal name of the author and the commiter of a commit. + Name string + // Email is the email of the author and the commiter of a commit. + Email string + } + + Author struct { + // Name is the personal name of the author of a commit. + Name string + // Email is the email of the author of a commit. + Email string + } + + Committer struct { + // Name is the personal name of the commiter of a commit. + Name string + // Email is the email of the the commiter of a commit. + Email string + } + Pack struct { // Window controls the size of the sliding window for delta // compression. The default is 10. A value of 0 turns off @@ -82,6 +118,77 @@ func NewConfig() *Config { return config } +// ReadConfig reads a config file from a io.Reader. +func ReadConfig(r io.Reader) (*Config, error) { + b, err := ioutil.ReadAll(r) + if err != nil { + return nil, err + } + + cfg := NewConfig() + if err = cfg.Unmarshal(b); err != nil { + return nil, err + } + + return cfg, nil +} + +// LoadConfig loads a config file from a given scope. The returned Config, +// contains exclusively information fom the given scope. If couldn't find a +// config file to the given scope, a empty one is returned. +func LoadConfig(scope Scope) (*Config, error) { + if scope == LocalScope { + return nil, fmt.Errorf("LocalScope should be read from the a ConfigStorer.") + } + + files, err := Paths(scope) + if err != nil { + return nil, err + } + + for _, file := range files { + f, err := os.Open(file) + if err != nil { + if os.IsNotExist(err) { + continue + } + + return nil, err + } + + defer f.Close() + return ReadConfig(f) + } + + return NewConfig(), nil +} + +// Paths returns the config file location for a given scope. +func Paths(scope Scope) ([]string, error) { + var files []string + switch scope { + case GlobalScope: + xdg := os.Getenv("XDG_CONFIG_HOME") + if xdg != "" { + files = append(files, filepath.Join(xdg, "git/config")) + } + + home, err := homedir.Dir() + if err != nil { + return nil, err + } + + files = append(files, + filepath.Join(home, ".gitconfig"), + filepath.Join(home, ".config/git/config"), + ) + case SystemScope: + files = append(files, "/etc/gitconfig") + } + + return files, nil +} + // Validate validates the fields and sets the default values. func (c *Config) Validate() error { for name, r := range c.Remotes { @@ -113,6 +220,9 @@ const ( branchSection = "branch" coreSection = "core" packSection = "pack" + userSection = "user" + authorSection = "author" + committerSection = "committer" fetchKey = "fetch" urlKey = "url" bareKey = "bare" @@ -121,6 +231,8 @@ const ( windowKey = "window" mergeKey = "merge" rebaseKey = "rebase" + nameKey = "name" + emailKey = "email" // DefaultPackWindow holds the number of previous objects used to // generate deltas. The value 10 is the same used by git command. @@ -138,6 +250,7 @@ func (c *Config) Unmarshal(b []byte) error { } c.unmarshalCore() + c.unmarshalUser() if err := c.unmarshalPack(); err != nil { return err } @@ -160,6 +273,20 @@ func (c *Config) unmarshalCore() { c.Core.CommentChar = s.Options.Get(commentCharKey) } +func (c *Config) unmarshalUser() { + s := c.Raw.Section(userSection) + c.User.Name = s.Options.Get(nameKey) + c.User.Email = s.Options.Get(emailKey) + + s = c.Raw.Section(authorSection) + c.Author.Name = s.Options.Get(nameKey) + c.Author.Email = s.Options.Get(emailKey) + + s = c.Raw.Section(committerSection) + c.Committer.Name = s.Options.Get(nameKey) + c.Committer.Email = s.Options.Get(emailKey) +} + func (c *Config) unmarshalPack() error { s := c.Raw.Section(packSection) window := s.Options.Get(windowKey) @@ -220,6 +347,7 @@ func (c *Config) unmarshalBranches() error { // Marshal returns Config encoded as a git-config file. func (c *Config) Marshal() ([]byte, error) { c.marshalCore() + c.marshalUser() c.marshalPack() c.marshalRemotes() c.marshalSubmodules() @@ -242,6 +370,35 @@ func (c *Config) marshalCore() { } } +func (c *Config) marshalUser() { + s := c.Raw.Section(userSection) + if c.User.Name != "" { + s.SetOption(nameKey, c.User.Name) + } + + if c.User.Email != "" { + s.SetOption(emailKey, c.User.Email) + } + + s = c.Raw.Section(authorSection) + if c.Author.Name != "" { + s.SetOption(nameKey, c.Author.Name) + } + + if c.Author.Email != "" { + s.SetOption(emailKey, c.Author.Email) + } + + s = c.Raw.Section(committerSection) + if c.Committer.Name != "" { + s.SetOption(nameKey, c.Committer.Name) + } + + if c.Committer.Email != "" { + s.SetOption(emailKey, c.Committer.Email) + } +} + func (c *Config) marshalPack() { s := c.Raw.Section(packSection) if c.Pack.Window != DefaultPackWindow { diff --git a/vendor/github.com/go-git/go-git/v5/config/refspec.go b/vendor/github.com/go-git/go-git/v5/config/refspec.go index 87cf2a601..4bfaa37bb 100644 --- a/vendor/github.com/go-git/go-git/v5/config/refspec.go +++ b/vendor/github.com/go-git/go-git/v5/config/refspec.go @@ -25,7 +25,7 @@ var ( // reference even if it isn’t a fast-forward. // eg.: "+refs/heads/*:refs/remotes/origin/*" // -// https://git-scm.com/book/es/v2/Git-Internals-The-Refspec +// https://git-scm.com/book/en/v2/Git-Internals-The-Refspec type RefSpec string // Validate validates the RefSpec @@ -59,6 +59,11 @@ func (s RefSpec) IsDelete() bool { return s[0] == refSpecSeparator[0] } +// IsExactSHA1 returns true if the source is a SHA1 hash. +func (s RefSpec) IsExactSHA1() bool { + return plumbing.IsHash(s.Src()) +} + // Src return the src side. func (s RefSpec) Src() string { spec := string(s) @@ -69,8 +74,8 @@ func (s RefSpec) Src() string { } else { start = 0 } - end := strings.Index(spec, refSpecSeparator) + end := strings.Index(spec, refSpecSeparator) return spec[start:end] } diff --git a/vendor/github.com/go-git/go-git/v5/go.mod b/vendor/github.com/go-git/go-git/v5/go.mod index 6d8da35c3..0c9cfd2ca 100644 --- a/vendor/github.com/go-git/go-git/v5/go.mod +++ b/vendor/github.com/go-git/go-git/v5/go.mod @@ -10,6 +10,7 @@ require ( github.com/go-git/go-billy/v5 v5.0.0 github.com/go-git/go-git-fixtures/v4 v4.0.1 github.com/google/go-cmp v0.3.0 + github.com/imdario/mergo v0.3.9 github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 github.com/jessevdk/go-flags v1.4.0 github.com/kevinburke/ssh_config v0.0.0-20190725054713-01f96b0aa0cd diff --git a/vendor/github.com/go-git/go-git/v5/go.sum b/vendor/github.com/go-git/go-git/v5/go.sum index a73585e90..e14e29ae3 100644 --- a/vendor/github.com/go-git/go-git/v5/go.sum +++ b/vendor/github.com/go-git/go-git/v5/go.sum @@ -22,6 +22,8 @@ github.com/go-git/go-git-fixtures/v4 v4.0.1 h1:q+IFMfLx200Q3scvt2hN79JsEzy4AmBTp github.com/go-git/go-git-fixtures/v4 v4.0.1/go.mod h1:m+ICp2rF3jDhFgEZ/8yziagdT1C+ZpZcrJjappBCDSw= github.com/google/go-cmp v0.3.0 h1:crn/baboCvb5fXaQ0IJ1SGTsTVrWpDsCWC8EGETZijY= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/imdario/mergo v0.3.9 h1:UauaLniWCFHWd+Jp9oCEkTBj8VO/9DKg3PV3VCNMDIg= +github.com/imdario/mergo v0.3.9/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 h1:BQSFePA1RWJOlocH6Fxy8MmwDt+yVQYULKfN0RoTN8A= github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99/go.mod h1:1lJo3i6rXxKeerYnT8Nvf0QmHCRC1n8sfWVwXF2Frvo= github.com/jessevdk/go-flags v1.4.0 h1:4IU2WS7AumrZ/40jfhf4QVDMsQwqA7VEHozFRrGARJA= diff --git a/vendor/github.com/go-git/go-git/v5/options.go b/vendor/github.com/go-git/go-git/v5/options.go index a147f58b9..5367031f4 100644 --- a/vendor/github.com/go-git/go-git/v5/options.go +++ b/vendor/github.com/go-git/go-git/v5/options.go @@ -6,12 +6,12 @@ import ( "strings" "time" - "golang.org/x/crypto/openpgp" "github.com/go-git/go-git/v5/config" "github.com/go-git/go-git/v5/plumbing" "github.com/go-git/go-git/v5/plumbing/object" "github.com/go-git/go-git/v5/plumbing/protocol/packp/sideband" "github.com/go-git/go-git/v5/plumbing/transport" + "golang.org/x/crypto/openpgp" ) // SubmoduleRescursivity defines how depth will affect any submodule recursive @@ -190,6 +190,9 @@ type PushOptions struct { // Prune specify that remote refs that match given RefSpecs and that do // not exist locally will be removed. Prune bool + // Force allows the push to update a remote branch even when the local + // branch does not descend from it. + Force bool } // Validate validates the fields and sets the default values. @@ -375,7 +378,8 @@ type CommitOptions struct { // All automatically stage files that have been modified and deleted, but // new files you have not told Git about are not affected. All bool - // Author is the author's signature of the commit. + // Author is the author's signature of the commit. If Author is empty the + // Name and Email is read from the config, and time.Now it's used as When. Author *object.Signature // Committer is the committer's signature of the commit. If Committer is // nil the Author signature is used. @@ -392,7 +396,9 @@ type CommitOptions struct { // Validate validates the fields and sets the default values. func (o *CommitOptions) Validate(r *Repository) error { if o.Author == nil { - return ErrMissingAuthor + if err := o.loadConfigAuthorAndCommitter(r); err != nil { + return err + } } if o.Committer == nil { @@ -413,6 +419,43 @@ func (o *CommitOptions) Validate(r *Repository) error { return nil } +func (o *CommitOptions) loadConfigAuthorAndCommitter(r *Repository) error { + cfg, err := r.ConfigScoped(config.SystemScope) + if err != nil { + return err + } + + if o.Author == nil && cfg.Author.Email != "" && cfg.Author.Name != "" { + o.Author = &object.Signature{ + Name: cfg.Author.Name, + Email: cfg.Author.Email, + When: time.Now(), + } + } + + if o.Committer == nil && cfg.Committer.Email != "" && cfg.Committer.Name != "" { + o.Committer = &object.Signature{ + Name: cfg.Committer.Name, + Email: cfg.Committer.Email, + When: time.Now(), + } + } + + if o.Author == nil && cfg.User.Email != "" && cfg.User.Name != "" { + o.Author = &object.Signature{ + Name: cfg.User.Name, + Email: cfg.User.Email, + When: time.Now(), + } + } + + if o.Author == nil { + return ErrMissingAuthor + } + + return nil +} + var ( ErrMissingName = errors.New("name field is required") ErrMissingTagger = errors.New("tagger field is required") diff --git a/vendor/github.com/go-git/go-git/v5/plumbing/format/diff/unified_encoder.go b/vendor/github.com/go-git/go-git/v5/plumbing/format/diff/unified_encoder.go index f2bc910a2..413984aa5 100644 --- a/vendor/github.com/go-git/go-git/v5/plumbing/format/diff/unified_encoder.go +++ b/vendor/github.com/go-git/go-git/v5/plumbing/format/diff/unified_encoder.go @@ -1,157 +1,158 @@ package diff import ( - "bytes" "fmt" "io" "regexp" + "strconv" "strings" "github.com/go-git/go-git/v5/plumbing" ) -const ( - diffInit = "diff --git a/%s b/%s\n" +// DefaultContextLines is the default number of context lines. +const DefaultContextLines = 3 - chunkStart = "@@ -" - chunkMiddle = " +" - chunkEnd = " @@%s\n" - chunkCount = "%d,%d" +var ( + splitLinesRegexp = regexp.MustCompile(`[^\n]*(\n|$)`) - noFilePath = "/dev/null" - aDir = "a/" - bDir = "b/" - - fPath = "--- %s\n" - tPath = "+++ %s\n" - binary = "Binary files %s and %s differ\n" - - addLine = "+%s%s" - deleteLine = "-%s%s" - equalLine = " %s%s" - noNewLine = "\n\\ No newline at end of file\n" - - oldMode = "old mode %o\n" - newMode = "new mode %o\n" - deletedFileMode = "deleted file mode %o\n" - newFileMode = "new file mode %o\n" - - renameFrom = "from" - renameTo = "to" - renameFileMode = "rename %s %s\n" - - indexAndMode = "index %s..%s %o\n" - indexNoMode = "index %s..%s\n" + operationChar = map[Operation]byte{ + Add: '+', + Delete: '-', + Equal: ' ', + } - DefaultContextLines = 3 + operationColorKey = map[Operation]ColorKey{ + Add: New, + Delete: Old, + Equal: Context, + } ) -// UnifiedEncoder encodes an unified diff into the provided Writer. -// There are some unsupported features: -// - Similarity index for renames -// - Sort hash representation +// UnifiedEncoder encodes an unified diff into the provided Writer. It does not +// support similarity index for renames or sorting hash representations. type UnifiedEncoder struct { io.Writer - // ctxLines is the count of unchanged lines that will appear - // surrounding a change. - ctxLines int + // contextLines is the count of unchanged lines that will appear surrounding + // a change. + contextLines int - buf bytes.Buffer + // colorConfig is the color configuration. The default is no color. + color ColorConfig } -func NewUnifiedEncoder(w io.Writer, ctxLines int) *UnifiedEncoder { - return &UnifiedEncoder{ctxLines: ctxLines, Writer: w} -} - -func (e *UnifiedEncoder) Encode(patch Patch) error { - e.printMessage(patch.Message()) - - if err := e.encodeFilePatch(patch.FilePatches()); err != nil { - return err +// NewUnifiedEncoder returns a new UnifiedEncoder that writes to w. +func NewUnifiedEncoder(w io.Writer, contextLines int) *UnifiedEncoder { + return &UnifiedEncoder{ + Writer: w, + contextLines: contextLines, } +} - _, err := e.buf.WriteTo(e) - - return err +// SetColor sets e's color configuration and returns e. +func (e *UnifiedEncoder) SetColor(colorConfig ColorConfig) *UnifiedEncoder { + e.color = colorConfig + return e } -func (e *UnifiedEncoder) encodeFilePatch(filePatches []FilePatch) error { - for _, p := range filePatches { - f, t := p.Files() - if err := e.header(f, t, p.IsBinary()); err != nil { - return err +// Encode encodes patch. +func (e *UnifiedEncoder) Encode(patch Patch) error { + sb := &strings.Builder{} + + if message := patch.Message(); message != "" { + sb.WriteString(message) + if !strings.HasSuffix(message, "\n") { + sb.WriteByte('\n') } + } - g := newHunksGenerator(p.Chunks(), e.ctxLines) - for _, c := range g.Generate() { - c.WriteTo(&e.buf) + for _, filePatch := range patch.FilePatches() { + e.writeFilePatchHeader(sb, filePatch) + g := newHunksGenerator(filePatch.Chunks(), e.contextLines) + for _, hunk := range g.Generate() { + hunk.writeTo(sb, e.color) } } - return nil + _, err := e.Write([]byte(sb.String())) + return err } -func (e *UnifiedEncoder) printMessage(message string) { - isEmpty := message == "" - hasSuffix := strings.HasSuffix(message, "\n") - if !isEmpty && !hasSuffix { - message += "\n" +func (e *UnifiedEncoder) writeFilePatchHeader(sb *strings.Builder, filePatch FilePatch) { + from, to := filePatch.Files() + if from == nil && to == nil { + return } + isBinary := filePatch.IsBinary() - e.buf.WriteString(message) -} - -func (e *UnifiedEncoder) header(from, to File, isBinary bool) error { + var lines []string switch { - case from == nil && to == nil: - return nil case from != nil && to != nil: hashEquals := from.Hash() == to.Hash() - - fmt.Fprintf(&e.buf, diffInit, from.Path(), to.Path()) - + lines = append(lines, + fmt.Sprintf("diff --git a/%s b/%s", from.Path(), to.Path()), + ) if from.Mode() != to.Mode() { - fmt.Fprintf(&e.buf, oldMode+newMode, from.Mode(), to.Mode()) + lines = append(lines, + fmt.Sprintf("old mode %o", from.Mode()), + fmt.Sprintf("new mode %o", to.Mode()), + ) } - if from.Path() != to.Path() { - fmt.Fprintf(&e.buf, - renameFileMode+renameFileMode, - renameFrom, from.Path(), renameTo, to.Path()) + lines = append(lines, + fmt.Sprintf("rename from %s", from.Path()), + fmt.Sprintf("rename to %s", to.Path()), + ) } - if from.Mode() != to.Mode() && !hashEquals { - fmt.Fprintf(&e.buf, indexNoMode, from.Hash(), to.Hash()) + lines = append(lines, + fmt.Sprintf("index %s..%s", from.Hash(), to.Hash()), + ) } else if !hashEquals { - fmt.Fprintf(&e.buf, indexAndMode, from.Hash(), to.Hash(), from.Mode()) + lines = append(lines, + fmt.Sprintf("index %s..%s %o", from.Hash(), to.Hash(), from.Mode()), + ) } - if !hashEquals { - e.pathLines(isBinary, aDir+from.Path(), bDir+to.Path()) + lines = e.appendPathLines(lines, "a/"+from.Path(), "b/"+to.Path(), isBinary) } case from == nil: - fmt.Fprintf(&e.buf, diffInit, to.Path(), to.Path()) - fmt.Fprintf(&e.buf, newFileMode, to.Mode()) - fmt.Fprintf(&e.buf, indexNoMode, plumbing.ZeroHash, to.Hash()) - e.pathLines(isBinary, noFilePath, bDir+to.Path()) + lines = append(lines, + fmt.Sprintf("diff --git a/%s b/%s", to.Path(), to.Path()), + fmt.Sprintf("new file mode %o", to.Mode()), + fmt.Sprintf("index %s..%s", plumbing.ZeroHash, to.Hash()), + ) + lines = e.appendPathLines(lines, "/dev/null", "b/"+to.Path(), isBinary) case to == nil: - fmt.Fprintf(&e.buf, diffInit, from.Path(), from.Path()) - fmt.Fprintf(&e.buf, deletedFileMode, from.Mode()) - fmt.Fprintf(&e.buf, indexNoMode, from.Hash(), plumbing.ZeroHash) - e.pathLines(isBinary, aDir+from.Path(), noFilePath) + lines = append(lines, + fmt.Sprintf("diff --git a/%s b/%s", from.Path(), from.Path()), + fmt.Sprintf("deleted file mode %o", from.Mode()), + fmt.Sprintf("index %s..%s", from.Hash(), plumbing.ZeroHash), + ) + lines = e.appendPathLines(lines, "a/"+from.Path(), "/dev/null", isBinary) } - return nil + sb.WriteString(e.color[Meta]) + sb.WriteString(lines[0]) + for _, line := range lines[1:] { + sb.WriteByte('\n') + sb.WriteString(line) + } + sb.WriteString(e.color.Reset(Meta)) + sb.WriteByte('\n') } -func (e *UnifiedEncoder) pathLines(isBinary bool, fromPath, toPath string) { - format := fPath + tPath +func (e *UnifiedEncoder) appendPathLines(lines []string, fromPath, toPath string, isBinary bool) []string { if isBinary { - format = binary + return append(lines, + fmt.Sprintf("Binary files %s and %s differ", fromPath, toPath), + ) } - - fmt.Fprintf(&e.buf, format, fromPath, toPath) + return append(lines, + fmt.Sprintf("--- %s", fromPath), + fmt.Sprintf("+++ %s", toPath), + ) } type hunksGenerator struct { @@ -170,84 +171,84 @@ func newHunksGenerator(chunks []Chunk, ctxLines int) *hunksGenerator { } } -func (c *hunksGenerator) Generate() []*hunk { - for i, chunk := range c.chunks { - ls := splitLines(chunk.Content()) - lsLen := len(ls) +func (g *hunksGenerator) Generate() []*hunk { + for i, chunk := range g.chunks { + lines := splitLines(chunk.Content()) + nLines := len(lines) switch chunk.Type() { case Equal: - c.fromLine += lsLen - c.toLine += lsLen - c.processEqualsLines(ls, i) + g.fromLine += nLines + g.toLine += nLines + g.processEqualsLines(lines, i) case Delete: - if lsLen != 0 { - c.fromLine++ + if nLines != 0 { + g.fromLine++ } - c.processHunk(i, chunk.Type()) - c.fromLine += lsLen - 1 - c.current.AddOp(chunk.Type(), ls...) + g.processHunk(i, chunk.Type()) + g.fromLine += nLines - 1 + g.current.AddOp(chunk.Type(), lines...) case Add: - if lsLen != 0 { - c.toLine++ + if nLines != 0 { + g.toLine++ } - c.processHunk(i, chunk.Type()) - c.toLine += lsLen - 1 - c.current.AddOp(chunk.Type(), ls...) + g.processHunk(i, chunk.Type()) + g.toLine += nLines - 1 + g.current.AddOp(chunk.Type(), lines...) } - if i == len(c.chunks)-1 && c.current != nil { - c.hunks = append(c.hunks, c.current) + if i == len(g.chunks)-1 && g.current != nil { + g.hunks = append(g.hunks, g.current) } } - return c.hunks + return g.hunks } -func (c *hunksGenerator) processHunk(i int, op Operation) { - if c.current != nil { +func (g *hunksGenerator) processHunk(i int, op Operation) { + if g.current != nil { return } var ctxPrefix string - linesBefore := len(c.beforeContext) - if linesBefore > c.ctxLines { - ctxPrefix = " " + c.beforeContext[linesBefore-c.ctxLines-1] - c.beforeContext = c.beforeContext[linesBefore-c.ctxLines:] - linesBefore = c.ctxLines + linesBefore := len(g.beforeContext) + if linesBefore > g.ctxLines { + ctxPrefix = g.beforeContext[linesBefore-g.ctxLines-1] + g.beforeContext = g.beforeContext[linesBefore-g.ctxLines:] + linesBefore = g.ctxLines } - c.current = &hunk{ctxPrefix: strings.TrimSuffix(ctxPrefix, "\n")} - c.current.AddOp(Equal, c.beforeContext...) + g.current = &hunk{ctxPrefix: strings.TrimSuffix(ctxPrefix, "\n")} + g.current.AddOp(Equal, g.beforeContext...) switch op { case Delete: - c.current.fromLine, c.current.toLine = - c.addLineNumbers(c.fromLine, c.toLine, linesBefore, i, Add) + g.current.fromLine, g.current.toLine = + g.addLineNumbers(g.fromLine, g.toLine, linesBefore, i, Add) case Add: - c.current.toLine, c.current.fromLine = - c.addLineNumbers(c.toLine, c.fromLine, linesBefore, i, Delete) + g.current.toLine, g.current.fromLine = + g.addLineNumbers(g.toLine, g.fromLine, linesBefore, i, Delete) } - c.beforeContext = nil + g.beforeContext = nil } -// addLineNumbers obtains the line numbers in a new chunk -func (c *hunksGenerator) addLineNumbers(la, lb int, linesBefore int, i int, op Operation) (cla, clb int) { +// addLineNumbers obtains the line numbers in a new chunk. +func (g *hunksGenerator) addLineNumbers(la, lb int, linesBefore int, i int, op Operation) (cla, clb int) { cla = la - linesBefore // we need to search for a reference for the next diff switch { - case linesBefore != 0 && c.ctxLines != 0: - if lb > c.ctxLines { - clb = lb - c.ctxLines + 1 + case linesBefore != 0 && g.ctxLines != 0: + if lb > g.ctxLines { + clb = lb - g.ctxLines + 1 } else { clb = 1 } - case c.ctxLines == 0: + case g.ctxLines == 0: clb = lb - case i != len(c.chunks)-1: - next := c.chunks[i+1] + case i != len(g.chunks)-1: + next := g.chunks[i+1] if next.Type() == op || next.Type() == Equal { // this diff will be into this chunk clb = lb + 1 @@ -257,34 +258,32 @@ func (c *hunksGenerator) addLineNumbers(la, lb int, linesBefore int, i int, op O return } -func (c *hunksGenerator) processEqualsLines(ls []string, i int) { - if c.current == nil { - c.beforeContext = append(c.beforeContext, ls...) +func (g *hunksGenerator) processEqualsLines(ls []string, i int) { + if g.current == nil { + g.beforeContext = append(g.beforeContext, ls...) return } - c.afterContext = append(c.afterContext, ls...) - if len(c.afterContext) <= c.ctxLines*2 && i != len(c.chunks)-1 { - c.current.AddOp(Equal, c.afterContext...) - c.afterContext = nil + g.afterContext = append(g.afterContext, ls...) + if len(g.afterContext) <= g.ctxLines*2 && i != len(g.chunks)-1 { + g.current.AddOp(Equal, g.afterContext...) + g.afterContext = nil } else { - ctxLines := c.ctxLines - if ctxLines > len(c.afterContext) { - ctxLines = len(c.afterContext) + ctxLines := g.ctxLines + if ctxLines > len(g.afterContext) { + ctxLines = len(g.afterContext) } - c.current.AddOp(Equal, c.afterContext[:ctxLines]...) - c.hunks = append(c.hunks, c.current) + g.current.AddOp(Equal, g.afterContext[:ctxLines]...) + g.hunks = append(g.hunks, g.current) - c.current = nil - c.beforeContext = c.afterContext[ctxLines:] - c.afterContext = nil + g.current = nil + g.beforeContext = g.afterContext[ctxLines:] + g.afterContext = nil } } -var splitLinesRE = regexp.MustCompile(`[^\n]*(\n|$)`) - func splitLines(s string) []string { - out := splitLinesRE.FindAllString(s, -1) + out := splitLinesRegexp.FindAllString(s, -1) if out[len(out)-1] == "" { out = out[:len(out)-1] } @@ -302,44 +301,59 @@ type hunk struct { ops []*op } -func (c *hunk) WriteTo(buf *bytes.Buffer) { - buf.WriteString(chunkStart) +func (h *hunk) writeTo(sb *strings.Builder, color ColorConfig) { + sb.WriteString(color[Frag]) + sb.WriteString("@@ -") - if c.fromCount == 1 { - fmt.Fprintf(buf, "%d", c.fromLine) + if h.fromCount == 1 { + sb.WriteString(strconv.Itoa(h.fromLine)) } else { - fmt.Fprintf(buf, chunkCount, c.fromLine, c.fromCount) + sb.WriteString(strconv.Itoa(h.fromLine)) + sb.WriteByte(',') + sb.WriteString(strconv.Itoa(h.fromCount)) } - buf.WriteString(chunkMiddle) + sb.WriteString(" +") - if c.toCount == 1 { - fmt.Fprintf(buf, "%d", c.toLine) + if h.toCount == 1 { + sb.WriteString(strconv.Itoa(h.toLine)) } else { - fmt.Fprintf(buf, chunkCount, c.toLine, c.toCount) + sb.WriteString(strconv.Itoa(h.toLine)) + sb.WriteByte(',') + sb.WriteString(strconv.Itoa(h.toCount)) } - fmt.Fprintf(buf, chunkEnd, c.ctxPrefix) + sb.WriteString(" @@") + sb.WriteString(color.Reset(Frag)) - for _, d := range c.ops { - buf.WriteString(d.String()) + if h.ctxPrefix != "" { + sb.WriteByte(' ') + sb.WriteString(color[Func]) + sb.WriteString(h.ctxPrefix) + sb.WriteString(color.Reset(Func)) + } + + sb.WriteByte('\n') + + for _, op := range h.ops { + op.writeTo(sb, color) } } -func (c *hunk) AddOp(t Operation, s ...string) { - ls := len(s) +func (h *hunk) AddOp(t Operation, ss ...string) { + n := len(ss) switch t { case Add: - c.toCount += ls + h.toCount += n case Delete: - c.fromCount += ls + h.fromCount += n case Equal: - c.toCount += ls - c.fromCount += ls + h.toCount += n + h.fromCount += n } - for _, l := range s { - c.ops = append(c.ops, &op{l, t}) + for _, s := range ss { + h.ops = append(h.ops, &op{s, t}) } } @@ -348,20 +362,15 @@ type op struct { t Operation } -func (o *op) String() string { - var prefix, suffix string - switch o.t { - case Add: - prefix = addLine - case Delete: - prefix = deleteLine - case Equal: - prefix = equalLine - } - n := len(o.text) - if n > 0 && o.text[n-1] != '\n' { - suffix = noNewLine +func (o *op) writeTo(sb *strings.Builder, color ColorConfig) { + colorKey := operationColorKey[o.t] + sb.WriteString(color[colorKey]) + sb.WriteByte(operationChar[o.t]) + if strings.HasSuffix(o.text, "\n") { + sb.WriteString(strings.TrimSuffix(o.text, "\n")) + } else { + sb.WriteString(o.text + "\n\\ No newline at end of file") } - - return fmt.Sprintf(prefix, o.text, suffix) + sb.WriteString(color.Reset(colorKey)) + sb.WriteByte('\n') } diff --git a/vendor/github.com/go-git/go-git/v5/plumbing/format/packfile/diff_delta.go b/vendor/github.com/go-git/go-git/v5/plumbing/format/packfile/diff_delta.go index 1d4b384a7..1951b34ef 100644 --- a/vendor/github.com/go-git/go-git/v5/plumbing/format/packfile/diff_delta.go +++ b/vendor/github.com/go-git/go-git/v5/plumbing/format/packfile/diff_delta.go @@ -4,6 +4,7 @@ import ( "bytes" "github.com/go-git/go-git/v5/plumbing" + "github.com/go-git/go-git/v5/utils/ioutil" ) // See https://github.com/jelmer/dulwich/blob/master/dulwich/pack.py and @@ -27,17 +28,20 @@ func GetDelta(base, target plumbing.EncodedObject) (plumbing.EncodedObject, erro return getDelta(new(deltaIndex), base, target) } -func getDelta(index *deltaIndex, base, target plumbing.EncodedObject) (plumbing.EncodedObject, error) { +func getDelta(index *deltaIndex, base, target plumbing.EncodedObject) (o plumbing.EncodedObject, err error) { br, err := base.Reader() if err != nil { return nil, err } - defer br.Close() + + defer ioutil.CheckClose(br, &err) + tr, err := target.Reader() if err != nil { return nil, err } - defer tr.Close() + + defer ioutil.CheckClose(tr, &err) bb := bufPool.Get().(*bytes.Buffer) defer bufPool.Put(bb) diff --git a/vendor/github.com/go-git/go-git/v5/plumbing/format/packfile/encoder.go b/vendor/github.com/go-git/go-git/v5/plumbing/format/packfile/encoder.go index 65fae523a..5501f8861 100644 --- a/vendor/github.com/go-git/go-git/v5/plumbing/format/packfile/encoder.go +++ b/vendor/github.com/go-git/go-git/v5/plumbing/format/packfile/encoder.go @@ -9,6 +9,7 @@ import ( "github.com/go-git/go-git/v5/plumbing" "github.com/go-git/go-git/v5/plumbing/storer" "github.com/go-git/go-git/v5/utils/binary" + "github.com/go-git/go-git/v5/utils/ioutil" ) // Encoder gets the data from the storage and write it into the writer in PACK @@ -80,7 +81,7 @@ func (e *Encoder) head(numEntries int) error { ) } -func (e *Encoder) entry(o *ObjectToPack) error { +func (e *Encoder) entry(o *ObjectToPack) (err error) { if o.WantWrite() { // A cycle exists in this delta chain. This should only occur if a // selected object representation disappeared during writing @@ -119,17 +120,22 @@ func (e *Encoder) entry(o *ObjectToPack) error { } e.zw.Reset(e.w) + + defer ioutil.CheckClose(e.zw, &err) + or, err := o.Object.Reader() if err != nil { return err } + defer ioutil.CheckClose(or, &err) + _, err = io.Copy(e.zw, or) if err != nil { return err } - return e.zw.Close() + return nil } func (e *Encoder) writeBaseIfDelta(o *ObjectToPack) error { diff --git a/vendor/github.com/go-git/go-git/v5/plumbing/format/packfile/packfile.go b/vendor/github.com/go-git/go-git/v5/plumbing/format/packfile/packfile.go index d06004197..ddd7f62fc 100644 --- a/vendor/github.com/go-git/go-git/v5/plumbing/format/packfile/packfile.go +++ b/vendor/github.com/go-git/go-git/v5/plumbing/format/packfile/packfile.go @@ -10,6 +10,7 @@ import ( "github.com/go-git/go-git/v5/plumbing/cache" "github.com/go-git/go-git/v5/plumbing/format/idxfile" "github.com/go-git/go-git/v5/plumbing/storer" + "github.com/go-git/go-git/v5/utils/ioutil" ) var ( @@ -307,12 +308,14 @@ func (p *Packfile) getNextMemoryObject(h *ObjectHeader) (plumbing.EncodedObject, return obj, nil } -func (p *Packfile) fillRegularObjectContent(obj plumbing.EncodedObject) error { +func (p *Packfile) fillRegularObjectContent(obj plumbing.EncodedObject) (err error) { w, err := obj.Writer() if err != nil { return err } + defer ioutil.CheckClose(w, &err) + _, _, err = p.s.NextObject(w) p.cachePut(obj) diff --git a/vendor/github.com/go-git/go-git/v5/plumbing/format/packfile/parser.go b/vendor/github.com/go-git/go-git/v5/plumbing/format/packfile/parser.go index d411c5b57..4b5a5708c 100644 --- a/vendor/github.com/go-git/go-git/v5/plumbing/format/packfile/parser.go +++ b/vendor/github.com/go-git/go-git/v5/plumbing/format/packfile/parser.go @@ -4,11 +4,12 @@ import ( "bytes" "errors" "io" - "io/ioutil" + stdioutil "io/ioutil" "github.com/go-git/go-git/v5/plumbing" "github.com/go-git/go-git/v5/plumbing/cache" "github.com/go-git/go-git/v5/plumbing/storer" + "github.com/go-git/go-git/v5/utils/ioutil" ) var ( @@ -283,7 +284,7 @@ func (p *Parser) resolveDeltas() error { if !obj.IsDelta() && len(obj.Children) > 0 { for _, child := range obj.Children { - if err := p.resolveObject(ioutil.Discard, child, content); err != nil { + if err := p.resolveObject(stdioutil.Discard, child, content); err != nil { return err } } @@ -298,7 +299,7 @@ func (p *Parser) resolveDeltas() error { return nil } -func (p *Parser) get(o *objectInfo, buf *bytes.Buffer) error { +func (p *Parser) get(o *objectInfo, buf *bytes.Buffer) (err error) { if !o.ExternalRef { // skip cache check for placeholder parents b, ok := p.cache.Get(o.Offset) if ok { @@ -310,17 +311,21 @@ func (p *Parser) get(o *objectInfo, buf *bytes.Buffer) error { // If it's not on the cache and is not a delta we can try to find it in the // storage, if there's one. External refs must enter here. if p.storage != nil && !o.Type.IsDelta() { - e, err := p.storage.EncodedObject(plumbing.AnyObject, o.SHA1) + var e plumbing.EncodedObject + e, err = p.storage.EncodedObject(plumbing.AnyObject, o.SHA1) if err != nil { return err } o.Type = e.Type() - r, err := e.Reader() + var r io.ReadCloser + r, err = e.Reader() if err != nil { return err } + defer ioutil.CheckClose(r, &err) + _, err = buf.ReadFrom(io.LimitReader(r, e.Size())) return err } diff --git a/vendor/github.com/go-git/go-git/v5/plumbing/format/packfile/patch_delta.go b/vendor/github.com/go-git/go-git/v5/plumbing/format/packfile/patch_delta.go index 57c9da7ce..1dc8b8b00 100644 --- a/vendor/github.com/go-git/go-git/v5/plumbing/format/packfile/patch_delta.go +++ b/vendor/github.com/go-git/go-git/v5/plumbing/format/packfile/patch_delta.go @@ -6,6 +6,7 @@ import ( "io" "github.com/go-git/go-git/v5/plumbing" + "github.com/go-git/go-git/v5/utils/ioutil" ) // See https://github.com/git/git/blob/49fa3dc76179e04b0833542fa52d0f287a4955ac/delta.h @@ -16,17 +17,21 @@ import ( const deltaSizeMin = 4 // ApplyDelta writes to target the result of applying the modification deltas in delta to base. -func ApplyDelta(target, base plumbing.EncodedObject, delta []byte) error { +func ApplyDelta(target, base plumbing.EncodedObject, delta []byte) (err error) { r, err := base.Reader() if err != nil { return err } + defer ioutil.CheckClose(r, &err) + w, err := target.Writer() if err != nil { return err } + defer ioutil.CheckClose(w, &err) + buf := bufPool.Get().(*bytes.Buffer) defer bufPool.Put(buf) buf.Reset() diff --git a/vendor/github.com/go-git/go-git/v5/plumbing/hash.go b/vendor/github.com/go-git/go-git/v5/plumbing/hash.go index 637a4252a..afc602a9e 100644 --- a/vendor/github.com/go-git/go-git/v5/plumbing/hash.go +++ b/vendor/github.com/go-git/go-git/v5/plumbing/hash.go @@ -71,3 +71,13 @@ type HashSlice []Hash func (p HashSlice) Len() int { return len(p) } func (p HashSlice) Less(i, j int) bool { return bytes.Compare(p[i][:], p[j][:]) < 0 } func (p HashSlice) Swap(i, j int) { p[i], p[j] = p[j], p[i] } + +// IsHash returns true if the given string is a valid hash. +func IsHash(s string) bool { + if len(s) != 40 { + return false + } + + _, err := hex.DecodeString(s) + return err == nil +} diff --git a/vendor/github.com/go-git/go-git/v5/plumbing/object/change.go b/vendor/github.com/go-git/go-git/v5/plumbing/object/change.go index 4474905e0..c9d161508 100644 --- a/vendor/github.com/go-git/go-git/v5/plumbing/object/change.go +++ b/vendor/github.com/go-git/go-git/v5/plumbing/object/change.go @@ -18,7 +18,7 @@ type Change struct { To ChangeEntry } -var empty = ChangeEntry{} +var empty ChangeEntry // Action returns the kind of action represented by the change, an // insertion, a deletion or a modification. @@ -27,9 +27,11 @@ func (c *Change) Action() (merkletrie.Action, error) { return merkletrie.Action(0), fmt.Errorf("malformed change: empty from and to") } + if c.From == empty { return merkletrie.Insert, nil } + if c.To == empty { return merkletrie.Delete, nil } diff --git a/vendor/github.com/go-git/go-git/v5/plumbing/object/commit.go b/vendor/github.com/go-git/go-git/v5/plumbing/object/commit.go index b37ff61d3..113cb29e5 100644 --- a/vendor/github.com/go-git/go-git/v5/plumbing/object/commit.go +++ b/vendor/github.com/go-git/go-git/v5/plumbing/object/commit.go @@ -78,21 +78,30 @@ func (c *Commit) Tree() (*Tree, error) { // PatchContext returns the Patch between the actual commit and the provided one. // Error will be return if context expires. Provided context must be non-nil. +// +// NOTE: Since version 5.1.0 the renames are correctly handled, the settings +// used are the recommended options DefaultDiffTreeOptions. func (c *Commit) PatchContext(ctx context.Context, to *Commit) (*Patch, error) { fromTree, err := c.Tree() if err != nil { return nil, err } - toTree, err := to.Tree() - if err != nil { - return nil, err + var toTree *Tree + if to != nil { + toTree, err = to.Tree() + if err != nil { + return nil, err + } } return fromTree.PatchContext(ctx, toTree) } // Patch returns the Patch between the actual commit and the provided one. +// +// NOTE: Since version 5.1.0 the renames are correctly handled, the settings +// used are the recommended options DefaultDiffTreeOptions. func (c *Commit) Patch(to *Commit) (*Patch, error) { return c.PatchContext(context.Background(), to) } diff --git a/vendor/github.com/go-git/go-git/v5/plumbing/object/difftree.go b/vendor/github.com/go-git/go-git/v5/plumbing/object/difftree.go index 72411a590..7c2222702 100644 --- a/vendor/github.com/go-git/go-git/v5/plumbing/object/difftree.go +++ b/vendor/github.com/go-git/go-git/v5/plumbing/object/difftree.go @@ -10,14 +10,62 @@ import ( // DiffTree compares the content and mode of the blobs found via two // tree objects. +// DiffTree does not perform rename detection, use DiffTreeWithOptions +// instead to detect renames. func DiffTree(a, b *Tree) (Changes, error) { return DiffTreeContext(context.Background(), a, b) } -// DiffTree compares the content and mode of the blobs found via two +// DiffTreeContext compares the content and mode of the blobs found via two // tree objects. Provided context must be non-nil. -// An error will be return if context expires +// An error will be returned if context expires. func DiffTreeContext(ctx context.Context, a, b *Tree) (Changes, error) { + return DiffTreeWithOptions(ctx, a, b, nil) +} + +// DiffTreeOptions are the configurable options when performing a diff tree. +type DiffTreeOptions struct { + // DetectRenames is whether the diff tree will use rename detection. + DetectRenames bool + // RenameScore is the threshold to of similarity between files to consider + // that a pair of delete and insert are a rename. The number must be + // exactly between 0 and 100. + RenameScore uint + // RenameLimit is the maximum amount of files that can be compared when + // detecting renames. The number of comparisons that have to be performed + // is equal to the number of deleted files * the number of added files. + // That means, that if 100 files were deleted and 50 files were added, 5000 + // file comparisons may be needed. So, if the rename limit is 50, the number + // of both deleted and added needs to be equal or less than 50. + // A value of 0 means no limit. + RenameLimit uint + // OnlyExactRenames performs only detection of exact renames and will not perform + // any detection of renames based on file similarity. + OnlyExactRenames bool +} + +// DefaultDiffTreeOptions are the default and recommended options for the +// diff tree. +var DefaultDiffTreeOptions = &DiffTreeOptions{ + DetectRenames: true, + RenameScore: 60, + RenameLimit: 0, + OnlyExactRenames: false, +} + +// DiffTreeWithOptions compares the content and mode of the blobs found +// via two tree objects with the given options. The provided context +// must be non-nil. +// If no options are passed, no rename detection will be performed. The +// recommended options are DefaultDiffTreeOptions. +// An error will be returned if the context expires. +// This function will be deprecated and removed in v6 so the default +// behaviour of DiffTree is to detect renames. +func DiffTreeWithOptions( + ctx context.Context, + a, b *Tree, + opts *DiffTreeOptions, +) (Changes, error) { from := NewTreeRootNode(a) to := NewTreeRootNode(b) @@ -33,5 +81,18 @@ func DiffTreeContext(ctx context.Context, a, b *Tree) (Changes, error) { return nil, err } - return newChanges(merkletrieChanges) + changes, err := newChanges(merkletrieChanges) + if err != nil { + return nil, err + } + + if opts == nil { + opts = new(DiffTreeOptions) + } + + if opts.DetectRenames { + return DetectRenames(changes, opts) + } + + return changes, nil } diff --git a/vendor/github.com/go-git/go-git/v5/plumbing/object/patch.go b/vendor/github.com/go-git/go-git/v5/plumbing/object/patch.go index be1e60927..1135a40a4 100644 --- a/vendor/github.com/go-git/go-git/v5/plumbing/object/patch.go +++ b/vendor/github.com/go-git/go-git/v5/plumbing/object/patch.go @@ -115,7 +115,7 @@ func fileContent(f *File) (content string, isBinary bool, err error) { return } -// textPatch is an implementation of fdiff.Patch interface +// Patch is an implementation of fdiff.Patch interface type Patch struct { message string filePatches []fdiff.FilePatch diff --git a/vendor/github.com/go-git/go-git/v5/plumbing/object/tree.go b/vendor/github.com/go-git/go-git/v5/plumbing/object/tree.go index d3c8c77d1..5e6378ca4 100644 --- a/vendor/github.com/go-git/go-git/v5/plumbing/object/tree.go +++ b/vendor/github.com/go-git/go-git/v5/plumbing/object/tree.go @@ -304,29 +304,34 @@ func (t *Tree) buildMap() { } // Diff returns a list of changes between this tree and the provided one -func (from *Tree) Diff(to *Tree) (Changes, error) { - return DiffTree(from, to) +func (t *Tree) Diff(to *Tree) (Changes, error) { + return t.DiffContext(context.Background(), to) } -// Diff returns a list of changes between this tree and the provided one -// Error will be returned if context expires -// Provided context must be non nil -func (from *Tree) DiffContext(ctx context.Context, to *Tree) (Changes, error) { - return DiffTreeContext(ctx, from, to) +// DiffContext returns a list of changes between this tree and the provided one +// Error will be returned if context expires. Provided context must be non nil. +// +// NOTE: Since version 5.1.0 the renames are correctly handled, the settings +// used are the recommended options DefaultDiffTreeOptions. +func (t *Tree) DiffContext(ctx context.Context, to *Tree) (Changes, error) { + return DiffTreeWithOptions(ctx, t, to, DefaultDiffTreeOptions) } // Patch returns a slice of Patch objects with all the changes between trees // in chunks. This representation can be used to create several diff outputs. -func (from *Tree) Patch(to *Tree) (*Patch, error) { - return from.PatchContext(context.Background(), to) +func (t *Tree) Patch(to *Tree) (*Patch, error) { + return t.PatchContext(context.Background(), to) } -// Patch returns a slice of Patch objects with all the changes between trees -// in chunks. This representation can be used to create several diff outputs. -// If context expires, an error will be returned -// Provided context must be non-nil -func (from *Tree) PatchContext(ctx context.Context, to *Tree) (*Patch, error) { - changes, err := DiffTreeContext(ctx, from, to) +// PatchContext returns a slice of Patch objects with all the changes between +// trees in chunks. This representation can be used to create several diff +// outputs. If context expires, an error will be returned. Provided context must +// be non-nil. +// +// NOTE: Since version 5.1.0 the renames are correctly handled, the settings +// used are the recommended options DefaultDiffTreeOptions. +func (t *Tree) PatchContext(ctx context.Context, to *Tree) (*Patch, error) { + changes, err := t.DiffContext(ctx, to) if err != nil { return nil, err } diff --git a/vendor/github.com/go-git/go-git/v5/plumbing/protocol/packp/advrefs.go b/vendor/github.com/go-git/go-git/v5/plumbing/protocol/packp/advrefs.go index ab286c638..1bd724cad 100644 --- a/vendor/github.com/go-git/go-git/v5/plumbing/protocol/packp/advrefs.go +++ b/vendor/github.com/go-git/go-git/v5/plumbing/protocol/packp/advrefs.go @@ -201,3 +201,11 @@ func (a *AdvRefs) addSymbolicRefs(s storer.ReferenceStorer) error { func (a *AdvRefs) supportSymrefs() bool { return a.Capabilities.Supports(capability.SymRef) } + +// IsEmpty returns true if doesn't contain any reference. +func (a *AdvRefs) IsEmpty() bool { + return a.Head == nil && + len(a.References) == 0 && + len(a.Peeled) == 0 && + len(a.Shallows) == 0 +} diff --git a/vendor/github.com/go-git/go-git/v5/plumbing/transport/internal/common/common.go b/vendor/github.com/go-git/go-git/v5/plumbing/transport/internal/common/common.go index d564d25a6..89432e34c 100644 --- a/vendor/github.com/go-git/go-git/v5/plumbing/transport/internal/common/common.go +++ b/vendor/github.com/go-git/go-git/v5/plumbing/transport/internal/common/common.go @@ -175,6 +175,13 @@ func (s *session) AdvertisedReferences() (*packp.AdvRefs, error) { } } + // Some servers like jGit, announce capabilities instead of returning an + // packp message with a flush. This verifies that we received a empty + // adv-refs, even it contains capabilities. + if !s.isReceivePack && ar.IsEmpty() { + return nil, transport.ErrEmptyRemoteRepository + } + transport.FilterUnsupportedCapabilities(ar.Capabilities) s.advRefs = ar return ar, nil diff --git a/vendor/github.com/go-git/go-git/v5/plumbing/transport/server/server.go b/vendor/github.com/go-git/go-git/v5/plumbing/transport/server/server.go index 71845e3bb..727f90215 100644 --- a/vendor/github.com/go-git/go-git/v5/plumbing/transport/server/server.go +++ b/vendor/github.com/go-git/go-git/v5/plumbing/transport/server/server.go @@ -243,11 +243,13 @@ func (s *rpSession) ReceivePack(ctx context.Context, req *packp.ReferenceUpdateR //TODO: Implement 'atomic' update of references. - r := ioutil.NewContextReadCloser(ctx, req.Packfile) - if err := s.writePackfile(r); err != nil { - s.unpackErr = err - s.firstErr = err - return s.reportStatus(), err + if req.Packfile != nil { + r := ioutil.NewContextReadCloser(ctx, req.Packfile) + if err := s.writePackfile(r); err != nil { + s.unpackErr = err + s.firstErr = err + return s.reportStatus(), err + } } s.updateReferences(req) diff --git a/vendor/github.com/go-git/go-git/v5/remote.go b/vendor/github.com/go-git/go-git/v5/remote.go index 242df0d44..e642c5729 100644 --- a/vendor/github.com/go-git/go-git/v5/remote.go +++ b/vendor/github.com/go-git/go-git/v5/remote.go @@ -29,6 +29,7 @@ var ( NoErrAlreadyUpToDate = errors.New("already up-to-date") ErrDeleteRefNotSupported = errors.New("server does not support delete-refs") ErrForceNeeded = errors.New("some refs were not updated") + ErrExactSHA1NotSupported = errors.New("server does not support exact SHA1 refspec") ) const ( @@ -122,6 +123,15 @@ func (r *Remote) PushContext(ctx context.Context, o *PushOptions) (err error) { return ErrDeleteRefNotSupported } + if o.Force { + for i := 0; i < len(o.RefSpecs); i++ { + rs := &o.RefSpecs[i] + if !rs.IsForceUpdate() { + o.RefSpecs[i] = config.RefSpec("+" + rs.String()) + } + } + } + localRefs, err := r.references() if err != nil { return err @@ -303,6 +313,10 @@ func (r *Remote) fetch(ctx context.Context, o *FetchOptions) (sto storer.Referen return nil, err } + if err := r.isSupportedRefSpec(o.RefSpecs, ar); err != nil { + return nil, err + } + remoteRefs, err := ar.AllReferences() if err != nil { return nil, err @@ -546,6 +560,7 @@ func (r *Remote) addReferenceIfRefSpecMatches(rs config.RefSpec, func (r *Remote) references() ([]*plumbing.Reference, error) { var localRefs []*plumbing.Reference + iter, err := r.s.IterReferences() if err != nil { return nil, err @@ -701,6 +716,11 @@ func doCalculateRefs( return err } + if s.IsExactSHA1() { + ref := plumbing.NewHashReference(s.Dst(""), plumbing.NewHash(s.Src())) + return refs.SetReference(ref) + } + var matched bool err = iter.ForEach(func(ref *plumbing.Reference) error { if !s.Match(ref.Name()) { @@ -850,6 +870,26 @@ func (r *Remote) newUploadPackRequest(o *FetchOptions, return req, nil } +func (r *Remote) isSupportedRefSpec(refs []config.RefSpec, ar *packp.AdvRefs) error { + var containsIsExact bool + for _, ref := range refs { + if ref.IsExactSHA1() { + containsIsExact = true + } + } + + if !containsIsExact { + return nil + } + + if ar.Capabilities.Supports(capability.AllowReachableSHA1InWant) || + ar.Capabilities.Supports(capability.AllowTipSHA1InWant) { + return nil + } + + return ErrExactSHA1NotSupported +} + func buildSidebandIfSupported(l *capability.List, reader io.Reader, p sideband.Progress) io.Reader { var t sideband.Type @@ -883,7 +923,7 @@ func (r *Remote) updateLocalReferenceStorage( } for _, ref := range fetchedRefs { - if !spec.Match(ref.Name()) { + if !spec.Match(ref.Name()) && !spec.IsExactSHA1() { continue } diff --git a/vendor/github.com/go-git/go-git/v5/repository.go b/vendor/github.com/go-git/go-git/v5/repository.go index c83a13603..47318d113 100644 --- a/vendor/github.com/go-git/go-git/v5/repository.go +++ b/vendor/github.com/go-git/go-git/v5/repository.go @@ -13,7 +13,6 @@ import ( "strings" "time" - "golang.org/x/crypto/openpgp" "github.com/go-git/go-git/v5/config" "github.com/go-git/go-git/v5/internal/revision" "github.com/go-git/go-git/v5/plumbing" @@ -24,6 +23,8 @@ import ( "github.com/go-git/go-git/v5/storage" "github.com/go-git/go-git/v5/storage/filesystem" "github.com/go-git/go-git/v5/utils/ioutil" + "github.com/imdario/mergo" + "golang.org/x/crypto/openpgp" "github.com/go-git/go-billy/v5" "github.com/go-git/go-billy/v5/osfs" @@ -155,7 +156,7 @@ func setConfigWorktree(r *Repository, worktree, storage billy.Filesystem) error return nil } - cfg, err := r.Storer.Config() + cfg, err := r.Config() if err != nil { return err } @@ -434,14 +435,56 @@ func cleanUpDir(path string, all bool) error { return err } -// Config return the repository config +// Config return the repository config. In a filesystem backed repository this +// means read the `.git/config`. func (r *Repository) Config() (*config.Config, error) { return r.Storer.Config() } +// SetConfig marshall and writes the repository config. In a filesystem backed +// repository this means write the `.git/config`. This function should be called +// with the result of `Repository.Config` and never with the output of +// `Repository.ConfigScoped`. +func (r *Repository) SetConfig(cfg *config.Config) error { + return r.Storer.SetConfig(cfg) +} + +// ConfigScoped returns the repository config, merged with requested scope and +// lower. For example if, config.GlobalScope is given the local and global config +// are returned merged in one config value. +func (r *Repository) ConfigScoped(scope config.Scope) (*config.Config, error) { + // TODO(mcuadros): v6, add this as ConfigOptions.Scoped + + var err error + system := config.NewConfig() + if scope >= config.SystemScope { + system, err = config.LoadConfig(config.SystemScope) + if err != nil { + return nil, err + } + } + + global := config.NewConfig() + if scope >= config.GlobalScope { + global, err = config.LoadConfig(config.GlobalScope) + if err != nil { + return nil, err + } + } + + local, err := r.Storer.Config() + if err != nil { + return nil, err + } + + _ = mergo.Merge(global, system) + _ = mergo.Merge(local, global) + return local, nil +} + // Remote return a remote if exists func (r *Repository) Remote(name string) (*Remote, error) { - cfg, err := r.Storer.Config() + cfg, err := r.Config() if err != nil { return nil, err } @@ -456,7 +499,7 @@ func (r *Repository) Remote(name string) (*Remote, error) { // Remotes returns a list with all the remotes func (r *Repository) Remotes() ([]*Remote, error) { - cfg, err := r.Storer.Config() + cfg, err := r.Config() if err != nil { return nil, err } @@ -480,7 +523,7 @@ func (r *Repository) CreateRemote(c *config.RemoteConfig) (*Remote, error) { remote := NewRemote(r.Storer, c) - cfg, err := r.Storer.Config() + cfg, err := r.Config() if err != nil { return nil, err } @@ -511,7 +554,7 @@ func (r *Repository) CreateRemoteAnonymous(c *config.RemoteConfig) (*Remote, err // DeleteRemote delete a remote from the repository and delete the config func (r *Repository) DeleteRemote(name string) error { - cfg, err := r.Storer.Config() + cfg, err := r.Config() if err != nil { return err } @@ -526,7 +569,7 @@ func (r *Repository) DeleteRemote(name string) error { // Branch return a Branch if exists func (r *Repository) Branch(name string) (*config.Branch, error) { - cfg, err := r.Storer.Config() + cfg, err := r.Config() if err != nil { return nil, err } @@ -545,7 +588,7 @@ func (r *Repository) CreateBranch(c *config.Branch) error { return err } - cfg, err := r.Storer.Config() + cfg, err := r.Config() if err != nil { return err } @@ -560,7 +603,7 @@ func (r *Repository) CreateBranch(c *config.Branch) error { // DeleteBranch delete a Branch from the repository and delete the config func (r *Repository) DeleteBranch(name string) error { - cfg, err := r.Storer.Config() + cfg, err := r.Config() if err != nil { return err } @@ -835,7 +878,7 @@ func (r *Repository) cloneRefSpec(o *CloneOptions) []config.RefSpec { } func (r *Repository) setIsBare(isBare bool) error { - cfg, err := r.Storer.Config() + cfg, err := r.Config() if err != nil { return err } @@ -851,7 +894,7 @@ func (r *Repository) updateRemoteConfigIfNeeded(o *CloneOptions, c *config.Remot c.Fetch = r.cloneRefSpec(o) - cfg, err := r.Storer.Config() + cfg, err := r.Config() if err != nil { return err } @@ -1541,7 +1584,7 @@ func (r *Repository) createNewObjectPack(cfg *RepackConfig) (h plumbing.Hash, er return h, err } defer ioutil.CheckClose(wc, &err) - scfg, err := r.Storer.Config() + scfg, err := r.Config() if err != nil { return h, err } diff --git a/vendor/github.com/go-git/go-git/v5/storage/filesystem/config.go b/vendor/github.com/go-git/go-git/v5/storage/filesystem/config.go index 01b35b4e3..78a646465 100644 --- a/vendor/github.com/go-git/go-git/v5/storage/filesystem/config.go +++ b/vendor/github.com/go-git/go-git/v5/storage/filesystem/config.go @@ -1,7 +1,6 @@ package filesystem import ( - stdioutil "io/ioutil" "os" "github.com/go-git/go-git/v5/config" @@ -14,29 +13,17 @@ type ConfigStorage struct { } func (c *ConfigStorage) Config() (conf *config.Config, err error) { - cfg := config.NewConfig() - f, err := c.dir.Config() if err != nil { if os.IsNotExist(err) { - return cfg, nil + return config.NewConfig(), nil } return nil, err } defer ioutil.CheckClose(f, &err) - - b, err := stdioutil.ReadAll(f) - if err != nil { - return nil, err - } - - if err = cfg.Unmarshal(b); err != nil { - return nil, err - } - - return cfg, err + return config.ReadConfig(f) } func (c *ConfigStorage) SetConfig(cfg *config.Config) (err error) { diff --git a/vendor/github.com/go-git/go-git/v5/storage/filesystem/dotgit/dotgit.go b/vendor/github.com/go-git/go-git/v5/storage/filesystem/dotgit/dotgit.go index 3ce9daeda..83c768307 100644 --- a/vendor/github.com/go-git/go-git/v5/storage/filesystem/dotgit/dotgit.go +++ b/vendor/github.com/go-git/go-git/v5/storage/filesystem/dotgit/dotgit.go @@ -57,6 +57,9 @@ var ( // targeting a non-existing object. This usually means the repository // is corrupt. ErrSymRefTargetNotFound = errors.New("symbolic reference target not found") + // ErrIsDir is returned when a reference file is attempting to be read, + // but the path specified is a directory. + ErrIsDir = errors.New("reference path is a directory") ) // Options holds configuration for the storage. @@ -926,6 +929,14 @@ func (d *DotGit) addRefFromHEAD(refs *[]*plumbing.Reference) error { func (d *DotGit) readReferenceFile(path, name string) (ref *plumbing.Reference, err error) { path = d.fs.Join(path, d.fs.Join(strings.Split(name, "/")...)) + st, err := d.fs.Stat(path) + if err != nil { + return nil, err + } + if st.IsDir() { + return nil, ErrIsDir + } + f, err := d.fs.Open(path) if err != nil { return nil, err diff --git a/vendor/github.com/go-git/go-git/v5/storage/filesystem/object.go b/vendor/github.com/go-git/go-git/v5/storage/filesystem/object.go index 862cc1b1a..743717439 100644 --- a/vendor/github.com/go-git/go-git/v5/storage/filesystem/object.go +++ b/vendor/github.com/go-git/go-git/v5/storage/filesystem/object.go @@ -408,6 +408,8 @@ func (s *ObjectStorage) getFromUnpacked(h plumbing.Hash) (obj plumbing.EncodedOb return nil, err } + defer ioutil.CheckClose(w, &err) + s.objectCache.Put(obj) _, err = io.Copy(w, r) diff --git a/vendor/github.com/go-git/go-git/v5/submodule.go b/vendor/github.com/go-git/go-git/v5/submodule.go index 92ccdb1c8..dff26b0d8 100644 --- a/vendor/github.com/go-git/go-git/v5/submodule.go +++ b/vendor/github.com/go-git/go-git/v5/submodule.go @@ -35,7 +35,7 @@ func (s *Submodule) Config() *config.Submodule { // Init initialize the submodule reading the recorded Entry in the index for // the given submodule func (s *Submodule) Init() error { - cfg, err := s.w.r.Storer.Config() + cfg, err := s.w.r.Config() if err != nil { return err } diff --git a/vendor/github.com/go-git/go-git/v5/utils/merkletrie/difftree.go b/vendor/github.com/go-git/go-git/v5/utils/merkletrie/difftree.go index 90d9c958d..bd084b2ab 100644 --- a/vendor/github.com/go-git/go-git/v5/utils/merkletrie/difftree.go +++ b/vendor/github.com/go-git/go-git/v5/utils/merkletrie/difftree.go @@ -23,7 +23,7 @@ package merkletrie // # Cases // -// When comparing noders in both trees you will found yourself in +// When comparing noders in both trees you will find yourself in // one of 169 possible cases, but if we ignore moves, we can // simplify a lot the search space into the following table: // @@ -256,17 +256,21 @@ import ( ) var ( + // ErrCanceled is returned whenever the operation is canceled. ErrCanceled = errors.New("operation canceled") ) // DiffTree calculates the list of changes between two merkletries. It // uses the provided hashEqual callback to compare noders. -func DiffTree(fromTree, toTree noder.Noder, - hashEqual noder.Equal) (Changes, error) { +func DiffTree( + fromTree, + toTree noder.Noder, + hashEqual noder.Equal, +) (Changes, error) { return DiffTreeContext(context.Background(), fromTree, toTree, hashEqual) } -// DiffTree calculates the list of changes between two merkletries. It +// DiffTreeContext calculates the list of changes between two merkletries. It // uses the provided hashEqual callback to compare noders. // Error will be returned if context expires // Provided context must be non nil diff --git a/vendor/github.com/imdario/mergo/map.go b/vendor/github.com/imdario/mergo/map.go index 3f5afa83a..d83258b4d 100644 --- a/vendor/github.com/imdario/mergo/map.go +++ b/vendor/github.com/imdario/mergo/map.go @@ -99,11 +99,11 @@ func deepMap(dst, src reflect.Value, visited map[uintptr]*visit, depth int, conf continue } if srcKind == dstKind { - if err = deepMerge(dstElement, srcElement, visited, depth+1, config); err != nil { + if _, err = deepMerge(dstElement, srcElement, visited, depth+1, config); err != nil { return } } else if dstKind == reflect.Interface && dstElement.Kind() == reflect.Interface { - if err = deepMerge(dstElement, srcElement, visited, depth+1, config); err != nil { + if _, err = deepMerge(dstElement, srcElement, visited, depth+1, config); err != nil { return } } else if srcKind == reflect.Map { @@ -157,7 +157,8 @@ func _map(dst, src interface{}, opts ...func(*Config)) error { // To be friction-less, we redirect equal-type arguments // to deepMerge. Only because arguments can be anything. if vSrc.Kind() == vDst.Kind() { - return deepMerge(vDst, vSrc, make(map[uintptr]*visit), 0, config) + _, err := deepMerge(vDst, vSrc, make(map[uintptr]*visit), 0, config) + return err } switch vSrc.Kind() { case reflect.Struct: diff --git a/vendor/github.com/imdario/mergo/merge.go b/vendor/github.com/imdario/mergo/merge.go index 3fb6c64d0..3332c9c2a 100644 --- a/vendor/github.com/imdario/mergo/merge.go +++ b/vendor/github.com/imdario/mergo/merge.go @@ -11,20 +11,32 @@ package mergo import ( "fmt" "reflect" + "unsafe" ) func hasExportedField(dst reflect.Value) (exported bool) { for i, n := 0, dst.NumField(); i < n; i++ { field := dst.Type().Field(i) - if field.Anonymous && dst.Field(i).Kind() == reflect.Struct { - exported = exported || hasExportedField(dst.Field(i)) - } else { - exported = exported || len(field.PkgPath) == 0 + if isExportedComponent(&field) { + return true } } return } +func isExportedComponent(field *reflect.StructField) bool { + name := field.Name + pkgPath := field.PkgPath + if len(pkgPath) > 0 { + return false + } + c := name[0] + if 'a' <= c && c <= 'z' || c == '_' { + return false + } + return true +} + type Config struct { Overwrite bool AppendSlice bool @@ -41,16 +53,17 @@ type Transformers interface { // Traverses recursively both values, assigning src's fields values to dst. // The map argument tracks comparisons that have already been seen, which allows // short circuiting on recursive types. -func deepMerge(dst, src reflect.Value, visited map[uintptr]*visit, depth int, config *Config) (err error) { +func deepMerge(dstIn, src reflect.Value, visited map[uintptr]*visit, depth int, config *Config) (dst reflect.Value, err error) { + dst = dstIn overwrite := config.Overwrite typeCheck := config.TypeCheck overwriteWithEmptySrc := config.overwriteWithEmptyValue overwriteSliceWithEmptySrc := config.overwriteSliceWithEmptyValue - config.overwriteWithEmptyValue = false if !src.IsValid() { return } + if dst.CanAddr() { addr := dst.UnsafeAddr() h := 17 * addr @@ -58,7 +71,7 @@ func deepMerge(dst, src reflect.Value, visited map[uintptr]*visit, depth int, co typ := dst.Type() for p := seen; p != nil; p = p.next { if p.ptr == addr && p.typ == typ { - return nil + return dst, nil } } // Remember, remember... @@ -72,114 +85,124 @@ func deepMerge(dst, src reflect.Value, visited map[uintptr]*visit, depth int, co } } + if dst.IsValid() && src.IsValid() && src.Type() != dst.Type() { + err = fmt.Errorf("cannot append two different types (%s, %s)", src.Kind(), dst.Kind()) + return + } + switch dst.Kind() { case reflect.Struct: if hasExportedField(dst) { + dstCp := reflect.New(dst.Type()).Elem() for i, n := 0, dst.NumField(); i < n; i++ { - if err = deepMerge(dst.Field(i), src.Field(i), visited, depth+1, config); err != nil { + dstField := dst.Field(i) + structField := dst.Type().Field(i) + // copy un-exported struct fields + if !isExportedComponent(&structField) { + rf := dstCp.Field(i) + rf = reflect.NewAt(rf.Type(), unsafe.Pointer(rf.UnsafeAddr())).Elem() //nolint:gosec + dstRF := dst.Field(i) + if !dst.Field(i).CanAddr() { + continue + } + + dstRF = reflect.NewAt(dstRF.Type(), unsafe.Pointer(dstRF.UnsafeAddr())).Elem() //nolint:gosec + rf.Set(dstRF) + continue + } + dstField, err = deepMerge(dstField, src.Field(i), visited, depth+1, config) + if err != nil { return } + dstCp.Field(i).Set(dstField) + } + + if dst.CanSet() { + dst.Set(dstCp) + } else { + dst = dstCp } + return } else { - if dst.CanSet() && (!isEmptyValue(src) || overwriteWithEmptySrc) && (overwrite || isEmptyValue(dst)) { - dst.Set(src) + if (isReflectNil(dst) || overwrite) && (!isEmptyValue(src) || overwriteWithEmptySrc) { + dst = src } } + case reflect.Map: if dst.IsNil() && !src.IsNil() { - dst.Set(reflect.MakeMap(dst.Type())) + if dst.CanSet() { + dst.Set(reflect.MakeMap(dst.Type())) + } else { + dst = src + return + } } for _, key := range src.MapKeys() { srcElement := src.MapIndex(key) + dstElement := dst.MapIndex(key) if !srcElement.IsValid() { continue } - dstElement := dst.MapIndex(key) - switch srcElement.Kind() { - case reflect.Chan, reflect.Func, reflect.Map, reflect.Interface, reflect.Slice: - if srcElement.IsNil() { - continue - } - fallthrough - default: - if !srcElement.CanInterface() { - continue - } - switch reflect.TypeOf(srcElement.Interface()).Kind() { - case reflect.Struct: - fallthrough - case reflect.Ptr: - fallthrough - case reflect.Map: - srcMapElm := srcElement - dstMapElm := dstElement - if srcMapElm.CanInterface() { - srcMapElm = reflect.ValueOf(srcMapElm.Interface()) - if dstMapElm.IsValid() { - dstMapElm = reflect.ValueOf(dstMapElm.Interface()) - } - } - if err = deepMerge(dstMapElm, srcMapElm, visited, depth+1, config); err != nil { - return - } - case reflect.Slice: - srcSlice := reflect.ValueOf(srcElement.Interface()) - - var dstSlice reflect.Value - if !dstElement.IsValid() || dstElement.IsNil() { - dstSlice = reflect.MakeSlice(srcSlice.Type(), 0, srcSlice.Len()) - } else { - dstSlice = reflect.ValueOf(dstElement.Interface()) - } - - if (!isEmptyValue(src) || overwriteWithEmptySrc || overwriteSliceWithEmptySrc) && (overwrite || isEmptyValue(dst)) && !config.AppendSlice { - if typeCheck && srcSlice.Type() != dstSlice.Type() { - return fmt.Errorf("cannot override two slices with different type (%s, %s)", srcSlice.Type(), dstSlice.Type()) - } - dstSlice = srcSlice - } else if config.AppendSlice { - if srcSlice.Type() != dstSlice.Type() { - return fmt.Errorf("cannot append two slices with different type (%s, %s)", srcSlice.Type(), dstSlice.Type()) - } - dstSlice = reflect.AppendSlice(dstSlice, srcSlice) - } - dst.SetMapIndex(key, dstSlice) + if dst.MapIndex(key).IsValid() { + k := dstElement.Interface() + dstElement = reflect.ValueOf(k) + } + if isReflectNil(srcElement) { + if overwrite || isReflectNil(dstElement) { + dst.SetMapIndex(key, srcElement) } + continue } - if dstElement.IsValid() && !isEmptyValue(dstElement) && (reflect.TypeOf(srcElement.Interface()).Kind() == reflect.Map || reflect.TypeOf(srcElement.Interface()).Kind() == reflect.Slice) { + if !srcElement.CanInterface() { continue } - if srcElement.IsValid() && ((srcElement.Kind() != reflect.Ptr && overwrite) || !dstElement.IsValid() || isEmptyValue(dstElement)) { - if dst.IsNil() { - dst.Set(reflect.MakeMap(dst.Type())) + if srcElement.CanInterface() { + srcElement = reflect.ValueOf(srcElement.Interface()) + if dstElement.IsValid() { + dstElement = reflect.ValueOf(dstElement.Interface()) } - dst.SetMapIndex(key, srcElement) } + dstElement, err = deepMerge(dstElement, srcElement, visited, depth+1, config) + if err != nil { + return + } + dst.SetMapIndex(key, dstElement) + } case reflect.Slice: - if !dst.CanSet() { - break - } + newSlice := dst if (!isEmptyValue(src) || overwriteWithEmptySrc || overwriteSliceWithEmptySrc) && (overwrite || isEmptyValue(dst)) && !config.AppendSlice { - dst.Set(src) + if typeCheck && src.Type() != dst.Type() { + return dst, fmt.Errorf("cannot override two slices with different type (%s, %s)", src.Type(), dst.Type()) + } + newSlice = src } else if config.AppendSlice { - if src.Type() != dst.Type() { - return fmt.Errorf("cannot append two slice with different type (%s, %s)", src.Type(), dst.Type()) + if typeCheck && src.Type() != dst.Type() { + err = fmt.Errorf("cannot append two slice with different type (%s, %s)", src.Type(), dst.Type()) + return } - dst.Set(reflect.AppendSlice(dst, src)) + newSlice = reflect.AppendSlice(dst, src) } - case reflect.Ptr: - fallthrough - case reflect.Interface: - if src.IsNil() { + if dst.CanSet() { + dst.Set(newSlice) + } else { + dst = newSlice + } + case reflect.Ptr, reflect.Interface: + if isReflectNil(src) { break } if dst.Kind() != reflect.Ptr && src.Type().AssignableTo(dst.Type()) { if dst.IsNil() || overwrite { - if dst.CanSet() && (overwrite || isEmptyValue(dst)) { - dst.Set(src) + if overwrite || isEmptyValue(dst) { + if dst.CanSet() { + dst.Set(src) + } else { + dst = src + } } } break @@ -191,28 +214,38 @@ func deepMerge(dst, src reflect.Value, visited map[uintptr]*visit, depth int, co dst.Set(src) } } else if src.Kind() == reflect.Ptr { - if err = deepMerge(dst.Elem(), src.Elem(), visited, depth+1, config); err != nil { + if dst, err = deepMerge(dst.Elem(), src.Elem(), visited, depth+1, config); err != nil { return } + dst = dst.Addr() } else if dst.Elem().Type() == src.Type() { - if err = deepMerge(dst.Elem(), src, visited, depth+1, config); err != nil { + if dst, err = deepMerge(dst.Elem(), src, visited, depth+1, config); err != nil { return } } else { - return ErrDifferentArgumentsTypes + return dst, ErrDifferentArgumentsTypes } break } if dst.IsNil() || overwrite { - if dst.CanSet() && (overwrite || isEmptyValue(dst)) { - dst.Set(src) + if (overwrite || isEmptyValue(dst)) && (overwriteWithEmptySrc || !isEmptyValue(src)) { + if dst.CanSet() { + dst.Set(src) + } else { + dst = src + } } - } else if err = deepMerge(dst.Elem(), src.Elem(), visited, depth+1, config); err != nil { + } else if _, err = deepMerge(dst.Elem(), src.Elem(), visited, depth+1, config); err != nil { return } default: - if dst.CanSet() && (!isEmptyValue(src) || overwriteWithEmptySrc) && (overwrite || isEmptyValue(dst)) { - dst.Set(src) + overwriteFull := (!isEmptyValue(src) || overwriteWithEmptySrc) && (overwrite || isEmptyValue(dst)) + if overwriteFull { + if dst.CanSet() { + dst.Set(src) + } else { + dst = src + } } } @@ -246,7 +279,12 @@ func WithOverride(config *Config) { config.Overwrite = true } -// WithOverride will make merge override empty dst slice with empty src slice. +// WithOverwriteWithEmptyValue will make merge override non empty dst attributes with empty src attributes values. +func WithOverwriteWithEmptyValue(config *Config) { + config.overwriteWithEmptyValue = true +} + +// WithOverrideEmptySlice will make merge override empty dst slice with empty src slice. func WithOverrideEmptySlice(config *Config) { config.overwriteSliceWithEmptyValue = true } @@ -276,8 +314,25 @@ func merge(dst, src interface{}, opts ...func(*Config)) error { if vDst, vSrc, err = resolveValues(dst, src); err != nil { return err } + if !vDst.CanSet() { + return fmt.Errorf("cannot set dst, needs reference") + } if vDst.Type() != vSrc.Type() { return ErrDifferentArgumentsTypes } - return deepMerge(vDst, vSrc, make(map[uintptr]*visit), 0, config) + _, err = deepMerge(vDst, vSrc, make(map[uintptr]*visit), 0, config) + return err +} + +// IsReflectNil is the reflect value provided nil +func isReflectNil(v reflect.Value) bool { + k := v.Kind() + switch k { + case reflect.Interface, reflect.Slice, reflect.Chan, reflect.Func, reflect.Map, reflect.Ptr: + // Both interface and slice are nil if first word is 0. + // Both are always bigger than a word; assume flagIndir. + return v.IsNil() + default: + return false + } } diff --git a/vendor/github.com/journeymidnight/radoshttpd/rados/striper.go b/vendor/github.com/journeymidnight/radoshttpd/rados/striper.go index fda7c54a4..90806d110 100644 --- a/vendor/github.com/journeymidnight/radoshttpd/rados/striper.go +++ b/vendor/github.com/journeymidnight/radoshttpd/rados/striper.go @@ -58,7 +58,7 @@ func (sp *StriperPool) State(oid string) (uint64,uint64, error) { func (sp *StriperPool) Truncate(oid string, offset uint64) error{ c_oid := C.CString(oid) defer C.free(unsafe.Pointer(c_oid)) - ret := C.rados_striper_trunc(sp.ioctx, c_oid, C.uint64_t(offset)) + ret := C.rados_striper_trunc(sp.striper, c_oid, C.uint64_t(offset)) if ret < 0 { return RadosError(int(ret)) } diff --git a/vendor/github.com/mattn/go-ieproxy/proxyMiddleman_unix.go b/vendor/github.com/mattn/go-ieproxy/proxyMiddleman_unix.go index 7ddbe2ed2..d0b16ec28 100644 --- a/vendor/github.com/mattn/go-ieproxy/proxyMiddleman_unix.go +++ b/vendor/github.com/mattn/go-ieproxy/proxyMiddleman_unix.go @@ -1,4 +1,4 @@ -//+build darwin unix linux +// +build !windows package ieproxy diff --git a/vendor/github.com/micro/go-micro/v2/README.md b/vendor/github.com/micro/go-micro/v2/README.md index 491c42db3..a28793d82 100644 --- a/vendor/github.com/micro/go-micro/v2/README.md +++ b/vendor/github.com/micro/go-micro/v2/README.md @@ -1,22 +1,26 @@ -# Go Micro [![License](https://img.shields.io/:license-apache-blue.svg)](https://opensource.org/licenses/Apache-2.0) [![Go.Dev reference](https://img.shields.io/badge/go.dev-reference-007d9c?logo=go&logoColor=white&style=flat-square)](https://pkg.go.dev/github.com/micro/go-micro?tab=doc) [![Travis CI](https://api.travis-ci.org/micro/go-micro.svg?branch=master)](https://travis-ci.org/micro/go-micro) [![Go Report Card](https://goreportcard.com/badge/micro/go-micro)](https://goreportcard.com/report/github.com/micro/go-micro) +# Go Micro [![License](https://img.shields.io/:license-apache-blue.svg)](https://opensource.org/licenses/Apache-2.0) [![Go.Dev reference](https://img.shields.io/badge/go.dev-reference-007d9c?logo=go&logoColor=white&style=flat-square)](https://pkg.go.dev/github.com/micro/go-micro?tab=doc) [![Travis CI](https://api.travis-ci.org/micro/go-micro.svg?branch=master)](https://travis-ci.org/micro/go-micro) [![Go Report Card](https://goreportcard.com/badge/micro/go-micro)](https://goreportcard.com/report/github.com/micro/go-micro) Go Micro is a framework for distributed systems development. ## Overview Go Micro provides the core requirements for distributed systems development including RPC and Event driven communication. -The **micro** philosophy is sane defaults with a pluggable architecture. We provide defaults to get you started quickly +The **Micro** philosophy is sane defaults with a pluggable architecture. We provide defaults to get you started quickly but everything can be easily swapped out. - +## Features -Plugins are available at [github.com/micro/go-plugins](https://github.com/micro/go-plugins). +Go Micro abstracts away the details of distributed systems. Here are the main features. -Follow us on [Twitter](https://twitter.com/microhq) or join the [Community](https://micro.mu/slack). +- **Authentication** - Auth is built in as a first class citizen. Authentication and authorization enable secure +zero trust networking by providing every service an identity and certificates. This additionally includes rule +based access control. -## Features +- **Dynamic Config** - Load and hot reload dynamic config from anywhere. The config interface provides a way to load application +level config from any source such as env vars, file, etcd. You can merge the sources and even define fallbacks. -Go Micro abstracts away the details of distributed systems. Here are the main features. +- **Data Storage** - A simple data store interface to read, write and delete records. It includes support for memory, file and +CockroachDB by default. State and persistence becomes a core requirement beyond prototyping and Micro looks to build that into the framework. - **Service Discovery** - Automatic service registration and name resolution. Service discovery is at the core of micro service development. When service A needs to speak to service B it needs the location of that service. The default discovery mechanism is @@ -30,13 +34,14 @@ across the services and retry a different node if there's a problem. to seamlessly encode and decode Go types for you. Any variety of messages could be encoded and sent from different clients. The client and server handle this by default. This includes protobuf and json by default. -- **Request/Response** - RPC based request/response with support for bidirectional streaming. We provide an abstraction for synchronous -communication. A request made to a service will be automatically resolved, load balanced, dialled and streamed. The default -transport is [gRPC](https://grpc.io/). +- **gRPC Transport** - gRPC based request/response with support for bidirectional streaming. We provide an abstraction for synchronous communication. A request made to a service will be automatically resolved, load balanced, dialled and streamed. - **Async Messaging** - PubSub is built in as a first class citizen for asynchronous communication and event driven architectures. Event notifications are a core pattern in micro service development. The default messaging system is a HTTP event message broker. +- **Synchronization** - Distributed systems are often built in an eventually consistent manner. Support for distributed locking and +leadership are built in as a Sync interface. When using an eventually consistent database or scheduling use the Sync interface. + - **Pluggable Interfaces** - Go Micro makes use of Go interfaces for each distributed system abstraction. Because of this these interfaces are pluggable and allows Go Micro to be runtime agnostic. You can plugin any underlying technology. Find plugins in [github.com/micro/go-plugins](https://github.com/micro/go-plugins). @@ -47,9 +52,20 @@ To make use of Go Micro ```golang import "github.com/micro/go-micro/v2" + +// create a new service +service := micro.NewService( + micro.Name("helloworld"), +) + +// initialise flags +service.Init() + +// start the service +service.Run() ``` -See the [docs](https://micro.mu/docs/framework.html) for detailed information on the architecture, installation and use of go-micro. +See the [docs](https://dev.m3o.com) for detailed information on the architecture, installation and use of go-micro. ## License diff --git a/vendor/github.com/micro/go-micro/v2/README.zh-cn.md b/vendor/github.com/micro/go-micro/v2/README.zh-cn.md deleted file mode 100644 index 60c009ffa..000000000 --- a/vendor/github.com/micro/go-micro/v2/README.zh-cn.md +++ /dev/null @@ -1,36 +0,0 @@ -# Go Micro [![License](https://img.shields.io/:license-apache-blue.svg)](https://opensource.org/licenses/Apache-2.0) [![Go.Dev reference](https://img.shields.io/badge/go.dev-reference-007d9c?logo=go&logoColor=white&style=flat-square)](https://pkg.go.dev/github.com/micro/go-micro?tab=doc) [![Travis CI](https://api.travis-ci.org/micro/go-micro.svg?branch=master)](https://travis-ci.org/micro/go-micro) [![Go Report Card](https://goreportcard.com/badge/micro/go-micro)](https://goreportcard.com/report/github.com/micro/go-micro) - -Go Micro是基于Golang的微服务开发框架。 - -## 概览 - -Go Micro提供分布式系统开发的核心库,包含RPC与事件驱动的通信机制。 - -**micro**的设计哲学是可插拔的架构理念,她提供可快速构建系统的组件,并且可以根据自身的需求剥离默认实现并自行定制。 - - - -所有插件可在仓库[github.com/micro/go-plugins](https://github.com/micro/go-plugins)中找到。 - -可以订阅我们的[Twitter](https://twitter.com/microhq)或者加入[Slack](http://slack.micro.mu/)论坛。 - -## 特性 - -Go Micro把分布式系统的各种细节抽象出来。下面是它的主要特性。 - -- **服务发现(Service Discovery)** - 自动服务注册与名称解析。服务发现是微服务开发中的核心。当服务A要与服务B协作时,它得知道B在哪里。默认的服务发现系统是Consul,而multicast DNS (mdns,组播)机制作为本地解决方案,或者零依赖的P2P网络中的SWIM协议(gossip)。 - -- **负载均衡(Load Balancing)** - 在服务发现之上构建了负载均衡机制。当我们得到一个服务的任意多个的实例节点时,我们要一个机制去决定要路由到哪一个节点。我们使用随机处理过的哈希负载均衡机制来保证对服务请求颁发的均匀分布,并且在发生问题时进行重试。 - -- **消息编码(Message Encoding)** - 支持基于内容类型(content-type)动态编码消息。客户端和服务端会一起使用content-type的格式来对Go进行无缝编/解码。各种各样的消息被编码会发送到不同的客户端,客户端服服务端默认会处理这些消息。content-type默认包含proto-rpc和json-rpc。 - -- **Request/Response** - RPC通信基于支持双向流的请求/响应方式,我们提供有抽象的同步通信机制。请求发送到服务时,会自动解析、负载均衡、拨号、转成字节流。默认的传输协议是http/1.1,而tls下使用http2协议。 - -- **异步消息(Async Messaging)** - 发布订阅(PubSub)头等功能内置在异步通信与事件驱动架构中。事件通知在微服务开发中处于核心位置。默认的消息传送使用点到点http/1.1,激活tls时则使用http2。 - -- **可插拔接口(Pluggable Interfaces)** - Go Micro为每个分布式系统抽象出接口。因此,Go Micro的接口都是可插拔的,允许其在运行时不可知的情况下仍可支持。所以只要实现接口,可以在内部使用任何的技术。更多插件请参考:[github.com/micro/go-plugins](https://github.com/micro/go-plugins)。 - -## 快速上手 - -更多关于架构、安装的资料可以查看[文档](https://micro.mu/docs/cn/)。 - diff --git a/vendor/github.com/micro/go-micro/v2/auth/auth.go b/vendor/github.com/micro/go-micro/v2/auth/auth.go index fbca70a6b..fee5792a2 100644 --- a/vendor/github.com/micro/go-micro/v2/auth/auth.go +++ b/vendor/github.com/micro/go-micro/v2/auth/auth.go @@ -7,20 +7,23 @@ import ( "time" ) +const ( + // BearerScheme used for Authorization header + BearerScheme = "Bearer " + // ScopePublic is the scope applied to a rule to allow access to the public + ScopePublic = "" + // ScopeAccount is the scope applied to a rule to limit to users with any valid account + ScopeAccount = "*" +) + var ( - // ErrNotFound is returned when a resouce cannot be found - ErrNotFound = errors.New("not found") - // ErrEncodingToken is returned when the service encounters an error during encoding - ErrEncodingToken = errors.New("error encoding the token") - // ErrInvalidToken is returned when the token provided is not valid + // ErrInvalidToken is when the token provided is not valid ErrInvalidToken = errors.New("invalid token provided") - // ErrInvalidRole is returned when the role provided was invalid - ErrInvalidRole = errors.New("invalid role") - // ErrForbidden is returned when a user does not have the necessary roles to access a resource + // ErrForbidden is when a user does not have the necessary scope to access a resource ErrForbidden = errors.New("resource forbidden") ) -// Auth providers authentication and authorization +// Auth provides authentication and authorization type Auth interface { // Init the auth Init(opts ...Option) @@ -28,46 +31,34 @@ type Auth interface { Options() Options // Generate a new account Generate(id string, opts ...GenerateOption) (*Account, error) - // Grant access to a resource - Grant(role string, res *Resource) error - // Revoke access to a resource - Revoke(role string, res *Resource) error - // Verify an account has access to a resource - Verify(acc *Account, res *Resource) error + // Verify an account has access to a resource using the rules + Verify(acc *Account, res *Resource, opts ...VerifyOption) error // Inspect a token Inspect(token string) (*Account, error) - // Token generated using refresh token + // Token generated using refresh token or credentials Token(opts ...TokenOption) (*Token, error) + // Grant access to a resource + Grant(rule *Rule) error + // Revoke access to a resource + Revoke(rule *Rule) error + // Rules returns all the rules used to verify requests + Rules(...RulesOption) ([]*Rule, error) // String returns the name of the implementation String() string } -// Resource is an entity such as a user or -type Resource struct { - // Name of the resource - Name string `json:"name"` - // Type of resource, e.g. - Type string `json:"type"` - // Endpoint resource e.g NotesService.Create - Endpoint string `json:"endpoint"` - // Namespace the resource belongs to - Namespace string `json:"namespace"` -} - // Account provided by an auth provider type Account struct { // ID of the account e.g. email ID string `json:"id"` // Type of the account, e.g. service Type string `json:"type"` - // Provider who issued the account - Provider string `json:"provider"` - // Roles associated with the Account - Roles []string `json:"roles"` + // Issuer of the account + Issuer string `json:"issuer"` // Any other associated metadata Metadata map[string]string `json:"metadata"` - // Namespace the account belongs to - Namespace string `json:"namespace"` + // Scopes the account has access to + Scopes []string `json:"scopes"` // Secret for the account, e.g. the password Secret string `json:"secret"` } @@ -84,15 +75,47 @@ type Token struct { Expiry time.Time `json:"expiry"` } +// Expired returns a boolean indicating if the token needs to be refreshed +func (t *Token) Expired() bool { + return t.Expiry.Unix() < time.Now().Unix() +} + +// Resource is an entity such as a user or +type Resource struct { + // Name of the resource, e.g. go.micro.service.notes + Name string `json:"name"` + // Type of resource, e.g. service + Type string `json:"type"` + // Endpoint resource e.g NotesService.Create + Endpoint string `json:"endpoint"` +} + +// Access defines the type of access a rule grants +type Access int + const ( - // DefaultNamespace used for auth - DefaultNamespace = "go.micro" - // TokenCookieName is the name of the cookie which stores the auth token - TokenCookieName = "micro-token" - // BearerScheme used for Authorization header - BearerScheme = "Bearer " + // AccessGranted to a resource + AccessGranted Access = iota + // AccessDenied to a resource + AccessDenied ) +// Rule is used to verify access to a resource +type Rule struct { + // ID of the rule, e.g. "public" + ID string + // Scope the rule requires, a blank scope indicates open to the public and * indicates the rule + // applies to any valid account + Scope string + // Resource the rule applies to + Resource *Resource + // Access determines if the rule grants or denies access to the resource + Access Access + // Priority the rule should take when verifying a request, the higher the value the sooner the + // rule will be applied + Priority int32 +} + type accountKey struct{} // AccountFromContext gets the account from the context, which diff --git a/vendor/github.com/micro/go-micro/v2/auth/default.go b/vendor/github.com/micro/go-micro/v2/auth/default.go index b9160a505..e66983a03 100644 --- a/vendor/github.com/micro/go-micro/v2/auth/default.go +++ b/vendor/github.com/micro/go-micro/v2/auth/default.go @@ -49,35 +49,37 @@ func (n *noop) Generate(id string, opts ...GenerateOption) (*Account, error) { options := NewGenerateOptions(opts...) return &Account{ - ID: id, - Roles: options.Roles, - Secret: options.Secret, - Metadata: options.Metadata, - Namespace: DefaultNamespace, + ID: id, + Secret: options.Secret, + Metadata: options.Metadata, + Scopes: options.Scopes, + Issuer: n.Options().Namespace, }, nil } // Grant access to a resource -func (n *noop) Grant(role string, res *Resource) error { +func (n *noop) Grant(rule *Rule) error { return nil } // Revoke access to a resource -func (n *noop) Revoke(role string, res *Resource) error { +func (n *noop) Revoke(rule *Rule) error { return nil } +// Rules used to verify requests +func (n *noop) Rules(opts ...RulesOption) ([]*Rule, error) { + return []*Rule{}, nil +} + // Verify an account has access to a resource -func (n *noop) Verify(acc *Account, res *Resource) error { +func (n *noop) Verify(acc *Account, res *Resource, opts ...VerifyOption) error { return nil } // Inspect a token func (n *noop) Inspect(token string) (*Account, error) { - return &Account{ - ID: uuid.New().String(), - Namespace: DefaultNamespace, - }, nil + return &Account{ID: uuid.New().String(), Issuer: n.Options().Namespace}, nil } // Token generation using an account id and secret diff --git a/vendor/github.com/micro/go-micro/v2/auth/jwt/jwt.go b/vendor/github.com/micro/go-micro/v2/auth/jwt/jwt.go index 86815bce1..f2cf2eb33 100644 --- a/vendor/github.com/micro/go-micro/v2/auth/jwt/jwt.go +++ b/vendor/github.com/micro/go-micro/v2/auth/jwt/jwt.go @@ -2,8 +2,10 @@ package jwt import ( "sync" + "time" "github.com/micro/go-micro/v2/auth" + "github.com/micro/go-micro/v2/auth/rules" "github.com/micro/go-micro/v2/auth/token" jwtToken "github.com/micro/go-micro/v2/auth/token/jwt" ) @@ -15,15 +17,10 @@ func NewAuth(opts ...auth.Option) auth.Auth { return j } -type rule struct { - role string - resource *auth.Resource -} - type jwt struct { options auth.Options jwt token.Provider - rules []*rule + rules []*auth.Rule sync.Mutex } @@ -40,10 +37,6 @@ func (j *jwt) Init(opts ...auth.Option) { o(&j.options) } - if len(j.options.Namespace) == 0 { - j.options.Namespace = auth.DefaultNamespace - } - j.jwt = jwtToken.NewTokenProvider( token.WithPrivateKey(j.options.PrivateKey), token.WithPublicKey(j.options.PublicKey), @@ -59,12 +52,11 @@ func (j *jwt) Options() auth.Options { func (j *jwt) Generate(id string, opts ...auth.GenerateOption) (*auth.Account, error) { options := auth.NewGenerateOptions(opts...) account := &auth.Account{ - ID: id, - Type: options.Type, - Roles: options.Roles, - Provider: options.Provider, - Metadata: options.Metadata, - Namespace: options.Namespace, + ID: id, + Type: options.Type, + Scopes: options.Scopes, + Metadata: options.Metadata, + Issuer: j.Options().Namespace, } // generate a JWT secret which can be provided to the Token() method @@ -79,84 +71,44 @@ func (j *jwt) Generate(id string, opts ...auth.GenerateOption) (*auth.Account, e return account, nil } -func (j *jwt) Grant(role string, res *auth.Resource) error { +func (j *jwt) Grant(rule *auth.Rule) error { j.Lock() defer j.Unlock() - j.rules = append(j.rules, &rule{role, res}) + j.rules = append(j.rules, rule) return nil } -func (j *jwt) Revoke(role string, res *auth.Resource) error { +func (j *jwt) Revoke(rule *auth.Rule) error { j.Lock() defer j.Unlock() - rules := make([]*rule, 0, len(j.rules)) - - var ruleFound bool - for _, r := range rules { - if r.role == role && r.resource == res { - ruleFound = true - } else { + rules := []*auth.Rule{} + for _, r := range j.rules { + if r.ID != rule.ID { rules = append(rules, r) } } - if !ruleFound { - return auth.ErrNotFound - } - j.rules = rules return nil } -func (j *jwt) Verify(acc *auth.Account, res *auth.Resource) error { +func (j *jwt) Verify(acc *auth.Account, res *auth.Resource, opts ...auth.VerifyOption) error { j.Lock() - if len(res.Namespace) == 0 { - res.Namespace = j.options.Namespace - } - rules := j.rules - j.Unlock() - - for _, rule := range rules { - // validate the rule applies to the requested resource - if rule.resource.Namespace != "*" && rule.resource.Namespace != res.Namespace { - continue - } - if rule.resource.Type != "*" && rule.resource.Type != res.Type { - continue - } - if rule.resource.Name != "*" && rule.resource.Name != res.Name { - continue - } - if rule.resource.Endpoint != "*" && rule.resource.Endpoint != res.Endpoint { - continue - } - - // a blank role indicates anyone can access the resource, even without an account - if rule.role == "" { - return nil - } - - // all furter checks require an account - if acc == nil { - continue - } - - // this rule allows any account access, allow the request - if rule.role == "*" { - return nil - } + defer j.Unlock() - // if the account has the necessary role, allow the request - for _, r := range acc.Roles { - if r == rule.role { - return nil - } - } + var options auth.VerifyOptions + for _, o := range opts { + o(&options) } - // no rules matched, forbid the request - return auth.ErrForbidden + return rules.Verify(j.rules, acc, res) +} + +func (j *jwt) Rules(opts ...auth.RulesOption) ([]*auth.Rule, error) { + j.Lock() + defer j.Unlock() + return j.rules, nil } func (j *jwt) Inspect(token string) (*auth.Account, error) { @@ -176,15 +128,20 @@ func (j *jwt) Token(opts ...auth.TokenOption) (*auth.Token, error) { return nil, err } - tok, err := j.jwt.Generate(account, token.WithExpiry(options.Expiry)) + access, err := j.jwt.Generate(account, token.WithExpiry(options.Expiry)) + if err != nil { + return nil, err + } + + refresh, err := j.jwt.Generate(account, token.WithExpiry(options.Expiry+time.Hour)) if err != nil { return nil, err } return &auth.Token{ - Created: tok.Created, - Expiry: tok.Expiry, - AccessToken: tok.Token, - RefreshToken: tok.Token, + Created: access.Created, + Expiry: access.Expiry, + AccessToken: access.Token, + RefreshToken: refresh.Token, }, nil } diff --git a/vendor/github.com/micro/go-micro/v2/auth/options.go b/vendor/github.com/micro/go-micro/v2/auth/options.go index cb395d044..11de5c607 100644 --- a/vendor/github.com/micro/go-micro/v2/auth/options.go +++ b/vendor/github.com/micro/go-micro/v2/auth/options.go @@ -1,9 +1,11 @@ package auth import ( + "context" "time" "github.com/micro/go-micro/v2/auth/provider" + "github.com/micro/go-micro/v2/client" "github.com/micro/go-micro/v2/store" ) @@ -12,9 +14,8 @@ func NewOptions(opts ...Option) Options { for _, o := range opts { o(&options) } - - if len(options.Namespace) == 0 { - options.Namespace = DefaultNamespace + if options.Client == nil { + options.Client = client.DefaultClient } return options @@ -39,10 +40,21 @@ type Options struct { LoginURL string // Store to back auth Store store.Store + // Client to use for RPC + Client client.Client + // Addrs sets the addresses of auth + Addrs []string } type Option func(o *Options) +// Addrs is the auth addresses to use +func Addrs(addrs ...string) Option { + return func(o *Options) { + o.Addrs = addrs + } +} + // Namespace the service belongs to func Namespace(n string) Option { return func(o *Options) { @@ -100,13 +112,18 @@ func LoginURL(url string) Option { } } +// WithClient sets the client to use when making requests +func WithClient(c client.Client) Option { + return func(o *Options) { + o.Client = c + } +} + type GenerateOptions struct { // Metadata associated with the account Metadata map[string]string - // Roles/scopes associated with the account - Roles []string - // Namespace the account belongs too - Namespace string + // Scopes the account has access too + Scopes []string // Provider of the account, e.g. oauth Provider string // Type of the account, e.g. user @@ -138,24 +155,17 @@ func WithMetadata(md map[string]string) GenerateOption { } } -// WithRoles for the generated account -func WithRoles(rs ...string) GenerateOption { - return func(o *GenerateOptions) { - o.Roles = rs - } -} - -// WithNamespace for the generated account -func WithNamespace(n string) GenerateOption { +// WithProvider for the generated account +func WithProvider(p string) GenerateOption { return func(o *GenerateOptions) { - o.Namespace = n + o.Provider = p } } -// WithProvider for the generated account -func WithProvider(p string) GenerateOption { +// WithScopes for the generated account +func WithScopes(s ...string) GenerateOption { return func(o *GenerateOptions) { - o.Provider = p + o.Scopes = s } } @@ -215,3 +225,27 @@ func NewTokenOptions(opts ...TokenOption) TokenOptions { return options } + +type VerifyOptions struct { + Context context.Context +} + +type VerifyOption func(o *VerifyOptions) + +func VerifyContext(ctx context.Context) VerifyOption { + return func(o *VerifyOptions) { + o.Context = ctx + } +} + +type RulesOptions struct { + Context context.Context +} + +type RulesOption func(o *RulesOptions) + +func RulesContext(ctx context.Context) RulesOption { + return func(o *RulesOptions) { + o.Context = ctx + } +} diff --git a/vendor/github.com/micro/go-micro/v2/auth/service/proto/auth.pb.go b/vendor/github.com/micro/go-micro/v2/auth/service/proto/auth.pb.go index cba1c78fd..fe13d3891 100644 --- a/vendor/github.com/micro/go-micro/v2/auth/service/proto/auth.pb.go +++ b/vendor/github.com/micro/go-micro/v2/auth/service/proto/auth.pb.go @@ -188,10 +188,9 @@ func (m *Token) GetExpiry() int64 { type Account struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` Type string `protobuf:"bytes,2,opt,name=type,proto3" json:"type,omitempty"` - Roles []string `protobuf:"bytes,3,rep,name=roles,proto3" json:"roles,omitempty"` Metadata map[string]string `protobuf:"bytes,4,rep,name=metadata,proto3" json:"metadata,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - Namespace string `protobuf:"bytes,5,opt,name=namespace,proto3" json:"namespace,omitempty"` - Provider string `protobuf:"bytes,6,opt,name=provider,proto3" json:"provider,omitempty"` + Scopes []string `protobuf:"bytes,5,rep,name=scopes,proto3" json:"scopes,omitempty"` + Issuer string `protobuf:"bytes,6,opt,name=issuer,proto3" json:"issuer,omitempty"` Secret string `protobuf:"bytes,7,opt,name=secret,proto3" json:"secret,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` @@ -237,13 +236,6 @@ func (m *Account) GetType() string { return "" } -func (m *Account) GetRoles() []string { - if m != nil { - return m.Roles - } - return nil -} - func (m *Account) GetMetadata() map[string]string { if m != nil { return m.Metadata @@ -251,16 +243,16 @@ func (m *Account) GetMetadata() map[string]string { return nil } -func (m *Account) GetNamespace() string { +func (m *Account) GetScopes() []string { if m != nil { - return m.Namespace + return m.Scopes } - return "" + return nil } -func (m *Account) GetProvider() string { +func (m *Account) GetIssuer() string { if m != nil { - return m.Provider + return m.Issuer } return "" } @@ -276,7 +268,6 @@ type Resource struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` Type string `protobuf:"bytes,2,opt,name=type,proto3" json:"type,omitempty"` Endpoint string `protobuf:"bytes,3,opt,name=endpoint,proto3" json:"endpoint,omitempty"` - Namespace string `protobuf:"bytes,4,opt,name=namespace,proto3" json:"namespace,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -328,18 +319,10 @@ func (m *Resource) GetEndpoint() string { return "" } -func (m *Resource) GetNamespace() string { - if m != nil { - return m.Namespace - } - return "" -} - type GenerateRequest struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - Roles []string `protobuf:"bytes,2,rep,name=roles,proto3" json:"roles,omitempty"` Metadata map[string]string `protobuf:"bytes,3,rep,name=metadata,proto3" json:"metadata,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - Namespace string `protobuf:"bytes,4,opt,name=namespace,proto3" json:"namespace,omitempty"` + Scopes []string `protobuf:"bytes,4,rep,name=scopes,proto3" json:"scopes,omitempty"` Secret string `protobuf:"bytes,5,opt,name=secret,proto3" json:"secret,omitempty"` Type string `protobuf:"bytes,6,opt,name=type,proto3" json:"type,omitempty"` Provider string `protobuf:"bytes,7,opt,name=provider,proto3" json:"provider,omitempty"` @@ -380,13 +363,6 @@ func (m *GenerateRequest) GetId() string { return "" } -func (m *GenerateRequest) GetRoles() []string { - if m != nil { - return m.Roles - } - return nil -} - func (m *GenerateRequest) GetMetadata() map[string]string { if m != nil { return m.Metadata @@ -394,11 +370,11 @@ func (m *GenerateRequest) GetMetadata() map[string]string { return nil } -func (m *GenerateRequest) GetNamespace() string { +func (m *GenerateRequest) GetScopes() []string { if m != nil { - return m.Namespace + return m.Scopes } - return "" + return nil } func (m *GenerateRequest) GetSecret() string { @@ -462,7 +438,7 @@ func (m *GenerateResponse) GetAccount() *Account { } type GrantRequest struct { - Role string `protobuf:"bytes,1,opt,name=role,proto3" json:"role,omitempty"` + Scope string `protobuf:"bytes,1,opt,name=scope,proto3" json:"scope,omitempty"` Resource *Resource `protobuf:"bytes,2,opt,name=resource,proto3" json:"resource,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` @@ -494,9 +470,9 @@ func (m *GrantRequest) XXX_DiscardUnknown() { var xxx_messageInfo_GrantRequest proto.InternalMessageInfo -func (m *GrantRequest) GetRole() string { +func (m *GrantRequest) GetScope() string { if m != nil { - return m.Role + return m.Scope } return "" } @@ -540,7 +516,7 @@ func (m *GrantResponse) XXX_DiscardUnknown() { var xxx_messageInfo_GrantResponse proto.InternalMessageInfo type RevokeRequest struct { - Role string `protobuf:"bytes,1,opt,name=role,proto3" json:"role,omitempty"` + Scope string `protobuf:"bytes,1,opt,name=scope,proto3" json:"scope,omitempty"` Resource *Resource `protobuf:"bytes,2,opt,name=resource,proto3" json:"resource,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` @@ -572,9 +548,9 @@ func (m *RevokeRequest) XXX_DiscardUnknown() { var xxx_messageInfo_RevokeRequest proto.InternalMessageInfo -func (m *RevokeRequest) GetRole() string { +func (m *RevokeRequest) GetScope() string { if m != nil { - return m.Role + return m.Scope } return "" } @@ -799,7 +775,7 @@ func (m *TokenResponse) GetToken() *Token { type Rule struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - Role string `protobuf:"bytes,2,opt,name=role,proto3" json:"role,omitempty"` + Scope string `protobuf:"bytes,2,opt,name=scope,proto3" json:"scope,omitempty"` Resource *Resource `protobuf:"bytes,3,opt,name=resource,proto3" json:"resource,omitempty"` Access Access `protobuf:"varint,4,opt,name=access,proto3,enum=go.micro.auth.Access" json:"access,omitempty"` Priority int32 `protobuf:"varint,5,opt,name=priority,proto3" json:"priority,omitempty"` @@ -840,9 +816,9 @@ func (m *Rule) GetId() string { return "" } -func (m *Rule) GetRole() string { +func (m *Rule) GetScope() string { if m != nil { - return m.Role + return m.Scope } return "" } @@ -869,13 +845,10 @@ func (m *Rule) GetPriority() int32 { } type CreateRequest struct { - Role string `protobuf:"bytes,1,opt,name=role,proto3" json:"role,omitempty"` - Resource *Resource `protobuf:"bytes,2,opt,name=resource,proto3" json:"resource,omitempty"` - Access Access `protobuf:"varint,3,opt,name=access,proto3,enum=go.micro.auth.Access" json:"access,omitempty"` - Priority int32 `protobuf:"varint,4,opt,name=priority,proto3" json:"priority,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + Rule *Rule `protobuf:"bytes,1,opt,name=rule,proto3" json:"rule,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } func (m *CreateRequest) Reset() { *m = CreateRequest{} } @@ -903,34 +876,13 @@ func (m *CreateRequest) XXX_DiscardUnknown() { var xxx_messageInfo_CreateRequest proto.InternalMessageInfo -func (m *CreateRequest) GetRole() string { +func (m *CreateRequest) GetRule() *Rule { if m != nil { - return m.Role - } - return "" -} - -func (m *CreateRequest) GetResource() *Resource { - if m != nil { - return m.Resource + return m.Rule } return nil } -func (m *CreateRequest) GetAccess() Access { - if m != nil { - return m.Access - } - return Access_UNKNOWN -} - -func (m *CreateRequest) GetPriority() int32 { - if m != nil { - return m.Priority - } - return 0 -} - type CreateResponse struct { XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` @@ -963,13 +915,10 @@ func (m *CreateResponse) XXX_DiscardUnknown() { var xxx_messageInfo_CreateResponse proto.InternalMessageInfo type DeleteRequest struct { - Role string `protobuf:"bytes,1,opt,name=role,proto3" json:"role,omitempty"` - Resource *Resource `protobuf:"bytes,2,opt,name=resource,proto3" json:"resource,omitempty"` - Access Access `protobuf:"varint,3,opt,name=access,proto3,enum=go.micro.auth.Access" json:"access,omitempty"` - Priority int32 `protobuf:"varint,4,opt,name=priority,proto3" json:"priority,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } func (m *DeleteRequest) Reset() { *m = DeleteRequest{} } @@ -997,34 +946,13 @@ func (m *DeleteRequest) XXX_DiscardUnknown() { var xxx_messageInfo_DeleteRequest proto.InternalMessageInfo -func (m *DeleteRequest) GetRole() string { +func (m *DeleteRequest) GetId() string { if m != nil { - return m.Role + return m.Id } return "" } -func (m *DeleteRequest) GetResource() *Resource { - if m != nil { - return m.Resource - } - return nil -} - -func (m *DeleteRequest) GetAccess() Access { - if m != nil { - return m.Access - } - return Access_UNKNOWN -} - -func (m *DeleteRequest) GetPriority() int32 { - if m != nil { - return m.Priority - } - return 0 -} - type DeleteResponse struct { XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` @@ -1157,64 +1085,62 @@ func init() { func init() { proto.RegisterFile("auth/service/proto/auth.proto", fileDescriptor_21300bfacc51fc2a) } var fileDescriptor_21300bfacc51fc2a = []byte{ - // 900 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x56, 0xdd, 0x8e, 0xdb, 0x44, - 0x14, 0x5e, 0xff, 0xc4, 0xc9, 0x9e, 0xfc, 0x6c, 0x34, 0xdd, 0x16, 0x2b, 0xed, 0x96, 0xad, 0x8b, - 0xd0, 0x52, 0x41, 0x16, 0xa5, 0x37, 0x40, 0x6f, 0x58, 0x35, 0x51, 0x68, 0xa1, 0x41, 0x58, 0x45, - 0xe5, 0x06, 0x55, 0xc6, 0x39, 0xb0, 0xd6, 0x66, 0x6d, 0x33, 0x33, 0x5e, 0x91, 0x1b, 0x24, 0xde, - 0x81, 0x37, 0x80, 0x2b, 0x9e, 0x89, 0x7b, 0x5e, 0x03, 0xcd, 0x9f, 0x37, 0x76, 0x9c, 0xaa, 0x40, - 0x2f, 0xb8, 0x9b, 0x33, 0xe7, 0xf8, 0xcc, 0xf7, 0x7d, 0xe7, 0xcc, 0xf1, 0xc0, 0x51, 0x54, 0xf0, - 0xf3, 0x53, 0x86, 0xf4, 0x2a, 0x89, 0xf1, 0x34, 0xa7, 0x19, 0xcf, 0x4e, 0xc5, 0xd6, 0x58, 0x2e, - 0x49, 0xff, 0x87, 0x6c, 0x7c, 0x99, 0xc4, 0x34, 0x1b, 0x8b, 0xcd, 0xe0, 0x26, 0xdc, 0xf8, 0x22, - 0x61, 0xfc, 0x2c, 0x8e, 0xb3, 0x22, 0xe5, 0x2c, 0xc4, 0x1f, 0x0b, 0x64, 0x3c, 0x78, 0x0a, 0x87, - 0xd5, 0x6d, 0x96, 0x67, 0x29, 0x43, 0x32, 0x81, 0x4e, 0xa4, 0xf7, 0x7c, 0xeb, 0xd8, 0x39, 0xe9, - 0x4e, 0x6e, 0x8d, 0x2b, 0x09, 0xc7, 0xfa, 0x93, 0xb0, 0x8c, 0x0b, 0x7e, 0xb1, 0xa0, 0xf5, 0x3c, - 0xbb, 0xc0, 0x94, 0xdc, 0x83, 0x5e, 0x14, 0xc7, 0xc8, 0xd8, 0x4b, 0x2e, 0x6c, 0xdf, 0x3a, 0xb6, - 0x4e, 0xf6, 0xc3, 0xae, 0xda, 0x53, 0x21, 0xf7, 0xa1, 0x4f, 0xf1, 0x7b, 0x8a, 0xec, 0x5c, 0xc7, - 0xd8, 0x32, 0xa6, 0xa7, 0x37, 0x55, 0x90, 0x0f, 0xed, 0x98, 0x62, 0xc4, 0x71, 0xe9, 0x3b, 0xc7, - 0xd6, 0x89, 0x13, 0x1a, 0x93, 0xdc, 0x02, 0x0f, 0x7f, 0xca, 0x13, 0xba, 0xf6, 0x5d, 0xe9, 0xd0, - 0x56, 0xf0, 0xab, 0x0d, 0x6d, 0x8d, 0x8c, 0x0c, 0xc0, 0x4e, 0x96, 0xfa, 0x6c, 0x3b, 0x59, 0x12, - 0x02, 0x2e, 0x5f, 0xe7, 0xa8, 0x4f, 0x92, 0x6b, 0x72, 0x08, 0x2d, 0x9a, 0xad, 0x90, 0xf9, 0xce, - 0xb1, 0x73, 0xb2, 0x1f, 0x2a, 0x83, 0x7c, 0x0a, 0x9d, 0x4b, 0xe4, 0xd1, 0x32, 0xe2, 0x91, 0xef, - 0x4a, 0xf6, 0xef, 0x34, 0xb3, 0x1f, 0x3f, 0xd3, 0x61, 0xb3, 0x94, 0xd3, 0x75, 0x58, 0x7e, 0x45, - 0xee, 0xc0, 0x7e, 0x1a, 0x5d, 0x22, 0xcb, 0xa3, 0x18, 0xfd, 0x96, 0x3c, 0xf0, 0x7a, 0x83, 0x8c, - 0xa0, 0x93, 0xd3, 0xec, 0x2a, 0x59, 0x22, 0xf5, 0x3d, 0xe9, 0x2c, 0x6d, 0xc1, 0x8c, 0x61, 0x4c, - 0x91, 0xfb, 0x6d, 0xe9, 0xd1, 0xd6, 0xe8, 0x11, 0xf4, 0x2b, 0x87, 0x91, 0x21, 0x38, 0x17, 0xb8, - 0xd6, 0xfc, 0xc4, 0x52, 0x90, 0xb9, 0x8a, 0x56, 0x85, 0x61, 0xa8, 0x8c, 0x4f, 0xec, 0x8f, 0xac, - 0x60, 0x05, 0x9d, 0x10, 0x59, 0x56, 0xd0, 0x18, 0x85, 0x0c, 0x02, 0x89, 0xfe, 0x50, 0xae, 0x1b, - 0xa5, 0x19, 0x41, 0x07, 0xd3, 0x65, 0x9e, 0x25, 0x29, 0x97, 0xea, 0xef, 0x87, 0xa5, 0x5d, 0xa5, - 0xe7, 0xd6, 0xe8, 0x05, 0xbf, 0xdb, 0x70, 0x30, 0xc7, 0x14, 0x69, 0xc4, 0x51, 0x37, 0xda, 0x56, - 0x31, 0x4a, 0xe1, 0xed, 0x4d, 0xe1, 0x3f, 0xdb, 0x10, 0xde, 0x91, 0xc2, 0xbf, 0x5f, 0x13, 0xbe, - 0x96, 0xf7, 0xf5, 0x0a, 0x50, 0x47, 0xb8, 0x21, 0x72, 0x6b, 0x53, 0xe4, 0x52, 0x07, 0xaf, 0xaa, - 0x43, 0x59, 0xac, 0x76, 0xb5, 0x58, 0xff, 0xad, 0x28, 0x53, 0x18, 0x5e, 0xb3, 0xd1, 0xf7, 0xee, - 0x43, 0x68, 0xeb, 0xfb, 0x24, 0x73, 0xec, 0xbe, 0x76, 0x26, 0x2c, 0x78, 0x01, 0xbd, 0x39, 0x8d, - 0x52, 0x6e, 0x84, 0x26, 0xe0, 0x0a, 0x2d, 0x4d, 0x79, 0xc5, 0x9a, 0x3c, 0x84, 0x0e, 0xd5, 0xe5, - 0x97, 0x30, 0xba, 0x93, 0xb7, 0x6a, 0x69, 0x4d, 0x77, 0x84, 0x65, 0x60, 0x70, 0x00, 0x7d, 0x9d, - 0x58, 0x61, 0x0b, 0xbe, 0x81, 0x7e, 0x88, 0x57, 0xd9, 0x05, 0xbe, 0xf1, 0xa3, 0x86, 0x30, 0x30, - 0x99, 0xf5, 0x59, 0xef, 0xc2, 0xe0, 0x49, 0xca, 0x72, 0x8c, 0x4b, 0x5e, 0x87, 0xd0, 0xda, 0x1c, - 0x26, 0xca, 0x08, 0x1e, 0xc3, 0x41, 0x19, 0xf7, 0xaf, 0x25, 0xfc, 0x19, 0x7a, 0x72, 0xde, 0xec, - 0xea, 0xd5, 0xeb, 0x6e, 0xb1, 0x2b, 0xdd, 0xb2, 0x35, 0xc3, 0x9c, 0x86, 0x19, 0x76, 0x0f, 0x7a, - 0xd2, 0xf9, 0xb2, 0x32, 0xaf, 0xba, 0x72, 0x6f, 0xa6, 0x86, 0xd6, 0x23, 0xe8, 0xeb, 0xf3, 0x35, - 0x85, 0x07, 0x9b, 0x5c, 0xbb, 0x93, 0xc3, 0x1a, 0x01, 0x15, 0xac, 0x15, 0xf8, 0xc3, 0x02, 0x37, - 0x2c, 0x56, 0xd8, 0x34, 0xee, 0x64, 0x75, 0xec, 0x1d, 0xd5, 0x71, 0x5e, 0xb3, 0x3a, 0xe4, 0x03, - 0xf0, 0xd4, 0xe4, 0x96, 0xd8, 0x07, 0x93, 0x9b, 0xdb, 0x7a, 0x22, 0x63, 0xa1, 0x0e, 0x52, 0xf7, - 0x25, 0xc9, 0x68, 0xc2, 0xd7, 0xf2, 0x76, 0xb5, 0xc2, 0xd2, 0x0e, 0x7e, 0xb3, 0xa0, 0xff, 0x58, - 0x8e, 0xf0, 0x37, 0xdd, 0x43, 0x1b, 0x28, 0x9d, 0x7f, 0x8a, 0xd2, 0xad, 0xa1, 0x1c, 0xc2, 0xc0, - 0x80, 0xd4, 0xed, 0x28, 0x70, 0x4f, 0x71, 0x85, 0xff, 0x7b, 0xdc, 0x06, 0xa4, 0xc6, 0xdd, 0x87, - 0xae, 0xf8, 0xbd, 0x9b, 0xbf, 0xfd, 0xc7, 0xd0, 0x53, 0xa6, 0xee, 0xb3, 0xf7, 0xa0, 0x45, 0x0b, - 0x31, 0x84, 0xd5, 0x2f, 0xfe, 0x46, 0x1d, 0x6d, 0xb1, 0xc2, 0x50, 0x45, 0x3c, 0x18, 0x83, 0xa7, - 0x90, 0x90, 0x2e, 0xb4, 0xbf, 0x5e, 0x7c, 0xbe, 0xf8, 0xf2, 0xc5, 0x62, 0xb8, 0x27, 0x8c, 0x79, - 0x78, 0xb6, 0x78, 0x3e, 0x9b, 0x0e, 0x2d, 0x02, 0xe0, 0x4d, 0x67, 0x8b, 0x27, 0xb3, 0xe9, 0xd0, - 0x9e, 0xfc, 0x65, 0x81, 0x7b, 0x56, 0xf0, 0x73, 0xf2, 0x0c, 0x3a, 0x66, 0xca, 0x91, 0xbb, 0xaf, - 0x1e, 0xe6, 0xa3, 0xb7, 0x77, 0xfa, 0x35, 0x9f, 0x3d, 0xf2, 0x14, 0xda, 0xfa, 0xc2, 0x93, 0xa3, - 0x5a, 0x74, 0x75, 0x60, 0x8c, 0xee, 0xee, 0x72, 0x97, 0xb9, 0xa6, 0xe6, 0xbd, 0x72, 0xbb, 0xf1, - 0x82, 0xe9, 0x3c, 0x77, 0x9a, 0x9d, 0x26, 0xcb, 0xe4, 0x5b, 0xe8, 0x98, 0xe7, 0x13, 0xf9, 0x0a, - 0x5c, 0x21, 0x30, 0x09, 0x6a, 0xdf, 0x34, 0x3c, 0xbd, 0x46, 0xf7, 0x5f, 0x19, 0x53, 0xa6, 0xff, - 0xd3, 0x82, 0x96, 0x28, 0x04, 0x23, 0x73, 0xf0, 0x54, 0x5b, 0x92, 0x3a, 0xa4, 0xca, 0x95, 0x1a, - 0x1d, 0xed, 0xf0, 0x96, 0xbc, 0xe7, 0xe0, 0xa9, 0x3e, 0xd9, 0x4a, 0x54, 0xe9, 0xf1, 0xad, 0x44, - 0xb5, 0xe6, 0xda, 0x23, 0x67, 0x9a, 0xee, 0xa8, 0x81, 0x8a, 0x49, 0x72, 0xbb, 0xd1, 0x67, 0x52, - 0x7c, 0xe7, 0xc9, 0xd7, 0xea, 0xc3, 0xbf, 0x03, 0x00, 0x00, 0xff, 0xff, 0xdf, 0x67, 0x3c, 0x6e, - 0xce, 0x0a, 0x00, 0x00, + // 872 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x56, 0x51, 0x8f, 0xdb, 0x44, + 0x10, 0x3e, 0x27, 0xb1, 0x93, 0x9b, 0xc4, 0x77, 0xd1, 0xf6, 0x5a, 0xac, 0x94, 0x6b, 0xaf, 0x2e, + 0x82, 0xa3, 0x82, 0x1c, 0x4a, 0x5f, 0x0a, 0x7d, 0xe1, 0xd4, 0x44, 0xa1, 0x85, 0x06, 0x61, 0x15, + 0x21, 0x90, 0x50, 0x65, 0x9c, 0x81, 0xb3, 0x2e, 0x67, 0x9b, 0xdd, 0xf5, 0x89, 0xbc, 0x20, 0xf1, + 0xc6, 0x8f, 0xe1, 0x27, 0xf1, 0xce, 0x1f, 0xe0, 0x07, 0x20, 0xef, 0xce, 0xba, 0xb1, 0xe3, 0x54, + 0x15, 0x88, 0x37, 0xcf, 0xec, 0xb7, 0xb3, 0xf3, 0x7d, 0x3b, 0x33, 0x6b, 0x38, 0x0e, 0x73, 0x79, + 0x71, 0x26, 0x90, 0x5f, 0xc7, 0x11, 0x9e, 0x65, 0x3c, 0x95, 0xe9, 0x59, 0xe1, 0x1a, 0xab, 0x4f, + 0xe6, 0xfe, 0x94, 0x8e, 0xaf, 0xe2, 0x88, 0xa7, 0xe3, 0xc2, 0xe9, 0xdf, 0x84, 0x1b, 0x5f, 0xc4, + 0x42, 0x9e, 0x47, 0x51, 0x9a, 0x27, 0x52, 0x04, 0xf8, 0x73, 0x8e, 0x42, 0xfa, 0xcf, 0xe0, 0xa8, + 0xea, 0x16, 0x59, 0x9a, 0x08, 0x64, 0x13, 0xe8, 0x85, 0xe4, 0xf3, 0xac, 0x93, 0xf6, 0x69, 0x7f, + 0x72, 0x6b, 0x5c, 0x09, 0x38, 0xa6, 0x2d, 0x41, 0x89, 0xf3, 0x7f, 0xb3, 0xc0, 0x7e, 0x91, 0x5e, + 0x62, 0xc2, 0xee, 0xc1, 0x20, 0x8c, 0x22, 0x14, 0xe2, 0xa5, 0x2c, 0x6c, 0xcf, 0x3a, 0xb1, 0x4e, + 0xf7, 0x83, 0xbe, 0xf6, 0x69, 0xc8, 0x7d, 0x70, 0x39, 0xfe, 0xc8, 0x51, 0x5c, 0x10, 0xa6, 0xa5, + 0x30, 0x03, 0x72, 0x6a, 0x90, 0x07, 0xdd, 0x88, 0x63, 0x28, 0x71, 0xe9, 0xb5, 0x4f, 0xac, 0xd3, + 0x76, 0x60, 0x4c, 0x76, 0x0b, 0x1c, 0xfc, 0x25, 0x8b, 0xf9, 0xda, 0xeb, 0xa8, 0x05, 0xb2, 0xfc, + 0xbf, 0x2d, 0xe8, 0x52, 0x66, 0xec, 0x00, 0x5a, 0xf1, 0x92, 0xce, 0x6e, 0xc5, 0x4b, 0xc6, 0xa0, + 0x23, 0xd7, 0x19, 0xd2, 0x49, 0xea, 0x9b, 0x7d, 0x0a, 0xbd, 0x2b, 0x94, 0xe1, 0x32, 0x94, 0xa1, + 0xd7, 0x51, 0x3c, 0xdf, 0x69, 0xe6, 0x39, 0x7e, 0x4e, 0xb0, 0x59, 0x22, 0xf9, 0x3a, 0x28, 0x77, + 0x15, 0x99, 0x88, 0x28, 0xcd, 0x50, 0x78, 0xf6, 0x49, 0xfb, 0x74, 0x3f, 0x20, 0xab, 0xf0, 0xc7, + 0x42, 0xe4, 0xc8, 0x3d, 0x47, 0x9d, 0x47, 0x96, 0xc2, 0x63, 0xc4, 0x51, 0x7a, 0x5d, 0xed, 0xd7, + 0xd6, 0xe8, 0x31, 0xb8, 0x95, 0x23, 0xd8, 0x10, 0xda, 0x97, 0xb8, 0xa6, 0xfc, 0x8b, 0x4f, 0x76, + 0x04, 0xf6, 0x75, 0xb8, 0xca, 0x0d, 0x03, 0x6d, 0x7c, 0xd2, 0x7a, 0x64, 0xf9, 0x0b, 0xe8, 0x05, + 0x28, 0xd2, 0x9c, 0x47, 0x58, 0xd0, 0x4c, 0xc2, 0x2b, 0xa4, 0x8d, 0xea, 0xbb, 0x91, 0xfa, 0x08, + 0x7a, 0x98, 0x2c, 0xb3, 0x34, 0x4e, 0xa4, 0x52, 0x77, 0x3f, 0x28, 0x6d, 0xff, 0xf7, 0x16, 0x1c, + 0xce, 0x31, 0x41, 0x1e, 0x4a, 0xa4, 0x52, 0xd9, 0x92, 0xf3, 0xb3, 0x0d, 0xe9, 0xda, 0x4a, 0xba, + 0x0f, 0x6a, 0xd2, 0xd5, 0x22, 0xbc, 0x81, 0x84, 0x9d, 0xba, 0x84, 0x24, 0x95, 0xbd, 0x29, 0x55, + 0xc9, 0xc6, 0xa9, 0xb2, 0xc9, 0x78, 0x7a, 0x1d, 0x2f, 0x91, 0x93, 0xb0, 0xa5, 0xfd, 0xdf, 0xa4, + 0x9d, 0xc2, 0xf0, 0x15, 0x0f, 0xea, 0x8e, 0x8f, 0xa0, 0x4b, 0x55, 0xaf, 0x62, 0xec, 0x6e, 0x0e, + 0x03, 0xf3, 0xbf, 0x85, 0xc1, 0x9c, 0x87, 0x89, 0x34, 0x62, 0x1e, 0x81, 0xad, 0x48, 0x52, 0x0e, + 0xda, 0x60, 0x0f, 0xa1, 0xc7, 0xe9, 0x1a, 0x55, 0x22, 0xfd, 0xc9, 0x5b, 0xb5, 0xc0, 0xe6, 0x96, + 0x83, 0x12, 0xe8, 0x1f, 0x82, 0x4b, 0xa1, 0x75, 0x76, 0xfe, 0x77, 0xe0, 0x06, 0x78, 0x9d, 0x5e, + 0xe2, 0xff, 0x70, 0xd8, 0x10, 0x0e, 0x4c, 0x6c, 0x3a, 0xed, 0x5d, 0x38, 0x78, 0x9a, 0x88, 0x0c, + 0xa3, 0x4d, 0x6e, 0x9b, 0x6d, 0xaf, 0x0d, 0xff, 0x09, 0x1c, 0x96, 0xb8, 0x7f, 0x2d, 0xe3, 0xaf, + 0x30, 0x50, 0x93, 0x61, 0x57, 0x4d, 0xbe, 0xaa, 0x98, 0x56, 0xa5, 0x62, 0xb6, 0xa6, 0x4d, 0xbb, + 0x61, 0xda, 0xdc, 0x83, 0x81, 0x5a, 0x7c, 0x59, 0x99, 0x2c, 0x7d, 0xe5, 0x9b, 0xe9, 0xf1, 0xf2, + 0x18, 0x5c, 0x3a, 0x9f, 0x28, 0x3c, 0xd8, 0xe4, 0xda, 0x9f, 0x1c, 0xd5, 0x08, 0x68, 0x30, 0x29, + 0xf0, 0x87, 0x05, 0x9d, 0x20, 0x5f, 0xe1, 0x56, 0xd6, 0xe5, 0xfd, 0xb4, 0x76, 0xdd, 0x4f, 0xfb, + 0x0d, 0xef, 0x87, 0x7d, 0x08, 0x8e, 0x9e, 0xb2, 0x2a, 0xfb, 0x83, 0xc9, 0xcd, 0x6d, 0x45, 0x51, + 0x88, 0x80, 0x40, 0xba, 0x6b, 0xe2, 0x94, 0xc7, 0x72, 0xad, 0x7a, 0xcc, 0x0e, 0x4a, 0xdb, 0x7f, + 0x04, 0xee, 0x13, 0x35, 0x6d, 0x8d, 0xd8, 0xef, 0x41, 0x87, 0xe7, 0x2b, 0x24, 0xaa, 0x37, 0xea, + 0xc9, 0xe4, 0x2b, 0x0c, 0x14, 0xa0, 0x28, 0x12, 0xb3, 0x93, 0x8a, 0xe4, 0x2e, 0xb8, 0x53, 0x5c, + 0xe1, 0xce, 0x61, 0x52, 0x6c, 0x31, 0x00, 0xda, 0xe2, 0x42, 0xbf, 0x78, 0x99, 0xcc, 0x43, 0xf5, + 0x31, 0x0c, 0xb4, 0x49, 0xc2, 0xbf, 0x0f, 0x76, 0x71, 0x96, 0x79, 0x9d, 0x1a, 0xb3, 0xd1, 0x88, + 0x07, 0x63, 0x70, 0x34, 0x6d, 0xd6, 0x87, 0xee, 0xd7, 0x8b, 0xcf, 0x17, 0x5f, 0x7e, 0xb3, 0x18, + 0xee, 0x15, 0xc6, 0x3c, 0x38, 0x5f, 0xbc, 0x98, 0x4d, 0x87, 0x16, 0x03, 0x70, 0xa6, 0xb3, 0xc5, + 0xd3, 0xd9, 0x74, 0xd8, 0x9a, 0xfc, 0x65, 0x41, 0xe7, 0x3c, 0x97, 0x17, 0xec, 0x39, 0xf4, 0x4c, + 0xeb, 0xb3, 0x3b, 0xaf, 0x9f, 0x6d, 0xa3, 0xbb, 0x3b, 0xd7, 0x89, 0xcf, 0x1e, 0x7b, 0x06, 0x5d, + 0xea, 0x00, 0x76, 0x5c, 0x43, 0x57, 0x3b, 0x68, 0x74, 0x67, 0xd7, 0x72, 0x19, 0x6b, 0x6a, 0x9e, + 0xda, 0xdb, 0x8d, 0x15, 0x47, 0x71, 0xde, 0x6e, 0x5e, 0x34, 0x51, 0x26, 0xdf, 0x43, 0xcf, 0xbc, + 0xfc, 0xec, 0x2b, 0xe8, 0x14, 0x02, 0x33, 0xbf, 0xb6, 0xa7, 0xe1, 0xaf, 0x61, 0x74, 0xff, 0xb5, + 0x98, 0x32, 0xfc, 0x9f, 0x16, 0xd8, 0xc5, 0x45, 0x08, 0x36, 0x07, 0x47, 0x57, 0x04, 0xab, 0xa7, + 0x54, 0x29, 0xb1, 0xd1, 0xf1, 0x8e, 0xd5, 0x92, 0xf7, 0x1c, 0x1c, 0x5d, 0x27, 0x5b, 0x81, 0x2a, + 0xf5, 0xb5, 0x15, 0xa8, 0x56, 0x5c, 0x7b, 0xec, 0x9c, 0xe8, 0x8e, 0x1a, 0xa8, 0x98, 0x20, 0xb7, + 0x1b, 0xd7, 0x4c, 0x88, 0x1f, 0x1c, 0xf5, 0xa3, 0xf5, 0xf0, 0x9f, 0x00, 0x00, 0x00, 0xff, 0xff, + 0x52, 0x12, 0xc2, 0xdb, 0x89, 0x09, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/vendor/github.com/micro/go-micro/v2/auth/service/proto/auth.proto b/vendor/github.com/micro/go-micro/v2/auth/service/proto/auth.proto index 7590957a3..5eb1d6677 100644 --- a/vendor/github.com/micro/go-micro/v2/auth/service/proto/auth.proto +++ b/vendor/github.com/micro/go-micro/v2/auth/service/proto/auth.proto @@ -35,10 +35,9 @@ message Token { message Account { string id = 1; string type = 2; - repeated string roles = 3; map metadata = 4; - string namespace = 5; - string provider = 6; + repeated string scopes = 5; + string issuer = 6; string secret = 7; } @@ -46,14 +45,12 @@ message Resource{ string name = 1; string type = 2; string endpoint = 3; - string namespace = 4; } message GenerateRequest { string id = 1; - repeated string roles = 2; map metadata = 3; - string namespace = 4; + repeated string scopes = 4; string secret = 5; string type = 6; string provider = 7; @@ -64,14 +61,14 @@ message GenerateResponse { } message GrantRequest { - string role = 1; + string scope = 1; Resource resource = 2; } message GrantResponse {} message RevokeRequest { - string role = 1; + string scope = 1; Resource resource = 2; } @@ -104,26 +101,20 @@ enum Access { message Rule { string id = 1; - string role = 2; + string scope = 2; Resource resource = 3; Access access = 4; int32 priority = 5; } message CreateRequest { - string role = 1; - Resource resource = 2; - Access access = 3; - int32 priority = 4; + Rule rule = 1; } message CreateResponse {} message DeleteRequest { - string role = 1; - Resource resource = 2; - Access access = 3; - int32 priority = 4; + string id = 1; } message DeleteResponse {} diff --git a/vendor/github.com/micro/go-micro/v2/auth/service/service.go b/vendor/github.com/micro/go-micro/v2/auth/service/service.go index c0f7e7dd7..9c3bd3230 100644 --- a/vendor/github.com/micro/go-micro/v2/auth/service/service.go +++ b/vendor/github.com/micro/go-micro/v2/auth/service/service.go @@ -2,35 +2,23 @@ package service import ( "context" - "fmt" - "sort" "strings" - "sync" "time" "github.com/micro/go-micro/v2/auth" + "github.com/micro/go-micro/v2/auth/rules" pb "github.com/micro/go-micro/v2/auth/service/proto" "github.com/micro/go-micro/v2/auth/token" "github.com/micro/go-micro/v2/auth/token/jwt" "github.com/micro/go-micro/v2/client" - log "github.com/micro/go-micro/v2/logger" - "github.com/micro/go-micro/v2/util/jitter" ) -// NewAuth returns a new instance of the Auth service -func NewAuth(opts ...auth.Option) auth.Auth { - return &svc{options: auth.NewOptions(opts...)} -} - // svc is the service implementation of the Auth interface type svc struct { options auth.Options auth pb.AuthService - rule pb.RulesService + rules pb.RulesService jwt token.Provider - - rules []*pb.Rule - sync.Mutex } func (s *svc) String() string { @@ -42,9 +30,12 @@ func (s *svc) Init(opts ...auth.Option) { o(&s.options) } - dc := client.DefaultClient - s.auth = pb.NewAuthService("go.micro.auth", dc) - s.rule = pb.NewRulesService("go.micro.auth", dc) + if s.options.Client == nil { + s.options.Client = client.DefaultClient + } + + s.auth = pb.NewAuthService("go.micro.auth", s.options.Client) + s.rules = pb.NewRulesService("go.micro.auth", s.options.Client) // if we have a JWT public key passed as an option, // we can decode tokens with the type "JWT" locally @@ -52,29 +43,9 @@ func (s *svc) Init(opts ...auth.Option) { if key := s.options.PublicKey; len(key) > 0 { s.jwt = jwt.NewTokenProvider(token.WithPublicKey(key)) } - - // load rules periodically from the auth service - go func() { - ruleTimer := time.NewTicker(time.Second * 30) - - // load rules immediately on startup - s.loadRules() - - for { - <-ruleTimer.C - - // jitter for up to 5 seconds, this stops - // all the services calling the auth service - // at the exact same time - time.Sleep(jitter.Do(time.Second * 5)) - s.loadRules() - } - }() } func (s *svc) Options() auth.Options { - s.Lock() - defer s.Unlock() return s.options } @@ -83,13 +54,12 @@ func (s *svc) Generate(id string, opts ...auth.GenerateOption) (*auth.Account, e options := auth.NewGenerateOptions(opts...) rsp, err := s.auth.Generate(context.TODO(), &pb.GenerateRequest{ - Id: id, - Type: options.Type, - Secret: options.Secret, - Roles: options.Roles, - Metadata: options.Metadata, - Provider: options.Provider, - Namespace: options.Namespace, + Id: id, + Type: options.Type, + Secret: options.Secret, + Scopes: options.Scopes, + Metadata: options.Metadata, + Provider: options.Provider, }) if err != nil { return nil, err @@ -99,87 +69,75 @@ func (s *svc) Generate(id string, opts ...auth.GenerateOption) (*auth.Account, e } // Grant access to a resource -func (s *svc) Grant(role string, res *auth.Resource) error { - _, err := s.rule.Create(context.TODO(), &pb.CreateRequest{ - Role: role, - Access: pb.Access_GRANTED, - Resource: &pb.Resource{ - Namespace: res.Namespace, - Type: res.Type, - Name: res.Name, - Endpoint: res.Endpoint, +func (s *svc) Grant(rule *auth.Rule) error { + access := pb.Access_UNKNOWN + if rule.Access == auth.AccessGranted { + access = pb.Access_GRANTED + } else if rule.Access == auth.AccessDenied { + access = pb.Access_DENIED + } + + _, err := s.rules.Create(context.TODO(), &pb.CreateRequest{ + Rule: &pb.Rule{ + Id: rule.ID, + Scope: rule.Scope, + Priority: rule.Priority, + Access: access, + Resource: &pb.Resource{ + Type: rule.Resource.Type, + Name: rule.Resource.Name, + Endpoint: rule.Resource.Endpoint, + }, }, }) + return err } // Revoke access to a resource -func (s *svc) Revoke(role string, res *auth.Resource) error { - _, err := s.rule.Delete(context.TODO(), &pb.DeleteRequest{ - Role: role, - Access: pb.Access_GRANTED, - Resource: &pb.Resource{ - Namespace: res.Namespace, - Type: res.Type, - Name: res.Name, - Endpoint: res.Endpoint, - }, +func (s *svc) Revoke(rule *auth.Rule) error { + _, err := s.rules.Delete(context.TODO(), &pb.DeleteRequest{ + Id: rule.ID, }) + return err } -// Verify an account has access to a resource -func (s *svc) Verify(acc *auth.Account, res *auth.Resource) error { - // set the namespace on the resource - if len(res.Namespace) == 0 { - res.Namespace = s.Options().Namespace +func (s *svc) Rules(opts ...auth.RulesOption) ([]*auth.Rule, error) { + var options auth.RulesOptions + for _, o := range opts { + o(&options) } - - queries := [][]string{ - {res.Namespace, res.Type, res.Name, res.Endpoint}, // check for specific role, e.g. service.foo.ListFoo:admin (role is checked in accessForRule) - {res.Namespace, res.Type, res.Name, "*"}, // check for wildcard endpoint, e.g. service.foo* - {res.Namespace, res.Type, "*"}, // check for wildcard name, e.g. service.* - {res.Namespace, "*"}, // check for wildcard type, e.g. * - {"*"}, // check for wildcard namespace + if options.Context == nil { + options.Context = context.TODO() } - // endpoint is a url which can have wildcard excludes, e.g. - // "/foo/*" will allow "/foo/bar" - if comps := strings.Split(res.Endpoint, "/"); len(comps) > 1 { - for i := 1; i < len(comps); i++ { - wildcard := fmt.Sprintf("%v/*", strings.Join(comps[0:i], "/")) - queries = append(queries, []string{res.Type, res.Name, wildcard}) - } + rsp, err := s.rules.List(options.Context, &pb.ListRequest{}, client.WithCache(time.Second*30)) + if err != nil { + return nil, err } - // set a default account id / namespace to log - logID := acc.ID - if len(logID) == 0 { - logID = "[no account]" + rules := make([]*auth.Rule, len(rsp.Rules)) + for i, r := range rsp.Rules { + rules[i] = serializeRule(r) } - logNamespace := acc.Namespace - if len(logNamespace) == 0 { - logNamespace = "[no namespace]" + + return rules, nil +} + +// Verify an account has access to a resource +func (s *svc) Verify(acc *auth.Account, res *auth.Resource, opts ...auth.VerifyOption) error { + var options auth.VerifyOptions + for _, o := range opts { + o(&options) } - for _, q := range queries { - for _, rule := range s.listRules(q...) { - switch accessForRule(rule, acc, res) { - case pb.Access_UNKNOWN: - continue // rule did not specify access, check the next rule - case pb.Access_GRANTED: - log.Tracef("%v:%v granted access to %v:%v:%v:%v by rule %v", logNamespace, logID, res.Namespace, res.Type, res.Name, res.Endpoint, rule.Id) - return nil // rule grants the account access to the resource - case pb.Access_DENIED: - log.Tracef("%v:%v denied access to %v:%v:%v:%v by rule %v", logNamespace, logID, res.Namespace, res.Type, res.Name, res.Endpoint, rule.Id) - return auth.ErrForbidden // rule denies access to the resource - } - } + rs, err := s.Rules(auth.RulesContext(options.Context)) + if err != nil { + return err } - // no rules were found for the resource, default to denying access - log.Tracef("%v:%v denied access to %v:%v:%v:%v by lack of rule (%v rules found for namespace)", logNamespace, logID, res.Namespace, res.Type, res.Name, res.Endpoint, len(s.listRules(res.Namespace))) - return auth.ErrForbidden + return rules.Verify(rs, acc, res) } // Inspect a token @@ -215,75 +173,6 @@ func (s *svc) Token(opts ...auth.TokenOption) (*auth.Token, error) { return serializeToken(rsp.Token), nil } -var ruleJoinKey = ":" - -// accessForRule returns a rule status, indicating if a rule permits access to a -// resource for a given account -func accessForRule(rule *pb.Rule, acc *auth.Account, res *auth.Resource) pb.Access { - if rule.Role == "*" { - return rule.Access - } - - for _, role := range acc.Roles { - if rule.Role == role { - return rule.Access - } - - // allow user.anything if role is user.* - if strings.HasSuffix(rule.Role, ".*") && strings.HasPrefix(rule.Role, role+".") { - return rule.Access - } - } - - return pb.Access_UNKNOWN -} - -// listRules gets all the rules from the store which match the filters. -// filters are namespace, type, name and then endpoint. -func (s *svc) listRules(filters ...string) []*pb.Rule { - s.Lock() - defer s.Unlock() - - var rules []*pb.Rule - for _, r := range s.rules { - if len(filters) > 0 && r.Resource.Namespace != filters[0] { - continue - } - if len(filters) > 1 && r.Resource.Type != filters[1] { - continue - } - if len(filters) > 2 && r.Resource.Name != filters[2] { - continue - } - if len(filters) > 3 && r.Resource.Endpoint != filters[3] { - continue - } - - rules = append(rules, r) - } - - // sort rules by priority - sort.Slice(rules, func(i, j int) bool { - return rules[i].Priority < rules[j].Priority - }) - - return rules -} - -// loadRules retrieves the rules from the auth service -func (s *svc) loadRules() { - rsp, err := s.rule.List(context.TODO(), &pb.ListRequest{}) - s.Lock() - defer s.Unlock() - - if err != nil { - log.Errorf("Error listing rules: %v", err) - return - } - - s.rules = rsp.Rules -} - func serializeToken(t *pb.Token) *auth.Token { return &auth.Token{ AccessToken: t.AccessToken, @@ -295,11 +184,45 @@ func serializeToken(t *pb.Token) *auth.Token { func serializeAccount(a *pb.Account) *auth.Account { return &auth.Account{ - ID: a.Id, - Roles: a.Roles, - Secret: a.Secret, - Metadata: a.Metadata, - Provider: a.Provider, - Namespace: a.Namespace, + ID: a.Id, + Secret: a.Secret, + Issuer: a.Issuer, + Metadata: a.Metadata, + Scopes: a.Scopes, + } +} + +func serializeRule(r *pb.Rule) *auth.Rule { + var access auth.Access + if r.Access == pb.Access_GRANTED { + access = auth.AccessGranted + } else { + access = auth.AccessDenied + } + + return &auth.Rule{ + ID: r.Id, + Scope: r.Scope, + Access: access, + Priority: r.Priority, + Resource: &auth.Resource{ + Type: r.Resource.Type, + Name: r.Resource.Name, + Endpoint: r.Resource.Endpoint, + }, + } +} + +// NewAuth returns a new instance of the Auth service +func NewAuth(opts ...auth.Option) auth.Auth { + options := auth.NewOptions(opts...) + if options.Client == nil { + options.Client = client.DefaultClient + } + + return &svc{ + auth: pb.NewAuthService("go.micro.auth", options.Client), + rules: pb.NewRulesService("go.micro.auth", options.Client), + options: options, } } diff --git a/vendor/github.com/micro/go-micro/v2/auth/token/jwt/jwt.go b/vendor/github.com/micro/go-micro/v2/auth/token/jwt/jwt.go index a633736d7..04ce7d6fb 100644 --- a/vendor/github.com/micro/go-micro/v2/auth/token/jwt/jwt.go +++ b/vendor/github.com/micro/go-micro/v2/auth/token/jwt/jwt.go @@ -11,11 +11,9 @@ import ( // authClaims to be encoded in the JWT type authClaims struct { - Type string `json:"type"` - Roles []string `json:"roles"` - Provider string `json:"provider"` - Metadata map[string]string `json:"metadata"` - Namespace string `json:"namespace"` + Type string `json:"type"` + Scopes []string `json:"scopes"` + Metadata map[string]string `json:"metadata"` jwt.StandardClaims } @@ -52,8 +50,9 @@ func (j *JWT) Generate(acc *auth.Account, opts ...token.GenerateOption) (*token. // generate the JWT expiry := time.Now().Add(options.Expiry) t := jwt.NewWithClaims(jwt.SigningMethodRS256, authClaims{ - acc.Type, acc.Roles, acc.Provider, acc.Metadata, acc.Namespace, jwt.StandardClaims{ + acc.Type, acc.Scopes, acc.Metadata, jwt.StandardClaims{ Subject: acc.ID, + Issuer: acc.Issuer, ExpiresAt: expiry.Unix(), }, }) @@ -97,12 +96,11 @@ func (j *JWT) Inspect(t string) (*auth.Account, error) { // return the token return &auth.Account{ - ID: claims.Subject, - Type: claims.Type, - Roles: claims.Roles, - Provider: claims.Provider, - Metadata: claims.Metadata, - Namespace: claims.Namespace, + ID: claims.Subject, + Issuer: claims.Issuer, + Type: claims.Type, + Scopes: claims.Scopes, + Metadata: claims.Metadata, }, nil } diff --git a/vendor/github.com/micro/go-micro/v2/client/grpc/grpc.go b/vendor/github.com/micro/go-micro/v2/client/grpc/grpc.go index 1932f9ce5..7571e5bf3 100644 --- a/vendor/github.com/micro/go-micro/v2/client/grpc/grpc.go +++ b/vendor/github.com/micro/go-micro/v2/client/grpc/grpc.go @@ -6,6 +6,7 @@ import ( "crypto/tls" "fmt" "net" + "reflect" "strings" "sync/atomic" "time" @@ -173,7 +174,7 @@ func (g *grpcClient) call(ctx context.Context, node *registry.Node, req client.R return grr } -func (g *grpcClient) stream(ctx context.Context, node *registry.Node, req client.Request, opts client.CallOptions) (client.Stream, error) { +func (g *grpcClient) stream(ctx context.Context, node *registry.Node, req client.Request, rsp interface{}, opts client.CallOptions) error { var header map[string]string address := node.Address @@ -199,7 +200,7 @@ func (g *grpcClient) stream(ctx context.Context, node *registry.Node, req client cf, err := g.newGRPCCodec(req.ContentType()) if err != nil { - return nil, errors.InternalServerError("go.micro.client", err.Error()) + return errors.InternalServerError("go.micro.client", err.Error()) } var dialCtx context.Context @@ -224,7 +225,7 @@ func (g *grpcClient) stream(ctx context.Context, node *registry.Node, req client cc, err := grpc.DialContext(dialCtx, address, grpcDialOptions...) if err != nil { - return nil, errors.InternalServerError("go.micro.client", fmt.Sprintf("Error sending request: %v", err)) + return errors.InternalServerError("go.micro.client", fmt.Sprintf("Error sending request: %v", err)) } desc := &grpc.StreamDesc{ @@ -252,7 +253,7 @@ func (g *grpcClient) stream(ctx context.Context, node *registry.Node, req client // close the connection cc.Close() // now return the error - return nil, errors.InternalServerError("go.micro.client", fmt.Sprintf("Error creating stream: %v", err)) + return errors.InternalServerError("go.micro.client", fmt.Sprintf("Error creating stream: %v", err)) } codec := &grpcCodec{ @@ -265,21 +266,25 @@ func (g *grpcClient) stream(ctx context.Context, node *registry.Node, req client r.codec = codec } - rsp := &response{ - conn: cc, + // setup the stream response + stream := &grpcStream{ + context: ctx, + request: req, + response: &response{ + conn: cc, + stream: st, + codec: cf, + gcodec: codec, + }, stream: st, - codec: cf, - gcodec: codec, - } - - return &grpcStream{ - context: ctx, - request: req, - response: rsp, - stream: st, - conn: cc, - cancel: cancel, - }, nil + conn: cc, + cancel: cancel, + } + + // set the stream as the response + val := reflect.ValueOf(rsp).Elem() + val.Set(reflect.ValueOf(stream).Elem()) + return nil } func (g *grpcClient) poolMaxStreams() int { @@ -506,6 +511,14 @@ func (g *grpcClient) Stream(ctx context.Context, req client.Request, opts ...cli default: } + // make a copy of stream + gstream := g.stream + + // wrap the call in reverse + for i := len(callOpts.CallWrappers); i > 0; i-- { + gstream = callOpts.CallWrappers[i-1](gstream) + } + call := func(i int) (client.Stream, error) { // call backoff first. Someone may want an initial start delay t, err := callOpts.Backoff(ctx, req, i) @@ -527,7 +540,10 @@ func (g *grpcClient) Stream(ctx context.Context, req client.Request, opts ...cli return nil, errors.InternalServerError("go.micro.client", "error selecting %s node: %s", service, err.Error()) } - stream, err := g.stream(ctx, node, req, callOpts) + // make the call + stream := &grpcStream{} + err = g.stream(ctx, node, req, stream, callOpts) + g.opts.Selector.Mark(service, node, err) return stream, err } diff --git a/vendor/github.com/micro/go-micro/v2/client/options.go b/vendor/github.com/micro/go-micro/v2/client/options.go index fed5992f7..8ba146981 100644 --- a/vendor/github.com/micro/go-micro/v2/client/options.go +++ b/vendor/github.com/micro/go-micro/v2/client/options.go @@ -4,7 +4,6 @@ import ( "context" "time" - "github.com/micro/go-micro/v2/auth" "github.com/micro/go-micro/v2/broker" "github.com/micro/go-micro/v2/client/selector" "github.com/micro/go-micro/v2/codec" @@ -17,7 +16,6 @@ type Options struct { ContentType string // Plugged interfaces - Auth auth.Auth Broker broker.Broker Codecs map[string]codec.NewCodec Registry registry.Registry @@ -31,6 +29,9 @@ type Options struct { PoolSize int PoolTTL time.Duration + // Response cache + Cache *Cache + // Middleware for client Wrappers []Wrapper @@ -61,6 +62,8 @@ type CallOptions struct { StreamTimeout time.Duration // Use the services own auth token ServiceToken bool + // Duration to cache the response for + CacheExpiry time.Duration // Middleware for low level call func CallWrappers []CallWrapper @@ -93,6 +96,7 @@ type RequestOptions struct { func NewOptions(options ...Option) Options { opts := Options{ + Cache: NewCache(), Context: context.Background(), ContentType: DefaultContentType, Codecs: make(map[string]codec.NewCodec), @@ -105,7 +109,6 @@ func NewOptions(options ...Option) Options { }, PoolSize: DefaultPoolSize, PoolTTL: DefaultPoolTTL, - Auth: auth.DefaultAuth, Broker: broker.DefaultBroker, Selector: selector.DefaultSelector, Registry: registry.DefaultRegistry, @@ -126,13 +129,6 @@ func Broker(b broker.Broker) Option { } } -// Auth to be used when making a request -func Auth(a auth.Auth) Option { - return func(o *Options) { - o.Auth = a - } -} - // Codec to be used to encode/decode requests for a given content type func Codec(contentType string, c codec.NewCodec) Option { return func(o *Options) { @@ -334,6 +330,14 @@ func WithServiceToken() CallOption { } } +// WithCache is a CallOption which sets the duration the response +// shoull be cached for +func WithCache(c time.Duration) CallOption { + return func(o *CallOptions) { + o.CacheExpiry = c + } +} + func WithMessageContentType(ct string) MessageOption { return func(o *MessageOptions) { o.ContentType = ct diff --git a/vendor/github.com/micro/go-micro/v2/client/rpc_client.go b/vendor/github.com/micro/go-micro/v2/client/rpc_client.go index d66a918a9..20d075465 100644 --- a/vendor/github.com/micro/go-micro/v2/client/rpc_client.go +++ b/vendor/github.com/micro/go-micro/v2/client/rpc_client.go @@ -114,8 +114,7 @@ func (r *rpcClient) call(ctx context.Context, node *registry.Node, req Request, return errors.InternalServerError("go.micro.client", "connection error: %v", err) } - seq := atomic.LoadUint64(&r.seq) - atomic.AddUint64(&r.seq, 1) + seq := atomic.AddUint64(&r.seq, 1) - 1 codec := newRpcCodec(msg, c, cf, "") rsp := &rpcResponse{ @@ -232,8 +231,7 @@ func (r *rpcClient) stream(ctx context.Context, node *registry.Node, req Request } // increment the sequence number - seq := atomic.LoadUint64(&r.seq) - atomic.AddUint64(&r.seq, 1) + seq := atomic.AddUint64(&r.seq, 1) - 1 id := fmt.Sprintf("%v", seq) // create codec with stream id diff --git a/vendor/github.com/micro/go-micro/v2/client/rpc_stream.go b/vendor/github.com/micro/go-micro/v2/client/rpc_stream.go index 7c880d88e..426aafc47 100644 --- a/vendor/github.com/micro/go-micro/v2/client/rpc_stream.go +++ b/vendor/github.com/micro/go-micro/v2/client/rpc_stream.go @@ -130,15 +130,15 @@ func (r *rpcStream) Error() error { } func (r *rpcStream) Close() error { - r.RLock() + r.Lock() select { case <-r.closed: - r.RUnlock() + r.Unlock() return nil default: close(r.closed) - r.RUnlock() + r.Unlock() // send the end of stream message if r.sendEOS { diff --git a/vendor/github.com/micro/go-micro/v2/config/cmd/cmd.go b/vendor/github.com/micro/go-micro/v2/config/cmd/cmd.go index 7cec8f99e..568a0c979 100644 --- a/vendor/github.com/micro/go-micro/v2/config/cmd/cmd.go +++ b/vendor/github.com/micro/go-micro/v2/config/cmd/cmd.go @@ -11,8 +11,10 @@ import ( "github.com/micro/go-micro/v2/auth/provider" "github.com/micro/go-micro/v2/broker" "github.com/micro/go-micro/v2/client" + "github.com/micro/go-micro/v2/client/grpc" "github.com/micro/go-micro/v2/client/selector" "github.com/micro/go-micro/v2/config" + configSrc "github.com/micro/go-micro/v2/config/source" configSrv "github.com/micro/go-micro/v2/config/source/service" "github.com/micro/go-micro/v2/debug/profile" "github.com/micro/go-micro/v2/debug/profile/http" @@ -20,10 +22,13 @@ import ( "github.com/micro/go-micro/v2/debug/trace" "github.com/micro/go-micro/v2/logger" "github.com/micro/go-micro/v2/registry" + registrySrv "github.com/micro/go-micro/v2/registry/service" "github.com/micro/go-micro/v2/runtime" "github.com/micro/go-micro/v2/server" "github.com/micro/go-micro/v2/store" "github.com/micro/go-micro/v2/transport" + authutil "github.com/micro/go-micro/v2/util/auth" + "github.com/micro/go-micro/v2/util/wrapper" // clients cgrpc "github.com/micro/go-micro/v2/client/grpc" @@ -270,6 +275,12 @@ var ( EnvVars: []string{"MICRO_AUTH_SECRET"}, Usage: "Account secret used for client authentication", }, + &cli.StringFlag{ + Name: "auth_namespace", + EnvVars: []string{"MICRO_AUTH_NAMESPACE"}, + Usage: "Namespace for the services auth account", + Value: "go.micro", + }, &cli.StringFlag{ Name: "auth_public_key", EnvVars: []string{"MICRO_AUTH_PUBLIC_KEY"}, @@ -458,10 +469,17 @@ func (c *cmd) Options() Options { func (c *cmd) Before(ctx *cli.Context) error { // If flags are set then use them otherwise do nothing - var authOpts []auth.Option var serverOpts []server.Option var clientOpts []client.Option + // setup a client to use when calling the runtime. It is important the auth client is wrapped + // after the cache client since the wrappers are applied in reverse order and the cache will use + // some of the headers set by the auth client. + authFn := func() auth.Auth { return *c.opts.Auth } + cacheFn := func() *client.Cache { return (*c.opts.Client).Options().Cache } + microClient := wrapper.CacheClient(cacheFn, grpc.NewClient()) + microClient = wrapper.AuthClient(authFn, microClient) + // Set the store if name := ctx.String("store"); len(name) > 0 { s, ok := c.opts.Stores[name] @@ -469,7 +487,7 @@ func (c *cmd) Before(ctx *cli.Context) error { return fmt.Errorf("Unsupported store: %s", name) } - *c.opts.Store = s() + *c.opts.Store = s(store.WithClient(microClient)) } // Set the runtime @@ -479,7 +497,7 @@ func (c *cmd) Before(ctx *cli.Context) error { return fmt.Errorf("Unsupported runtime: %s", name) } - *c.opts.Runtime = r() + *c.opts.Runtime = r(runtime.WithClient(microClient)) } // Set the tracer @@ -492,28 +510,6 @@ func (c *cmd) Before(ctx *cli.Context) error { *c.opts.Tracer = r() } - // Set the auth - if name := ctx.String("auth"); len(name) > 0 { - a, ok := c.opts.Auths[name] - if !ok { - return fmt.Errorf("Unsupported auth: %s", name) - } - - *c.opts.Auth = a() - clientOpts = append(clientOpts, client.Auth(*c.opts.Auth)) - serverOpts = append(serverOpts, server.Auth(*c.opts.Auth)) - } - - // Set the profile - if name := ctx.String("profile"); len(name) > 0 { - p, ok := c.opts.Profiles[name] - if !ok { - return fmt.Errorf("Unsupported profile: %s", name) - } - - *c.opts.Profile = p() - } - // Set the client if name := ctx.String("client"); len(name) > 0 { // only change if we have the client and type differs @@ -530,16 +526,58 @@ func (c *cmd) Before(ctx *cli.Context) error { } } - // Set the broker - if name := ctx.String("broker"); len(name) > 0 && (*c.opts.Broker).String() != name { - b, ok := c.opts.Brokers[name] + // Setup auth + authOpts := []auth.Option{auth.WithClient(microClient)} + + if len(ctx.String("auth_id")) > 0 || len(ctx.String("auth_secret")) > 0 { + authOpts = append(authOpts, auth.Credentials( + ctx.String("auth_id"), ctx.String("auth_secret"), + )) + } + if len(ctx.String("auth_public_key")) > 0 { + authOpts = append(authOpts, auth.PublicKey(ctx.String("auth_public_key"))) + } + if len(ctx.String("auth_private_key")) > 0 { + authOpts = append(authOpts, auth.PrivateKey(ctx.String("auth_private_key"))) + } + if len(ctx.String("auth_namespace")) > 0 { + authOpts = append(authOpts, auth.Namespace(ctx.String("auth_namespace"))) + } + if name := ctx.String("auth_provider"); len(name) > 0 { + p, ok := DefaultAuthProviders[name] if !ok { - return fmt.Errorf("Broker %s not found", name) + return fmt.Errorf("AuthProvider %s not found", name) } - *c.opts.Broker = b() - serverOpts = append(serverOpts, server.Broker(*c.opts.Broker)) - clientOpts = append(clientOpts, client.Broker(*c.opts.Broker)) + var provOpts []provider.Option + clientID := ctx.String("auth_provider_client_id") + clientSecret := ctx.String("auth_provider_client_secret") + if len(clientID) > 0 || len(clientSecret) > 0 { + provOpts = append(provOpts, provider.Credentials(clientID, clientSecret)) + } + if e := ctx.String("auth_provider_endpoint"); len(e) > 0 { + provOpts = append(provOpts, provider.Endpoint(e)) + } + if r := ctx.String("auth_provider_redirect"); len(r) > 0 { + provOpts = append(provOpts, provider.Redirect(r)) + } + if s := ctx.String("auth_provider_scope"); len(s) > 0 { + provOpts = append(provOpts, provider.Scope(s)) + } + + authOpts = append(authOpts, auth.Provider(p(provOpts...))) + } + + // Set the auth + if name := ctx.String("auth"); len(name) > 0 { + a, ok := c.opts.Auths[name] + if !ok { + return fmt.Errorf("Unsupported auth: %s", name) + } + *c.opts.Auth = a(authOpts...) + serverOpts = append(serverOpts, server.Auth(*c.opts.Auth)) + } else { + (*c.opts.Auth).Init(authOpts...) } // Set the registry @@ -549,7 +587,7 @@ func (c *cmd) Before(ctx *cli.Context) error { return fmt.Errorf("Registry %s not found", name) } - *c.opts.Registry = r() + *c.opts.Registry = r(registrySrv.WithClient(microClient)) serverOpts = append(serverOpts, server.Registry(*c.opts.Registry)) clientOpts = append(clientOpts, client.Registry(*c.opts.Registry)) @@ -564,6 +602,34 @@ func (c *cmd) Before(ctx *cli.Context) error { } } + // generate the services auth account + serverID := (*c.opts.Server).Options().Id + if err := authutil.Generate(serverID, c.App().Name, (*c.opts.Auth)); err != nil { + return err + } + + // Set the profile + if name := ctx.String("profile"); len(name) > 0 { + p, ok := c.opts.Profiles[name] + if !ok { + return fmt.Errorf("Unsupported profile: %s", name) + } + + *c.opts.Profile = p() + } + + // Set the broker + if name := ctx.String("broker"); len(name) > 0 && (*c.opts.Broker).String() != name { + b, ok := c.opts.Brokers[name] + if !ok { + return fmt.Errorf("Broker %s not found", name) + } + + *c.opts.Broker = b() + serverOpts = append(serverOpts, server.Broker(*c.opts.Broker)) + clientOpts = append(clientOpts, client.Broker(*c.opts.Broker)) + } + // Set the selector if name := ctx.String("selector"); len(name) > 0 && (*c.opts.Selector).String() != name { s, ok := c.opts.Selectors[name] @@ -675,48 +741,8 @@ func (c *cmd) Before(ctx *cli.Context) error { } } - if len(ctx.String("auth_id")) > 0 || len(ctx.String("auth_secret")) > 0 { - authOpts = append(authOpts, auth.Credentials( - ctx.String("auth_id"), ctx.String("auth_secret"), - )) - } - - if len(ctx.String("auth_public_key")) > 0 { - authOpts = append(authOpts, auth.PublicKey(ctx.String("auth_public_key"))) - } - if len(ctx.String("auth_private_key")) > 0 { - authOpts = append(authOpts, auth.PrivateKey(ctx.String("auth_private_key"))) - } - - if name := ctx.String("auth_provider"); len(name) > 0 { - p, ok := DefaultAuthProviders[name] - if !ok { - return fmt.Errorf("AuthProvider %s not found", name) - } - - var provOpts []provider.Option - - clientID := ctx.String("auth_provider_client_id") - clientSecret := ctx.String("auth_provider_client_secret") - if len(clientID) > 0 || len(clientSecret) > 0 { - provOpts = append(provOpts, provider.Credentials(clientID, clientSecret)) - } - if e := ctx.String("auth_provider_endpoint"); len(e) > 0 { - provOpts = append(provOpts, provider.Endpoint(e)) - } - if r := ctx.String("auth_provider_redirect"); len(r) > 0 { - provOpts = append(provOpts, provider.Redirect(r)) - } - if s := ctx.String("auth_provider_scope"); len(s) > 0 { - provOpts = append(provOpts, provider.Scope(s)) - } - - authOpts = append(authOpts, auth.Provider(p(provOpts...))) - } - (*c.opts.Auth).Init(authOpts...) - if ctx.String("config") == "service" { - opt := config.WithSource(configSrv.NewSource()) + opt := config.WithSource(configSrv.NewSource(configSrc.WithClient(microClient))) if err := (*c.opts.Config).Init(opt); err != nil { logger.Fatalf("Error configuring config: %v", err) } diff --git a/vendor/github.com/micro/go-micro/v2/config/cmd/options.go b/vendor/github.com/micro/go-micro/v2/config/cmd/options.go index 7ec9e2b4c..1dfc80762 100644 --- a/vendor/github.com/micro/go-micro/v2/config/cmd/options.go +++ b/vendor/github.com/micro/go-micro/v2/config/cmd/options.go @@ -100,6 +100,12 @@ func Registry(r *registry.Registry) Option { } } +func Runtime(r *runtime.Runtime) Option { + return func(o *Options) { + o.Runtime = r + } +} + func Transport(t *transport.Transport) Option { return func(o *Options) { o.Transport = t diff --git a/vendor/github.com/micro/go-micro/v2/config/default.go b/vendor/github.com/micro/go-micro/v2/config/default.go index 905ccad73..34a14c146 100644 --- a/vendor/github.com/micro/go-micro/v2/config/default.go +++ b/vendor/github.com/micro/go-micro/v2/config/default.go @@ -41,7 +41,6 @@ func newConfig(opts ...Option) (Config, error) { func (c *config) Init(opts ...Option) error { c.opts = Options{ - Loader: memory.NewLoader(), Reader: json.NewReader(), } c.exit = make(chan bool) @@ -49,6 +48,11 @@ func (c *config) Init(opts ...Option) error { o(&c.opts) } + // default loader uses the configured reader + if c.opts.Loader == nil { + c.opts.Loader = memory.NewLoader(memory.WithReader(c.opts.Reader)) + } + err := c.opts.Loader.Load(c.opts.Source...) if err != nil { return err @@ -82,6 +86,11 @@ func (c *config) run() { c.Lock() + if c.snap.Version >= snap.Version { + c.Unlock() + continue + } + // save c.snap = snap diff --git a/vendor/github.com/micro/go-micro/v2/config/loader/memory/memory.go b/vendor/github.com/micro/go-micro/v2/config/loader/memory/memory.go index 65c586bfd..5af7d5c48 100644 --- a/vendor/github.com/micro/go-micro/v2/config/loader/memory/memory.go +++ b/vendor/github.com/micro/go-micro/v2/config/loader/memory/memory.go @@ -32,19 +32,21 @@ type memory struct { watchers *list.List } +type updateValue struct { + version string + value reader.Value +} + type watcher struct { exit chan bool path []string value reader.Value reader reader.Reader - updates chan reader.Value + version string + updates chan updateValue } func (m *memory) watch(idx int, s source.Source) { - m.Lock() - m.sets = append(m.sets, &source.ChangeSet{Source: s.String()}) - m.Unlock() - // watches a source for changes watch := func(idx int, s source.Watcher) error { for { @@ -70,7 +72,7 @@ func (m *memory) watch(idx int, s source.Source) { m.vals, _ = m.opts.Reader.Values(set) m.snap = &loader.Snapshot{ ChangeSet: set, - Version: fmt.Sprintf("%d", time.Now().Unix()), + Version: genVer(), } m.Unlock() @@ -141,7 +143,7 @@ func (m *memory) reload() error { m.vals, _ = m.opts.Reader.Values(set) m.snap = &loader.Snapshot{ ChangeSet: set, - Version: fmt.Sprintf("%d", time.Now().Unix()), + Version: genVer(), } m.Unlock() @@ -159,11 +161,23 @@ func (m *memory) update() { for e := m.watchers.Front(); e != nil; e = e.Next() { watchers = append(watchers, e.Value.(*watcher)) } + + vals := m.vals + snap := m.snap m.RUnlock() for _, w := range watchers { + if w.version >= snap.Version { + continue + } + + uv := updateValue{ + version: m.snap.Version, + value: vals.Get(w.path...), + } + select { - case w.updates <- m.vals.Get(w.path...): + case w.updates <- uv: default: } } @@ -226,7 +240,7 @@ func (m *memory) Sync() error { m.vals = vals m.snap = &loader.Snapshot{ ChangeSet: set, - Version: fmt.Sprintf("%d", time.Now().Unix()), + Version: genVer(), } m.Unlock() @@ -285,6 +299,7 @@ func (m *memory) Get(path ...string) (reader.Value, error) { } // ok we're going hardcore now + return nil, errors.New("no values") } @@ -333,7 +348,8 @@ func (m *memory) Watch(path ...string) (loader.Watcher, error) { path: path, value: value, reader: m.opts.Reader, - updates: make(chan reader.Value, 1), + updates: make(chan updateValue, 1), + version: m.snap.Version, } e := m.watchers.PushBack(w) @@ -355,28 +371,43 @@ func (m *memory) String() string { } func (w *watcher) Next() (*loader.Snapshot, error) { + update := func(v reader.Value) *loader.Snapshot { + w.value = v + + cs := &source.ChangeSet{ + Data: v.Bytes(), + Format: w.reader.String(), + Source: "memory", + Timestamp: time.Now(), + } + cs.Checksum = cs.Sum() + + return &loader.Snapshot{ + ChangeSet: cs, + Version: w.version, + } + + } + for { select { case <-w.exit: return nil, errors.New("watcher stopped") - case v := <-w.updates: - if bytes.Equal(w.value.Bytes(), v.Bytes()) { + + case uv := <-w.updates: + if uv.version <= w.version { continue } - w.value = v - cs := &source.ChangeSet{ - Data: v.Bytes(), - Format: w.reader.String(), - Source: "memory", - Timestamp: time.Now(), + v := uv.value + + w.version = uv.version + + if bytes.Equal(w.value.Bytes(), v.Bytes()) { + continue } - cs.Sum() - return &loader.Snapshot{ - ChangeSet: cs, - Version: fmt.Sprintf("%d", time.Now().Unix()), - }, nil + return update(v), nil } } } @@ -386,10 +417,16 @@ func (w *watcher) Stop() error { case <-w.exit: default: close(w.exit) + close(w.updates) } + return nil } +func genVer() string { + return fmt.Sprintf("%d", time.Now().UnixNano()) +} + func NewLoader(opts ...loader.Option) loader.Loader { options := loader.Options{ Reader: json.NewReader(), @@ -406,7 +443,10 @@ func NewLoader(opts ...loader.Option) loader.Loader { sources: options.Source, } + m.sets = make([]*source.ChangeSet, len(options.Source)) + for i, s := range options.Source { + m.sets[i] = &source.ChangeSet{Source: s.String()} go m.watch(i, s) } diff --git a/vendor/github.com/micro/go-micro/v2/config/source/options.go b/vendor/github.com/micro/go-micro/v2/config/source/options.go index d4a2ba090..cd694a779 100644 --- a/vendor/github.com/micro/go-micro/v2/config/source/options.go +++ b/vendor/github.com/micro/go-micro/v2/config/source/options.go @@ -3,6 +3,7 @@ package source import ( "context" + "github.com/micro/go-micro/v2/client" "github.com/micro/go-micro/v2/config/encoder" "github.com/micro/go-micro/v2/config/encoder/json" ) @@ -13,6 +14,9 @@ type Options struct { // for alternative data Context context.Context + + // Client to use for RPC + Client client.Client } type Option func(o *Options) @@ -21,6 +25,7 @@ func NewOptions(opts ...Option) Options { options := Options{ Encoder: json.NewEncoder(), Context: context.Background(), + Client: client.DefaultClient, } for _, o := range opts { @@ -36,3 +41,10 @@ func WithEncoder(e encoder.Encoder) Option { o.Encoder = e } } + +// WithClient sets the source client +func WithClient(c client.Client) Option { + return func(o *Options) { + o.Client = c + } +} diff --git a/vendor/github.com/micro/go-micro/v2/config/source/service/service.go b/vendor/github.com/micro/go-micro/v2/config/source/service/service.go index cc5499eb8..25c06d526 100644 --- a/vendor/github.com/micro/go-micro/v2/config/source/service/service.go +++ b/vendor/github.com/micro/go-micro/v2/config/source/service/service.go @@ -2,10 +2,12 @@ package service import ( "context" + "net/http" "github.com/micro/go-micro/v2/client" "github.com/micro/go-micro/v2/config/source" proto "github.com/micro/go-micro/v2/config/source/service/proto" + "github.com/micro/go-micro/v2/errors" "github.com/micro/go-micro/v2/logger" ) @@ -24,12 +26,14 @@ type service struct { } func (m *service) Read() (set *source.ChangeSet, err error) { - client := proto.NewConfigService(m.serviceName, client.DefaultClient) + client := proto.NewConfigService(m.serviceName, m.opts.Client) req, err := client.Read(context.Background(), &proto.ReadRequest{ Namespace: m.namespace, Path: m.path, }) - if err != nil { + if verr, ok := err.(*errors.Error); ok && verr.Code == http.StatusNotFound { + return nil, nil + } else if err != nil { return nil, err } @@ -37,7 +41,7 @@ func (m *service) Read() (set *source.ChangeSet, err error) { } func (m *service) Watch() (w source.Watcher, err error) { - client := proto.NewConfigService(m.serviceName, client.DefaultClient) + client := proto.NewConfigService(m.serviceName, m.opts.Client) stream, err := client.Watch(context.Background(), &proto.WatchRequest{ Namespace: m.namespace, Path: m.path, @@ -87,6 +91,10 @@ func NewSource(opts ...source.Option) source.Source { } } + if options.Client == nil { + options.Client = client.DefaultClient + } + s := &service{ serviceName: addr, opts: options, diff --git a/vendor/github.com/micro/go-micro/v2/debug/service/handler/debug.go b/vendor/github.com/micro/go-micro/v2/debug/service/handler/debug.go index ffe1a9223..cf97cdc0a 100644 --- a/vendor/github.com/micro/go-micro/v2/debug/service/handler/debug.go +++ b/vendor/github.com/micro/go-micro/v2/debug/service/handler/debug.go @@ -5,6 +5,7 @@ import ( "context" "time" + "github.com/micro/go-micro/v2/client" "github.com/micro/go-micro/v2/debug/log" proto "github.com/micro/go-micro/v2/debug/service/proto" "github.com/micro/go-micro/v2/debug/stats" @@ -13,11 +14,12 @@ import ( ) // NewHandler returns an instance of the Debug Handler -func NewHandler() *Debug { +func NewHandler(c client.Client) *Debug { return &Debug{ log: log.DefaultLog, stats: stats.DefaultStats, trace: trace.DefaultTracer, + cache: c.Options().Cache, } } @@ -30,6 +32,8 @@ type Debug struct { stats stats.Stats // the tracer trace trace.Tracer + // the cache + cache *client.Cache } func (d *Debug) Health(ctx context.Context, req *proto.HealthRequest, rsp *proto.HealthResponse) error { @@ -164,3 +168,9 @@ func (d *Debug) Log(ctx context.Context, stream server.Stream) error { return nil } + +// Cache returns all the key value pairs in the client cache +func (d *Debug) Cache(ctx context.Context, req *proto.CacheRequest, rsp *proto.CacheResponse) error { + rsp.Values = d.cache.List() + return nil +} diff --git a/vendor/github.com/micro/go-micro/v2/debug/service/proto/debug.pb.go b/vendor/github.com/micro/go-micro/v2/debug/service/proto/debug.pb.go index 41e6aebec..859d44cd9 100644 --- a/vendor/github.com/micro/go-micro/v2/debug/service/proto/debug.pb.go +++ b/vendor/github.com/micro/go-micro/v2/debug/service/proto/debug.pb.go @@ -582,6 +582,76 @@ func (m *Span) GetType() SpanType { return SpanType_INBOUND } +type CacheRequest struct { + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *CacheRequest) Reset() { *m = CacheRequest{} } +func (m *CacheRequest) String() string { return proto.CompactTextString(m) } +func (*CacheRequest) ProtoMessage() {} +func (*CacheRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_df91f41a5db378e6, []int{9} +} + +func (m *CacheRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_CacheRequest.Unmarshal(m, b) +} +func (m *CacheRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_CacheRequest.Marshal(b, m, deterministic) +} +func (m *CacheRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_CacheRequest.Merge(m, src) +} +func (m *CacheRequest) XXX_Size() int { + return xxx_messageInfo_CacheRequest.Size(m) +} +func (m *CacheRequest) XXX_DiscardUnknown() { + xxx_messageInfo_CacheRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_CacheRequest proto.InternalMessageInfo + +type CacheResponse struct { + Values map[string]string `protobuf:"bytes,1,rep,name=values,proto3" json:"values,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *CacheResponse) Reset() { *m = CacheResponse{} } +func (m *CacheResponse) String() string { return proto.CompactTextString(m) } +func (*CacheResponse) ProtoMessage() {} +func (*CacheResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_df91f41a5db378e6, []int{10} +} + +func (m *CacheResponse) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_CacheResponse.Unmarshal(m, b) +} +func (m *CacheResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_CacheResponse.Marshal(b, m, deterministic) +} +func (m *CacheResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_CacheResponse.Merge(m, src) +} +func (m *CacheResponse) XXX_Size() int { + return xxx_messageInfo_CacheResponse.Size(m) +} +func (m *CacheResponse) XXX_DiscardUnknown() { + xxx_messageInfo_CacheResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_CacheResponse proto.InternalMessageInfo + +func (m *CacheResponse) GetValues() map[string]string { + if m != nil { + return m.Values + } + return nil +} + func init() { proto.RegisterEnum("SpanType", SpanType_name, SpanType_value) proto.RegisterType((*HealthRequest)(nil), "HealthRequest") @@ -595,50 +665,56 @@ func init() { proto.RegisterType((*TraceResponse)(nil), "TraceResponse") proto.RegisterType((*Span)(nil), "Span") proto.RegisterMapType((map[string]string)(nil), "Span.MetadataEntry") + proto.RegisterType((*CacheRequest)(nil), "CacheRequest") + proto.RegisterType((*CacheResponse)(nil), "CacheResponse") + proto.RegisterMapType((map[string]string)(nil), "CacheResponse.ValuesEntry") } func init() { proto.RegisterFile("debug/service/proto/debug.proto", fileDescriptor_df91f41a5db378e6) } var fileDescriptor_df91f41a5db378e6 = []byte{ - // 594 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x54, 0xdb, 0x6e, 0xd3, 0x40, - 0x10, 0x8d, 0xed, 0x38, 0xb1, 0xa7, 0x8d, 0xa9, 0x96, 0x8b, 0x2c, 0x73, 0x69, 0x65, 0x09, 0x29, - 0x5c, 0xe4, 0x40, 0x79, 0x41, 0xf0, 0x86, 0x8a, 0x04, 0x52, 0x69, 0xa5, 0x6d, 0xfb, 0x01, 0x5b, - 0x7b, 0xe4, 0x1a, 0xea, 0x0b, 0xbb, 0xeb, 0x4a, 0xf9, 0x16, 0xbe, 0x80, 0x37, 0x7e, 0x86, 0xff, - 0x41, 0x7b, 0x71, 0x1b, 0x0b, 0xa1, 0x3e, 0xf0, 0xb6, 0xe7, 0xec, 0xec, 0xc9, 0xcc, 0xc9, 0xf1, - 0xc0, 0x6e, 0x81, 0xe7, 0x7d, 0xb9, 0x12, 0xc8, 0xaf, 0xaa, 0x1c, 0x57, 0x1d, 0x6f, 0x65, 0xbb, - 0xd2, 0x5c, 0xa6, 0xcf, 0xe9, 0x33, 0x58, 0x7c, 0x42, 0x76, 0x29, 0x2f, 0x28, 0x7e, 0xef, 0x51, - 0x48, 0x12, 0xc3, 0xdc, 0x56, 0xc7, 0xce, 0x9e, 0xb3, 0x0c, 0xe9, 0x00, 0xd3, 0x25, 0x44, 0x43, - 0xa9, 0xe8, 0xda, 0x46, 0x20, 0x79, 0x00, 0x33, 0x21, 0x99, 0xec, 0x85, 0x2d, 0xb5, 0x28, 0x5d, - 0xc2, 0xf6, 0x89, 0x64, 0x52, 0xdc, 0xae, 0xf9, 0xdb, 0x81, 0x85, 0x2d, 0xb5, 0x9a, 0x8f, 0x20, - 0x94, 0x55, 0x8d, 0x42, 0xb2, 0xba, 0xd3, 0xd5, 0x53, 0x7a, 0x43, 0x68, 0x25, 0xc9, 0xb8, 0xc4, - 0x22, 0x76, 0xf5, 0xdd, 0x00, 0x55, 0x2f, 0x7d, 0xa7, 0x0a, 0x63, 0x4f, 0x5f, 0x58, 0xa4, 0xf8, - 0x1a, 0xeb, 0x96, 0xaf, 0xe3, 0xa9, 0xe1, 0x0d, 0x52, 0x4a, 0xf2, 0x82, 0x23, 0x2b, 0x44, 0xec, - 0x1b, 0x25, 0x0b, 0x49, 0x04, 0x6e, 0x99, 0xc7, 0x33, 0x4d, 0xba, 0x65, 0x4e, 0x12, 0x08, 0xb8, - 0x19, 0x44, 0xc4, 0x73, 0xcd, 0x5e, 0x63, 0xa5, 0x8e, 0x9c, 0xb7, 0x5c, 0xc4, 0x81, 0x51, 0x37, - 0x28, 0xfd, 0x0a, 0x70, 0xd8, 0x96, 0xb7, 0xce, 0x6f, 0x1c, 0xe4, 0xc8, 0x6a, 0x3d, 0x4e, 0x40, - 0x2d, 0x22, 0xf7, 0xc0, 0xcf, 0xdb, 0xbe, 0x91, 0x7a, 0x18, 0x8f, 0x1a, 0xa0, 0x58, 0x51, 0x35, - 0x39, 0xea, 0x51, 0x3c, 0x6a, 0x40, 0xfa, 0xcb, 0x81, 0x19, 0xc5, 0xbc, 0xe5, 0xc5, 0xdf, 0xe6, - 0x79, 0x9b, 0xe6, 0xbd, 0x86, 0xa0, 0x46, 0xc9, 0x0a, 0x26, 0x59, 0xec, 0xee, 0x79, 0xcb, 0xad, - 0xfd, 0xfb, 0x99, 0x79, 0x98, 0x7d, 0xb1, 0xfc, 0xc7, 0x46, 0xf2, 0x35, 0xbd, 0x2e, 0x53, 0x9d, - 0xd7, 0x28, 0x04, 0x2b, 0x8d, 0xad, 0x21, 0x1d, 0x60, 0xf2, 0x1e, 0x16, 0xa3, 0x47, 0x64, 0x07, - 0xbc, 0x6f, 0xb8, 0xb6, 0x03, 0xaa, 0xa3, 0x6a, 0xf7, 0x8a, 0x5d, 0xf6, 0xa8, 0x67, 0x0b, 0xa9, - 0x01, 0xef, 0xdc, 0xb7, 0x4e, 0xfa, 0x04, 0xb6, 0x4f, 0x39, 0xcb, 0x71, 0x30, 0x28, 0x02, 0xb7, - 0x2a, 0xec, 0x53, 0xb7, 0x2a, 0xd2, 0x97, 0xb0, 0xb0, 0xf7, 0x36, 0x15, 0x0f, 0xc1, 0x17, 0x1d, - 0x6b, 0x54, 0xd0, 0x54, 0xdf, 0x7e, 0x76, 0xd2, 0xb1, 0x86, 0x1a, 0x2e, 0xfd, 0xe1, 0xc2, 0x54, - 0x61, 0xf5, 0x83, 0x52, 0x3d, 0xb3, 0x4a, 0x06, 0x58, 0x71, 0x77, 0x10, 0x57, 0x9e, 0x77, 0x8c, - 0xa3, 0x35, 0x37, 0xa4, 0x16, 0x11, 0x02, 0xd3, 0x86, 0xd5, 0xc6, 0xdc, 0x90, 0xea, 0xf3, 0x66, - 0xde, 0xfc, 0x71, 0xde, 0x12, 0x08, 0x8a, 0x9e, 0x33, 0x59, 0xb5, 0x8d, 0xcd, 0xca, 0x35, 0x26, - 0xab, 0x0d, 0xa3, 0xe7, 0xba, 0xe1, 0xbb, 0xba, 0xe1, 0x7f, 0xda, 0xfc, 0x18, 0xa6, 0x72, 0xdd, - 0xa1, 0x0e, 0x51, 0xb4, 0x1f, 0xea, 0xe2, 0xd3, 0x75, 0x87, 0x54, 0xd3, 0xff, 0xe5, 0xf5, 0xf3, - 0xa7, 0x10, 0x0c, 0x72, 0x64, 0x0b, 0xe6, 0x9f, 0x8f, 0x3e, 0x1c, 0x9f, 0x1d, 0x1d, 0xec, 0x4c, - 0xc8, 0x36, 0x04, 0xc7, 0x67, 0xa7, 0x06, 0x39, 0xfb, 0x3f, 0x1d, 0xf0, 0x0f, 0xd4, 0x62, 0x20, - 0xbb, 0xe0, 0x1d, 0xb6, 0x25, 0xd9, 0xca, 0x6e, 0x12, 0x9c, 0xcc, 0x6d, 0x50, 0xd2, 0xc9, 0x2b, - 0x87, 0xbc, 0x80, 0x99, 0x59, 0x04, 0x24, 0xca, 0x46, 0xcb, 0x23, 0xb9, 0x93, 0x8d, 0x37, 0x44, - 0x3a, 0x21, 0x4b, 0xf0, 0xf5, 0x07, 0x4e, 0x16, 0xd9, 0xe6, 0x4e, 0x48, 0xa2, 0x6c, 0xf4, 0xdd, - 0x9b, 0x4a, 0xfd, 0xa7, 0x93, 0x45, 0xb6, 0x19, 0x8e, 0x24, 0xca, 0x46, 0x59, 0x48, 0x27, 0xe7, - 0x33, 0xbd, 0xbb, 0xde, 0xfc, 0x09, 0x00, 0x00, 0xff, 0xff, 0x6e, 0x42, 0x7f, 0x05, 0xde, 0x04, - 0x00, 0x00, + // 646 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x54, 0xdb, 0x6e, 0xd3, 0x4a, + 0x14, 0x8d, 0xed, 0x38, 0xb1, 0x77, 0x62, 0x9f, 0x6a, 0xce, 0x45, 0x96, 0x0f, 0xd0, 0xca, 0x12, + 0x52, 0xb8, 0x68, 0x02, 0xe1, 0x85, 0xcb, 0x1b, 0x14, 0x09, 0xa4, 0xd2, 0x4a, 0xd3, 0x96, 0xf7, + 0xa9, 0x3d, 0x4a, 0x03, 0xf5, 0x85, 0x99, 0x71, 0xa5, 0xbc, 0xf0, 0x23, 0xfc, 0x04, 0xff, 0x82, + 0xf8, 0x1f, 0x34, 0x17, 0xb7, 0xb6, 0x10, 0xaa, 0x10, 0x6f, 0x5e, 0x6b, 0xaf, 0xd9, 0xd9, 0x7b, + 0x69, 0x65, 0xc3, 0x6e, 0xc1, 0xce, 0xda, 0xf5, 0x52, 0x30, 0x7e, 0xb9, 0xc9, 0xd9, 0xb2, 0xe1, + 0xb5, 0xac, 0x97, 0x9a, 0xc3, 0xfa, 0x3b, 0xbb, 0x07, 0xd1, 0x1b, 0x46, 0x2f, 0xe4, 0x39, 0x61, + 0x9f, 0x5a, 0x26, 0x24, 0x4a, 0x60, 0x6a, 0xd5, 0x89, 0xb3, 0xe7, 0x2c, 0x42, 0xd2, 0xc1, 0x6c, + 0x01, 0x71, 0x27, 0x15, 0x4d, 0x5d, 0x09, 0x86, 0xfe, 0x83, 0x89, 0x90, 0x54, 0xb6, 0xc2, 0x4a, + 0x2d, 0xca, 0x16, 0x30, 0x3f, 0x96, 0x54, 0x8a, 0x9b, 0x7b, 0x7e, 0x77, 0x20, 0xb2, 0x52, 0xdb, + 0xf3, 0x16, 0x84, 0x72, 0x53, 0x32, 0x21, 0x69, 0xd9, 0x68, 0xf5, 0x98, 0x5c, 0x13, 0xba, 0x93, + 0xa4, 0x5c, 0xb2, 0x22, 0x71, 0x75, 0xad, 0x83, 0x6a, 0x96, 0xb6, 0x51, 0xc2, 0xc4, 0xd3, 0x05, + 0x8b, 0x14, 0x5f, 0xb2, 0xb2, 0xe6, 0xdb, 0x64, 0x6c, 0x78, 0x83, 0x54, 0x27, 0x79, 0xce, 0x19, + 0x2d, 0x44, 0xe2, 0x9b, 0x4e, 0x16, 0xa2, 0x18, 0xdc, 0x75, 0x9e, 0x4c, 0x34, 0xe9, 0xae, 0x73, + 0x94, 0x42, 0xc0, 0xcd, 0x22, 0x22, 0x99, 0x6a, 0xf6, 0x0a, 0xab, 0xee, 0x8c, 0xf3, 0x9a, 0x8b, + 0x24, 0x30, 0xdd, 0x0d, 0xca, 0x3e, 0x00, 0x1c, 0xd4, 0xeb, 0x1b, 0xf7, 0x37, 0x0e, 0x72, 0x46, + 0x4b, 0xbd, 0x4e, 0x40, 0x2c, 0x42, 0xff, 0x80, 0x9f, 0xd7, 0x6d, 0x25, 0xf5, 0x32, 0x1e, 0x31, + 0x40, 0xb1, 0x62, 0x53, 0xe5, 0x4c, 0xaf, 0xe2, 0x11, 0x03, 0xb2, 0xaf, 0x0e, 0x4c, 0x08, 0xcb, + 0x6b, 0x5e, 0xfc, 0x6c, 0x9e, 0xd7, 0x37, 0xef, 0x31, 0x04, 0x25, 0x93, 0xb4, 0xa0, 0x92, 0x26, + 0xee, 0x9e, 0xb7, 0x98, 0xad, 0xfe, 0xc5, 0xe6, 0x21, 0x7e, 0x67, 0xf9, 0xd7, 0x95, 0xe4, 0x5b, + 0x72, 0x25, 0x53, 0x93, 0x97, 0x4c, 0x08, 0xba, 0x36, 0xb6, 0x86, 0xa4, 0x83, 0xe9, 0x0b, 0x88, + 0x06, 0x8f, 0xd0, 0x0e, 0x78, 0x1f, 0xd9, 0xd6, 0x2e, 0xa8, 0x3e, 0xd5, 0xb8, 0x97, 0xf4, 0xa2, + 0x65, 0x7a, 0xb7, 0x90, 0x18, 0xf0, 0xdc, 0x7d, 0xea, 0x64, 0x77, 0x60, 0x7e, 0xc2, 0x69, 0xce, + 0x3a, 0x83, 0x62, 0x70, 0x37, 0x85, 0x7d, 0xea, 0x6e, 0x8a, 0xec, 0x21, 0x44, 0xb6, 0x6e, 0x53, + 0xf1, 0x3f, 0xf8, 0xa2, 0xa1, 0x95, 0x0a, 0x9a, 0x9a, 0xdb, 0xc7, 0xc7, 0x0d, 0xad, 0x88, 0xe1, + 0xb2, 0x2f, 0x2e, 0x8c, 0x15, 0x56, 0x3f, 0x28, 0xd5, 0x33, 0xdb, 0xc9, 0x00, 0xdb, 0xdc, 0xed, + 0x9a, 0x2b, 0xcf, 0x1b, 0xca, 0x99, 0x35, 0x37, 0x24, 0x16, 0x21, 0x04, 0xe3, 0x8a, 0x96, 0xc6, + 0xdc, 0x90, 0xe8, 0xef, 0x7e, 0xde, 0xfc, 0x61, 0xde, 0x52, 0x08, 0x8a, 0x96, 0x53, 0xb9, 0xa9, + 0x2b, 0x9b, 0x95, 0x2b, 0x8c, 0x96, 0x3d, 0xa3, 0xa7, 0x7a, 0xe0, 0xbf, 0xf5, 0xc0, 0xbf, 0xb4, + 0xf9, 0x36, 0x8c, 0xe5, 0xb6, 0x61, 0x3a, 0x44, 0xf1, 0x2a, 0xd4, 0xe2, 0x93, 0x6d, 0xc3, 0x88, + 0xa6, 0xff, 0xcc, 0xeb, 0x18, 0xe6, 0xaf, 0x68, 0x7e, 0xde, 0x79, 0x9d, 0x7d, 0x86, 0xc8, 0x62, + 0xeb, 0xed, 0x0a, 0x26, 0x5a, 0xdd, 0x99, 0x9b, 0xe2, 0x41, 0x1d, 0xbf, 0xd7, 0x45, 0x33, 0xb2, + 0x55, 0xa6, 0xcf, 0x60, 0xd6, 0xa3, 0x7f, 0x67, 0x9e, 0xfb, 0x77, 0x21, 0xe8, 0xd6, 0x43, 0x33, + 0x98, 0xbe, 0x3d, 0x7c, 0x79, 0x74, 0x7a, 0xb8, 0xbf, 0x33, 0x42, 0x73, 0x08, 0x8e, 0x4e, 0x4f, + 0x0c, 0x72, 0x56, 0xdf, 0x1c, 0xf0, 0xf7, 0xd5, 0xa1, 0x42, 0xbb, 0xe0, 0x1d, 0xd4, 0x6b, 0x34, + 0xc3, 0xd7, 0xff, 0xa8, 0x74, 0x6a, 0x83, 0x9b, 0x8d, 0x1e, 0x39, 0xe8, 0x01, 0x4c, 0xcc, 0x61, + 0x42, 0x31, 0x1e, 0x1c, 0xb3, 0xf4, 0x2f, 0x3c, 0xbc, 0x58, 0xd9, 0x08, 0x2d, 0xc0, 0xd7, 0x07, + 0x07, 0x45, 0xb8, 0x7f, 0xa3, 0xd2, 0x18, 0x0f, 0xee, 0x90, 0x51, 0xea, 0x10, 0xa2, 0x08, 0xf7, + 0xc3, 0x9a, 0xc6, 0x78, 0x90, 0x4d, 0xa3, 0xd4, 0x96, 0xa1, 0x08, 0xf7, 0xad, 0x4e, 0xe3, 0xa1, + 0x93, 0xd9, 0xe8, 0x6c, 0xa2, 0xaf, 0xee, 0x93, 0x1f, 0x01, 0x00, 0x00, 0xff, 0xff, 0x22, 0x65, + 0x99, 0x10, 0x98, 0x05, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -657,6 +733,7 @@ type DebugClient interface { Health(ctx context.Context, in *HealthRequest, opts ...grpc.CallOption) (*HealthResponse, error) Stats(ctx context.Context, in *StatsRequest, opts ...grpc.CallOption) (*StatsResponse, error) Trace(ctx context.Context, in *TraceRequest, opts ...grpc.CallOption) (*TraceResponse, error) + Cache(ctx context.Context, in *CacheRequest, opts ...grpc.CallOption) (*CacheResponse, error) } type debugClient struct { @@ -726,12 +803,22 @@ func (c *debugClient) Trace(ctx context.Context, in *TraceRequest, opts ...grpc. return out, nil } +func (c *debugClient) Cache(ctx context.Context, in *CacheRequest, opts ...grpc.CallOption) (*CacheResponse, error) { + out := new(CacheResponse) + err := c.cc.Invoke(ctx, "/Debug/Cache", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // DebugServer is the server API for Debug service. type DebugServer interface { Log(*LogRequest, Debug_LogServer) error Health(context.Context, *HealthRequest) (*HealthResponse, error) Stats(context.Context, *StatsRequest) (*StatsResponse, error) Trace(context.Context, *TraceRequest) (*TraceResponse, error) + Cache(context.Context, *CacheRequest) (*CacheResponse, error) } // UnimplementedDebugServer can be embedded to have forward compatible implementations. @@ -750,6 +837,9 @@ func (*UnimplementedDebugServer) Stats(ctx context.Context, req *StatsRequest) ( func (*UnimplementedDebugServer) Trace(ctx context.Context, req *TraceRequest) (*TraceResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Trace not implemented") } +func (*UnimplementedDebugServer) Cache(ctx context.Context, req *CacheRequest) (*CacheResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Cache not implemented") +} func RegisterDebugServer(s *grpc.Server, srv DebugServer) { s.RegisterService(&_Debug_serviceDesc, srv) @@ -830,6 +920,24 @@ func _Debug_Trace_Handler(srv interface{}, ctx context.Context, dec func(interfa return interceptor(ctx, in, info, handler) } +func _Debug_Cache_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CacheRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DebugServer).Cache(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/Debug/Cache", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DebugServer).Cache(ctx, req.(*CacheRequest)) + } + return interceptor(ctx, in, info, handler) +} + var _Debug_serviceDesc = grpc.ServiceDesc{ ServiceName: "Debug", HandlerType: (*DebugServer)(nil), @@ -846,6 +954,10 @@ var _Debug_serviceDesc = grpc.ServiceDesc{ MethodName: "Trace", Handler: _Debug_Trace_Handler, }, + { + MethodName: "Cache", + Handler: _Debug_Cache_Handler, + }, }, Streams: []grpc.StreamDesc{ { diff --git a/vendor/github.com/micro/go-micro/v2/debug/service/proto/debug.pb.micro.go b/vendor/github.com/micro/go-micro/v2/debug/service/proto/debug.pb.micro.go index 3d71b7224..1e436e221 100644 --- a/vendor/github.com/micro/go-micro/v2/debug/service/proto/debug.pb.micro.go +++ b/vendor/github.com/micro/go-micro/v2/debug/service/proto/debug.pb.micro.go @@ -46,6 +46,7 @@ type DebugService interface { Health(ctx context.Context, in *HealthRequest, opts ...client.CallOption) (*HealthResponse, error) Stats(ctx context.Context, in *StatsRequest, opts ...client.CallOption) (*StatsResponse, error) Trace(ctx context.Context, in *TraceRequest, opts ...client.CallOption) (*TraceResponse, error) + Cache(ctx context.Context, in *CacheRequest, opts ...client.CallOption) (*CacheResponse, error) } type debugService struct { @@ -139,6 +140,16 @@ func (c *debugService) Trace(ctx context.Context, in *TraceRequest, opts ...clie return out, nil } +func (c *debugService) Cache(ctx context.Context, in *CacheRequest, opts ...client.CallOption) (*CacheResponse, error) { + req := c.c.NewRequest(c.name, "Debug.Cache", in) + out := new(CacheResponse) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // Server API for Debug service type DebugHandler interface { @@ -146,6 +157,7 @@ type DebugHandler interface { Health(context.Context, *HealthRequest, *HealthResponse) error Stats(context.Context, *StatsRequest, *StatsResponse) error Trace(context.Context, *TraceRequest, *TraceResponse) error + Cache(context.Context, *CacheRequest, *CacheResponse) error } func RegisterDebugHandler(s server.Server, hdlr DebugHandler, opts ...server.HandlerOption) error { @@ -154,6 +166,7 @@ func RegisterDebugHandler(s server.Server, hdlr DebugHandler, opts ...server.Han Health(ctx context.Context, in *HealthRequest, out *HealthResponse) error Stats(ctx context.Context, in *StatsRequest, out *StatsResponse) error Trace(ctx context.Context, in *TraceRequest, out *TraceResponse) error + Cache(ctx context.Context, in *CacheRequest, out *CacheResponse) error } type Debug struct { debug @@ -217,3 +230,7 @@ func (h *debugHandler) Stats(ctx context.Context, in *StatsRequest, out *StatsRe func (h *debugHandler) Trace(ctx context.Context, in *TraceRequest, out *TraceResponse) error { return h.DebugHandler.Trace(ctx, in, out) } + +func (h *debugHandler) Cache(ctx context.Context, in *CacheRequest, out *CacheResponse) error { + return h.DebugHandler.Cache(ctx, in, out) +} diff --git a/vendor/github.com/micro/go-micro/v2/debug/service/proto/debug.proto b/vendor/github.com/micro/go-micro/v2/debug/service/proto/debug.proto index 7516651e9..6646cb654 100644 --- a/vendor/github.com/micro/go-micro/v2/debug/service/proto/debug.proto +++ b/vendor/github.com/micro/go-micro/v2/debug/service/proto/debug.proto @@ -1,10 +1,11 @@ syntax = "proto3"; service Debug { - rpc Log(LogRequest) returns (stream Record) {}; - rpc Health(HealthRequest) returns (HealthResponse) {}; - rpc Stats(StatsRequest) returns (StatsResponse) {}; + rpc Log(LogRequest) returns (stream Record) {}; + rpc Health(HealthRequest) returns (HealthResponse) {}; + rpc Stats(StatsRequest) returns (StatsResponse) {}; rpc Trace(TraceRequest) returns (TraceResponse) {}; + rpc Cache(CacheRequest) returns (CacheResponse) {}; } message HealthRequest { @@ -97,3 +98,9 @@ message Span { map metadata = 7; SpanType type = 8; } + +message CacheRequest {} + +message CacheResponse { + map values = 1; +} \ No newline at end of file diff --git a/vendor/github.com/micro/go-micro/v2/go.mod b/vendor/github.com/micro/go-micro/v2/go.mod index fe1ce6b05..dea316734 100644 --- a/vendor/github.com/micro/go-micro/v2/go.mod +++ b/vendor/github.com/micro/go-micro/v2/go.mod @@ -2,11 +2,14 @@ module github.com/micro/go-micro/v2 go 1.13 +replace github.com/imdario/mergo => github.com/imdario/mergo v0.3.8 + require ( github.com/BurntSushi/toml v0.3.1 github.com/bitly/go-simplejson v0.5.0 github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869 // indirect github.com/bwmarrin/discordgo v0.20.2 + github.com/caddyserver/certmagic v0.10.6 github.com/coreos/bbolt v1.3.3 // indirect github.com/coreos/etcd v3.3.18+incompatible github.com/coreos/go-semver v0.3.0 // indirect @@ -21,15 +24,14 @@ require ( github.com/fsnotify/fsnotify v1.4.7 github.com/fsouza/go-dockerclient v1.6.0 github.com/ghodss/yaml v1.0.0 - github.com/go-acme/lego/v3 v3.3.0 - github.com/go-git/go-git/v5 v5.0.0 + github.com/go-acme/lego/v3 v3.4.0 + github.com/go-git/go-git/v5 v5.1.0 github.com/go-telegram-bot-api/telegram-bot-api v4.6.4+incompatible // indirect github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee github.com/gobwas/pool v0.2.0 // indirect github.com/gobwas/ws v1.0.3 github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e // indirect - github.com/golang/protobuf v1.3.5 - github.com/google/go-cmp v0.4.0 // indirect + github.com/golang/protobuf v1.4.0 github.com/google/uuid v1.1.1 github.com/gorilla/handlers v1.4.2 github.com/gorilla/websocket v1.4.1 // indirect @@ -38,13 +40,12 @@ require ( github.com/grpc-ecosystem/grpc-gateway v1.9.5 // indirect github.com/hashicorp/hcl v1.0.0 github.com/hpcloud/tail v1.0.0 - github.com/imdario/mergo v0.3.8 + github.com/imdario/mergo v0.3.9 github.com/jonboulle/clockwork v0.1.0 // indirect github.com/json-iterator/go v1.1.9 // indirect github.com/kr/pretty v0.1.0 github.com/lib/pq v1.3.0 github.com/lucas-clemente/quic-go v0.14.1 - github.com/mholt/certmagic v0.9.3 github.com/micro/cli/v2 v2.1.2 github.com/miekg/dns v1.1.27 github.com/mitchellh/hashstructure v1.0.0 @@ -61,12 +62,13 @@ require ( github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2 // indirect go.etcd.io/bbolt v1.3.4 go.uber.org/zap v1.13.0 - golang.org/x/crypto v0.0.0-20200323165209-0ec3e9974c59 - golang.org/x/net v0.0.0-20200301022130-244492dfa37a + golang.org/x/crypto v0.0.0-20200510223506-06a226fb4e37 + golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2 + golang.org/x/sys v0.0.0-20200523222454-059865788121 // indirect golang.org/x/time v0.0.0-20191024005414-555d28b269f0 // indirect google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1 google.golang.org/grpc v1.26.0 - gopkg.in/src-d/go-git.v4 v4.13.1 + google.golang.org/protobuf v1.22.0 gopkg.in/telegram-bot-api.v4 v4.6.4 sigs.k8s.io/yaml v1.1.0 // indirect ) diff --git a/vendor/github.com/micro/go-micro/v2/go.sum b/vendor/github.com/micro/go-micro/v2/go.sum index c86297fe9..06dc61782 100644 --- a/vendor/github.com/micro/go-micro/v2/go.sum +++ b/vendor/github.com/micro/go-micro/v2/go.sum @@ -64,8 +64,10 @@ github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869 h1:DDGfHa7BWjL4Yn github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869/go.mod h1:Ekp36dRnpXw/yCqJaO+ZrUyxD+3VXMFFr56k5XYrpB4= github.com/bwmarrin/discordgo v0.20.2 h1:nA7jiTtqUA9lT93WL2jPjUp8ZTEInRujBdx1C9gkr20= github.com/bwmarrin/discordgo v0.20.2/go.mod h1:O9S4p+ofTFwB02em7jkpkV8M3R0/PUVOwN61zSZ0r4Q= -github.com/cenkalti/backoff/v3 v3.0.0 h1:ske+9nBpD9qZsTBoF41nW5L+AIuFBKMeze18XQ3eG1c= -github.com/cenkalti/backoff/v3 v3.0.0/go.mod h1:cIeZDE3IrqwwJl6VUwCN6trj1oXrTS4rc0ij+ULvLYs= +github.com/caddyserver/certmagic v0.10.6 h1:sCya6FmfaN74oZE46kqfaFOVoROD/mF36rTQfjN7TZc= +github.com/caddyserver/certmagic v0.10.6/go.mod h1:Y8jcUBctgk/IhpAzlHKfimZNyXCkfGgRTC0orl8gROQ= +github.com/cenkalti/backoff/v4 v4.0.0 h1:6VeaLF9aI+MAUQ95106HwWzYZgJJpZ4stumjj6RFYAU= +github.com/cenkalti/backoff/v4 v4.0.0/go.mod h1:eEew/i+1Q6OrCDZh3WiXYv3+nJwBASZ8Bog/87DQnVg= github.com/census-instrumentation/opencensus-proto v0.2.0/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/cheekybits/genny v1.0.0 h1:uGGa4nei+j20rOSeDeP5Of12XVm7TGUd4dJA9RDitfE= @@ -100,7 +102,6 @@ github.com/cpu/goacmedns v0.0.1/go.mod h1:sesf/pNnCYwUevQEQfEwY0Y3DydlQWSGZbaMEl github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/cpuguy83/go-md2man/v2 v2.0.0 h1:EoUDS0afbrsXAZ9YQ9jdu/mZ2sXgT1/2yyNng4PGlyM= github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= -github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= 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= @@ -143,8 +144,8 @@ github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/gliderlabs/ssh v0.2.2 h1:6zsha5zo/TWhRhwqCD3+EarCAgZ2yN28ipRnGPnwkI0= github.com/gliderlabs/ssh v0.2.2/go.mod h1:U7qILu1NlMHj9FlMhZLlkCdDnU1DBEAqr0aevW3Awn0= -github.com/go-acme/lego/v3 v3.3.0 h1:6BePZsOiYA4/w+M7QDytxQtMfCipMPGnWAHs9pWks98= -github.com/go-acme/lego/v3 v3.3.0/go.mod h1:iGSY2vQrvQs3WezicSB/oVbO2eCrD88dpWPwb1qLqu0= +github.com/go-acme/lego/v3 v3.4.0 h1:deB9NkelA+TfjGHVw8J7iKl/rMtffcGMWSMmptvMv0A= +github.com/go-acme/lego/v3 v3.4.0/go.mod h1:xYbLDuxq3Hy4bMUT1t9JIuz6GWIWb3m5X+TeTHYaT7M= github.com/go-cmd/cmd v1.0.5/go.mod h1:y8q8qlK5wQibcw63djSl/ntiHUHXHGdCkPk0j4QeW4s= github.com/go-errors/errors v1.0.1/go.mod h1:f4zRHt4oKfwPJE5k8C9vpYG+aDHdBFUsgrm6/TyX73Q= github.com/go-git/gcfg v1.5.0 h1:Q5ViNfGF8zFgyJWPqYwA7qGFoMTEiBmdlkcfRmpIMa4= @@ -153,8 +154,8 @@ github.com/go-git/go-billy/v5 v5.0.0 h1:7NQHvd9FVid8VL4qVUMm8XifBK+2xCoZ2lSk0agR github.com/go-git/go-billy/v5 v5.0.0/go.mod h1:pmpqyWchKfYfrkb/UVH4otLvyi/5gJlGI4Hb3ZqZ3W0= github.com/go-git/go-git-fixtures/v4 v4.0.1 h1:q+IFMfLx200Q3scvt2hN79JsEzy4AmBTp/pqnefH+Bc= github.com/go-git/go-git-fixtures/v4 v4.0.1/go.mod h1:m+ICp2rF3jDhFgEZ/8yziagdT1C+ZpZcrJjappBCDSw= -github.com/go-git/go-git/v5 v5.0.0 h1:k5RWPm4iJwYtfWoxIJy4wJX9ON7ihPeZZYC1fLYDnpg= -github.com/go-git/go-git/v5 v5.0.0/go.mod h1:oYD8y9kWsGINPFJoLdaScGCN6dlKg23blmClfZwtUVA= +github.com/go-git/go-git/v5 v5.1.0 h1:HxJn9g/E7eYvKW3Fm7Jt4ee8LXfPOm/H1cdDu8vEssk= +github.com/go-git/go-git/v5 v5.1.0/go.mod h1:ZKfuPUoY1ZqIG4QG9BDBh3G4gLM5zvPuSJAozQrZuyM= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-ini/ini v1.44.0/go.mod h1:ByCAeIL28uOIIG0E3PJtZPDL8WnHpFKFOtgjp+3Ies8= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= @@ -191,6 +192,12 @@ github.com/golang/protobuf v1.3.2 h1:6nsPYzhq5kReh6QImI3k5qWzO4PEbvbIW2cwSfR/6xs github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.5 h1:F768QJ1E9tib+q5Sc8MkdJi1RxLTbRcTf8LJV56aRls= github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk= +github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= +github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= +github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= +github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= +github.com/golang/protobuf v1.4.0 h1:oOuy+ugB+P/kBdUnG5QaMXSIyJ1q38wWSojYCb3z5VQ= +github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0 h1:0udJVsspx3VBr5FwtLhQQtuAsVc79tTq0ocGIPAU6qo= @@ -259,8 +266,8 @@ github.com/kevinburke/ssh_config v0.0.0-20190725054713-01f96b0aa0cd h1:Coekwdh0v github.com/kevinburke/ssh_config v0.0.0-20190725054713-01f96b0aa0cd/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF4nAY/ojJ6r6mM= 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/klauspost/cpuid v1.2.0 h1:NMpwD2G9JSFOE1/TJjGSo5zG7Yb2bTe7eq1jH+irmeE= -github.com/klauspost/cpuid v1.2.0/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= +github.com/klauspost/cpuid v1.2.3 h1:CCtW0xUnWGVINKvE/WWOYKdsPV6mawAtvQuSl8guwQs= +github.com/klauspost/cpuid v1.2.3/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= github.com/kolo/xmlrpc v0.0.0-20190717152603-07c4ee3fd181/go.mod h1:o03bZfuBwAXHetKXuInt4S7omeXUu62/A845kiycsSQ= 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.2 h1:DB17ag19krx9CFsz4o3enTrPXyIXCl+2iCXH/aMAp9s= @@ -269,7 +276,6 @@ github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFB github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/pty v1.1.8/go.mod h1:O1sed60cT9XZ5uDucP5qwvh+TE3NnUj51EiZO/lmSfw= github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= @@ -293,8 +299,6 @@ github.com/mattn/go-runewidth v0.0.4/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzp github.com/mattn/go-tty v0.0.0-20180219170247-931426f7535a/go.mod h1:XPvLUNfbS4fJH25nqRHfWLMa1ONC8Amw+mIA639KxkE= 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/mholt/certmagic v0.9.3 h1:RmzuNJ5mpFplDbyS41z+gGgE/py24IX6m0nHZ0yNTQU= -github.com/mholt/certmagic v0.9.3/go.mod h1:nu8jbsbtwK4205EDH/ZUMTKsfYpJA1Q7MKXHfgTihNw= github.com/micro/cli/v2 v2.1.2 h1:43J1lChg/rZCC1rvdqZNFSQDrGT7qfMrtp6/ztpIkEM= github.com/micro/cli/v2 v2.1.2/go.mod h1:EguNh6DAoWKm9nmk+k/Rg0H3lQnDxqzu5x5srOtGtYg= github.com/miekg/dns v1.1.15/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= @@ -333,7 +337,7 @@ github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLA github.com/nlopes/slack v0.6.1-0.20191106133607-d06c2a2b3249 h1:Pr5gZa2VcmktVwq0lyC39MsN5tz356vC/pQHKvq+QBo= github.com/nlopes/slack v0.6.1-0.20191106133607-d06c2a2b3249/go.mod h1:JzQ9m3PMAqcpeCam7UaHSuBuupz7CmpjehYMayT6YOk= github.com/nrdcg/auroradns v1.0.0/go.mod h1:6JPXKzIRzZzMqtTDgueIhTi6rFf1QvYE/HzqidhOhjw= -github.com/nrdcg/dnspod-go v0.3.0/go.mod h1:vZSoFSFeQVm2gWLMkyX61LZ8HI3BaqtHZWgPTGKr6KQ= +github.com/nrdcg/dnspod-go v0.4.0/go.mod h1:vZSoFSFeQVm2gWLMkyX61LZ8HI3BaqtHZWgPTGKr6KQ= github.com/nrdcg/goinwx v0.6.1/go.mod h1:XPiut7enlbEdntAqalBIqcYcTEVhpv/dKWgDCX2SwKQ= github.com/nrdcg/namesilo v0.2.1/go.mod h1:lwMvfQTyYq+BbjJd30ylEG4GPSS6PII0Tia4rRpRiyw= github.com/olekukonko/tablewriter v0.0.1/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= @@ -360,7 +364,6 @@ github.com/oxtoacart/bpool v0.0.0-20190530202638-03653db5a59c h1:rp5dCmg/yLR3mgF github.com/oxtoacart/bpool v0.0.0-20190530202638-03653db5a59c/go.mod h1:X07ZCGwUbLaax7L0S3Tw4hpejzu63ZrrQiUe6W0hcy0= github.com/patrickmn/go-cache v2.1.0+incompatible h1:HRMgzkcYKYpi3C8ajMPV8OFXaaRUnok+kx1WdO15EQc= github.com/patrickmn/go-cache v2.1.0+incompatible/go.mod h1:3Qf8kWWT7OJRJbdiICTKqZju1ZixQ/KpMGzzAfe6+WQ= -github.com/pelletier/go-buffruneio v0.2.0/go.mod h1:JkE26KsDizTr40EUHkXVtNPvgGtbSNq5BcowyYOWdKo= github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= @@ -396,8 +399,6 @@ github.com/russross/blackfriday/v2 v2.0.1 h1:lPqVAte+HuHNfhJ/0LC98ESWRz8afy9tM/0 github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/sacloud/libsacloud v1.26.1/go.mod h1:79ZwATmHLIFZIMd7sxA3LwzVy/B77uj3LDoToVTxDoQ= github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0= -github.com/sergi/go-diff v1.0.0 h1:Kpca3qRNrduNnOQeazBd0ysaKrUJiIuISHxogkT9RPQ= -github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= github.com/sergi/go-diff v1.1.0 h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0= github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= github.com/shurcooL/sanitized_anchor_name v1.0.0 h1:PdmoCO6wvbs+7yrJyMORt4/BmY5IYyJwS/kOiWx8mHo= @@ -411,11 +412,8 @@ github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1 github.com/smartystreets/goconvey v0.0.0-20190330032615-68dc04aab96a/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= github.com/soheilhy/cmux v0.1.4 h1:0HKaf1o97UwFjHH9o5XsHUOF+tqmdA7KEzXLpiyaw0E= github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= -github.com/src-d/gcfg v1.4.0 h1:xXbNR5AlLSA315x2UO+fTSSAXCDf+Ar38/6oyGbDKQ4= -github.com/src-d/gcfg v1.4.0/go.mod h1:p/UMsR43ujA89BJY9duynAwIpvqEujIH/jFlfL7jWoI= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk= @@ -474,6 +472,8 @@ golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20200302210943-78000ba7a073/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200323165209-0ec3e9974c59 h1:3zb4D3T4G8jdExgVU/95+vQXfpEPiMdCaZgmGVxjNHM= golang.org/x/crypto v0.0.0-20200323165209-0ec3e9974c59/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20200510223506-06a226fb4e37 h1:cg5LA/zNPRzIXIWSCxQW10Rvpy94aQh3LT/ShoCpkHw= +golang.org/x/crypto v0.0.0-20200510223506-06a226fb4e37/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -518,6 +518,8 @@ golang.org/x/net v0.0.0-20190930134127-c5a3c61f89f3/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20191027093000-83d349e8ac1a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200301022130-244492dfa37a h1:GuSPYbZzB5/dcLNCwLQLsg3obCJtX9IJhpXkvY7kzk0= golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2 h1:eDrdRpKgkcCqKZQwyZRyeFZgfqt37SL7Kv3tok06cKE= +golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -557,6 +559,9 @@ golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5 h1:LfCXLvNmTYH9kEmVgqbnsWfru golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527 h1:uYVVQ9WP/Ds2ROhcaGPeIdVq0RIXVLwsHlnvJ+cT1So= golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200523222454-059865788121 h1:rITEj+UZHYC927n8GT97eC3zrpzXdb/voyeOuVKS46o= +golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs= @@ -582,7 +587,6 @@ golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBn golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190729092621-ff9f1409240a/go.mod h1:jcCCGcm9btYwXyDqrUWc6MKQKKGJCWEQ3AfLSRIbEuI= golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= @@ -626,6 +630,13 @@ google.golang.org/grpc v1.22.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyac google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.26.0 h1:2dTRdpdFEEhJYQD8EMLB61nnrzSCTbG38PhqdhvOltg= google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= +google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= +google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= +google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= +google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= +google.golang.org/protobuf v1.22.0 h1:cJv5/xdbk1NnMPR1VP9+HU6gupuG9MLBoH1r6RHZ2MY= +google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= @@ -644,12 +655,6 @@ gopkg.in/resty.v1 v1.9.1/go.mod h1:vo52Hzryw9PnPHcJfPsBiFW62XhNx5OczbV9y+IMpgc= gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= 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/src-d/go-billy.v4 v4.3.2 h1:0SQA1pRztfTFx2miS8sA97XvooFeNOmvUenF4o0EcVg= -gopkg.in/src-d/go-billy.v4 v4.3.2/go.mod h1:nDjArDMp+XMs1aFAESLRjfGSgfvoYN0hDfzEk0GjC98= -gopkg.in/src-d/go-git-fixtures.v3 v3.5.0 h1:ivZFOIltbce2Mo8IjzUHAFoq/IylO9WHhNOAJK+LsJg= -gopkg.in/src-d/go-git-fixtures.v3 v3.5.0/go.mod h1:dLBcvytrw/TYZsNTWCnkNF2DSIlzWYqTe3rJR56Ac7g= -gopkg.in/src-d/go-git.v4 v4.13.1 h1:SRtFyV8Kxc0UP7aCHcijOMQGPxHSmMOPrzulQWolkYE= -gopkg.in/src-d/go-git.v4 v4.13.1/go.mod h1:nx5NYcxdKxq5fpltdHnPa2Exj4Sx0EclMWZQbYDu2z8= gopkg.in/telegram-bot-api.v4 v4.6.4 h1:hpHWhzn4jTCsAJZZ2loNKfy2QWyPDRJVl3aTFXeMW8g= gopkg.in/telegram-bot-api.v4 v4.6.4/go.mod h1:5DpGO5dbumb40px+dXcwCpcjmeHNYLpk0bp3XRNvWDM= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= diff --git a/vendor/github.com/micro/go-micro/v2/logger/default.go b/vendor/github.com/micro/go-micro/v2/logger/default.go index 828b4867e..70aeb4763 100644 --- a/vendor/github.com/micro/go-micro/v2/logger/default.go +++ b/vendor/github.com/micro/go-micro/v2/logger/default.go @@ -4,7 +4,6 @@ import ( "context" "fmt" "os" - "path/filepath" "runtime" "sort" "strings" @@ -55,9 +54,28 @@ func copyFields(src map[string]interface{}) map[string]interface{} { return dst } +// logCallerfilePath returns a package/file:line description of the caller, +// preserving only the leaf directory name and file name. func logCallerfilePath(loggingFilePath string) string { - parts := strings.Split(loggingFilePath, string(filepath.Separator)) - return parts[len(parts)-1] + // To make sure we trim the path correctly on Windows too, we + // counter-intuitively need to use '/' and *not* os.PathSeparator here, + // because the path given originates from Go stdlib, specifically + // runtime.Caller() which (as of Mar/17) returns forward slashes even on + // Windows. + // + // See https://github.com/golang/go/issues/3335 + // and https://github.com/golang/go/issues/18151 + // + // for discussion on the issue on Go side. + idx := strings.LastIndexByte(loggingFilePath, '/') + if idx == -1 { + return loggingFilePath + } + idx = strings.LastIndexByte(loggingFilePath[:idx], '/') + if idx == -1 { + return loggingFilePath + } + return loggingFilePath[idx+1:] } func (l *defaultLogger) Log(level Level, v ...interface{}) { diff --git a/vendor/github.com/micro/go-micro/v2/options.go b/vendor/github.com/micro/go-micro/v2/options.go index d216b53e6..e807e4964 100644 --- a/vendor/github.com/micro/go-micro/v2/options.go +++ b/vendor/github.com/micro/go-micro/v2/options.go @@ -14,6 +14,7 @@ import ( "github.com/micro/go-micro/v2/debug/profile" "github.com/micro/go-micro/v2/debug/trace" "github.com/micro/go-micro/v2/registry" + "github.com/micro/go-micro/v2/runtime" "github.com/micro/go-micro/v2/server" "github.com/micro/go-micro/v2/store" "github.com/micro/go-micro/v2/transport" @@ -29,6 +30,7 @@ type Options struct { Server server.Server Store store.Store Registry registry.Registry + Runtime runtime.Runtime Transport transport.Transport Profile profile.Profile @@ -55,6 +57,7 @@ func newOptions(opts ...Option) Options { Server: server.DefaultServer, Store: store.DefaultStore, Registry: registry.DefaultRegistry, + Runtime: runtime.DefaultRuntime, Transport: transport.DefaultTransport, Context: context.Background(), Signal: true, @@ -152,7 +155,6 @@ func Tracer(t trace.Tracer) Option { func Auth(a auth.Auth) Option { return func(o *Options) { o.Auth = a - o.Client.Init(client.Auth(a)) o.Server.Init(server.Auth(a)) } } @@ -182,6 +184,13 @@ func Transport(t transport.Transport) Option { } } +// Runtime sets the runtime +func Runtime(r runtime.Runtime) Option { + return func(o *Options) { + o.Runtime = r + } +} + // Convenience options // Address sets the address of the server diff --git a/vendor/github.com/micro/go-micro/v2/registry/mdns_registry.go b/vendor/github.com/micro/go-micro/v2/registry/mdns_registry.go index fde00f371..cd4419922 100644 --- a/vendor/github.com/micro/go-micro/v2/registry/mdns_registry.go +++ b/vendor/github.com/micro/go-micro/v2/registry/mdns_registry.go @@ -252,7 +252,7 @@ func (m *mdnsRegistry) Register(service *Service, opts ...RegisterOption) error continue } - srv, err := mdns.NewServer(&mdns.Config{Zone: s}) + srv, err := mdns.NewServer(&mdns.Config{Zone: s, LocalhostChecking: true}) if err != nil { gerr = err continue @@ -353,10 +353,10 @@ func (m *mdnsRegistry) GetService(service string, opts ...GetOption) ([]*Service } addr := "" // prefer ipv4 addrs - if e.AddrV4 != nil { + if len(e.AddrV4) > 0 { addr = e.AddrV4.String() // else use ipv6 - } else if e.AddrV6 != nil { + } else if len(e.AddrV6) > 0 { addr = "[" + e.AddrV6.String() + "]" } else { if logger.V(logger.InfoLevel, logger.DefaultLogger) { @@ -563,9 +563,7 @@ func (m *mdnsWatcher) Next() (*Result, error) { if len(m.wo.Service) > 0 && txt.Service != m.wo.Service { continue } - var action string - if e.TTL == 0 { action = "delete" } else { @@ -584,9 +582,18 @@ func (m *mdnsWatcher) Next() (*Result, error) { continue } + var addr string + if len(e.AddrV4) > 0 { + addr = e.AddrV4.String() + } else if len(e.AddrV6) > 0 { + addr = "[" + e.AddrV6.String() + "]" + } else { + addr = e.Addr.String() + } + service.Nodes = append(service.Nodes, &Node{ Id: strings.TrimSuffix(e.Name, suffix), - Address: fmt.Sprintf("%s:%d", e.AddrV4.String(), e.Port), + Address: fmt.Sprintf("%s:%d", addr, e.Port), Metadata: txt.Metadata, }) diff --git a/vendor/github.com/micro/go-micro/v2/registry/service/service.go b/vendor/github.com/micro/go-micro/v2/registry/service/service.go index acf42d3a4..3be9e97be 100644 --- a/vendor/github.com/micro/go-micro/v2/registry/service/service.go +++ b/vendor/github.com/micro/go-micro/v2/registry/service/service.go @@ -7,6 +7,7 @@ import ( "github.com/micro/go-micro/v2/client" "github.com/micro/go-micro/v2/client/grpc" + "github.com/micro/go-micro/v2/errors" "github.com/micro/go-micro/v2/registry" pb "github.com/micro/go-micro/v2/registry/service/proto" ) @@ -46,6 +47,21 @@ func (s *serviceRegistry) Init(opts ...registry.Option) error { for _, o := range opts { o(&s.opts) } + + if len(s.opts.Addrs) > 0 { + s.address = s.opts.Addrs + } + + // extract the client from the context, fallback to grpc + var cli client.Client + if c, ok := s.opts.Context.Value(clientKey{}).(client.Client); ok { + cli = c + } else { + cli = grpc.NewClient() + } + + s.client = pb.NewRegistryService(DefaultService, cli) + return nil } @@ -105,7 +121,9 @@ func (s *serviceRegistry) GetService(name string, opts ...registry.GetOption) ([ Service: name, }, s.callOpts()...) - if err != nil { + if verr, ok := err.(*errors.Error); ok && verr.Code == 404 { + return nil, registry.ErrNotFound + } else if err != nil { return nil, err } @@ -171,21 +189,23 @@ func NewRegistry(opts ...registry.Option) registry.Registry { // the registry address addrs := options.Addrs - if len(addrs) == 0 { addrs = []string{"127.0.0.1:8000"} } - // use mdns as a fall back in case its used - mReg := registry.NewRegistry() + if options.Context == nil { + options.Context = context.TODO() + } - // create new client with mdns - cli := grpc.NewClient( - client.Registry(mReg), - ) + // extract the client from the context, fallback to grpc + var cli client.Client + if c, ok := options.Context.Value(clientKey{}).(client.Client); ok { + cli = c + } else { + cli = grpc.NewClient() + } - // service name - // TODO: accept option + // service name. TODO: accept option name := DefaultService return &serviceRegistry{ diff --git a/vendor/github.com/micro/go-micro/v2/router/default.go b/vendor/github.com/micro/go-micro/v2/router/default.go index 9026886b0..f3b329a48 100644 --- a/vendor/github.com/micro/go-micro/v2/router/default.go +++ b/vendor/github.com/micro/go-micro/v2/router/default.go @@ -3,7 +3,6 @@ package router import ( "errors" "fmt" - "math" "sort" "strings" "sync" @@ -19,18 +18,6 @@ var ( AdvertiseEventsTick = 10 * time.Second // DefaultAdvertTTL is default advertisement TTL DefaultAdvertTTL = 2 * time.Minute - // AdvertSuppress is advert suppression threshold - AdvertSuppress = 200.0 - // AdvertRecover is advert recovery threshold - AdvertRecover = 20.0 - // Penalty for routes processed multiple times - Penalty = 100.0 - // PenaltyHalfLife is the time the advert penalty decays to half its value - PenaltyHalfLife = 30.0 - // MaxSuppressTime defines time after which the suppressed advert is deleted - MaxSuppressTime = 90 * time.Second - // PenaltyDecay is a coefficient which controls the speed the advert penalty decays - PenaltyDecay = math.Log(2) / PenaltyHalfLife ) // router implements default router @@ -269,68 +256,8 @@ func (r *router) publishAdvert(advType AdvertType, events []*Event) { r.sub.RUnlock() } -// advert contains a route event to be advertised -type advert struct { - // event received from routing table - event *Event - // lastSeen records the time of the last advert update - lastSeen time.Time - // penalty is current advert penalty - penalty float64 - // isSuppressed flags the advert suppression - isSuppressed bool - // suppressTime records the time interval the advert has been suppressed for - suppressTime time.Time -} - // adverts maintains a map of router adverts -type adverts map[uint64]*advert - -// process processes advert -// It updates advert timestamp, increments its penalty and -// marks upresses or recovers it if it reaches configured thresholds -func (m adverts) process(a *advert) error { - // lookup advert in adverts - hash := a.event.Route.Hash() - a, ok := m[hash] - if !ok { - return fmt.Errorf("advert not found") - } - - // decay the event penalty - delta := time.Since(a.lastSeen).Seconds() - - // decay advert penalty - a.penalty = a.penalty * math.Exp(-delta*PenaltyDecay) - service := a.event.Route.Service - address := a.event.Route.Address - - // suppress/recover the event based on its penalty level - switch { - case a.penalty > AdvertSuppress && !a.isSuppressed: - if logger.V(logger.DebugLevel, logger.DefaultLogger) { - logger.Debugf("Router suppressing advert %d %.2f for route %s %s", hash, a.penalty, service, address) - } - a.isSuppressed = true - a.suppressTime = time.Now() - case a.penalty < AdvertRecover && a.isSuppressed: - if logger.V(logger.DebugLevel, logger.DefaultLogger) { - logger.Debugf("Router recovering advert %d %.2f for route %s %s", hash, a.penalty, service, address) - } - a.isSuppressed = false - } - - // if suppressed, checked how long has it been suppressed for - if a.isSuppressed { - // max suppression time threshold has been reached, delete the advert - if time.Since(a.suppressTime) > MaxSuppressTime { - delete(m, hash) - return nil - } - } - - return nil -} +type adverts map[uint64]*Event // advertiseEvents advertises routing table events // It suppresses unhealthy flapping events and advertises healthy events upstream. @@ -396,21 +323,9 @@ func (r *router) advertiseEvents() error { var events []*Event // collect all events which are not flapping - for key, advert := range adverts { - // process the advert - if err := adverts.process(advert); err != nil { - if logger.V(logger.DebugLevel, logger.DefaultLogger) { - logger.Debugf("Router failed processing advert %d: %v", key, err) - } - continue - } - // if suppressed go to the next advert - if advert.isSuppressed { - continue - } - + for key, event := range adverts { // if we only advertise local routes skip processing anything not link local - if r.options.Advertise == AdvertiseLocal && advert.event.Route.Link != "local" { + if r.options.Advertise == AdvertiseLocal && event.Route.Link != "local" { continue } @@ -418,7 +333,7 @@ func (r *router) advertiseEvents() error { e := new(Event) // this is ok, because router.Event only contains builtin types // and no references so this creates a deep copy of struct Event - *e = *(advert.event) + *e = *event events = append(events, e) // delete the advert from adverts delete(adverts, key) @@ -447,44 +362,22 @@ func (r *router) advertiseEvents() error { continue } - now := time.Now() - if logger.V(logger.DebugLevel, logger.DefaultLogger) { logger.Debugf("Router processing table event %s for service %s %s", e.Type, e.Route.Service, e.Route.Address) } // check if we have already registered the route hash := e.Route.Hash() - a, ok := adverts[hash] + ev, ok := adverts[hash] if !ok { - a = &advert{ - event: e, - penalty: Penalty, - lastSeen: now, - } - adverts[hash] = a + ev = e + adverts[hash] = e continue } // override the route event only if the previous event was different - if a.event.Type != e.Type { - a.event = e - } - - // process the advert - if err := adverts.process(a); err != nil { - if logger.V(logger.DebugLevel, logger.DefaultLogger) { - logger.Debugf("Router error processing advert %d: %v", hash, err) - } - continue - } - - // update event penalty and timestamp - a.lastSeen = now - // increment the penalty - a.penalty += Penalty - if logger.V(logger.DebugLevel, logger.DefaultLogger) { - logger.Debugf("Router advert %d for route %s %s event penalty: %f", hash, a.event.Route.Service, a.event.Route.Address, a.penalty) + if ev.Type != e.Type { + ev = e } case <-r.exit: if w != nil { diff --git a/vendor/github.com/micro/go-micro/v2/runtime/default.go b/vendor/github.com/micro/go-micro/v2/runtime/default.go index bd783f505..28ecc4b8b 100644 --- a/vendor/github.com/micro/go-micro/v2/runtime/default.go +++ b/vendor/github.com/micro/go-micro/v2/runtime/default.go @@ -1,6 +1,8 @@ package runtime import ( + "archive/tar" + "compress/gzip" "errors" "fmt" "io" @@ -16,6 +18,9 @@ import ( "github.com/micro/go-micro/v2/runtime/local/git" ) +// defaultNamespace to use if not provided as an option +const defaultNamespace = "default" + type runtime struct { sync.RWMutex // options configure runtime @@ -26,9 +31,9 @@ type runtime struct { start chan *service // indicates if we're running running bool - // the service map - // TODO: track different versions of the same service - services map[string]*service + // namespaces stores services grouped by namespace, e.g. namespaces["foo"]["go.micro.auth:latest"] + // would return the latest version of go.micro.auth from the foo namespace + namespaces map[string]map[string]*service } // NewRuntime creates new local runtime and returns it @@ -46,10 +51,10 @@ func NewRuntime(opts ...Option) Runtime { _ = os.MkdirAll(path, 0755) return &runtime{ - options: options, - closed: make(chan bool), - start: make(chan *service, 128), - services: make(map[string]*service), + options: options, + closed: make(chan bool), + start: make(chan *service, 128), + namespaces: make(map[string]map[string]*service), } } @@ -60,6 +65,25 @@ func (r *runtime) checkoutSourceIfNeeded(s *Service) error { if len(s.Source) == 0 { return nil } + // @todo make this come from config + cpath := filepath.Join(os.TempDir(), "micro", "uploads", s.Source) + path := strings.ReplaceAll(cpath, ".tar.gz", "") + if ex, _ := exists(cpath); ex { + err := os.RemoveAll(path) + if err != nil { + return err + } + err = os.MkdirAll(path, 0777) + if err != nil { + return err + } + err = uncompress(cpath, path) + if err != nil { + return err + } + s.Source = path + return nil + } source, err := git.ParseSourceLocal("", s.Source) if err != nil { return err @@ -74,6 +98,83 @@ func (r *runtime) checkoutSourceIfNeeded(s *Service) error { return nil } +// modified version of: https://gist.github.com/mimoo/25fc9716e0f1353791f5908f94d6e726 +func uncompress(src string, dst string) error { + file, err := os.OpenFile(src, os.O_RDWR|os.O_CREATE, 0666) + defer file.Close() + if err != nil { + return err + } + // ungzip + zr, err := gzip.NewReader(file) + if err != nil { + return err + } + // untar + tr := tar.NewReader(zr) + + // uncompress each element + for { + header, err := tr.Next() + if err == io.EOF { + break // End of archive + } + if err != nil { + return err + } + target := header.Name + + // validate name against path traversal + if !validRelPath(header.Name) { + return fmt.Errorf("tar contained invalid name error %q\n", target) + } + + // add dst + re-format slashes according to system + target = filepath.Join(dst, header.Name) + // if no join is needed, replace with ToSlash: + // target = filepath.ToSlash(header.Name) + + // check the type + switch header.Typeflag { + + // if its a dir and it doesn't exist create it (with 0755 permission) + case tar.TypeDir: + if _, err := os.Stat(target); err != nil { + // @todo think about this: + // if we don't nuke the folder, we might end up with files from + // the previous decompress. + if err := os.MkdirAll(target, 0755); err != nil { + return err + } + } + // if it's a file create it (with same permission) + case tar.TypeReg: + // the truncating is probably unnecessary due to the `RemoveAll` of folders + // above + fileToWrite, err := os.OpenFile(target, os.O_TRUNC|os.O_CREATE|os.O_RDWR, os.FileMode(header.Mode)) + if err != nil { + return err + } + // copy over contents + if _, err := io.Copy(fileToWrite, tr); err != nil { + return err + } + // manually close here after each file operation; defering would cause each file close + // to wait until all operations have completed. + fileToWrite.Close() + } + } + return nil +} + +// check for path traversal and correct forward slashes +func validRelPath(p string) bool { + if p == "" || strings.Contains(p, `\`) || strings.HasPrefix(p, "/") || strings.Contains(p, "../") { + return false + } + return true +} + // Init initializes runtime options func (r *runtime) Init(opts ...Option) error { r.Lock() @@ -92,7 +193,7 @@ func (r *runtime) run(events <-chan Event) { defer t.Stop() // process event processes an incoming event - processEvent := func(event Event, service *service) error { + processEvent := func(event Event, service *service, ns string) error { // get current vals r.RLock() name := service.Name @@ -105,11 +206,11 @@ func (r *runtime) run(events <-chan Event) { } if logger.V(logger.DebugLevel, logger.DefaultLogger) { - logger.Debugf("Runtime updating service %s", name) + logger.Debugf("Runtime updating service %s in %v namespace", name, ns) } // this will cause a delete followed by created - if err := r.Update(service.Service); err != nil { + if err := r.Update(service.Service, UpdateNamespace(ns)); err != nil { return err } @@ -126,18 +227,20 @@ func (r *runtime) run(events <-chan Event) { case <-t.C: // check running services r.RLock() - for _, service := range r.services { - if !service.ShouldStart() { - continue - } + for _, sevices := range r.namespaces { + for _, service := range sevices { + if !service.ShouldStart() { + continue + } - // TODO: check service error - if logger.V(logger.DebugLevel, logger.DefaultLogger) { - logger.Debugf("Runtime starting %s", service.Name) - } - if err := service.Start(); err != nil { + // TODO: check service error if logger.V(logger.DebugLevel, logger.DefaultLogger) { - logger.Debugf("Runtime error starting %s: %v", service.Name, err) + logger.Debugf("Runtime starting %s", service.Name) + } + if err := service.Start(); err != nil { + if logger.V(logger.DebugLevel, logger.DefaultLogger) { + logger.Debugf("Runtime error starting %s: %v", service.Name, err) + } } } } @@ -162,17 +265,27 @@ func (r *runtime) run(events <-chan Event) { // NOTE: we only handle Update events for now switch event.Type { case Update: - if len(event.Service) > 0 { + if event.Service != nil { + ns := defaultNamespace + if event.Options != nil && len(event.Options.Namespace) > 0 { + ns = event.Options.Namespace + } + r.RLock() - service, ok := r.services[fmt.Sprintf("%v:%v", event.Service, event.Version)] - r.RUnlock() - if !ok { + if _, ok := r.namespaces[ns]; !ok { if logger.V(logger.DebugLevel, logger.DefaultLogger) { - logger.Debugf("Runtime unknown service: %s", event.Service) + logger.Debugf("Runtime unknown namespace: %s", ns) } + r.RUnlock() continue } - if err := processEvent(event, service); err != nil { + service, ok := r.namespaces[ns][fmt.Sprintf("%v:%v", event.Service.Name, event.Service.Version)] + r.RUnlock() + if !ok { + logger.Debugf("Runtime unknown service: %s", event.Service) + } + + if err := processEvent(event, service, ns); err != nil { if logger.V(logger.DebugLevel, logger.DefaultLogger) { logger.Debugf("Runtime error updating service %s: %v", event.Service, err) } @@ -181,14 +294,16 @@ func (r *runtime) run(events <-chan Event) { } r.RLock() - services := r.services + namespaces := r.namespaces r.RUnlock() // if blank service was received we update all services - for _, service := range services { - if err := processEvent(event, service); err != nil { - if logger.V(logger.DebugLevel, logger.DefaultLogger) { - logger.Debugf("Runtime error updating service %s: %v", service.Name, err) + for ns, services := range namespaces { + for _, service := range services { + if err := processEvent(event, service, ns); err != nil { + if logger.V(logger.DebugLevel, logger.DefaultLogger) { + logger.Debugf("Runtime error updating service %s: %v", service.Name, err) + } } } } @@ -222,20 +337,25 @@ func (r *runtime) Create(s *Service, opts ...CreateOption) error { r.Lock() defer r.Unlock() - if _, ok := r.services[serviceKey(s)]; ok { - return errors.New("service already running") - } - var options CreateOptions for _, o := range opts { o(&options) } - + if len(options.Namespace) == 0 { + options.Namespace = defaultNamespace + } if len(options.Command) == 0 { options.Command = []string{"go"} options.Args = []string{"run", "."} } + if _, ok := r.namespaces[options.Namespace]; !ok { + r.namespaces[options.Namespace] = make(map[string]*service) + } + if _, ok := r.namespaces[options.Namespace][serviceKey(s)]; ok { + return errors.New("service already running") + } + // create new service service := newService(s, options) @@ -253,9 +373,8 @@ func (r *runtime) Create(s *Service, opts ...CreateOption) error { if err := service.Start(); err != nil { return err } - // save service - r.services[serviceKey(s)] = service + r.namespaces[options.Namespace][serviceKey(s)] = service return nil } @@ -383,6 +502,9 @@ func (r *runtime) Read(opts ...ReadOption) ([]*Service, error) { for _, o := range opts { o(&gopts) } + if len(gopts.Namespace) == 0 { + gopts.Namespace = defaultNamespace + } save := func(k, v string) bool { if len(k) == 0 { @@ -394,7 +516,11 @@ func (r *runtime) Read(opts ...ReadOption) ([]*Service, error) { //nolint:prealloc var services []*Service - for _, service := range r.services { + if _, ok := r.namespaces[gopts.Namespace]; !ok { + return make([]*Service, 0), nil + } + + for _, service := range r.namespaces[gopts.Namespace] { if !save(gopts.Service, service.Name) { continue } @@ -409,22 +535,40 @@ func (r *runtime) Read(opts ...ReadOption) ([]*Service, error) { return services, nil } -// Update attemps to update the service +// Update attempts to update the service func (r *runtime) Update(s *Service, opts ...UpdateOption) error { + var options UpdateOptions + for _, o := range opts { + o(&options) + } + if len(options.Namespace) == 0 { + options.Namespace = defaultNamespace + } + err := r.checkoutSourceIfNeeded(s) if err != nil { return err } + r.Lock() - service, ok := r.services[serviceKey(s)] + srvs, ok := r.namespaces[options.Namespace] r.Unlock() if !ok { return errors.New("Service not found") } - err = service.Stop() - if err != nil { + + r.Lock() + service, ok := srvs[serviceKey(s)] + r.Unlock() + if !ok { + return errors.New("Service not found") + } + + if err := service.Stop(); err != nil && err.Error() != "no such process" { + logger.Errorf("Error stopping service %s: %s", service.Name, err) return err } + return service.Start() } @@ -433,24 +577,41 @@ func (r *runtime) Delete(s *Service, opts ...DeleteOption) error { r.Lock() defer r.Unlock() + var options DeleteOptions + for _, o := range opts { + o(&options) + } + if len(options.Namespace) == 0 { + options.Namespace = defaultNamespace + } + + srvs, ok := r.namespaces[options.Namespace] + if !ok { + return nil + } + if logger.V(logger.DebugLevel, logger.DefaultLogger) { logger.Debugf("Runtime deleting service %s", s.Name) } - if s, ok := r.services[serviceKey(s)]; ok { - // check if running - if s.Running() { - delete(r.services, s.key()) - return nil - } - // otherwise stop it - if err := s.Stop(); err != nil { - return err - } - // delete it - delete(r.services, s.key()) + + service, ok := srvs[serviceKey(s)] + if !ok { return nil } + // check if running + if !service.Running() { + delete(srvs, service.key()) + r.namespaces[options.Namespace] = srvs + return nil + } + // otherwise stop it + if err := service.Stop(); err != nil { + return err + } + // delete it + delete(srvs, service.key()) + r.namespaces[options.Namespace] = srvs return nil } @@ -504,12 +665,15 @@ func (r *runtime) Stop() error { r.running = false // stop all the services - for _, service := range r.services { - if logger.V(logger.DebugLevel, logger.DefaultLogger) { - logger.Debugf("Runtime stopping %s", service.Name) + for _, services := range r.namespaces { + for _, service := range services { + if logger.V(logger.DebugLevel, logger.DefaultLogger) { + logger.Debugf("Runtime stopping %s", service.Name) + } + service.Stop() } - service.Stop() } + // stop the scheduler if r.options.Scheduler != nil { return r.options.Scheduler.Close() diff --git a/vendor/github.com/micro/go-micro/v2/runtime/kubernetes/kubernetes.go b/vendor/github.com/micro/go-micro/v2/runtime/kubernetes/kubernetes.go index 01f617691..c464d3817 100644 --- a/vendor/github.com/micro/go-micro/v2/runtime/kubernetes/kubernetes.go +++ b/vendor/github.com/micro/go-micro/v2/runtime/kubernetes/kubernetes.go @@ -167,11 +167,10 @@ func (k *kubernetes) getService(labels map[string]string, opts ...client.GetOpti // parse out deployment status and inject into service metadata if len(kdep.Status.Conditions) > 0 { - svc.Metadata["status"] = kdep.Status.Conditions[0].Type + svc.Status(kdep.Status.Conditions[0].Type, nil) svc.Metadata["started"] = kdep.Status.Conditions[0].LastUpdateTime - delete(svc.Metadata, "error") } else { - svc.Metadata["status"] = "n/a" + svc.Status("n/a", nil) } // get the real status @@ -214,8 +213,7 @@ func (k *kubernetes) getService(labels map[string]string, opts ...client.GetOpti } } // TODO: set from terminated - - svc.Metadata["status"] = status + svc.Status(status, nil) } // save deployment @@ -252,12 +250,12 @@ func (k *kubernetes) run(events <-chan runtime.Event) { case runtime.Update: // only process if there's an actual service // we do not update all the things individually - if len(event.Service) == 0 { + if event.Service == nil { continue } // format the name - name := client.Format(event.Service) + name := client.Format(event.Service.Name) // set the default labels labels := map[string]string{ @@ -265,8 +263,8 @@ func (k *kubernetes) run(events <-chan runtime.Event) { "name": name, } - if len(event.Version) > 0 { - labels["version"] = event.Version + if len(event.Service.Version) > 0 { + labels["version"] = event.Service.Version } // get the deployment status diff --git a/vendor/github.com/micro/go-micro/v2/runtime/kubernetes/service.go b/vendor/github.com/micro/go-micro/v2/runtime/kubernetes/service.go index b3c02395d..4cb71e37f 100644 --- a/vendor/github.com/micro/go-micro/v2/runtime/kubernetes/service.go +++ b/vendor/github.com/micro/go-micro/v2/runtime/kubernetes/service.go @@ -3,6 +3,7 @@ package kubernetes import ( "encoding/json" "strings" + "time" "github.com/micro/go-micro/v2/logger" "github.com/micro/go-micro/v2/runtime" @@ -185,8 +186,10 @@ func (s *service) Update(k client.Client, opts ...client.UpdateOption) error { } func (s *service) Status(status string, err error) { + s.Metadata["lastStatusUpdate"] = time.Now().Format(time.RFC3339) if err == nil { s.Metadata["status"] = status + delete(s.Metadata, "error") return } s.Metadata["status"] = "error" diff --git a/vendor/github.com/micro/go-micro/v2/runtime/local/git/git.go b/vendor/github.com/micro/go-micro/v2/runtime/local/git/git.go index dbb282bec..246aa79cc 100644 --- a/vendor/github.com/micro/go-micro/v2/runtime/local/git/git.go +++ b/vendor/github.com/micro/go-micro/v2/runtime/local/git/git.go @@ -74,27 +74,18 @@ func (g libGitter) Checkout(repo, branchOrCommit string) error { if err != nil { return err } - isCommit := func(s string) bool { - return strings.ContainsAny(s, "0123456789") && len(s) == 40 - } - if isCommit(branchOrCommit) { - err = worktree.Checkout(&git.CheckoutOptions{ + + if plumbing.IsHash(branchOrCommit) { + return worktree.Checkout(&git.CheckoutOptions{ Hash: plumbing.NewHash(branchOrCommit), Force: true, }) - if err != nil { - return err - } - } else { - err = worktree.Checkout(&git.CheckoutOptions{ - Branch: plumbing.NewBranchReferenceName(branchOrCommit), - Force: true, - }) - if err != nil { - return err - } } - return nil + + return worktree.Checkout(&git.CheckoutOptions{ + Branch: plumbing.NewBranchReferenceName(branchOrCommit), + Force: true, + }) } func (g libGitter) RepoDir(repo string) string { diff --git a/vendor/github.com/micro/go-micro/v2/runtime/local/process/os/os.go b/vendor/github.com/micro/go-micro/v2/runtime/local/process/os/os.go index a35d0b797..d285f7a4c 100644 --- a/vendor/github.com/micro/go-micro/v2/runtime/local/process/os/os.go +++ b/vendor/github.com/micro/go-micro/v2/runtime/local/process/os/os.go @@ -20,6 +20,7 @@ func (p *Process) Exec(exe *process.Executable) error { } func (p *Process) Fork(exe *process.Executable) (*process.PID, error) { + // create command cmd := exec.Command(exe.Package.Path, exe.Args...) @@ -43,7 +44,6 @@ func (p *Process) Fork(exe *process.Executable) (*process.PID, error) { if err != nil { return nil, err } - // start the process if err := cmd.Start(); err != nil { return nil, err @@ -62,22 +62,13 @@ func (p *Process) Kill(pid *process.PID) error { if err != nil { return err } - - pr, err := os.FindProcess(id) - if err != nil { + if _, err := os.FindProcess(id); err != nil { return err } // now kill it - err = pr.Kill() - - // kill the group - if pgid, err := syscall.Getpgid(id); err == nil { - syscall.Kill(-pgid, syscall.SIGKILL) - } - - // return the kill error - return err + // using -ve PID kills the process group which we created in Fork() + return syscall.Kill(-id, syscall.SIGTERM) } func (p *Process) Wait(pid *process.PID) error { diff --git a/vendor/github.com/micro/go-micro/v2/runtime/options.go b/vendor/github.com/micro/go-micro/v2/runtime/options.go index d7d9fe909..dea936b9e 100644 --- a/vendor/github.com/micro/go-micro/v2/runtime/options.go +++ b/vendor/github.com/micro/go-micro/v2/runtime/options.go @@ -3,6 +3,8 @@ package runtime import ( "context" "io" + + "github.com/micro/go-micro/v2/client" ) type Option func(o *Options) @@ -17,6 +19,8 @@ type Options struct { Source string // Base image to use Image string + // Client to use when making requests + Client client.Client } // WithSource sets the base image / repository @@ -47,6 +51,13 @@ func WithImage(t string) Option { } } +// WithClient sets the client to use +func WithClient(c client.Client) Option { + return func(o *Options) { + o.Client = c + } +} + type CreateOption func(o *CreateOptions) type ReadOption func(o *ReadOptions) diff --git a/vendor/github.com/micro/go-micro/v2/runtime/runtime.go b/vendor/github.com/micro/go-micro/v2/runtime/runtime.go index 567e8c3b0..1299baf52 100644 --- a/vendor/github.com/micro/go-micro/v2/runtime/runtime.go +++ b/vendor/github.com/micro/go-micro/v2/runtime/runtime.go @@ -85,14 +85,16 @@ func (t EventType) String() string { // Event is notification event type Event struct { + // ID of the event + ID string // Type is event type Type EventType // Timestamp is event timestamp Timestamp time.Time - // Service is the name of the service - Service string - // Version of the build - Version string + // Service the event relates to + Service *Service + // Options to use when processing the event + Options *CreateOptions } // Service is runtime service diff --git a/vendor/github.com/micro/go-micro/v2/runtime/service.go b/vendor/github.com/micro/go-micro/v2/runtime/service.go index 2733b01ec..8e28de1f2 100644 --- a/vendor/github.com/micro/go-micro/v2/runtime/service.go +++ b/vendor/github.com/micro/go-micro/v2/runtime/service.go @@ -93,7 +93,7 @@ func (s *service) Running() bool { return s.running } -// Start stars the service +// Start starts the service func (s *service) Start() error { s.Lock() defer s.Unlock() @@ -110,10 +110,7 @@ func (s *service) Start() error { if s.Metadata == nil { s.Metadata = make(map[string]string) } - - s.Metadata["status"] = "starting" - // delete any existing error - delete(s.Metadata, "error") + s.Status("starting", nil) // TODO: pull source & build binary if logger.V(logger.DebugLevel, logger.DefaultLogger) { @@ -122,17 +119,15 @@ func (s *service) Start() error { p, err := s.Process.Fork(s.Exec) if err != nil { - s.Metadata["status"] = "error" - s.Metadata["error"] = err.Error() + s.Status("error", err) return err } - // set the pid s.PID = p // set to running s.running = true // set status - s.Metadata["status"] = "running" + s.Status("running", nil) // set started s.Metadata["started"] = time.Now().Format(time.RFC3339) @@ -146,6 +141,18 @@ func (s *service) Start() error { return nil } +// Status updates the status of the service. Assumes it's called under a lock as it mutates state +func (s *service) Status(status string, err error) { + s.Metadata["lastStatusUpdate"] = time.Now().Format(time.RFC3339) + s.Metadata["status"] = status + if err == nil { + delete(s.Metadata, "error") + return + } + s.Metadata["error"] = err.Error() + +} + // Stop stops the service func (s *service) Stop() error { s.Lock() @@ -163,18 +170,17 @@ func (s *service) Stop() error { } // set status - s.Metadata["status"] = "stopping" + s.Status("stopping", nil) // kill the process err := s.Process.Kill(s.PID) - if err != nil { - return err + if err == nil { + // wait for it to exit + s.Process.Wait(s.PID) } - // wait for it to exit - s.Process.Wait(s.PID) // set status - s.Metadata["status"] = "stopped" + s.Status("stopped", err) // return the kill error return err @@ -191,21 +197,32 @@ func (s *service) Error() error { // Wait waits for the service to finish running func (s *service) Wait() { // wait for process to exit - err := s.Process.Wait(s.PID) + s.RLock() + thisPID := s.PID + s.RUnlock() + err := s.Process.Wait(thisPID) s.Lock() defer s.Unlock() + if s.PID.ID != thisPID.ID { + // trying to update when it's already been switched out, ignore + logger.Warnf("Trying to update a process status but PID doesn't match. Old %s, New %s. Skipping update.", thisPID.ID, s.PID.ID) + return + } + // save the error if err != nil { + if logger.V(logger.ErrorLevel, logger.DefaultLogger) { + logger.Errorf("Service %s terminated with error %s", s.Name, err) + } s.retries++ - s.Metadata["status"] = "error" - s.Metadata["error"] = err.Error() + s.Status("error", err) s.Metadata["retries"] = strconv.Itoa(s.retries) s.err = err } else { - s.Metadata["status"] = "done" + s.Status("done", nil) } // no longer running diff --git a/vendor/github.com/micro/go-micro/v2/runtime/service/proto/runtime.pb.go b/vendor/github.com/micro/go-micro/v2/runtime/service/proto/runtime.pb.go index 1c401b4ad..0573fc6aa 100644 --- a/vendor/github.com/micro/go-micro/v2/runtime/service/proto/runtime.pb.go +++ b/vendor/github.com/micro/go-micro/v2/runtime/service/proto/runtime.pb.go @@ -453,18 +453,50 @@ func (m *ReadResponse) GetServices() []*Service { return nil } -type DeleteRequest struct { - Service *Service `protobuf:"bytes,1,opt,name=service,proto3" json:"service,omitempty"` +type DeleteOptions struct { XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` } +func (m *DeleteOptions) Reset() { *m = DeleteOptions{} } +func (m *DeleteOptions) String() string { return proto.CompactTextString(m) } +func (*DeleteOptions) ProtoMessage() {} +func (*DeleteOptions) Descriptor() ([]byte, []int) { + return fileDescriptor_2434d8152598889b, []int{8} +} + +func (m *DeleteOptions) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_DeleteOptions.Unmarshal(m, b) +} +func (m *DeleteOptions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_DeleteOptions.Marshal(b, m, deterministic) +} +func (m *DeleteOptions) XXX_Merge(src proto.Message) { + xxx_messageInfo_DeleteOptions.Merge(m, src) +} +func (m *DeleteOptions) XXX_Size() int { + return xxx_messageInfo_DeleteOptions.Size(m) +} +func (m *DeleteOptions) XXX_DiscardUnknown() { + xxx_messageInfo_DeleteOptions.DiscardUnknown(m) +} + +var xxx_messageInfo_DeleteOptions proto.InternalMessageInfo + +type DeleteRequest struct { + Service *Service `protobuf:"bytes,1,opt,name=service,proto3" json:"service,omitempty"` + Options *DeleteOptions `protobuf:"bytes,2,opt,name=options,proto3" json:"options,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + func (m *DeleteRequest) Reset() { *m = DeleteRequest{} } func (m *DeleteRequest) String() string { return proto.CompactTextString(m) } func (*DeleteRequest) ProtoMessage() {} func (*DeleteRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_2434d8152598889b, []int{8} + return fileDescriptor_2434d8152598889b, []int{9} } func (m *DeleteRequest) XXX_Unmarshal(b []byte) error { @@ -492,6 +524,13 @@ func (m *DeleteRequest) GetService() *Service { return nil } +func (m *DeleteRequest) GetOptions() *DeleteOptions { + if m != nil { + return m.Options + } + return nil +} + type DeleteResponse struct { XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` @@ -502,7 +541,7 @@ func (m *DeleteResponse) Reset() { *m = DeleteResponse{} } func (m *DeleteResponse) String() string { return proto.CompactTextString(m) } func (*DeleteResponse) ProtoMessage() {} func (*DeleteResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_2434d8152598889b, []int{9} + return fileDescriptor_2434d8152598889b, []int{10} } func (m *DeleteResponse) XXX_Unmarshal(b []byte) error { @@ -523,18 +562,50 @@ func (m *DeleteResponse) XXX_DiscardUnknown() { var xxx_messageInfo_DeleteResponse proto.InternalMessageInfo -type UpdateRequest struct { - Service *Service `protobuf:"bytes,1,opt,name=service,proto3" json:"service,omitempty"` +type UpdateOptions struct { XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` } +func (m *UpdateOptions) Reset() { *m = UpdateOptions{} } +func (m *UpdateOptions) String() string { return proto.CompactTextString(m) } +func (*UpdateOptions) ProtoMessage() {} +func (*UpdateOptions) Descriptor() ([]byte, []int) { + return fileDescriptor_2434d8152598889b, []int{11} +} + +func (m *UpdateOptions) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_UpdateOptions.Unmarshal(m, b) +} +func (m *UpdateOptions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_UpdateOptions.Marshal(b, m, deterministic) +} +func (m *UpdateOptions) XXX_Merge(src proto.Message) { + xxx_messageInfo_UpdateOptions.Merge(m, src) +} +func (m *UpdateOptions) XXX_Size() int { + return xxx_messageInfo_UpdateOptions.Size(m) +} +func (m *UpdateOptions) XXX_DiscardUnknown() { + xxx_messageInfo_UpdateOptions.DiscardUnknown(m) +} + +var xxx_messageInfo_UpdateOptions proto.InternalMessageInfo + +type UpdateRequest struct { + Service *Service `protobuf:"bytes,1,opt,name=service,proto3" json:"service,omitempty"` + Options *UpdateOptions `protobuf:"bytes,2,opt,name=options,proto3" json:"options,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + func (m *UpdateRequest) Reset() { *m = UpdateRequest{} } func (m *UpdateRequest) String() string { return proto.CompactTextString(m) } func (*UpdateRequest) ProtoMessage() {} func (*UpdateRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_2434d8152598889b, []int{10} + return fileDescriptor_2434d8152598889b, []int{12} } func (m *UpdateRequest) XXX_Unmarshal(b []byte) error { @@ -562,6 +633,13 @@ func (m *UpdateRequest) GetService() *Service { return nil } +func (m *UpdateRequest) GetOptions() *UpdateOptions { + if m != nil { + return m.Options + } + return nil +} + type UpdateResponse struct { XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` @@ -572,7 +650,7 @@ func (m *UpdateResponse) Reset() { *m = UpdateResponse{} } func (m *UpdateResponse) String() string { return proto.CompactTextString(m) } func (*UpdateResponse) ProtoMessage() {} func (*UpdateResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_2434d8152598889b, []int{11} + return fileDescriptor_2434d8152598889b, []int{13} } func (m *UpdateResponse) XXX_Unmarshal(b []byte) error { @@ -593,17 +671,49 @@ func (m *UpdateResponse) XXX_DiscardUnknown() { var xxx_messageInfo_UpdateResponse proto.InternalMessageInfo -type ListRequest struct { +type ListOptions struct { XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` } +func (m *ListOptions) Reset() { *m = ListOptions{} } +func (m *ListOptions) String() string { return proto.CompactTextString(m) } +func (*ListOptions) ProtoMessage() {} +func (*ListOptions) Descriptor() ([]byte, []int) { + return fileDescriptor_2434d8152598889b, []int{14} +} + +func (m *ListOptions) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ListOptions.Unmarshal(m, b) +} +func (m *ListOptions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ListOptions.Marshal(b, m, deterministic) +} +func (m *ListOptions) XXX_Merge(src proto.Message) { + xxx_messageInfo_ListOptions.Merge(m, src) +} +func (m *ListOptions) XXX_Size() int { + return xxx_messageInfo_ListOptions.Size(m) +} +func (m *ListOptions) XXX_DiscardUnknown() { + xxx_messageInfo_ListOptions.DiscardUnknown(m) +} + +var xxx_messageInfo_ListOptions proto.InternalMessageInfo + +type ListRequest struct { + Options *ListOptions `protobuf:"bytes,1,opt,name=options,proto3" json:"options,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + func (m *ListRequest) Reset() { *m = ListRequest{} } func (m *ListRequest) String() string { return proto.CompactTextString(m) } func (*ListRequest) ProtoMessage() {} func (*ListRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_2434d8152598889b, []int{12} + return fileDescriptor_2434d8152598889b, []int{15} } func (m *ListRequest) XXX_Unmarshal(b []byte) error { @@ -624,6 +734,13 @@ func (m *ListRequest) XXX_DiscardUnknown() { var xxx_messageInfo_ListRequest proto.InternalMessageInfo +func (m *ListRequest) GetOptions() *ListOptions { + if m != nil { + return m.Options + } + return nil +} + type ListResponse struct { Services []*Service `protobuf:"bytes,1,rep,name=services,proto3" json:"services,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` @@ -635,7 +752,7 @@ func (m *ListResponse) Reset() { *m = ListResponse{} } func (m *ListResponse) String() string { return proto.CompactTextString(m) } func (*ListResponse) ProtoMessage() {} func (*ListResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_2434d8152598889b, []int{13} + return fileDescriptor_2434d8152598889b, []int{16} } func (m *ListResponse) XXX_Unmarshal(b []byte) error { @@ -663,6 +780,37 @@ func (m *ListResponse) GetServices() []*Service { return nil } +type LogsOptions struct { + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *LogsOptions) Reset() { *m = LogsOptions{} } +func (m *LogsOptions) String() string { return proto.CompactTextString(m) } +func (*LogsOptions) ProtoMessage() {} +func (*LogsOptions) Descriptor() ([]byte, []int) { + return fileDescriptor_2434d8152598889b, []int{17} +} + +func (m *LogsOptions) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_LogsOptions.Unmarshal(m, b) +} +func (m *LogsOptions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_LogsOptions.Marshal(b, m, deterministic) +} +func (m *LogsOptions) XXX_Merge(src proto.Message) { + xxx_messageInfo_LogsOptions.Merge(m, src) +} +func (m *LogsOptions) XXX_Size() int { + return xxx_messageInfo_LogsOptions.Size(m) +} +func (m *LogsOptions) XXX_DiscardUnknown() { + xxx_messageInfo_LogsOptions.DiscardUnknown(m) +} + +var xxx_messageInfo_LogsOptions proto.InternalMessageInfo + type LogsRequest struct { // service to request logs for Service string `protobuf:"bytes,1,opt,name=service,proto3" json:"service,omitempty"` @@ -673,17 +821,19 @@ type LogsRequest struct { // relative time in seconds // before the current time // from which to show logs - Since int64 `protobuf:"varint,4,opt,name=since,proto3" json:"since,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + Since int64 `protobuf:"varint,4,opt,name=since,proto3" json:"since,omitempty"` + // options to use + Options *LogsOptions `protobuf:"bytes,5,opt,name=options,proto3" json:"options,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } func (m *LogsRequest) Reset() { *m = LogsRequest{} } func (m *LogsRequest) String() string { return proto.CompactTextString(m) } func (*LogsRequest) ProtoMessage() {} func (*LogsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_2434d8152598889b, []int{14} + return fileDescriptor_2434d8152598889b, []int{18} } func (m *LogsRequest) XXX_Unmarshal(b []byte) error { @@ -732,6 +882,13 @@ func (m *LogsRequest) GetSince() int64 { return 0 } +func (m *LogsRequest) GetOptions() *LogsOptions { + if m != nil { + return m.Options + } + return nil +} + type LogRecord struct { // timestamp of log record Timestamp int64 `protobuf:"varint,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"` @@ -748,7 +905,7 @@ func (m *LogRecord) Reset() { *m = LogRecord{} } func (m *LogRecord) String() string { return proto.CompactTextString(m) } func (*LogRecord) ProtoMessage() {} func (*LogRecord) Descriptor() ([]byte, []int) { - return fileDescriptor_2434d8152598889b, []int{15} + return fileDescriptor_2434d8152598889b, []int{19} } func (m *LogRecord) XXX_Unmarshal(b []byte) error { @@ -800,12 +957,16 @@ func init() { proto.RegisterType((*ReadOptions)(nil), "go.micro.runtime.ReadOptions") proto.RegisterType((*ReadRequest)(nil), "go.micro.runtime.ReadRequest") proto.RegisterType((*ReadResponse)(nil), "go.micro.runtime.ReadResponse") + proto.RegisterType((*DeleteOptions)(nil), "go.micro.runtime.DeleteOptions") proto.RegisterType((*DeleteRequest)(nil), "go.micro.runtime.DeleteRequest") proto.RegisterType((*DeleteResponse)(nil), "go.micro.runtime.DeleteResponse") + proto.RegisterType((*UpdateOptions)(nil), "go.micro.runtime.UpdateOptions") proto.RegisterType((*UpdateRequest)(nil), "go.micro.runtime.UpdateRequest") proto.RegisterType((*UpdateResponse)(nil), "go.micro.runtime.UpdateResponse") + proto.RegisterType((*ListOptions)(nil), "go.micro.runtime.ListOptions") proto.RegisterType((*ListRequest)(nil), "go.micro.runtime.ListRequest") proto.RegisterType((*ListResponse)(nil), "go.micro.runtime.ListResponse") + proto.RegisterType((*LogsOptions)(nil), "go.micro.runtime.LogsOptions") proto.RegisterType((*LogsRequest)(nil), "go.micro.runtime.LogsRequest") proto.RegisterType((*LogRecord)(nil), "go.micro.runtime.LogRecord") proto.RegisterMapType((map[string]string)(nil), "go.micro.runtime.LogRecord.MetadataEntry") @@ -816,48 +977,50 @@ func init() { } var fileDescriptor_2434d8152598889b = []byte{ - // 645 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x55, 0xc9, 0x6e, 0xdb, 0x30, - 0x10, 0x8d, 0x2c, 0x2f, 0xc9, 0xa8, 0x2e, 0x02, 0x22, 0x28, 0xd4, 0x74, 0x33, 0xd4, 0x43, 0xd3, - 0x8b, 0x52, 0x38, 0x28, 0xba, 0x1d, 0x63, 0xa7, 0x17, 0x1b, 0x05, 0x54, 0xe4, 0x03, 0x58, 0x79, - 0x60, 0x08, 0x89, 0x44, 0x55, 0xa4, 0x0c, 0xf8, 0xd4, 0x63, 0xcf, 0xfd, 0xaa, 0x9e, 0xfb, 0x47, - 0x05, 0x17, 0x6d, 0xb6, 0x94, 0x8b, 0x6f, 0x9c, 0x11, 0xf9, 0xf8, 0xde, 0x9b, 0x19, 0x0a, 0x5e, - 0x67, 0x79, 0x22, 0xa2, 0x18, 0x2f, 0x39, 0x66, 0x9b, 0x28, 0xc4, 0xcb, 0x34, 0x63, 0x82, 0x5d, - 0x9a, 0xac, 0xaf, 0x22, 0x72, 0xba, 0x66, 0x7e, 0x1c, 0x85, 0x19, 0xf3, 0x4d, 0xde, 0xfb, 0x67, - 0xc1, 0xe8, 0xbb, 0x3e, 0x41, 0x08, 0xf4, 0x13, 0x1a, 0xa3, 0x6b, 0x4d, 0xac, 0x8b, 0x93, 0x40, - 0xad, 0x89, 0x0b, 0xa3, 0x0d, 0x66, 0x3c, 0x62, 0x89, 0xdb, 0x53, 0xe9, 0x22, 0x24, 0x4f, 0x60, - 0xc8, 0x59, 0x9e, 0x85, 0xe8, 0xda, 0xea, 0x83, 0x89, 0xc8, 0x35, 0x1c, 0xc7, 0x28, 0xe8, 0x8a, - 0x0a, 0xea, 0xf6, 0x27, 0xf6, 0x85, 0x33, 0x7d, 0xe3, 0xef, 0x5e, 0xeb, 0x9b, 0x2b, 0xfd, 0xa5, - 0xd9, 0x39, 0x4f, 0x44, 0xb6, 0x0d, 0xca, 0x83, 0xe7, 0x5f, 0x60, 0xdc, 0xf8, 0x44, 0x4e, 0xc1, - 0xbe, 0xc3, 0xad, 0xa1, 0x26, 0x97, 0xe4, 0x0c, 0x06, 0x1b, 0x7a, 0x9f, 0xa3, 0xe1, 0xa5, 0x83, - 0xcf, 0xbd, 0x8f, 0x96, 0x17, 0xc3, 0x60, 0xbe, 0xc1, 0x44, 0x48, 0x41, 0x62, 0x9b, 0x96, 0x82, - 0xe4, 0x9a, 0x3c, 0x87, 0x13, 0xc9, 0x80, 0x0b, 0x1a, 0xa7, 0xea, 0xa8, 0x1d, 0x54, 0x09, 0x29, - 0xd7, 0xf8, 0x67, 0x54, 0x15, 0x61, 0xdd, 0x88, 0x7e, 0xc3, 0x08, 0xef, 0x8f, 0x05, 0xe3, 0xeb, - 0x0c, 0xa9, 0xc0, 0x6f, 0xa9, 0x88, 0x58, 0xc2, 0xe5, 0xde, 0x90, 0xc5, 0x31, 0x4d, 0x56, 0xae, - 0x35, 0xb1, 0xe5, 0x5e, 0x13, 0x4a, 0x46, 0x34, 0x5b, 0x73, 0xb7, 0xa7, 0xd2, 0x6a, 0x2d, 0xa5, - 0x61, 0xb2, 0x71, 0x6d, 0x95, 0x92, 0x4b, 0x69, 0x2d, 0xcb, 0x45, 0x9a, 0x0b, 0x73, 0x95, 0x89, - 0x4a, 0x3d, 0x83, 0x9a, 0x9e, 0x33, 0x18, 0x44, 0x31, 0x5d, 0xa3, 0x3b, 0xd4, 0x36, 0xa8, 0xc0, - 0xfb, 0x55, 0x50, 0x0a, 0xf0, 0x67, 0x8e, 0x5c, 0x90, 0xab, 0x4a, 0x98, 0x74, 0xc3, 0x99, 0x3e, - 0xed, 0x2c, 0x4a, 0xa5, 0xf9, 0x13, 0x8c, 0x98, 0x96, 0xa4, 0x9c, 0x72, 0xa6, 0xaf, 0xf6, 0x0f, - 0x35, 0x94, 0x07, 0xc5, 0x7e, 0xef, 0x14, 0x1e, 0x17, 0x04, 0x78, 0xca, 0x12, 0x8e, 0xde, 0x2d, - 0x38, 0x01, 0xd2, 0x55, 0xcd, 0xa3, 0x3a, 0xa1, 0x76, 0xa7, 0x77, 0x5a, 0xae, 0xd0, 0x6f, 0x57, - 0xfa, 0xbd, 0x1b, 0x0d, 0x5b, 0xe8, 0xfc, 0x50, 0x51, 0xd6, 0x3a, 0x5f, 0xec, 0x53, 0xae, 0xd1, - 0xa8, 0x08, 0xcf, 0xe1, 0x91, 0xc6, 0xd1, 0x74, 0xc9, 0x7b, 0x38, 0x36, 0x84, 0xb8, 0x2a, 0xe2, - 0x83, 0x8e, 0x95, 0x5b, 0xbd, 0x19, 0x8c, 0x67, 0x78, 0x8f, 0x87, 0x19, 0x2f, 0xdd, 0x2b, 0x50, - 0x8c, 0x7b, 0x33, 0x18, 0xdf, 0xa6, 0x2b, 0x7a, 0x38, 0x6e, 0x81, 0x62, 0x70, 0xc7, 0xe0, 0x2c, - 0x22, 0x2e, 0x0c, 0xaa, 0x74, 0x41, 0x87, 0x87, 0xb9, 0x70, 0x07, 0xce, 0x82, 0xad, 0x79, 0xc1, - 0xb5, 0xbb, 0xd6, 0xf2, 0x11, 0x11, 0x19, 0xd2, 0x58, 0x95, 0xfa, 0x38, 0x30, 0x91, 0xec, 0xea, - 0x90, 0xe5, 0x89, 0x50, 0xa5, 0xb6, 0x03, 0x1d, 0xc8, 0x2c, 0x8f, 0x92, 0x10, 0xd5, 0x58, 0xd8, - 0x81, 0x0e, 0xbc, 0xbf, 0x16, 0x9c, 0x2c, 0xd8, 0x3a, 0xc0, 0x90, 0x65, 0xab, 0xe6, 0x7c, 0x5b, - 0xbb, 0xf3, 0x3d, 0xaf, 0x3d, 0x4e, 0x3d, 0xa5, 0xe7, 0xed, 0xbe, 0x9e, 0x12, 0xac, 0xeb, 0x79, - 0x92, 0x82, 0x62, 0xe4, 0x5c, 0x8e, 0x9d, 0x79, 0x26, 0x4c, 0x78, 0xd0, 0xc3, 0x35, 0xfd, 0x6d, - 0xc3, 0x28, 0xd0, 0x24, 0xc8, 0x12, 0x86, 0x7a, 0x80, 0x48, 0xe7, 0xd0, 0x19, 0x7b, 0xcf, 0x27, - 0xdd, 0x1b, 0x4c, 0x95, 0x8f, 0xc8, 0x57, 0xe8, 0xcb, 0xf6, 0x26, 0x1d, 0xe3, 0x50, 0x40, 0xbd, - 0xec, 0xfa, 0x5c, 0x02, 0x2d, 0x61, 0xa8, 0x5b, 0xb3, 0x8d, 0x57, 0xa3, 0xf5, 0xdb, 0x78, 0xed, - 0x74, 0xb5, 0x82, 0xd3, 0x1d, 0xd9, 0x06, 0xd7, 0xe8, 0xf8, 0x36, 0xb8, 0x9d, 0x66, 0x3e, 0x22, - 0x37, 0xd0, 0x97, 0x8d, 0xd7, 0x26, 0xb3, 0xd6, 0x90, 0xe7, 0xcf, 0x1e, 0x28, 0xba, 0x77, 0xf4, - 0xce, 0xfa, 0x31, 0x54, 0xff, 0xcb, 0xab, 0xff, 0x01, 0x00, 0x00, 0xff, 0xff, 0x20, 0x0e, 0x37, - 0xf1, 0x56, 0x07, 0x00, 0x00, + // 683 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x56, 0xcb, 0x6e, 0xd3, 0x40, + 0x14, 0xad, 0xe3, 0x3c, 0xda, 0x1b, 0x42, 0xab, 0x51, 0x85, 0x4c, 0x79, 0x45, 0x66, 0x41, 0xd9, + 0x38, 0x28, 0x15, 0xe2, 0xb5, 0x2c, 0x09, 0x9b, 0x46, 0x48, 0x46, 0xfd, 0x80, 0xc1, 0xb9, 0x8a, + 0x2c, 0x6a, 0x8f, 0xf1, 0x8c, 0x23, 0x65, 0xc5, 0x92, 0x35, 0xff, 0xc0, 0xbf, 0xb0, 0xe6, 0x8f, + 0xd0, 0xbc, 0xfc, 0x48, 0xeb, 0x48, 0xa8, 0xea, 0x6e, 0xce, 0xf5, 0xcc, 0x9d, 0x73, 0xce, 0x9d, + 0x7b, 0x65, 0x78, 0x9e, 0x17, 0xa9, 0x88, 0x13, 0x9c, 0x70, 0xcc, 0xd7, 0x71, 0x84, 0x93, 0x2c, + 0x67, 0x82, 0x4d, 0x4c, 0x34, 0x50, 0x88, 0x1c, 0xad, 0x58, 0x90, 0xc4, 0x51, 0xce, 0x02, 0x13, + 0xf7, 0xff, 0x3a, 0x30, 0xf8, 0xa2, 0x4f, 0x10, 0x02, 0xdd, 0x94, 0x26, 0xe8, 0x39, 0x63, 0xe7, + 0xf4, 0x20, 0x54, 0x6b, 0xe2, 0xc1, 0x60, 0x8d, 0x39, 0x8f, 0x59, 0xea, 0x75, 0x54, 0xd8, 0x42, + 0xf2, 0x00, 0xfa, 0x9c, 0x15, 0x79, 0x84, 0x9e, 0xab, 0x3e, 0x18, 0x44, 0xce, 0x61, 0x3f, 0x41, + 0x41, 0x97, 0x54, 0x50, 0xaf, 0x3b, 0x76, 0x4f, 0x87, 0xd3, 0x17, 0xc1, 0xf6, 0xb5, 0x81, 0xb9, + 0x32, 0x58, 0x98, 0x9d, 0xb3, 0x54, 0xe4, 0x9b, 0xb0, 0x3c, 0x78, 0xf2, 0x01, 0x46, 0x8d, 0x4f, + 0xe4, 0x08, 0xdc, 0x6f, 0xb8, 0x31, 0xd4, 0xe4, 0x92, 0x1c, 0x43, 0x6f, 0x4d, 0xaf, 0x0a, 0x34, + 0xbc, 0x34, 0x78, 0xdf, 0x79, 0xeb, 0xf8, 0x09, 0xf4, 0x66, 0x6b, 0x4c, 0x85, 0x14, 0x24, 0x36, + 0x59, 0x29, 0x48, 0xae, 0xc9, 0x63, 0x38, 0x90, 0x0c, 0xb8, 0xa0, 0x49, 0xa6, 0x8e, 0xba, 0x61, + 0x15, 0x90, 0x72, 0x8d, 0x7f, 0x46, 0x95, 0x85, 0x75, 0x23, 0xba, 0x0d, 0x23, 0xfc, 0x5f, 0x0e, + 0x8c, 0xce, 0x73, 0xa4, 0x02, 0x3f, 0x67, 0x22, 0x66, 0x29, 0x97, 0x7b, 0x23, 0x96, 0x24, 0x34, + 0x5d, 0x7a, 0xce, 0xd8, 0x95, 0x7b, 0x0d, 0x94, 0x8c, 0x68, 0xbe, 0xe2, 0x5e, 0x47, 0x85, 0xd5, + 0x5a, 0x4a, 0xc3, 0x74, 0xed, 0xb9, 0x2a, 0x24, 0x97, 0xd2, 0x5a, 0x56, 0x88, 0xac, 0x10, 0xe6, + 0x2a, 0x83, 0x4a, 0x3d, 0xbd, 0x9a, 0x9e, 0x63, 0xe8, 0xc5, 0x09, 0x5d, 0xa1, 0xd7, 0xd7, 0x36, + 0x28, 0xe0, 0xff, 0xb0, 0x94, 0x42, 0xfc, 0x5e, 0x20, 0x17, 0xe4, 0xac, 0x12, 0x26, 0xdd, 0x18, + 0x4e, 0x1f, 0xb6, 0x16, 0xa5, 0xd2, 0xfc, 0x0e, 0x06, 0x4c, 0x4b, 0x52, 0x4e, 0x0d, 0xa7, 0xcf, + 0xae, 0x1f, 0x6a, 0x28, 0x0f, 0xed, 0x7e, 0xff, 0x08, 0xee, 0x5b, 0x02, 0x3c, 0x63, 0x29, 0x47, + 0xff, 0x12, 0x86, 0x21, 0xd2, 0x65, 0xcd, 0xa3, 0x3a, 0xa1, 0x9b, 0x9d, 0xde, 0x7a, 0x72, 0x56, + 0xbf, 0x5b, 0xe9, 0xf7, 0xe7, 0x3a, 0xad, 0xd5, 0xf9, 0xa6, 0xa2, 0xac, 0x75, 0x3e, 0xb9, 0x4e, + 0xb9, 0x46, 0xa3, 0x22, 0x3c, 0x83, 0x7b, 0x3a, 0x8f, 0xa6, 0x4b, 0x5e, 0xc3, 0xbe, 0x21, 0xc4, + 0x55, 0x11, 0x77, 0x3a, 0x56, 0x6e, 0xf5, 0x0f, 0x61, 0xf4, 0x11, 0xaf, 0xb0, 0x74, 0x44, 0x56, + 0x42, 0x07, 0xee, 0xbc, 0x12, 0x8d, 0x7b, 0x1b, 0x95, 0xb0, 0x04, 0x4c, 0x25, 0x0e, 0x61, 0x74, + 0x99, 0x2d, 0x69, 0x83, 0xa3, 0x0e, 0xdc, 0x39, 0xc7, 0xc6, 0xbd, 0x0d, 0x8e, 0x96, 0x80, 0xe1, + 0x38, 0x82, 0xe1, 0x45, 0xcc, 0x85, 0x65, 0x38, 0xd7, 0xf0, 0x7f, 0xaa, 0x5c, 0x3b, 0xde, 0xa8, + 0xb2, 0xce, 0x73, 0xbb, 0x2a, 0x4b, 0x76, 0x6c, 0xc5, 0x2d, 0xbb, 0xdf, 0x8e, 0xc6, 0x96, 0x5e, + 0xfb, 0xdb, 0x96, 0x43, 0x53, 0xe4, 0x48, 0x13, 0x65, 0xd1, 0x7e, 0x68, 0x90, 0xec, 0xe2, 0x88, + 0x15, 0xa9, 0x50, 0x4f, 0xdb, 0x0d, 0x35, 0x90, 0x51, 0x1e, 0xa7, 0x11, 0xaa, 0x31, 0xe0, 0x86, + 0x1a, 0xd4, 0xc5, 0xf7, 0x5a, 0xc5, 0x57, 0xec, 0x2a, 0xf1, 0x7f, 0x1c, 0x38, 0xb8, 0x60, 0xab, + 0x10, 0x23, 0x96, 0x2f, 0x9b, 0x83, 0xd0, 0xd9, 0x1e, 0x84, 0xb3, 0xda, 0x14, 0xef, 0x28, 0x63, + 0x5e, 0xde, 0x78, 0x8b, 0x4e, 0xd6, 0x36, 0xc7, 0xa5, 0x13, 0x09, 0x72, 0x2e, 0xe7, 0x93, 0x99, + 0xa7, 0x06, 0xde, 0x6a, 0xc2, 0x4f, 0x7f, 0xba, 0x30, 0x08, 0x35, 0x09, 0xb2, 0x80, 0xbe, 0x9e, + 0x34, 0xa4, 0x75, 0x3a, 0x99, 0xba, 0x9c, 0x8c, 0xdb, 0x37, 0x98, 0x67, 0xb7, 0x47, 0x3e, 0x41, + 0x57, 0xce, 0x01, 0xd2, 0x32, 0x37, 0x6c, 0xaa, 0xa7, 0x6d, 0x9f, 0xcb, 0x44, 0x0b, 0xe8, 0xeb, + 0xbe, 0x23, 0xad, 0xbd, 0xba, 0x83, 0xd7, 0x56, 0xcb, 0xaa, 0x74, 0xba, 0x45, 0x48, 0x6b, 0x5b, + 0xed, 0x48, 0xb7, 0xd5, 0x5d, 0x7b, 0x64, 0x0e, 0x5d, 0xf9, 0x46, 0x48, 0xcb, 0xdb, 0xb1, 0xa9, + 0x1e, 0xed, 0x28, 0xba, 0xbf, 0xf7, 0xca, 0xf9, 0xda, 0x57, 0x3f, 0x16, 0x67, 0xff, 0x02, 0x00, + 0x00, 0xff, 0xff, 0xe1, 0x5b, 0x52, 0x93, 0x7f, 0x08, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/vendor/github.com/micro/go-micro/v2/runtime/service/proto/runtime.proto b/vendor/github.com/micro/go-micro/v2/runtime/service/proto/runtime.proto index 6c7033c92..34b5a6df4 100644 --- a/vendor/github.com/micro/go-micro/v2/runtime/service/proto/runtime.proto +++ b/vendor/github.com/micro/go-micro/v2/runtime/service/proto/runtime.proto @@ -67,24 +67,40 @@ message ReadResponse { repeated Service services = 1; } +message DeleteOptions { +} + message DeleteRequest { Service service = 1; + DeleteOptions options = 2; } message DeleteResponse {} +message UpdateOptions { +} + message UpdateRequest { Service service = 1; + UpdateOptions options = 2; } message UpdateResponse {} -message ListRequest {} +message ListOptions { +} + +message ListRequest { + ListOptions options = 1; +} message ListResponse { repeated Service services = 1; } +message LogsOptions { +} + message LogsRequest{ // service to request logs for string service = 1; @@ -96,6 +112,8 @@ message LogsRequest{ // before the current time // from which to show logs int64 since = 4; + // options to use + LogsOptions options = 5; } message LogRecord { diff --git a/vendor/github.com/micro/go-micro/v2/runtime/service/service.go b/vendor/github.com/micro/go-micro/v2/runtime/service/service.go index f2c5c95ac..fb2f1c247 100644 --- a/vendor/github.com/micro/go-micro/v2/runtime/service/service.go +++ b/vendor/github.com/micro/go-micro/v2/runtime/service/service.go @@ -24,6 +24,9 @@ func (s *svc) Init(opts ...runtime.Option) error { o(&s.options) } + // reset the runtime as the client could have changed + s.runtime = pb.NewRuntimeService(runtime.DefaultName, s.options.Client) + return nil } @@ -267,19 +270,17 @@ func (s *svc) String() string { // NewRuntime creates new service runtime and returns it func NewRuntime(opts ...runtime.Option) runtime.Runtime { - // get default options - options := runtime.Options{} + var options runtime.Options - // apply requested options for _, o := range opts { o(&options) } - - // create default client - cli := client.DefaultClient + if options.Client == nil { + options.Client = client.DefaultClient + } return &svc{ options: options, - runtime: pb.NewRuntimeService(runtime.DefaultName, cli), + runtime: pb.NewRuntimeService(runtime.DefaultName, options.Client), } } diff --git a/vendor/github.com/micro/go-micro/v2/server/grpc/grpc.go b/vendor/github.com/micro/go-micro/v2/server/grpc/grpc.go index a4501c05b..1123fba8f 100644 --- a/vendor/github.com/micro/go-micro/v2/server/grpc/grpc.go +++ b/vendor/github.com/micro/go-micro/v2/server/grpc/grpc.go @@ -22,6 +22,7 @@ import ( "github.com/micro/go-micro/v2/registry" "github.com/micro/go-micro/v2/server" "github.com/micro/go-micro/v2/util/addr" + "github.com/micro/go-micro/v2/util/backoff" mgrpc "github.com/micro/go-micro/v2/util/grpc" mnet "github.com/micro/go-micro/v2/util/net" "golang.org/x/net/netutil" @@ -566,16 +567,36 @@ func (g *grpcServer) Subscribe(sb server.Subscriber) error { } func (g *grpcServer) Register() error { - g.RLock() rsvc := g.rsvc config := g.opts g.RUnlock() + regFunc := func(service *registry.Service) error { + var regErr error + + for i := 0; i < 3; i++ { + // set the ttl + rOpts := []registry.RegisterOption{registry.RegisterTTL(config.RegisterTTL)} + // attempt to register + if err := config.Registry.Register(service, rOpts...); err != nil { + // set the error + regErr = err + // backoff then retry + time.Sleep(backoff.Do(i + 1)) + continue + } + // success so nil error + regErr = nil + break + } + + return regErr + } + // if service already filled, reuse it and return early if rsvc != nil { - rOpts := []registry.RegisterOption{registry.RegisterTTL(config.RegisterTTL)} - if err := config.Registry.Register(rsvc, rOpts...); err != nil { + if err := regFunc(rsvc); err != nil { return err } return nil @@ -677,10 +698,8 @@ func (g *grpcServer) Register() error { } } - // create registry options - rOpts := []registry.RegisterOption{registry.RegisterTTL(config.RegisterTTL)} - - if err := config.Registry.Register(service, rOpts...); err != nil { + // register the service + if err := regFunc(service); err != nil { return err } diff --git a/vendor/github.com/micro/go-micro/v2/server/grpc/server.go b/vendor/github.com/micro/go-micro/v2/server/grpc/server.go index 024a90f1e..80abb711b 100644 --- a/vendor/github.com/micro/go-micro/v2/server/grpc/server.go +++ b/vendor/github.com/micro/go-micro/v2/server/grpc/server.go @@ -87,7 +87,7 @@ func prepareEndpoint(method reflect.Method) *methodType { contextType = mtype.In(1) default: if logger.V(logger.ErrorLevel, logger.DefaultLogger) { - logger.Error("method", mname, "of", mtype, "has wrong number of ins:", mtype.NumIn()) + logger.Errorf("method %v of %v has wrong number of ins: %v", mname, mtype, mtype.NumIn()) } return nil } @@ -97,7 +97,7 @@ func prepareEndpoint(method reflect.Method) *methodType { streamType := reflect.TypeOf((*server.Stream)(nil)).Elem() if !argType.Implements(streamType) { if logger.V(logger.ErrorLevel, logger.DefaultLogger) { - logger.Error(mname, "argument does not implement Streamer interface:", argType) + logger.Errorf("%v argument does not implement Streamer interface: %v", mname, argType) } return nil } @@ -107,14 +107,14 @@ func prepareEndpoint(method reflect.Method) *methodType { // First arg need not be a pointer. if !isExportedOrBuiltinType(argType) { if logger.V(logger.ErrorLevel, logger.DefaultLogger) { - logger.Error(mname, "argument type not exported:", argType) + logger.Errorf("%v argument type not exported: %v", mname, argType) } return nil } if replyType.Kind() != reflect.Ptr { if logger.V(logger.ErrorLevel, logger.DefaultLogger) { - logger.Error("method", mname, "reply type not a pointer:", replyType) + logger.Errorf("method %v reply type not a pointer: %v", mname, replyType) } return nil } @@ -122,7 +122,7 @@ func prepareEndpoint(method reflect.Method) *methodType { // Reply type must be exported. if !isExportedOrBuiltinType(replyType) { if logger.V(logger.ErrorLevel, logger.DefaultLogger) { - logger.Error("method", mname, "reply type not exported:", replyType) + logger.Errorf("method %v reply type not exported: %v", mname, replyType) } return nil } @@ -131,14 +131,14 @@ func prepareEndpoint(method reflect.Method) *methodType { // Endpoint() needs one out. if mtype.NumOut() != 1 { if logger.V(logger.ErrorLevel, logger.DefaultLogger) { - logger.Error("method", mname, "has wrong number of outs:", mtype.NumOut()) + logger.Errorf("method %v has wrong number of outs: %v", mname, mtype.NumOut()) } return nil } // The return type of the method must be error. if returnType := mtype.Out(0); returnType != typeOfError { if logger.V(logger.ErrorLevel, logger.DefaultLogger) { - logger.Error("method", mname, "returns", returnType.String(), "not error") + logger.Errorf("method %v returns %v not error", mname, returnType.String()) } return nil } @@ -156,7 +156,7 @@ func (server *rServer) register(rcvr interface{}) error { s.rcvr = reflect.ValueOf(rcvr) sname := reflect.Indirect(s.rcvr).Type().Name() if sname == "" { - logger.Fatal("rpc: no service name for type", s.typ.String()) + logger.Fatalf("rpc: no service name for type %v", s.typ.String()) } if !isExported(sname) { s := "rpc Register: type " + sname + " is not exported" diff --git a/vendor/github.com/micro/go-micro/v2/server/rpc_router.go b/vendor/github.com/micro/go-micro/v2/server/rpc_router.go index cd5d64df1..749a65911 100644 --- a/vendor/github.com/micro/go-micro/v2/server/rpc_router.go +++ b/vendor/github.com/micro/go-micro/v2/server/rpc_router.go @@ -140,7 +140,7 @@ func prepareMethod(method reflect.Method) *methodType { replyType = mtype.In(3) contextType = mtype.In(1) default: - log.Error("method", mname, "of", mtype, "has wrong number of ins:", mtype.NumIn()) + log.Errorf("method %v of %v has wrong number of ins: %v", mname, mtype, mtype.NumIn()) return nil } @@ -148,7 +148,7 @@ func prepareMethod(method reflect.Method) *methodType { // check stream type streamType := reflect.TypeOf((*Stream)(nil)).Elem() if !argType.Implements(streamType) { - log.Error(mname, "argument does not implement Stream interface:", argType) + log.Errorf("%v argument does not implement Stream interface: %v", mname, argType) return nil } } else { @@ -156,30 +156,30 @@ func prepareMethod(method reflect.Method) *methodType { // First arg need not be a pointer. if !isExportedOrBuiltinType(argType) { - log.Error(mname, "argument type not exported:", argType) + log.Errorf("%v argument type not exported: %v", mname, argType) return nil } if replyType.Kind() != reflect.Ptr { - log.Error("method", mname, "reply type not a pointer:", replyType) + log.Errorf("method %v reply type not a pointer: %v", mname, replyType) return nil } // Reply type must be exported. if !isExportedOrBuiltinType(replyType) { - log.Error("method", mname, "reply type not exported:", replyType) + log.Errorf("method %v reply type not exported: %v", mname, replyType) return nil } } // Method needs one out. if mtype.NumOut() != 1 { - log.Error("method", mname, "has wrong number of outs:", mtype.NumOut()) + log.Errorf("method %v has wrong number of outs: %v", mname, mtype.NumOut()) return nil } // The return type of the method must be error. if returnType := mtype.Out(0); returnType != typeOfError { - log.Error("method", mname, "returns", returnType.String(), "not error") + log.Errorf("method %v returns %v not error", mname, returnType.String()) return nil } return &methodType{method: method, ArgType: argType, ReplyType: replyType, ContextType: contextType, stream: stream} @@ -508,7 +508,7 @@ func (router *router) ProcessMessage(ctx context.Context, msg Message) (err erro defer func() { // recover any panics if r := recover(); r != nil { - log.Error("panic recovered: ", r) + log.Errorf("panic recovered: %v", r) log.Error(string(debug.Stack())) err = merrors.InternalServerError("go.micro.server", "panic recovered: %v", r) } diff --git a/vendor/github.com/micro/go-micro/v2/server/rpc_server.go b/vendor/github.com/micro/go-micro/v2/server/rpc_server.go index f1ce3ebb7..eda90942f 100644 --- a/vendor/github.com/micro/go-micro/v2/server/rpc_server.go +++ b/vendor/github.com/micro/go-micro/v2/server/rpc_server.go @@ -20,6 +20,7 @@ import ( "github.com/micro/go-micro/v2/registry" "github.com/micro/go-micro/v2/transport" "github.com/micro/go-micro/v2/util/addr" + "github.com/micro/go-micro/v2/util/backoff" mnet "github.com/micro/go-micro/v2/util/net" "github.com/micro/go-micro/v2/util/socket" ) @@ -362,11 +363,12 @@ func (s *rpcServer) ServeConn(sock transport.Socket) { r = rpcRouter{h: handler} } + // wait for two coroutines to exit + // serve the request and process the outbound messages + wg.Add(2) + // process the outbound messages from the socket go func(id string, psock *socket.Socket) { - // wait for processing to exit - wg.Add(1) - defer func() { // TODO: don't hack this but if its grpc just break out of the stream // We do this because the underlying connection is h2 and its a stream @@ -404,9 +406,6 @@ func (s *rpcServer) ServeConn(sock transport.Socket) { // serve the request in a go routine as this may be a stream go func(id string, psock *socket.Socket) { - // add to the waitgroup - wg.Add(1) - defer func() { // release the socket pool.Release(psock) @@ -514,18 +513,39 @@ func (s *rpcServer) Subscribe(sb Subscriber) error { } func (s *rpcServer) Register() error { - s.RLock() rsvc := s.rsvc config := s.Options() s.RUnlock() - if rsvc != nil { + regFunc := func(service *registry.Service) error { + // create registry options rOpts := []registry.RegisterOption{registry.RegisterTTL(config.RegisterTTL)} - if err := config.Registry.Register(rsvc, rOpts...); err != nil { - return err + + var regErr error + + for i := 0; i < 3; i++ { + // attempt to register + if err := config.Registry.Register(service, rOpts...); err != nil { + // set the error + regErr = err + // backoff then retry + time.Sleep(backoff.Do(i + 1)) + continue + } + // success so nil error + regErr = nil + break } + return regErr + } + + // have we registered before? + if rsvc != nil { + if err := regFunc(rsvc); err != nil { + return err + } return nil } @@ -635,10 +655,8 @@ func (s *rpcServer) Register() error { } } - // create registry options - rOpts := []registry.RegisterOption{registry.RegisterTTL(config.RegisterTTL)} - - if err := config.Registry.Register(service, rOpts...); err != nil { + // register the service + if err := regFunc(service); err != nil { return err } diff --git a/vendor/github.com/micro/go-micro/v2/server/server.go b/vendor/github.com/micro/go-micro/v2/server/server.go index 21e05e9f7..a7c00fcac 100644 --- a/vendor/github.com/micro/go-micro/v2/server/server.go +++ b/vendor/github.com/micro/go-micro/v2/server/server.go @@ -16,14 +16,23 @@ import ( // Server is a simple micro server abstraction type Server interface { - Options() Options + // Initialise options Init(...Option) error + // Retrieve the options + Options() Options + // Register a handler Handle(Handler) error + // Create a new handler NewHandler(interface{}, ...HandlerOption) Handler + // Create a new subscriber NewSubscriber(string, interface{}, ...SubscriberOption) Subscriber + // Register a subscriber Subscribe(Subscriber) error + // Start the server Start() error + // Stop the server Stop() error + // Server implementation String() string } @@ -116,7 +125,8 @@ type Handler interface { } // Subscriber interface represents a subscription to a given topic using -// a specific subscriber function or object with endpoints. +// a specific subscriber function or object with endpoints. It mirrors +// the handler in its behaviour. type Subscriber interface { Topic() string Subscriber() interface{} @@ -135,7 +145,7 @@ var ( DefaultRouter = newRpcRouter() DefaultRegisterCheck = func(context.Context) error { return nil } DefaultRegisterInterval = time.Second * 30 - DefaultRegisterTTL = time.Minute + DefaultRegisterTTL = time.Second * 90 // NewServer creates a new server NewServer func(...Option) Server = newRpcServer diff --git a/vendor/github.com/micro/go-micro/v2/service.go b/vendor/github.com/micro/go-micro/v2/service.go index c81127d2e..c8fe4c761 100644 --- a/vendor/github.com/micro/go-micro/v2/service.go +++ b/vendor/github.com/micro/go-micro/v2/service.go @@ -3,7 +3,7 @@ package micro import ( "os" "os/signal" - "runtime" + rtime "runtime" "strings" "sync" @@ -34,14 +34,15 @@ func newService(opts ...Option) Service { // service name serviceName := options.Server.Options().Name - // authFn returns the auth, we pass as a function since auth - // has not yet been set at this point. + // we pass functions to the wrappers since the values can change during initialisation authFn := func() auth.Auth { return options.Server.Options().Auth } + cacheFn := func() *client.Cache { return options.Client.Options().Cache } // wrap client to inject From-Service header on any calls options.Client = wrapper.FromService(serviceName, options.Client) options.Client = wrapper.TraceCall(serviceName, trace.DefaultTracer, options.Client) - options.Client = wrapper.AuthClient(serviceName, options.Server.Options().Id, authFn, options.Client) + options.Client = wrapper.CacheClient(cacheFn, options.Client) + options.Client = wrapper.AuthClient(authFn, options.Client) // wrap the server to provide handler stats options.Server.Init( @@ -98,6 +99,7 @@ func (s *service) Init(opts ...Option) { cmd.Auth(&s.opts.Auth), cmd.Broker(&s.opts.Broker), cmd.Registry(&s.opts.Registry), + cmd.Runtime(&s.opts.Runtime), cmd.Transport(&s.opts.Transport), cmd.Client(&s.opts.Client), cmd.Config(&s.opts.Config), @@ -111,14 +113,6 @@ func (s *service) Init(opts ...Option) { // Explicitly set the table name to the service name name := s.opts.Cmd.App().Name s.opts.Store.Init(store.Table(name)) - - // TODO: replace Cmd.Init with config.Load - // Right now we're just going to load a token - // May need to re-read value on change - // TODO: should be scoped to micro/auth/token - // if tk, _ := config.Get("token"); len(tk) > 0 { - // s.opts.Auth.Init(auth.ServiceToken(tk)) - // } }) } @@ -184,7 +178,7 @@ func (s *service) Run() error { // register the debug handler s.opts.Server.Handle( s.opts.Server.NewHandler( - handler.NewHandler(), + handler.NewHandler(s.opts.Client), server.InternalHandler(true), ), ) @@ -192,9 +186,9 @@ func (s *service) Run() error { // start the profiler if s.opts.Profile != nil { // to view mutex contention - runtime.SetMutexProfileFraction(5) + rtime.SetMutexProfileFraction(5) // to view blocking profile - runtime.SetBlockProfileRate(1) + rtime.SetBlockProfileRate(1) if err := s.opts.Profile.Start(); err != nil { return err diff --git a/vendor/github.com/micro/go-micro/v2/store/memory/memory.go b/vendor/github.com/micro/go-micro/v2/store/memory/memory.go index cbe6e38d3..bb3578c2e 100644 --- a/vendor/github.com/micro/go-micro/v2/store/memory/memory.go +++ b/vendor/github.com/micro/go-micro/v2/store/memory/memory.go @@ -33,9 +33,10 @@ type memoryStore struct { store *cache.Cache } -type internalRecord struct { +type storeRecord struct { key string value []byte + metadata map[string]interface{} expiresAt time.Time } @@ -56,26 +57,36 @@ func (m *memoryStore) prefix(database, table string) string { func (m *memoryStore) get(prefix, key string) (*store.Record, error) { key = m.key(prefix, key) - var storedRecord *internalRecord + var storedRecord *storeRecord r, found := m.store.Get(key) if !found { return nil, store.ErrNotFound } - storedRecord, ok := r.(*internalRecord) + storedRecord, ok := r.(*storeRecord) if !ok { - return nil, errors.New("Retrieved a non *internalRecord from the cache") + return nil, errors.New("Retrieved a non *storeRecord from the cache") } // Copy the record on the way out newRecord := &store.Record{} newRecord.Key = strings.TrimPrefix(storedRecord.key, prefix+"/") newRecord.Value = make([]byte, len(storedRecord.value)) + newRecord.Metadata = make(map[string]interface{}) + + // copy the value into the new record copy(newRecord.Value, storedRecord.value) + + // check if we need to set the expiry if !storedRecord.expiresAt.IsZero() { newRecord.Expiry = time.Until(storedRecord.expiresAt) } + // copy in the metadata + for k, v := range storedRecord.metadata { + newRecord.Metadata[k] = v + } + return newRecord, nil } @@ -84,15 +95,24 @@ func (m *memoryStore) set(prefix string, r *store.Record) { // copy the incoming record and then // convert the expiry in to a hard timestamp - i := &internalRecord{} + i := &storeRecord{} i.key = r.Key i.value = make([]byte, len(r.Value)) + i.metadata = make(map[string]interface{}) + + // copy the the value copy(i.value, r.Value) + // set the expiry if r.Expiry != 0 { i.expiresAt = time.Now().Add(r.Expiry) } + // set the metadata + for k, v := range r.Metadata { + i.metadata[k] = v + } + m.store.Set(key, i, r.Expiry) } @@ -134,7 +154,6 @@ func (m *memoryStore) Close() error { } func (m *memoryStore) Init(opts ...store.Option) error { - m.store.Flush() for _, o := range opts { o(&m.options) } @@ -200,6 +219,7 @@ func (m *memoryStore) Write(r *store.Record, opts ...store.WriteOption) error { newRecord := store.Record{} newRecord.Key = r.Key newRecord.Value = make([]byte, len(r.Value)) + newRecord.Metadata = make(map[string]interface{}) copy(newRecord.Value, r.Value) newRecord.Expiry = r.Expiry @@ -209,6 +229,11 @@ func (m *memoryStore) Write(r *store.Record, opts ...store.WriteOption) error { if writeOpts.TTL != 0 { newRecord.Expiry = writeOpts.TTL } + + for k, v := range r.Metadata { + newRecord.Metadata[k] = v + } + m.set(prefix, &newRecord) return nil } diff --git a/vendor/github.com/micro/go-micro/v2/store/options.go b/vendor/github.com/micro/go-micro/v2/store/options.go index 272247310..d89cb7661 100644 --- a/vendor/github.com/micro/go-micro/v2/store/options.go +++ b/vendor/github.com/micro/go-micro/v2/store/options.go @@ -3,6 +3,8 @@ package store import ( "context" "time" + + "github.com/micro/go-micro/v2/client" ) // Options contains configuration for the Store @@ -17,6 +19,8 @@ type Options struct { Table string // Context should contain all implementation specific options, using context.WithValue. Context context.Context + // Client to use for RPC + Client client.Client } // Option sets values in Options @@ -52,6 +56,13 @@ func WithContext(c context.Context) Option { } } +// WithClient sets the stores client to use for RPC +func WithClient(c client.Client) Option { + return func(o *Options) { + o.Client = c + } +} + // ReadOptions configures an individual Read operation type ReadOptions struct { Database, Table string diff --git a/vendor/github.com/micro/go-micro/v2/store/service/proto/store.pb.go b/vendor/github.com/micro/go-micro/v2/store/service/proto/store.pb.go index 71af1132e..f8f825150 100644 --- a/vendor/github.com/micro/go-micro/v2/store/service/proto/store.pb.go +++ b/vendor/github.com/micro/go-micro/v2/store/service/proto/store.pb.go @@ -1,883 +1,1455 @@ // Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.22.0 +// protoc v3.11.4 // source: github.com/micro/go-micro/store/service/proto/store.proto package go_micro_store import ( - fmt "fmt" proto "github.com/golang/protobuf/proto" - math "math" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" ) -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// This is a compile-time assertion that a sufficiently up-to-date version +// of the legacy proto package is being used. +const _ = proto.ProtoPackageIsVersion4 + +type Field struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // type of value e.g string, int, int64, bool, float64 + Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` + // the actual value + Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` +} + +func (x *Field) Reset() { + *x = Field{} + if protoimpl.UnsafeEnabled { + mi := &file_github_com_micro_go_micro_store_service_proto_store_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Field) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Field) ProtoMessage() {} + +func (x *Field) ProtoReflect() protoreflect.Message { + mi := &file_github_com_micro_go_micro_store_service_proto_store_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package +// Deprecated: Use Field.ProtoReflect.Descriptor instead. +func (*Field) Descriptor() ([]byte, []int) { + return file_github_com_micro_go_micro_store_service_proto_store_proto_rawDescGZIP(), []int{0} +} + +func (x *Field) GetType() string { + if x != nil { + return x.Type + } + return "" +} + +func (x *Field) GetValue() string { + if x != nil { + return x.Value + } + return "" +} type Record struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + // key of the record Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` // value in the record Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` // time.Duration (signed int64 nanoseconds) - Expiry int64 `protobuf:"varint,3,opt,name=expiry,proto3" json:"expiry,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + Expiry int64 `protobuf:"varint,3,opt,name=expiry,proto3" json:"expiry,omitempty"` + // the associated metadata + Metadata map[string]*Field `protobuf:"bytes,4,rep,name=metadata,proto3" json:"metadata,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` } -func (m *Record) Reset() { *m = Record{} } -func (m *Record) String() string { return proto.CompactTextString(m) } -func (*Record) ProtoMessage() {} -func (*Record) Descriptor() ([]byte, []int) { - return fileDescriptor_42854049893ccb13, []int{0} +func (x *Record) Reset() { + *x = Record{} + if protoimpl.UnsafeEnabled { + mi := &file_github_com_micro_go_micro_store_service_proto_store_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *Record) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Record.Unmarshal(m, b) -} -func (m *Record) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Record.Marshal(b, m, deterministic) +func (x *Record) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *Record) XXX_Merge(src proto.Message) { - xxx_messageInfo_Record.Merge(m, src) -} -func (m *Record) XXX_Size() int { - return xxx_messageInfo_Record.Size(m) -} -func (m *Record) XXX_DiscardUnknown() { - xxx_messageInfo_Record.DiscardUnknown(m) + +func (*Record) ProtoMessage() {} + +func (x *Record) ProtoReflect() protoreflect.Message { + mi := &file_github_com_micro_go_micro_store_service_proto_store_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_Record proto.InternalMessageInfo +// Deprecated: Use Record.ProtoReflect.Descriptor instead. +func (*Record) Descriptor() ([]byte, []int) { + return file_github_com_micro_go_micro_store_service_proto_store_proto_rawDescGZIP(), []int{1} +} -func (m *Record) GetKey() string { - if m != nil { - return m.Key +func (x *Record) GetKey() string { + if x != nil { + return x.Key } return "" } -func (m *Record) GetValue() []byte { - if m != nil { - return m.Value +func (x *Record) GetValue() []byte { + if x != nil { + return x.Value } return nil } -func (m *Record) GetExpiry() int64 { - if m != nil { - return m.Expiry +func (x *Record) GetExpiry() int64 { + if x != nil { + return x.Expiry } return 0 } -type ReadOptions struct { - Database string `protobuf:"bytes,1,opt,name=database,proto3" json:"database,omitempty"` - Table string `protobuf:"bytes,2,opt,name=table,proto3" json:"table,omitempty"` - Prefix bool `protobuf:"varint,3,opt,name=prefix,proto3" json:"prefix,omitempty"` - Suffix bool `protobuf:"varint,4,opt,name=suffix,proto3" json:"suffix,omitempty"` - Limit uint64 `protobuf:"varint,5,opt,name=limit,proto3" json:"limit,omitempty"` - Offset uint64 `protobuf:"varint,6,opt,name=offset,proto3" json:"offset,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ReadOptions) Reset() { *m = ReadOptions{} } -func (m *ReadOptions) String() string { return proto.CompactTextString(m) } -func (*ReadOptions) ProtoMessage() {} -func (*ReadOptions) Descriptor() ([]byte, []int) { - return fileDescriptor_42854049893ccb13, []int{1} +func (x *Record) GetMetadata() map[string]*Field { + if x != nil { + return x.Metadata + } + return nil } -func (m *ReadOptions) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ReadOptions.Unmarshal(m, b) -} -func (m *ReadOptions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ReadOptions.Marshal(b, m, deterministic) -} -func (m *ReadOptions) XXX_Merge(src proto.Message) { - xxx_messageInfo_ReadOptions.Merge(m, src) +type ReadOptions struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Database string `protobuf:"bytes,1,opt,name=database,proto3" json:"database,omitempty"` + Table string `protobuf:"bytes,2,opt,name=table,proto3" json:"table,omitempty"` + Prefix bool `protobuf:"varint,3,opt,name=prefix,proto3" json:"prefix,omitempty"` + Suffix bool `protobuf:"varint,4,opt,name=suffix,proto3" json:"suffix,omitempty"` + Limit uint64 `protobuf:"varint,5,opt,name=limit,proto3" json:"limit,omitempty"` + Offset uint64 `protobuf:"varint,6,opt,name=offset,proto3" json:"offset,omitempty"` +} + +func (x *ReadOptions) Reset() { + *x = ReadOptions{} + if protoimpl.UnsafeEnabled { + mi := &file_github_com_micro_go_micro_store_service_proto_store_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *ReadOptions) XXX_Size() int { - return xxx_messageInfo_ReadOptions.Size(m) + +func (x *ReadOptions) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *ReadOptions) XXX_DiscardUnknown() { - xxx_messageInfo_ReadOptions.DiscardUnknown(m) + +func (*ReadOptions) ProtoMessage() {} + +func (x *ReadOptions) ProtoReflect() protoreflect.Message { + mi := &file_github_com_micro_go_micro_store_service_proto_store_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_ReadOptions proto.InternalMessageInfo +// Deprecated: Use ReadOptions.ProtoReflect.Descriptor instead. +func (*ReadOptions) Descriptor() ([]byte, []int) { + return file_github_com_micro_go_micro_store_service_proto_store_proto_rawDescGZIP(), []int{2} +} -func (m *ReadOptions) GetDatabase() string { - if m != nil { - return m.Database +func (x *ReadOptions) GetDatabase() string { + if x != nil { + return x.Database } return "" } -func (m *ReadOptions) GetTable() string { - if m != nil { - return m.Table +func (x *ReadOptions) GetTable() string { + if x != nil { + return x.Table } return "" } -func (m *ReadOptions) GetPrefix() bool { - if m != nil { - return m.Prefix +func (x *ReadOptions) GetPrefix() bool { + if x != nil { + return x.Prefix } return false } -func (m *ReadOptions) GetSuffix() bool { - if m != nil { - return m.Suffix +func (x *ReadOptions) GetSuffix() bool { + if x != nil { + return x.Suffix } return false } -func (m *ReadOptions) GetLimit() uint64 { - if m != nil { - return m.Limit +func (x *ReadOptions) GetLimit() uint64 { + if x != nil { + return x.Limit } return 0 } -func (m *ReadOptions) GetOffset() uint64 { - if m != nil { - return m.Offset +func (x *ReadOptions) GetOffset() uint64 { + if x != nil { + return x.Offset } return 0 } type ReadRequest struct { - Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` - Options *ReadOptions `protobuf:"bytes,2,opt,name=options,proto3" json:"options,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (m *ReadRequest) Reset() { *m = ReadRequest{} } -func (m *ReadRequest) String() string { return proto.CompactTextString(m) } -func (*ReadRequest) ProtoMessage() {} -func (*ReadRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_42854049893ccb13, []int{2} + Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` + Options *ReadOptions `protobuf:"bytes,2,opt,name=options,proto3" json:"options,omitempty"` } -func (m *ReadRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ReadRequest.Unmarshal(m, b) -} -func (m *ReadRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ReadRequest.Marshal(b, m, deterministic) -} -func (m *ReadRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_ReadRequest.Merge(m, src) +func (x *ReadRequest) Reset() { + *x = ReadRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_github_com_micro_go_micro_store_service_proto_store_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *ReadRequest) XXX_Size() int { - return xxx_messageInfo_ReadRequest.Size(m) + +func (x *ReadRequest) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *ReadRequest) XXX_DiscardUnknown() { - xxx_messageInfo_ReadRequest.DiscardUnknown(m) + +func (*ReadRequest) ProtoMessage() {} + +func (x *ReadRequest) ProtoReflect() protoreflect.Message { + mi := &file_github_com_micro_go_micro_store_service_proto_store_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_ReadRequest proto.InternalMessageInfo +// Deprecated: Use ReadRequest.ProtoReflect.Descriptor instead. +func (*ReadRequest) Descriptor() ([]byte, []int) { + return file_github_com_micro_go_micro_store_service_proto_store_proto_rawDescGZIP(), []int{3} +} -func (m *ReadRequest) GetKey() string { - if m != nil { - return m.Key +func (x *ReadRequest) GetKey() string { + if x != nil { + return x.Key } return "" } -func (m *ReadRequest) GetOptions() *ReadOptions { - if m != nil { - return m.Options +func (x *ReadRequest) GetOptions() *ReadOptions { + if x != nil { + return x.Options } return nil } type ReadResponse struct { - Records []*Record `protobuf:"bytes,1,rep,name=records,proto3" json:"records,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (m *ReadResponse) Reset() { *m = ReadResponse{} } -func (m *ReadResponse) String() string { return proto.CompactTextString(m) } -func (*ReadResponse) ProtoMessage() {} -func (*ReadResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_42854049893ccb13, []int{3} + Records []*Record `protobuf:"bytes,1,rep,name=records,proto3" json:"records,omitempty"` } -func (m *ReadResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ReadResponse.Unmarshal(m, b) -} -func (m *ReadResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ReadResponse.Marshal(b, m, deterministic) -} -func (m *ReadResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_ReadResponse.Merge(m, src) +func (x *ReadResponse) Reset() { + *x = ReadResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_github_com_micro_go_micro_store_service_proto_store_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *ReadResponse) XXX_Size() int { - return xxx_messageInfo_ReadResponse.Size(m) + +func (x *ReadResponse) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *ReadResponse) XXX_DiscardUnknown() { - xxx_messageInfo_ReadResponse.DiscardUnknown(m) + +func (*ReadResponse) ProtoMessage() {} + +func (x *ReadResponse) ProtoReflect() protoreflect.Message { + mi := &file_github_com_micro_go_micro_store_service_proto_store_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_ReadResponse proto.InternalMessageInfo +// Deprecated: Use ReadResponse.ProtoReflect.Descriptor instead. +func (*ReadResponse) Descriptor() ([]byte, []int) { + return file_github_com_micro_go_micro_store_service_proto_store_proto_rawDescGZIP(), []int{4} +} -func (m *ReadResponse) GetRecords() []*Record { - if m != nil { - return m.Records +func (x *ReadResponse) GetRecords() []*Record { + if x != nil { + return x.Records } return nil } type WriteOptions struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + Database string `protobuf:"bytes,1,opt,name=database,proto3" json:"database,omitempty"` Table string `protobuf:"bytes,2,opt,name=table,proto3" json:"table,omitempty"` // time.Time Expiry int64 `protobuf:"varint,3,opt,name=expiry,proto3" json:"expiry,omitempty"` // time.Duration - Ttl int64 `protobuf:"varint,4,opt,name=ttl,proto3" json:"ttl,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + Ttl int64 `protobuf:"varint,4,opt,name=ttl,proto3" json:"ttl,omitempty"` } -func (m *WriteOptions) Reset() { *m = WriteOptions{} } -func (m *WriteOptions) String() string { return proto.CompactTextString(m) } -func (*WriteOptions) ProtoMessage() {} -func (*WriteOptions) Descriptor() ([]byte, []int) { - return fileDescriptor_42854049893ccb13, []int{4} +func (x *WriteOptions) Reset() { + *x = WriteOptions{} + if protoimpl.UnsafeEnabled { + mi := &file_github_com_micro_go_micro_store_service_proto_store_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *WriteOptions) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_WriteOptions.Unmarshal(m, b) +func (x *WriteOptions) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *WriteOptions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_WriteOptions.Marshal(b, m, deterministic) -} -func (m *WriteOptions) XXX_Merge(src proto.Message) { - xxx_messageInfo_WriteOptions.Merge(m, src) -} -func (m *WriteOptions) XXX_Size() int { - return xxx_messageInfo_WriteOptions.Size(m) -} -func (m *WriteOptions) XXX_DiscardUnknown() { - xxx_messageInfo_WriteOptions.DiscardUnknown(m) + +func (*WriteOptions) ProtoMessage() {} + +func (x *WriteOptions) ProtoReflect() protoreflect.Message { + mi := &file_github_com_micro_go_micro_store_service_proto_store_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_WriteOptions proto.InternalMessageInfo +// Deprecated: Use WriteOptions.ProtoReflect.Descriptor instead. +func (*WriteOptions) Descriptor() ([]byte, []int) { + return file_github_com_micro_go_micro_store_service_proto_store_proto_rawDescGZIP(), []int{5} +} -func (m *WriteOptions) GetDatabase() string { - if m != nil { - return m.Database +func (x *WriteOptions) GetDatabase() string { + if x != nil { + return x.Database } return "" } -func (m *WriteOptions) GetTable() string { - if m != nil { - return m.Table +func (x *WriteOptions) GetTable() string { + if x != nil { + return x.Table } return "" } -func (m *WriteOptions) GetExpiry() int64 { - if m != nil { - return m.Expiry +func (x *WriteOptions) GetExpiry() int64 { + if x != nil { + return x.Expiry } return 0 } -func (m *WriteOptions) GetTtl() int64 { - if m != nil { - return m.Ttl +func (x *WriteOptions) GetTtl() int64 { + if x != nil { + return x.Ttl } return 0 } type WriteRequest struct { - Record *Record `protobuf:"bytes,1,opt,name=record,proto3" json:"record,omitempty"` - Options *WriteOptions `protobuf:"bytes,2,opt,name=options,proto3" json:"options,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (m *WriteRequest) Reset() { *m = WriteRequest{} } -func (m *WriteRequest) String() string { return proto.CompactTextString(m) } -func (*WriteRequest) ProtoMessage() {} -func (*WriteRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_42854049893ccb13, []int{5} + Record *Record `protobuf:"bytes,1,opt,name=record,proto3" json:"record,omitempty"` + Options *WriteOptions `protobuf:"bytes,2,opt,name=options,proto3" json:"options,omitempty"` } -func (m *WriteRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_WriteRequest.Unmarshal(m, b) -} -func (m *WriteRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_WriteRequest.Marshal(b, m, deterministic) -} -func (m *WriteRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_WriteRequest.Merge(m, src) +func (x *WriteRequest) Reset() { + *x = WriteRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_github_com_micro_go_micro_store_service_proto_store_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *WriteRequest) XXX_Size() int { - return xxx_messageInfo_WriteRequest.Size(m) + +func (x *WriteRequest) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *WriteRequest) XXX_DiscardUnknown() { - xxx_messageInfo_WriteRequest.DiscardUnknown(m) + +func (*WriteRequest) ProtoMessage() {} + +func (x *WriteRequest) ProtoReflect() protoreflect.Message { + mi := &file_github_com_micro_go_micro_store_service_proto_store_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_WriteRequest proto.InternalMessageInfo +// Deprecated: Use WriteRequest.ProtoReflect.Descriptor instead. +func (*WriteRequest) Descriptor() ([]byte, []int) { + return file_github_com_micro_go_micro_store_service_proto_store_proto_rawDescGZIP(), []int{6} +} -func (m *WriteRequest) GetRecord() *Record { - if m != nil { - return m.Record +func (x *WriteRequest) GetRecord() *Record { + if x != nil { + return x.Record } return nil } -func (m *WriteRequest) GetOptions() *WriteOptions { - if m != nil { - return m.Options +func (x *WriteRequest) GetOptions() *WriteOptions { + if x != nil { + return x.Options } return nil } type WriteResponse struct { - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields } -func (m *WriteResponse) Reset() { *m = WriteResponse{} } -func (m *WriteResponse) String() string { return proto.CompactTextString(m) } -func (*WriteResponse) ProtoMessage() {} -func (*WriteResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_42854049893ccb13, []int{6} +func (x *WriteResponse) Reset() { + *x = WriteResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_github_com_micro_go_micro_store_service_proto_store_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *WriteResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_WriteResponse.Unmarshal(m, b) -} -func (m *WriteResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_WriteResponse.Marshal(b, m, deterministic) -} -func (m *WriteResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_WriteResponse.Merge(m, src) -} -func (m *WriteResponse) XXX_Size() int { - return xxx_messageInfo_WriteResponse.Size(m) -} -func (m *WriteResponse) XXX_DiscardUnknown() { - xxx_messageInfo_WriteResponse.DiscardUnknown(m) +func (x *WriteResponse) String() string { + return protoimpl.X.MessageStringOf(x) } -var xxx_messageInfo_WriteResponse proto.InternalMessageInfo +func (*WriteResponse) ProtoMessage() {} -type DeleteOptions struct { - Database string `protobuf:"bytes,1,opt,name=database,proto3" json:"database,omitempty"` - Table string `protobuf:"bytes,2,opt,name=table,proto3" json:"table,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` +func (x *WriteResponse) ProtoReflect() protoreflect.Message { + mi := &file_github_com_micro_go_micro_store_service_proto_store_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -func (m *DeleteOptions) Reset() { *m = DeleteOptions{} } -func (m *DeleteOptions) String() string { return proto.CompactTextString(m) } -func (*DeleteOptions) ProtoMessage() {} -func (*DeleteOptions) Descriptor() ([]byte, []int) { - return fileDescriptor_42854049893ccb13, []int{7} +// Deprecated: Use WriteResponse.ProtoReflect.Descriptor instead. +func (*WriteResponse) Descriptor() ([]byte, []int) { + return file_github_com_micro_go_micro_store_service_proto_store_proto_rawDescGZIP(), []int{7} } -func (m *DeleteOptions) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_DeleteOptions.Unmarshal(m, b) -} -func (m *DeleteOptions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_DeleteOptions.Marshal(b, m, deterministic) +type DeleteOptions struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Database string `protobuf:"bytes,1,opt,name=database,proto3" json:"database,omitempty"` + Table string `protobuf:"bytes,2,opt,name=table,proto3" json:"table,omitempty"` } -func (m *DeleteOptions) XXX_Merge(src proto.Message) { - xxx_messageInfo_DeleteOptions.Merge(m, src) + +func (x *DeleteOptions) Reset() { + *x = DeleteOptions{} + if protoimpl.UnsafeEnabled { + mi := &file_github_com_micro_go_micro_store_service_proto_store_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *DeleteOptions) XXX_Size() int { - return xxx_messageInfo_DeleteOptions.Size(m) + +func (x *DeleteOptions) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *DeleteOptions) XXX_DiscardUnknown() { - xxx_messageInfo_DeleteOptions.DiscardUnknown(m) + +func (*DeleteOptions) ProtoMessage() {} + +func (x *DeleteOptions) ProtoReflect() protoreflect.Message { + mi := &file_github_com_micro_go_micro_store_service_proto_store_proto_msgTypes[8] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_DeleteOptions proto.InternalMessageInfo +// Deprecated: Use DeleteOptions.ProtoReflect.Descriptor instead. +func (*DeleteOptions) Descriptor() ([]byte, []int) { + return file_github_com_micro_go_micro_store_service_proto_store_proto_rawDescGZIP(), []int{8} +} -func (m *DeleteOptions) GetDatabase() string { - if m != nil { - return m.Database +func (x *DeleteOptions) GetDatabase() string { + if x != nil { + return x.Database } return "" } -func (m *DeleteOptions) GetTable() string { - if m != nil { - return m.Table +func (x *DeleteOptions) GetTable() string { + if x != nil { + return x.Table } return "" } type DeleteRequest struct { - Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` - Options *DeleteOptions `protobuf:"bytes,2,opt,name=options,proto3" json:"options,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (m *DeleteRequest) Reset() { *m = DeleteRequest{} } -func (m *DeleteRequest) String() string { return proto.CompactTextString(m) } -func (*DeleteRequest) ProtoMessage() {} -func (*DeleteRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_42854049893ccb13, []int{8} + Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` + Options *DeleteOptions `protobuf:"bytes,2,opt,name=options,proto3" json:"options,omitempty"` } -func (m *DeleteRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_DeleteRequest.Unmarshal(m, b) -} -func (m *DeleteRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_DeleteRequest.Marshal(b, m, deterministic) -} -func (m *DeleteRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_DeleteRequest.Merge(m, src) +func (x *DeleteRequest) Reset() { + *x = DeleteRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_github_com_micro_go_micro_store_service_proto_store_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *DeleteRequest) XXX_Size() int { - return xxx_messageInfo_DeleteRequest.Size(m) + +func (x *DeleteRequest) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *DeleteRequest) XXX_DiscardUnknown() { - xxx_messageInfo_DeleteRequest.DiscardUnknown(m) + +func (*DeleteRequest) ProtoMessage() {} + +func (x *DeleteRequest) ProtoReflect() protoreflect.Message { + mi := &file_github_com_micro_go_micro_store_service_proto_store_proto_msgTypes[9] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_DeleteRequest proto.InternalMessageInfo +// Deprecated: Use DeleteRequest.ProtoReflect.Descriptor instead. +func (*DeleteRequest) Descriptor() ([]byte, []int) { + return file_github_com_micro_go_micro_store_service_proto_store_proto_rawDescGZIP(), []int{9} +} -func (m *DeleteRequest) GetKey() string { - if m != nil { - return m.Key +func (x *DeleteRequest) GetKey() string { + if x != nil { + return x.Key } return "" } -func (m *DeleteRequest) GetOptions() *DeleteOptions { - if m != nil { - return m.Options +func (x *DeleteRequest) GetOptions() *DeleteOptions { + if x != nil { + return x.Options } return nil } type DeleteResponse struct { - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields } -func (m *DeleteResponse) Reset() { *m = DeleteResponse{} } -func (m *DeleteResponse) String() string { return proto.CompactTextString(m) } -func (*DeleteResponse) ProtoMessage() {} -func (*DeleteResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_42854049893ccb13, []int{9} +func (x *DeleteResponse) Reset() { + *x = DeleteResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_github_com_micro_go_micro_store_service_proto_store_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *DeleteResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_DeleteResponse.Unmarshal(m, b) -} -func (m *DeleteResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_DeleteResponse.Marshal(b, m, deterministic) -} -func (m *DeleteResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_DeleteResponse.Merge(m, src) -} -func (m *DeleteResponse) XXX_Size() int { - return xxx_messageInfo_DeleteResponse.Size(m) -} -func (m *DeleteResponse) XXX_DiscardUnknown() { - xxx_messageInfo_DeleteResponse.DiscardUnknown(m) +func (x *DeleteResponse) String() string { + return protoimpl.X.MessageStringOf(x) } -var xxx_messageInfo_DeleteResponse proto.InternalMessageInfo +func (*DeleteResponse) ProtoMessage() {} -type ListOptions struct { - Database string `protobuf:"bytes,1,opt,name=database,proto3" json:"database,omitempty"` - Table string `protobuf:"bytes,2,opt,name=table,proto3" json:"table,omitempty"` - Prefix string `protobuf:"bytes,3,opt,name=prefix,proto3" json:"prefix,omitempty"` - Suffix string `protobuf:"bytes,4,opt,name=suffix,proto3" json:"suffix,omitempty"` - Limit uint64 `protobuf:"varint,5,opt,name=limit,proto3" json:"limit,omitempty"` - Offset uint64 `protobuf:"varint,6,opt,name=offset,proto3" json:"offset,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ListOptions) Reset() { *m = ListOptions{} } -func (m *ListOptions) String() string { return proto.CompactTextString(m) } -func (*ListOptions) ProtoMessage() {} -func (*ListOptions) Descriptor() ([]byte, []int) { - return fileDescriptor_42854049893ccb13, []int{10} +func (x *DeleteResponse) ProtoReflect() protoreflect.Message { + mi := &file_github_com_micro_go_micro_store_service_proto_store_proto_msgTypes[10] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -func (m *ListOptions) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ListOptions.Unmarshal(m, b) -} -func (m *ListOptions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ListOptions.Marshal(b, m, deterministic) +// Deprecated: Use DeleteResponse.ProtoReflect.Descriptor instead. +func (*DeleteResponse) Descriptor() ([]byte, []int) { + return file_github_com_micro_go_micro_store_service_proto_store_proto_rawDescGZIP(), []int{10} } -func (m *ListOptions) XXX_Merge(src proto.Message) { - xxx_messageInfo_ListOptions.Merge(m, src) + +type ListOptions struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Database string `protobuf:"bytes,1,opt,name=database,proto3" json:"database,omitempty"` + Table string `protobuf:"bytes,2,opt,name=table,proto3" json:"table,omitempty"` + Prefix string `protobuf:"bytes,3,opt,name=prefix,proto3" json:"prefix,omitempty"` + Suffix string `protobuf:"bytes,4,opt,name=suffix,proto3" json:"suffix,omitempty"` + Limit uint64 `protobuf:"varint,5,opt,name=limit,proto3" json:"limit,omitempty"` + Offset uint64 `protobuf:"varint,6,opt,name=offset,proto3" json:"offset,omitempty"` +} + +func (x *ListOptions) Reset() { + *x = ListOptions{} + if protoimpl.UnsafeEnabled { + mi := &file_github_com_micro_go_micro_store_service_proto_store_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *ListOptions) XXX_Size() int { - return xxx_messageInfo_ListOptions.Size(m) + +func (x *ListOptions) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *ListOptions) XXX_DiscardUnknown() { - xxx_messageInfo_ListOptions.DiscardUnknown(m) + +func (*ListOptions) ProtoMessage() {} + +func (x *ListOptions) ProtoReflect() protoreflect.Message { + mi := &file_github_com_micro_go_micro_store_service_proto_store_proto_msgTypes[11] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_ListOptions proto.InternalMessageInfo +// Deprecated: Use ListOptions.ProtoReflect.Descriptor instead. +func (*ListOptions) Descriptor() ([]byte, []int) { + return file_github_com_micro_go_micro_store_service_proto_store_proto_rawDescGZIP(), []int{11} +} -func (m *ListOptions) GetDatabase() string { - if m != nil { - return m.Database +func (x *ListOptions) GetDatabase() string { + if x != nil { + return x.Database } return "" } -func (m *ListOptions) GetTable() string { - if m != nil { - return m.Table +func (x *ListOptions) GetTable() string { + if x != nil { + return x.Table } return "" } -func (m *ListOptions) GetPrefix() string { - if m != nil { - return m.Prefix +func (x *ListOptions) GetPrefix() string { + if x != nil { + return x.Prefix } return "" } -func (m *ListOptions) GetSuffix() string { - if m != nil { - return m.Suffix +func (x *ListOptions) GetSuffix() string { + if x != nil { + return x.Suffix } return "" } -func (m *ListOptions) GetLimit() uint64 { - if m != nil { - return m.Limit +func (x *ListOptions) GetLimit() uint64 { + if x != nil { + return x.Limit } return 0 } -func (m *ListOptions) GetOffset() uint64 { - if m != nil { - return m.Offset +func (x *ListOptions) GetOffset() uint64 { + if x != nil { + return x.Offset } return 0 } type ListRequest struct { - Options *ListOptions `protobuf:"bytes,1,opt,name=options,proto3" json:"options,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (m *ListRequest) Reset() { *m = ListRequest{} } -func (m *ListRequest) String() string { return proto.CompactTextString(m) } -func (*ListRequest) ProtoMessage() {} -func (*ListRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_42854049893ccb13, []int{11} + Options *ListOptions `protobuf:"bytes,1,opt,name=options,proto3" json:"options,omitempty"` } -func (m *ListRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ListRequest.Unmarshal(m, b) -} -func (m *ListRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ListRequest.Marshal(b, m, deterministic) -} -func (m *ListRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_ListRequest.Merge(m, src) +func (x *ListRequest) Reset() { + *x = ListRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_github_com_micro_go_micro_store_service_proto_store_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *ListRequest) XXX_Size() int { - return xxx_messageInfo_ListRequest.Size(m) + +func (x *ListRequest) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *ListRequest) XXX_DiscardUnknown() { - xxx_messageInfo_ListRequest.DiscardUnknown(m) + +func (*ListRequest) ProtoMessage() {} + +func (x *ListRequest) ProtoReflect() protoreflect.Message { + mi := &file_github_com_micro_go_micro_store_service_proto_store_proto_msgTypes[12] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_ListRequest proto.InternalMessageInfo +// Deprecated: Use ListRequest.ProtoReflect.Descriptor instead. +func (*ListRequest) Descriptor() ([]byte, []int) { + return file_github_com_micro_go_micro_store_service_proto_store_proto_rawDescGZIP(), []int{12} +} -func (m *ListRequest) GetOptions() *ListOptions { - if m != nil { - return m.Options +func (x *ListRequest) GetOptions() *ListOptions { + if x != nil { + return x.Options } return nil } type ListResponse struct { - Keys []string `protobuf:"bytes,2,rep,name=keys,proto3" json:"keys,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (m *ListResponse) Reset() { *m = ListResponse{} } -func (m *ListResponse) String() string { return proto.CompactTextString(m) } -func (*ListResponse) ProtoMessage() {} -func (*ListResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_42854049893ccb13, []int{12} + Keys []string `protobuf:"bytes,2,rep,name=keys,proto3" json:"keys,omitempty"` } -func (m *ListResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ListResponse.Unmarshal(m, b) -} -func (m *ListResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ListResponse.Marshal(b, m, deterministic) -} -func (m *ListResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_ListResponse.Merge(m, src) +func (x *ListResponse) Reset() { + *x = ListResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_github_com_micro_go_micro_store_service_proto_store_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *ListResponse) XXX_Size() int { - return xxx_messageInfo_ListResponse.Size(m) + +func (x *ListResponse) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *ListResponse) XXX_DiscardUnknown() { - xxx_messageInfo_ListResponse.DiscardUnknown(m) + +func (*ListResponse) ProtoMessage() {} + +func (x *ListResponse) ProtoReflect() protoreflect.Message { + mi := &file_github_com_micro_go_micro_store_service_proto_store_proto_msgTypes[13] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_ListResponse proto.InternalMessageInfo +// Deprecated: Use ListResponse.ProtoReflect.Descriptor instead. +func (*ListResponse) Descriptor() ([]byte, []int) { + return file_github_com_micro_go_micro_store_service_proto_store_proto_rawDescGZIP(), []int{13} +} -func (m *ListResponse) GetKeys() []string { - if m != nil { - return m.Keys +func (x *ListResponse) GetKeys() []string { + if x != nil { + return x.Keys } return nil } type DatabasesRequest struct { - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields } -func (m *DatabasesRequest) Reset() { *m = DatabasesRequest{} } -func (m *DatabasesRequest) String() string { return proto.CompactTextString(m) } -func (*DatabasesRequest) ProtoMessage() {} -func (*DatabasesRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_42854049893ccb13, []int{13} +func (x *DatabasesRequest) Reset() { + *x = DatabasesRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_github_com_micro_go_micro_store_service_proto_store_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *DatabasesRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_DatabasesRequest.Unmarshal(m, b) -} -func (m *DatabasesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_DatabasesRequest.Marshal(b, m, deterministic) -} -func (m *DatabasesRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_DatabasesRequest.Merge(m, src) -} -func (m *DatabasesRequest) XXX_Size() int { - return xxx_messageInfo_DatabasesRequest.Size(m) -} -func (m *DatabasesRequest) XXX_DiscardUnknown() { - xxx_messageInfo_DatabasesRequest.DiscardUnknown(m) +func (x *DatabasesRequest) String() string { + return protoimpl.X.MessageStringOf(x) } -var xxx_messageInfo_DatabasesRequest proto.InternalMessageInfo +func (*DatabasesRequest) ProtoMessage() {} -type DatabasesResponse struct { - Databases []string `protobuf:"bytes,1,rep,name=databases,proto3" json:"databases,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` +func (x *DatabasesRequest) ProtoReflect() protoreflect.Message { + mi := &file_github_com_micro_go_micro_store_service_proto_store_proto_msgTypes[14] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -func (m *DatabasesResponse) Reset() { *m = DatabasesResponse{} } -func (m *DatabasesResponse) String() string { return proto.CompactTextString(m) } -func (*DatabasesResponse) ProtoMessage() {} -func (*DatabasesResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_42854049893ccb13, []int{14} +// Deprecated: Use DatabasesRequest.ProtoReflect.Descriptor instead. +func (*DatabasesRequest) Descriptor() ([]byte, []int) { + return file_github_com_micro_go_micro_store_service_proto_store_proto_rawDescGZIP(), []int{14} } -func (m *DatabasesResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_DatabasesResponse.Unmarshal(m, b) -} -func (m *DatabasesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_DatabasesResponse.Marshal(b, m, deterministic) +type DatabasesResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Databases []string `protobuf:"bytes,1,rep,name=databases,proto3" json:"databases,omitempty"` } -func (m *DatabasesResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_DatabasesResponse.Merge(m, src) + +func (x *DatabasesResponse) Reset() { + *x = DatabasesResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_github_com_micro_go_micro_store_service_proto_store_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *DatabasesResponse) XXX_Size() int { - return xxx_messageInfo_DatabasesResponse.Size(m) + +func (x *DatabasesResponse) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *DatabasesResponse) XXX_DiscardUnknown() { - xxx_messageInfo_DatabasesResponse.DiscardUnknown(m) + +func (*DatabasesResponse) ProtoMessage() {} + +func (x *DatabasesResponse) ProtoReflect() protoreflect.Message { + mi := &file_github_com_micro_go_micro_store_service_proto_store_proto_msgTypes[15] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_DatabasesResponse proto.InternalMessageInfo +// Deprecated: Use DatabasesResponse.ProtoReflect.Descriptor instead. +func (*DatabasesResponse) Descriptor() ([]byte, []int) { + return file_github_com_micro_go_micro_store_service_proto_store_proto_rawDescGZIP(), []int{15} +} -func (m *DatabasesResponse) GetDatabases() []string { - if m != nil { - return m.Databases +func (x *DatabasesResponse) GetDatabases() []string { + if x != nil { + return x.Databases } return nil } type TablesRequest struct { - Database string `protobuf:"bytes,1,opt,name=database,proto3" json:"database,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (m *TablesRequest) Reset() { *m = TablesRequest{} } -func (m *TablesRequest) String() string { return proto.CompactTextString(m) } -func (*TablesRequest) ProtoMessage() {} -func (*TablesRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_42854049893ccb13, []int{15} + Database string `protobuf:"bytes,1,opt,name=database,proto3" json:"database,omitempty"` } -func (m *TablesRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_TablesRequest.Unmarshal(m, b) -} -func (m *TablesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_TablesRequest.Marshal(b, m, deterministic) -} -func (m *TablesRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_TablesRequest.Merge(m, src) +func (x *TablesRequest) Reset() { + *x = TablesRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_github_com_micro_go_micro_store_service_proto_store_proto_msgTypes[16] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *TablesRequest) XXX_Size() int { - return xxx_messageInfo_TablesRequest.Size(m) + +func (x *TablesRequest) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *TablesRequest) XXX_DiscardUnknown() { - xxx_messageInfo_TablesRequest.DiscardUnknown(m) + +func (*TablesRequest) ProtoMessage() {} + +func (x *TablesRequest) ProtoReflect() protoreflect.Message { + mi := &file_github_com_micro_go_micro_store_service_proto_store_proto_msgTypes[16] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_TablesRequest proto.InternalMessageInfo +// Deprecated: Use TablesRequest.ProtoReflect.Descriptor instead. +func (*TablesRequest) Descriptor() ([]byte, []int) { + return file_github_com_micro_go_micro_store_service_proto_store_proto_rawDescGZIP(), []int{16} +} -func (m *TablesRequest) GetDatabase() string { - if m != nil { - return m.Database +func (x *TablesRequest) GetDatabase() string { + if x != nil { + return x.Database } return "" } type TablesResponse struct { - Tables []string `protobuf:"bytes,1,rep,name=tables,proto3" json:"tables,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (m *TablesResponse) Reset() { *m = TablesResponse{} } -func (m *TablesResponse) String() string { return proto.CompactTextString(m) } -func (*TablesResponse) ProtoMessage() {} -func (*TablesResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_42854049893ccb13, []int{16} + Tables []string `protobuf:"bytes,1,rep,name=tables,proto3" json:"tables,omitempty"` } -func (m *TablesResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_TablesResponse.Unmarshal(m, b) -} -func (m *TablesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_TablesResponse.Marshal(b, m, deterministic) -} -func (m *TablesResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_TablesResponse.Merge(m, src) +func (x *TablesResponse) Reset() { + *x = TablesResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_github_com_micro_go_micro_store_service_proto_store_proto_msgTypes[17] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *TablesResponse) XXX_Size() int { - return xxx_messageInfo_TablesResponse.Size(m) + +func (x *TablesResponse) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *TablesResponse) XXX_DiscardUnknown() { - xxx_messageInfo_TablesResponse.DiscardUnknown(m) + +func (*TablesResponse) ProtoMessage() {} + +func (x *TablesResponse) ProtoReflect() protoreflect.Message { + mi := &file_github_com_micro_go_micro_store_service_proto_store_proto_msgTypes[17] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_TablesResponse proto.InternalMessageInfo +// Deprecated: Use TablesResponse.ProtoReflect.Descriptor instead. +func (*TablesResponse) Descriptor() ([]byte, []int) { + return file_github_com_micro_go_micro_store_service_proto_store_proto_rawDescGZIP(), []int{17} +} -func (m *TablesResponse) GetTables() []string { - if m != nil { - return m.Tables +func (x *TablesResponse) GetTables() []string { + if x != nil { + return x.Tables } return nil } -func init() { - proto.RegisterType((*Record)(nil), "go.micro.store.Record") - proto.RegisterType((*ReadOptions)(nil), "go.micro.store.ReadOptions") - proto.RegisterType((*ReadRequest)(nil), "go.micro.store.ReadRequest") - proto.RegisterType((*ReadResponse)(nil), "go.micro.store.ReadResponse") - proto.RegisterType((*WriteOptions)(nil), "go.micro.store.WriteOptions") - proto.RegisterType((*WriteRequest)(nil), "go.micro.store.WriteRequest") - proto.RegisterType((*WriteResponse)(nil), "go.micro.store.WriteResponse") - proto.RegisterType((*DeleteOptions)(nil), "go.micro.store.DeleteOptions") - proto.RegisterType((*DeleteRequest)(nil), "go.micro.store.DeleteRequest") - proto.RegisterType((*DeleteResponse)(nil), "go.micro.store.DeleteResponse") - proto.RegisterType((*ListOptions)(nil), "go.micro.store.ListOptions") - proto.RegisterType((*ListRequest)(nil), "go.micro.store.ListRequest") - proto.RegisterType((*ListResponse)(nil), "go.micro.store.ListResponse") - proto.RegisterType((*DatabasesRequest)(nil), "go.micro.store.DatabasesRequest") - proto.RegisterType((*DatabasesResponse)(nil), "go.micro.store.DatabasesResponse") - proto.RegisterType((*TablesRequest)(nil), "go.micro.store.TablesRequest") - proto.RegisterType((*TablesResponse)(nil), "go.micro.store.TablesResponse") -} - -func init() { - proto.RegisterFile("github.com/micro/go-micro/store/service/proto/store.proto", fileDescriptor_42854049893ccb13) -} - -var fileDescriptor_42854049893ccb13 = []byte{ - // 598 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x55, 0xdd, 0x8e, 0xd2, 0x40, - 0x14, 0xa6, 0xdb, 0xd2, 0xa5, 0x87, 0x1f, 0x71, 0x62, 0x48, 0x83, 0xac, 0xa9, 0x73, 0xd5, 0xc4, - 0x58, 0x56, 0x8c, 0x1a, 0xef, 0x34, 0xa2, 0x51, 0x63, 0x62, 0x32, 0x1a, 0x4d, 0xbc, 0x2b, 0x30, - 0x60, 0x5d, 0xd8, 0x62, 0x67, 0x20, 0xcb, 0xc3, 0xf8, 0x38, 0xbe, 0x97, 0x99, 0x3f, 0x28, 0xd0, - 0xee, 0x85, 0xbb, 0x77, 0x73, 0xce, 0x1c, 0xbe, 0x39, 0xdf, 0x4f, 0x03, 0xbc, 0x9c, 0x25, 0xfc, - 0xe7, 0x6a, 0x14, 0x8d, 0xd3, 0x45, 0x7f, 0x91, 0x8c, 0xb3, 0xb4, 0x3f, 0x4b, 0x1f, 0xab, 0x03, - 0xe3, 0x69, 0x46, 0xfb, 0x8c, 0x66, 0xeb, 0x64, 0x4c, 0xfb, 0xcb, 0x2c, 0xe5, 0xba, 0x17, 0xc9, - 0x33, 0x6a, 0xcd, 0xd2, 0x48, 0x4e, 0x46, 0xb2, 0x8b, 0xdf, 0x83, 0x4b, 0xe8, 0x38, 0xcd, 0x26, - 0xa8, 0x0d, 0xf6, 0x05, 0xdd, 0xf8, 0x56, 0x60, 0x85, 0x1e, 0x11, 0x47, 0x74, 0x0f, 0xaa, 0xeb, - 0x78, 0xbe, 0xa2, 0xfe, 0x49, 0x60, 0x85, 0x0d, 0xa2, 0x0a, 0xd4, 0x01, 0x97, 0x5e, 0x2d, 0x93, - 0x6c, 0xe3, 0xdb, 0x81, 0x15, 0xda, 0x44, 0x57, 0xf8, 0x8f, 0x05, 0x75, 0x42, 0xe3, 0xc9, 0xe7, - 0x25, 0x4f, 0xd2, 0x4b, 0x86, 0xba, 0x50, 0x9b, 0xc4, 0x3c, 0x1e, 0xc5, 0x8c, 0x6a, 0xd0, 0x6d, - 0x2d, 0x90, 0x79, 0x3c, 0x9a, 0x2b, 0x64, 0x8f, 0xa8, 0x42, 0x20, 0x2f, 0x33, 0x3a, 0x4d, 0xae, - 0x24, 0x72, 0x8d, 0xe8, 0x4a, 0xf4, 0xd9, 0x6a, 0x2a, 0xfa, 0x8e, 0xea, 0xab, 0x4a, 0xa0, 0xcc, - 0x93, 0x45, 0xc2, 0xfd, 0x6a, 0x60, 0x85, 0x0e, 0x51, 0x85, 0x98, 0x4e, 0xa7, 0x53, 0x46, 0xb9, - 0xef, 0xca, 0xb6, 0xae, 0xf0, 0x37, 0xb5, 0x1e, 0xa1, 0xbf, 0x57, 0x94, 0xf1, 0x02, 0xba, 0xcf, - 0xe0, 0x34, 0x55, 0xbb, 0xcb, 0xb5, 0xea, 0x83, 0xfb, 0xd1, 0xbe, 0x58, 0x51, 0x8e, 0x1e, 0x31, - 0xb3, 0xf8, 0x15, 0x34, 0x14, 0x2e, 0x5b, 0xa6, 0x97, 0x8c, 0xa2, 0x73, 0x38, 0xcd, 0xa4, 0xa2, - 0xcc, 0xb7, 0x02, 0x3b, 0xac, 0x0f, 0x3a, 0xc7, 0x30, 0xe2, 0x9a, 0x98, 0x31, 0xfc, 0x0b, 0x1a, - 0xdf, 0xb3, 0x84, 0xd3, 0x1b, 0x29, 0x57, 0xe4, 0x89, 0x20, 0xc9, 0xf9, 0x5c, 0xca, 0x66, 0x13, - 0x71, 0xc4, 0x6b, 0xfd, 0x96, 0x91, 0x21, 0x02, 0x57, 0xad, 0x21, 0x5f, 0x2a, 0x5f, 0x56, 0x4f, - 0xa1, 0xe7, 0x87, 0x22, 0xf5, 0x0e, 0x7f, 0x90, 0xa7, 0xb2, 0x53, 0xe9, 0x0e, 0x34, 0xf5, 0xbb, - 0x4a, 0x26, 0xfc, 0x1a, 0x9a, 0x43, 0x3a, 0xa7, 0x37, 0x60, 0x8d, 0x7f, 0x18, 0x88, 0x72, 0x4f, - 0x5f, 0x1c, 0xae, 0x7b, 0x76, 0xb8, 0xee, 0xde, 0x12, 0xbb, 0x7d, 0xdb, 0xd0, 0x32, 0xd8, 0x7a, - 0x61, 0x91, 0xef, 0x4f, 0x09, 0xe3, 0xb7, 0x95, 0x6f, 0xaf, 0x24, 0xdf, 0xde, 0x7f, 0xe6, 0x7b, - 0xa8, 0xd6, 0x33, 0x5a, 0xe4, 0xd2, 0x6c, 0x15, 0xa7, 0x39, 0x47, 0x66, 0xc7, 0x3b, 0x84, 0x86, - 0x42, 0xd1, 0x69, 0x46, 0xe0, 0x5c, 0xd0, 0x8d, 0x50, 0xcf, 0x0e, 0x3d, 0x22, 0xcf, 0x1f, 0x9d, - 0x9a, 0xd5, 0x3e, 0xc1, 0x08, 0xda, 0x43, 0xcd, 0x97, 0xe9, 0x47, 0xf1, 0x13, 0xb8, 0x9b, 0xeb, - 0x69, 0x88, 0x1e, 0x78, 0x46, 0x18, 0xf5, 0x49, 0x78, 0x64, 0xd7, 0xc0, 0x8f, 0xa0, 0xf9, 0x55, - 0xa8, 0x63, 0x30, 0xae, 0xd3, 0x15, 0x87, 0xd0, 0x32, 0xc3, 0x1a, 0xbc, 0x03, 0xae, 0x14, 0xd7, - 0x20, 0xeb, 0x6a, 0xf0, 0xd7, 0x86, 0xea, 0x17, 0x41, 0x13, 0xbd, 0x01, 0x47, 0x7c, 0x9f, 0xa8, - 0xf0, 0x6b, 0xd6, 0x8f, 0x76, 0x7b, 0xc5, 0x97, 0xda, 0xfa, 0x0a, 0x7a, 0x07, 0x55, 0x19, 0x5f, - 0x54, 0x1c, 0x77, 0x03, 0x73, 0x56, 0x72, 0xbb, 0xc5, 0xf9, 0x00, 0xae, 0x8a, 0x15, 0x2a, 0x09, - 0xa2, 0x41, 0x7a, 0x50, 0x76, 0xbd, 0x85, 0x7a, 0x0b, 0x8e, 0x70, 0x0a, 0x15, 0xfa, 0x5a, 0xca, - 0x2b, 0x6f, 0x2e, 0xae, 0x9c, 0x5b, 0x88, 0x80, 0xb7, 0xb5, 0x0c, 0x05, 0x47, 0xaf, 0x1e, 0x38, - 0xdc, 0x7d, 0x78, 0xcd, 0x44, 0x9e, 0xa5, 0xb2, 0xe9, 0x98, 0xe5, 0x9e, 0xd7, 0xc7, 0x2c, 0xf7, - 0xdd, 0xc5, 0x95, 0x91, 0x2b, 0xff, 0xb6, 0x9e, 0xfe, 0x0b, 0x00, 0x00, 0xff, 0xff, 0xab, 0xcb, - 0x6e, 0xac, 0xf3, 0x06, 0x00, 0x00, +var File_github_com_micro_go_micro_store_service_proto_store_proto protoreflect.FileDescriptor + +var file_github_com_micro_go_micro_store_service_proto_store_proto_rawDesc = []byte{ + 0x0a, 0x39, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6d, 0x69, 0x63, + 0x72, 0x6f, 0x2f, 0x67, 0x6f, 0x2d, 0x6d, 0x69, 0x63, 0x72, 0x6f, 0x2f, 0x73, 0x74, 0x6f, 0x72, + 0x65, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, + 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0e, 0x67, 0x6f, 0x2e, + 0x6d, 0x69, 0x63, 0x72, 0x6f, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x22, 0x31, 0x0a, 0x05, 0x46, + 0x69, 0x65, 0x6c, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0xde, + 0x01, 0x0a, 0x06, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x12, 0x16, 0x0a, 0x06, 0x65, 0x78, 0x70, 0x69, 0x72, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x03, 0x52, 0x06, 0x65, 0x78, 0x70, 0x69, 0x72, 0x79, 0x12, 0x40, 0x0a, 0x08, 0x6d, 0x65, 0x74, + 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x67, 0x6f, + 0x2e, 0x6d, 0x69, 0x63, 0x72, 0x6f, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x52, 0x65, 0x63, + 0x6f, 0x72, 0x64, 0x2e, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x45, 0x6e, 0x74, 0x72, + 0x79, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x1a, 0x52, 0x0a, 0x0d, 0x4d, + 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, + 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x2b, + 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, + 0x67, 0x6f, 0x2e, 0x6d, 0x69, 0x63, 0x72, 0x6f, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x46, + 0x69, 0x65, 0x6c, 0x64, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, + 0x9d, 0x01, 0x0a, 0x0b, 0x52, 0x65, 0x61, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, + 0x1a, 0x0a, 0x08, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x08, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x74, + 0x61, 0x62, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x61, 0x62, 0x6c, + 0x65, 0x12, 0x16, 0x0a, 0x06, 0x70, 0x72, 0x65, 0x66, 0x69, 0x78, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x08, 0x52, 0x06, 0x70, 0x72, 0x65, 0x66, 0x69, 0x78, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x75, 0x66, + 0x66, 0x69, 0x78, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x73, 0x75, 0x66, 0x66, 0x69, + 0x78, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x04, + 0x52, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, + 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x22, + 0x56, 0x0a, 0x0b, 0x52, 0x65, 0x61, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x10, + 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, + 0x12, 0x35, 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x2e, 0x6d, 0x69, 0x63, 0x72, 0x6f, 0x2e, 0x73, 0x74, 0x6f, + 0x72, 0x65, 0x2e, 0x52, 0x65, 0x61, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x07, + 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x40, 0x0a, 0x0c, 0x52, 0x65, 0x61, 0x64, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x30, 0x0a, 0x07, 0x72, 0x65, 0x63, 0x6f, 0x72, + 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x67, 0x6f, 0x2e, 0x6d, 0x69, + 0x63, 0x72, 0x6f, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, + 0x52, 0x07, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x73, 0x22, 0x6a, 0x0a, 0x0c, 0x57, 0x72, 0x69, + 0x74, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x64, 0x61, 0x74, + 0x61, 0x62, 0x61, 0x73, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x64, 0x61, 0x74, + 0x61, 0x62, 0x61, 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x65, + 0x78, 0x70, 0x69, 0x72, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x65, 0x78, 0x70, + 0x69, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x74, 0x74, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, + 0x52, 0x03, 0x74, 0x74, 0x6c, 0x22, 0x76, 0x0a, 0x0c, 0x57, 0x72, 0x69, 0x74, 0x65, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2e, 0x0a, 0x06, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x67, 0x6f, 0x2e, 0x6d, 0x69, 0x63, 0x72, 0x6f, + 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, 0x06, 0x72, + 0x65, 0x63, 0x6f, 0x72, 0x64, 0x12, 0x36, 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x2e, 0x6d, 0x69, 0x63, 0x72, + 0x6f, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x57, 0x72, 0x69, 0x74, 0x65, 0x4f, 0x70, 0x74, + 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x0f, 0x0a, + 0x0d, 0x57, 0x72, 0x69, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x41, + 0x0a, 0x0d, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, + 0x1a, 0x0a, 0x08, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x08, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x74, + 0x61, 0x62, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x61, 0x62, 0x6c, + 0x65, 0x22, 0x5a, 0x0a, 0x0d, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x03, 0x6b, 0x65, 0x79, 0x12, 0x37, 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x67, 0x6f, 0x2e, 0x6d, 0x69, 0x63, 0x72, 0x6f, + 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4f, 0x70, 0x74, + 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x10, 0x0a, + 0x0e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x9d, 0x01, 0x0a, 0x0b, 0x4c, 0x69, 0x73, 0x74, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, + 0x1a, 0x0a, 0x08, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x08, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x74, + 0x61, 0x62, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x61, 0x62, 0x6c, + 0x65, 0x12, 0x16, 0x0a, 0x06, 0x70, 0x72, 0x65, 0x66, 0x69, 0x78, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x06, 0x70, 0x72, 0x65, 0x66, 0x69, 0x78, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x75, 0x66, + 0x66, 0x69, 0x78, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x75, 0x66, 0x66, 0x69, + 0x78, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x04, + 0x52, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, + 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x22, + 0x44, 0x0a, 0x0b, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x35, + 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x1b, 0x2e, 0x67, 0x6f, 0x2e, 0x6d, 0x69, 0x63, 0x72, 0x6f, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, + 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x07, 0x6f, 0x70, + 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x28, 0x0a, 0x0c, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6b, 0x65, 0x79, 0x73, 0x18, 0x02, 0x20, + 0x03, 0x28, 0x09, 0x52, 0x04, 0x6b, 0x65, 0x79, 0x73, 0x4a, 0x04, 0x08, 0x01, 0x10, 0x02, 0x22, + 0x12, 0x0a, 0x10, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x22, 0x31, 0x0a, 0x11, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x73, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x64, 0x61, 0x74, 0x61, + 0x62, 0x61, 0x73, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x09, 0x64, 0x61, 0x74, + 0x61, 0x62, 0x61, 0x73, 0x65, 0x73, 0x22, 0x2b, 0x0a, 0x0d, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x73, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x64, 0x61, 0x74, 0x61, 0x62, + 0x61, 0x73, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x64, 0x61, 0x74, 0x61, 0x62, + 0x61, 0x73, 0x65, 0x22, 0x28, 0x0a, 0x0e, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x73, 0x18, + 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x06, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x73, 0x32, 0xc5, 0x03, + 0x0a, 0x05, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x12, 0x43, 0x0a, 0x04, 0x52, 0x65, 0x61, 0x64, 0x12, + 0x1b, 0x2e, 0x67, 0x6f, 0x2e, 0x6d, 0x69, 0x63, 0x72, 0x6f, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, + 0x2e, 0x52, 0x65, 0x61, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x67, + 0x6f, 0x2e, 0x6d, 0x69, 0x63, 0x72, 0x6f, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x52, 0x65, + 0x61, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x46, 0x0a, 0x05, + 0x57, 0x72, 0x69, 0x74, 0x65, 0x12, 0x1c, 0x2e, 0x67, 0x6f, 0x2e, 0x6d, 0x69, 0x63, 0x72, 0x6f, + 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x57, 0x72, 0x69, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x67, 0x6f, 0x2e, 0x6d, 0x69, 0x63, 0x72, 0x6f, 0x2e, 0x73, + 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x57, 0x72, 0x69, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x22, 0x00, 0x12, 0x49, 0x0a, 0x06, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x12, 0x1d, + 0x2e, 0x67, 0x6f, 0x2e, 0x6d, 0x69, 0x63, 0x72, 0x6f, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, + 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, + 0x67, 0x6f, 0x2e, 0x6d, 0x69, 0x63, 0x72, 0x6f, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x44, + 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, + 0x45, 0x0a, 0x04, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x1b, 0x2e, 0x67, 0x6f, 0x2e, 0x6d, 0x69, 0x63, + 0x72, 0x6f, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x67, 0x6f, 0x2e, 0x6d, 0x69, 0x63, 0x72, 0x6f, 0x2e, + 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x22, 0x00, 0x30, 0x01, 0x12, 0x52, 0x0a, 0x09, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, + 0x73, 0x65, 0x73, 0x12, 0x20, 0x2e, 0x67, 0x6f, 0x2e, 0x6d, 0x69, 0x63, 0x72, 0x6f, 0x2e, 0x73, + 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x73, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x67, 0x6f, 0x2e, 0x6d, 0x69, 0x63, 0x72, 0x6f, + 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x73, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x49, 0x0a, 0x06, 0x54, 0x61, + 0x62, 0x6c, 0x65, 0x73, 0x12, 0x1d, 0x2e, 0x67, 0x6f, 0x2e, 0x6d, 0x69, 0x63, 0x72, 0x6f, 0x2e, + 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x67, 0x6f, 0x2e, 0x6d, 0x69, 0x63, 0x72, 0x6f, 0x2e, 0x73, + 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x22, 0x00, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_github_com_micro_go_micro_store_service_proto_store_proto_rawDescOnce sync.Once + file_github_com_micro_go_micro_store_service_proto_store_proto_rawDescData = file_github_com_micro_go_micro_store_service_proto_store_proto_rawDesc +) + +func file_github_com_micro_go_micro_store_service_proto_store_proto_rawDescGZIP() []byte { + file_github_com_micro_go_micro_store_service_proto_store_proto_rawDescOnce.Do(func() { + file_github_com_micro_go_micro_store_service_proto_store_proto_rawDescData = protoimpl.X.CompressGZIP(file_github_com_micro_go_micro_store_service_proto_store_proto_rawDescData) + }) + return file_github_com_micro_go_micro_store_service_proto_store_proto_rawDescData +} + +var file_github_com_micro_go_micro_store_service_proto_store_proto_msgTypes = make([]protoimpl.MessageInfo, 19) +var file_github_com_micro_go_micro_store_service_proto_store_proto_goTypes = []interface{}{ + (*Field)(nil), // 0: go.micro.store.Field + (*Record)(nil), // 1: go.micro.store.Record + (*ReadOptions)(nil), // 2: go.micro.store.ReadOptions + (*ReadRequest)(nil), // 3: go.micro.store.ReadRequest + (*ReadResponse)(nil), // 4: go.micro.store.ReadResponse + (*WriteOptions)(nil), // 5: go.micro.store.WriteOptions + (*WriteRequest)(nil), // 6: go.micro.store.WriteRequest + (*WriteResponse)(nil), // 7: go.micro.store.WriteResponse + (*DeleteOptions)(nil), // 8: go.micro.store.DeleteOptions + (*DeleteRequest)(nil), // 9: go.micro.store.DeleteRequest + (*DeleteResponse)(nil), // 10: go.micro.store.DeleteResponse + (*ListOptions)(nil), // 11: go.micro.store.ListOptions + (*ListRequest)(nil), // 12: go.micro.store.ListRequest + (*ListResponse)(nil), // 13: go.micro.store.ListResponse + (*DatabasesRequest)(nil), // 14: go.micro.store.DatabasesRequest + (*DatabasesResponse)(nil), // 15: go.micro.store.DatabasesResponse + (*TablesRequest)(nil), // 16: go.micro.store.TablesRequest + (*TablesResponse)(nil), // 17: go.micro.store.TablesResponse + nil, // 18: go.micro.store.Record.MetadataEntry +} +var file_github_com_micro_go_micro_store_service_proto_store_proto_depIdxs = []int32{ + 18, // 0: go.micro.store.Record.metadata:type_name -> go.micro.store.Record.MetadataEntry + 2, // 1: go.micro.store.ReadRequest.options:type_name -> go.micro.store.ReadOptions + 1, // 2: go.micro.store.ReadResponse.records:type_name -> go.micro.store.Record + 1, // 3: go.micro.store.WriteRequest.record:type_name -> go.micro.store.Record + 5, // 4: go.micro.store.WriteRequest.options:type_name -> go.micro.store.WriteOptions + 8, // 5: go.micro.store.DeleteRequest.options:type_name -> go.micro.store.DeleteOptions + 11, // 6: go.micro.store.ListRequest.options:type_name -> go.micro.store.ListOptions + 0, // 7: go.micro.store.Record.MetadataEntry.value:type_name -> go.micro.store.Field + 3, // 8: go.micro.store.Store.Read:input_type -> go.micro.store.ReadRequest + 6, // 9: go.micro.store.Store.Write:input_type -> go.micro.store.WriteRequest + 9, // 10: go.micro.store.Store.Delete:input_type -> go.micro.store.DeleteRequest + 12, // 11: go.micro.store.Store.List:input_type -> go.micro.store.ListRequest + 14, // 12: go.micro.store.Store.Databases:input_type -> go.micro.store.DatabasesRequest + 16, // 13: go.micro.store.Store.Tables:input_type -> go.micro.store.TablesRequest + 4, // 14: go.micro.store.Store.Read:output_type -> go.micro.store.ReadResponse + 7, // 15: go.micro.store.Store.Write:output_type -> go.micro.store.WriteResponse + 10, // 16: go.micro.store.Store.Delete:output_type -> go.micro.store.DeleteResponse + 13, // 17: go.micro.store.Store.List:output_type -> go.micro.store.ListResponse + 15, // 18: go.micro.store.Store.Databases:output_type -> go.micro.store.DatabasesResponse + 17, // 19: go.micro.store.Store.Tables:output_type -> go.micro.store.TablesResponse + 14, // [14:20] is the sub-list for method output_type + 8, // [8:14] is the sub-list for method input_type + 8, // [8:8] is the sub-list for extension type_name + 8, // [8:8] is the sub-list for extension extendee + 0, // [0:8] is the sub-list for field type_name +} + +func init() { file_github_com_micro_go_micro_store_service_proto_store_proto_init() } +func file_github_com_micro_go_micro_store_service_proto_store_proto_init() { + if File_github_com_micro_go_micro_store_service_proto_store_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_github_com_micro_go_micro_store_service_proto_store_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Field); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_github_com_micro_go_micro_store_service_proto_store_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Record); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_github_com_micro_go_micro_store_service_proto_store_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ReadOptions); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_github_com_micro_go_micro_store_service_proto_store_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ReadRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_github_com_micro_go_micro_store_service_proto_store_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ReadResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_github_com_micro_go_micro_store_service_proto_store_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*WriteOptions); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_github_com_micro_go_micro_store_service_proto_store_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*WriteRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_github_com_micro_go_micro_store_service_proto_store_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*WriteResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_github_com_micro_go_micro_store_service_proto_store_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeleteOptions); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_github_com_micro_go_micro_store_service_proto_store_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeleteRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_github_com_micro_go_micro_store_service_proto_store_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeleteResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_github_com_micro_go_micro_store_service_proto_store_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListOptions); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_github_com_micro_go_micro_store_service_proto_store_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_github_com_micro_go_micro_store_service_proto_store_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_github_com_micro_go_micro_store_service_proto_store_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DatabasesRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_github_com_micro_go_micro_store_service_proto_store_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DatabasesResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_github_com_micro_go_micro_store_service_proto_store_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TablesRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_github_com_micro_go_micro_store_service_proto_store_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TablesResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_github_com_micro_go_micro_store_service_proto_store_proto_rawDesc, + NumEnums: 0, + NumMessages: 19, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_github_com_micro_go_micro_store_service_proto_store_proto_goTypes, + DependencyIndexes: file_github_com_micro_go_micro_store_service_proto_store_proto_depIdxs, + MessageInfos: file_github_com_micro_go_micro_store_service_proto_store_proto_msgTypes, + }.Build() + File_github_com_micro_go_micro_store_service_proto_store_proto = out.File + file_github_com_micro_go_micro_store_service_proto_store_proto_rawDesc = nil + file_github_com_micro_go_micro_store_service_proto_store_proto_goTypes = nil + file_github_com_micro_go_micro_store_service_proto_store_proto_depIdxs = nil } diff --git a/vendor/github.com/micro/go-micro/v2/store/service/proto/store.proto b/vendor/github.com/micro/go-micro/v2/store/service/proto/store.proto index 22056ef9e..80fbc40f3 100644 --- a/vendor/github.com/micro/go-micro/v2/store/service/proto/store.proto +++ b/vendor/github.com/micro/go-micro/v2/store/service/proto/store.proto @@ -11,6 +11,13 @@ service Store { rpc Tables(TablesRequest) returns (TablesResponse) {}; } +message Field { + // type of value e.g string, int, int64, bool, float64 + string type = 1; + // the actual value + string value = 2; +} + message Record { // key of the record string key = 1; @@ -18,6 +25,8 @@ message Record { bytes value = 2; // time.Duration (signed int64 nanoseconds) int64 expiry = 3; + // the associated metadata + map metadata = 4; } message ReadOptions { diff --git a/vendor/github.com/micro/go-micro/v2/store/service/service.go b/vendor/github.com/micro/go-micro/v2/store/service/service.go index fbf043881..94fb7dd36 100644 --- a/vendor/github.com/micro/go-micro/v2/store/service/service.go +++ b/vendor/github.com/micro/go-micro/v2/store/service/service.go @@ -3,7 +3,9 @@ package service import ( "context" + "fmt" "io" + "reflect" "time" "github.com/micro/go-micro/v2/client" @@ -137,10 +139,21 @@ func (s *serviceStore) Read(key string, opts ...store.ReadOption) ([]*store.Reco records := make([]*store.Record, 0, len(rsp.Records)) for _, val := range rsp.Records { + metadata := make(map[string]interface{}) + + for k, v := range val.Metadata { + switch v.Type { + // TODO: parse all types + default: + metadata[k] = v + } + } + records = append(records, &store.Record{ - Key: val.Key, - Value: val.Value, - Expiry: time.Duration(val.Expiry) * time.Second, + Key: val.Key, + Value: val.Value, + Expiry: time.Duration(val.Expiry) * time.Second, + Metadata: metadata, }) } @@ -163,11 +176,21 @@ func (s *serviceStore) Write(record *store.Record, opts ...store.WriteOption) er Table: options.Table, } + metadata := make(map[string]*pb.Field) + + for k, v := range record.Metadata { + metadata[k] = &pb.Field{ + Type: reflect.TypeOf(v).String(), + Value: fmt.Sprintf("%v", v), + } + } + _, err := s.Client.Write(s.Context(), &pb.WriteRequest{ Record: &pb.Record{ - Key: record.Key, - Value: record.Value, - Expiry: int64(record.Expiry.Seconds()), + Key: record.Key, + Value: record.Value, + Expiry: int64(record.Expiry.Seconds()), + Metadata: metadata, }, Options: writeOpts}, client.WithAddress(s.Nodes...)) if err != nil && errors.Equal(err, errors.NotFound("", "")) { @@ -219,12 +242,16 @@ func NewStore(opts ...store.Option) store.Store { o(&options) } + if options.Client == nil { + options.Client = client.DefaultClient + } + service := &serviceStore{ options: options, Database: options.Database, Table: options.Table, Nodes: options.Nodes, - Client: pb.NewStoreService("go.micro.store", client.DefaultClient), + Client: pb.NewStoreService("go.micro.store", options.Client), } return service diff --git a/vendor/github.com/micro/go-micro/v2/store/store.go b/vendor/github.com/micro/go-micro/v2/store/store.go index c949f939b..9127f0776 100644 --- a/vendor/github.com/micro/go-micro/v2/store/store.go +++ b/vendor/github.com/micro/go-micro/v2/store/store.go @@ -36,7 +36,12 @@ type Store interface { // Record is an item stored or retrieved from a Store type Record struct { - Key string `json:"key"` - Value []byte `json:"value"` + // The key to store the record + Key string `json:"key"` + // The value within the record + Value []byte `json:"value"` + // Any associated metadata for indexing + Metadata map[string]interface{} `json:"metadata"` + // Time to expire a record: TODO: change to timestamp Expiry time.Duration `json:"expiry,omitempty"` } diff --git a/vendor/github.com/micro/go-micro/v2/util/addr/addr.go b/vendor/github.com/micro/go-micro/v2/util/addr/addr.go index 2fa52b25e..d814a95c5 100644 --- a/vendor/github.com/micro/go-micro/v2/util/addr/addr.go +++ b/vendor/github.com/micro/go-micro/v2/util/addr/addr.go @@ -17,6 +17,15 @@ func init() { } } +// AppendPrivateBlocks append private network blocks +func AppendPrivateBlocks(bs ...string) { + for _, b := range bs { + if _, block, err := net.ParseCIDR(b); err == nil { + privateBlocks = append(privateBlocks, block) + } + } +} + func isPrivateIP(ipAddr string) bool { ip := net.ParseIP(ipAddr) for _, priv := range privateBlocks { @@ -68,7 +77,7 @@ func Extract(addr string) (string, error) { for _, iface := range ifaces { ifaceAddrs, err := iface.Addrs() if err != nil { - // ignore error, interface can dissapear from system + // ignore error, interface can disappear from system continue } if iface.Flags&net.FlagLoopback != 0 { diff --git a/vendor/github.com/micro/go-micro/v2/util/config/config.go b/vendor/github.com/micro/go-micro/v2/util/config/config.go deleted file mode 100644 index a15eade76..000000000 --- a/vendor/github.com/micro/go-micro/v2/util/config/config.go +++ /dev/null @@ -1,90 +0,0 @@ -package config - -import ( - "io/ioutil" - "os" - "os/user" - "path/filepath" - "strings" - - conf "github.com/micro/go-micro/v2/config" - "github.com/micro/go-micro/v2/config/source/file" - "github.com/micro/go-micro/v2/util/log" -) - -// FileName for global micro config -const FileName = ".micro" - -// config is a singleton which is required to ensure -// each function call doesn't load the .micro file -// from disk -var config = newConfig() - -// Get a value from the .micro file -func Get(path ...string) (string, error) { - tk := config.Get(path...).String("") - return strings.TrimSpace(tk), nil -} - -// Set a value in the .micro file -func Set(value string, path ...string) error { - // get the filepath - fp, err := filePath() - if err != nil { - return err - } - - // set the value - config.Set(value, path...) - - // write to the file - return ioutil.WriteFile(fp, config.Bytes(), 0644) -} - -func filePath() (string, error) { - usr, err := user.Current() - if err != nil { - return "", err - } - return filepath.Join(usr.HomeDir, FileName), nil -} - -// newConfig returns a loaded config -func newConfig() conf.Config { - // get the filepath - fp, err := filePath() - if err != nil { - log.Error(err) - return conf.DefaultConfig - } - - // write the file if it does not exist - if _, err := os.Stat(fp); os.IsNotExist(err) { - ioutil.WriteFile(fp, []byte{}, 0644) - } else if err != nil { - log.Error(err) - return conf.DefaultConfig - } - - // create a new config - c, err := conf.NewConfig( - conf.WithSource( - file.NewSource( - file.WithPath(fp), - ), - ), - ) - if err != nil { - log.Error(err) - return conf.DefaultConfig - } - - // load the config - if err := c.Load(); err != nil { - log.Error(err) - return conf.DefaultConfig - } - - // return the conf - return c -} diff --git a/vendor/github.com/micro/go-micro/v2/util/jitter/jitter.go b/vendor/github.com/micro/go-micro/v2/util/jitter/jitter.go deleted file mode 100644 index 24e0700df..000000000 --- a/vendor/github.com/micro/go-micro/v2/util/jitter/jitter.go +++ /dev/null @@ -1,17 +0,0 @@ -// Package jitter provides a random jitter -package jitter - -import ( - "math/rand" - "time" -) - -var ( - r = rand.New(rand.NewSource(time.Now().UnixNano())) -) - -// Do returns a random time to jitter with max cap specified -func Do(d time.Duration) time.Duration { - v := r.Float64() * float64(d.Nanoseconds()) - return time.Duration(v) -} diff --git a/vendor/github.com/micro/go-micro/v2/util/kubernetes/api/request.go b/vendor/github.com/micro/go-micro/v2/util/kubernetes/api/request.go index 92bcbed61..18c1ab24b 100644 --- a/vendor/github.com/micro/go-micro/v2/util/kubernetes/api/request.go +++ b/vendor/github.com/micro/go-micro/v2/util/kubernetes/api/request.go @@ -9,6 +9,8 @@ import ( "io" "net/http" "net/url" + + "github.com/micro/go-micro/v2/logger" ) // Request is used to construct a http request for the k8s API. @@ -30,7 +32,7 @@ type Request struct { err error } -// Params is the object to pass in to set paramaters +// Params is the object to pass in to set parameters // on a request. type Params struct { LabelSelector map[string]string @@ -217,6 +219,7 @@ func (r *Request) Do() *Response { } } + logger.Debugf("[Kubernetes] %v %v", req.Method, req.URL.String()) res, err := r.client.Do(req) if err != nil { return &Response{ diff --git a/vendor/github.com/micro/go-micro/v2/util/kubernetes/client/templates.go b/vendor/github.com/micro/go-micro/v2/util/kubernetes/client/templates.go index 9c2851c8b..ce0e3b0e7 100644 --- a/vendor/github.com/micro/go-micro/v2/util/kubernetes/client/templates.go +++ b/vendor/github.com/micro/go-micro/v2/util/kubernetes/client/templates.go @@ -129,6 +129,7 @@ metadata: var secretTmpl = ` apiVersion: v1 kind: Secret +type: "{{ .Type }}" metadata: name: "{{ .Metadata.Name }}" namespace: "{{ .Metadata.Namespace }}" @@ -139,11 +140,11 @@ metadata: {{- end }} {{- end }} data: -{{- with .Data }} -{{- range $key, $value := . }} -{{ $key }}: "{{ $value }}" -{{- end }} -{{- end }} + {{- with .Data }} + {{- range $key, $value := . }} + {{ $key }}: "{{ $value }}" + {{- end }} + {{- end }} ` var serviceAccountTmpl = ` diff --git a/vendor/github.com/micro/go-micro/v2/util/mdns/client.go b/vendor/github.com/micro/go-micro/v2/util/mdns/client.go index 176ebac47..ba88cea26 100644 --- a/vendor/github.com/micro/go-micro/v2/util/mdns/client.go +++ b/vendor/github.com/micro/go-micro/v2/util/mdns/client.go @@ -34,7 +34,8 @@ type ServiceEntry struct { // complete is used to check if we have all the info we need func (s *ServiceEntry) complete() bool { - return (s.AddrV4 != nil || s.AddrV6 != nil || s.Addr != nil) && s.Port != 0 && s.hasTXT + + return (len(s.AddrV4) > 0 || len(s.AddrV6) > 0 || len(s.Addr) > 0) && s.Port != 0 && s.hasTXT } // QueryParam is used to customize how a Lookup is performed @@ -347,15 +348,21 @@ func (c *client) query(params *QueryParam) error { select { case resp := <-msgCh: inp := messageToEntry(resp, inprogress) + if inp == nil { continue } + if len(resp.Question) == 0 || resp.Question[0].Name != m.Question[0].Name { + // discard anything which we've not asked for + continue + } // Check if this entry is complete if inp.complete() { if inp.sent { continue } + inp.sent = true select { case params.Entries <- inp: diff --git a/vendor/github.com/micro/go-micro/v2/util/mdns/server.go b/vendor/github.com/micro/go-micro/v2/util/mdns/server.go index 909b39c57..e62d3e928 100644 --- a/vendor/github.com/micro/go-micro/v2/util/mdns/server.go +++ b/vendor/github.com/micro/go-micro/v2/util/mdns/server.go @@ -2,13 +2,13 @@ package mdns import ( "fmt" - "log" "math/rand" "net" "sync" "sync/atomic" "time" + log "github.com/micro/go-micro/v2/logger" "github.com/miekg/dns" "golang.org/x/net/ipv4" "golang.org/x/net/ipv6" @@ -39,6 +39,10 @@ var ( } ) +// GetMachineIP is a func which returns the outbound IP of this machine. +// Used by the server to determine whether to attempt send the response on a local address +type GetMachineIP func() net.IP + // Config is used to configure the mDNS server type Config struct { // Zone must be provided to support responding to queries @@ -51,9 +55,15 @@ type Config struct { // Port If it is not 0, replace the port 5353 with this port number. Port int + + // GetMachineIP is a function to return the IP of the local machine + GetMachineIP GetMachineIP + // LocalhostChecking if enabled asks the server to also send responses to 0.0.0.0 if the target IP + // is this host (as defined by GetMachineIP). Useful in case machine is on a VPN which blocks comms on non standard ports + LocalhostChecking bool } -// mDNS server is used to listen for mDNS queries and respond if we +// Server is an mDNS server used to listen for mDNS queries and respond if we // have a matching local record type Server struct { config *Config @@ -65,6 +75,8 @@ type Server struct { shutdownCh chan struct{} shutdownLock sync.Mutex wg sync.WaitGroup + + outboundIP net.IP } // NewServer is used to create a new mDNS server from a config @@ -118,11 +130,17 @@ func NewServer(config *Config) (*Server, error) { } } + ipFunc := getOutboundIP + if config.GetMachineIP != nil { + ipFunc = config.GetMachineIP + } + s := &Server{ config: config, ipv4List: ipv4List, ipv6List: ipv6List, shutdownCh: make(chan struct{}), + outboundIP: ipFunc(), } go s.recv(s.ipv4List) @@ -176,7 +194,7 @@ func (s *Server) recv(c *net.UDPConn) { continue } if err := s.parsePacket(buf[:n], from); err != nil { - log.Printf("[ERR] mdns: Failed to handle query: %v", err) + log.Errorf("[ERR] mdns: Failed to handle query: %v", err) } } } @@ -185,7 +203,7 @@ func (s *Server) recv(c *net.UDPConn) { func (s *Server) parsePacket(packet []byte, from net.Addr) error { var msg dns.Msg if err := msg.Unpack(packet); err != nil { - log.Printf("[ERR] mdns: Failed to unpack packet: %v", err) + log.Errorf("[ERR] mdns: Failed to unpack packet: %v", err) return err } // TODO: This is a bit of a hack @@ -278,8 +296,8 @@ func (s *Server) handleQuery(query *dns.Msg, from net.Addr) error { // caveats in the RFC), so set the Compress bit (part of the dns library // API, not part of the DNS packet) to true. Compress: true, - - Answer: answer, + Question: query.Question, + Answer: answer, } } @@ -302,7 +320,6 @@ func (s *Server) handleQuery(query *dns.Msg, from net.Addr) error { // both. The return values are DNS records for each transmission type. func (s *Server) handleQuestion(q dns.Question) (multicastRecs, unicastRecs []dns.RR) { records := s.config.Zone.Records(q) - if len(records) == 0 { return nil, nil } @@ -365,7 +382,7 @@ func (s *Server) probe() { for i := 0; i < 3; i++ { if err := s.SendMulticast(q); err != nil { - log.Println("[ERR] mdns: failed to send probe:", err.Error()) + log.Errorf("[ERR] mdns: failed to send probe:", err.Error()) } time.Sleep(time.Duration(randomizer.Intn(250)) * time.Millisecond) } @@ -391,7 +408,7 @@ func (s *Server) probe() { timer := time.NewTimer(timeout) for i := 0; i < 3; i++ { if err := s.SendMulticast(resp); err != nil { - log.Println("[ERR] mdns: failed to send announcement:", err.Error()) + log.Errorf("[ERR] mdns: failed to send announcement:", err.Error()) } select { case <-timer.C: @@ -404,7 +421,7 @@ func (s *Server) probe() { } } -// multicastResponse us used to send a multicast response packet +// SendMulticast us used to send a multicast response packet func (s *Server) SendMulticast(msg *dns.Msg) error { buf, err := msg.Pack() if err != nil { @@ -430,13 +447,23 @@ func (s *Server) sendResponse(resp *dns.Msg, from net.Addr) error { // Determine the socket to send from addr := from.(*net.UDPAddr) - if addr.IP.To4() != nil { - _, err = s.ipv4List.WriteToUDP(buf, addr) - return err - } else { - _, err = s.ipv6List.WriteToUDP(buf, addr) - return err + conn := s.ipv4List + backupTarget := net.IPv4zero + + if addr.IP.To4() == nil { + conn = s.ipv6List + backupTarget = net.IPv6zero + } + _, err = conn.WriteToUDP(buf, addr) + // If the address we're responding to is this machine then we can also attempt sending on 0.0.0.0 + // This covers the case where this machine is using a VPN and certain ports are blocked so the response never gets there + // Sending two responses is OK + if s.config.LocalhostChecking && addr.IP.Equal(s.outboundIP) { + // ignore any errors, this is best efforts + conn.WriteToUDP(buf, &net.UDPAddr{IP: backupTarget, Port: addr.Port}) } + return err + } func (s *Server) unregister() error { @@ -474,3 +501,17 @@ func setCustomPort(port int) { } } } + +// getOutboundIP returns the IP address of this machine as seen when dialling out +func getOutboundIP() net.IP { + conn, err := net.Dial("udp", "8.8.8.8:80") + if err != nil { + // no net connectivity maybe so fallback + return nil + } + defer conn.Close() + + localAddr := conn.LocalAddr().(*net.UDPAddr) + + return localAddr.IP +} diff --git a/vendor/github.com/micro/go-micro/v2/util/net/net.go b/vendor/github.com/micro/go-micro/v2/util/net/net.go index 00230647d..02d6ad2f8 100644 --- a/vendor/github.com/micro/go-micro/v2/util/net/net.go +++ b/vendor/github.com/micro/go-micro/v2/util/net/net.go @@ -83,20 +83,23 @@ func Listen(addr string, fn func(string) (net.Listener, error)) (net.Listener, e func Proxy(service string, address []string) (string, []string, bool) { var hasProxy bool - // get proxy + // get proxy. we parse out address if present if prx := os.Getenv("MICRO_PROXY"); len(prx) > 0 { // default name if prx == "service" { prx = "go.micro.proxy" + address = nil } + + // check if its an address + if v := strings.Split(prx, ":"); len(v) > 1 { + address = []string{prx} + } + service = prx hasProxy = true - } - // get proxy address - if prx := os.Getenv("MICRO_PROXY_ADDRESS"); len(prx) > 0 { - address = []string{prx} - hasProxy = true + return service, address, hasProxy } if prx := os.Getenv("MICRO_NETWORK"); len(prx) > 0 { diff --git a/vendor/github.com/micro/go-micro/v2/util/ring/buffer.go b/vendor/github.com/micro/go-micro/v2/util/ring/buffer.go index e49f1312e..45a7690a8 100644 --- a/vendor/github.com/micro/go-micro/v2/util/ring/buffer.go +++ b/vendor/github.com/micro/go-micro/v2/util/ring/buffer.go @@ -67,17 +67,12 @@ func (b *Buffer) Get(n int) []*Entry { defer b.RUnlock() // reset any invalid values - if n > b.size || n < 0 { - n = b.size + if n > len(b.vals) || n < 0 { + n = len(b.vals) } // create a delta - delta := b.size - n - - // if all the values are less than delta - if len(b.vals) < delta { - return b.vals - } + delta := len(b.vals) - n // return the delta set return b.vals[delta:] diff --git a/vendor/github.com/micro/go-micro/v2/util/socket/pool.go b/vendor/github.com/micro/go-micro/v2/util/socket/pool.go index 9439f131f..8ee2afb45 100644 --- a/vendor/github.com/micro/go-micro/v2/util/socket/pool.go +++ b/vendor/github.com/micro/go-micro/v2/util/socket/pool.go @@ -19,12 +19,18 @@ func (p *Pool) Get(id string) (*Socket, bool) { } p.RUnlock() - // create new socket - socket = New(id) // save socket p.Lock() + defer p.Unlock() + // double checked locking + socket, ok = p.pool[id] + if ok { + return socket, ok + } + // create new socket + socket = New(id) p.pool[id] = socket - p.Unlock() + // return socket return socket, false } diff --git a/vendor/github.com/micro/go-micro/v2/util/wrapper/wrapper.go b/vendor/github.com/micro/go-micro/v2/util/wrapper/wrapper.go index ee569ef21..e3af20a05 100644 --- a/vendor/github.com/micro/go-micro/v2/util/wrapper/wrapper.go +++ b/vendor/github.com/micro/go-micro/v2/util/wrapper/wrapper.go @@ -2,9 +2,8 @@ package wrapper import ( "context" - "fmt" + "reflect" "strings" - "time" "github.com/micro/go-micro/v2/auth" "github.com/micro/go-micro/v2/client" @@ -13,7 +12,6 @@ import ( "github.com/micro/go-micro/v2/errors" "github.com/micro/go-micro/v2/metadata" "github.com/micro/go-micro/v2/server" - "github.com/micro/go-micro/v2/util/config" ) type fromServiceWrapper struct { @@ -134,8 +132,6 @@ func TraceHandler(t trace.Tracer) server.HandlerWrapper { type authWrapper struct { client.Client - name string - id string auth func() auth.Auth } @@ -156,78 +152,29 @@ func (a *authWrapper) Call(ctx context.Context, req client.Request, rsp interfac // if auth is nil we won't be able to get an access token, so we execute // the request without one. aa := a.auth() - if a == nil { + if aa == nil { return a.Client.Call(ctx, req, rsp, opts...) } - // performs the call with the authorization token provided - callWithToken := func(token string) error { - ctx := metadata.Set(ctx, "Authorization", auth.BearerScheme+token) - return a.Client.Call(ctx, req, rsp, opts...) + // set the namespace header if it has not been set (e.g. on a service to service request) + if _, ok := metadata.Get(ctx, "Micro-Namespace"); !ok { + ctx = metadata.Set(ctx, "Micro-Namespace", aa.Options().Namespace) } // check to see if we have a valid access token aaOpts := aa.Options() - if aaOpts.Token != nil && aaOpts.Token.Expiry.Unix() > time.Now().Unix() { - return callWithToken(aaOpts.Token.AccessToken) - } - - // if we have a refresh token we can use this to generate another access token - if aaOpts.Token != nil { - tok, err := aa.Token(auth.WithToken(aaOpts.Token.RefreshToken)) - if err != nil { - return err - } - aa.Init(auth.ClientToken(tok)) - return callWithToken(tok.AccessToken) - } - - // if we have credentials we can generate a new token for the account - if len(aaOpts.ID) > 0 && len(aaOpts.Secret) > 0 { - tok, err := aa.Token(auth.WithCredentials(aaOpts.ID, aaOpts.Secret)) - if err != nil { - return err - } - aa.Init(auth.ClientToken(tok)) - return callWithToken(tok.AccessToken) - } - - // check to see if a token was provided in config, this is normally used for - // setting the token when calling via the cli - if token, err := config.Get("micro", "auth", "token"); err == nil && len(token) > 0 { - return callWithToken(token) - } - - // determine the type of service from the name. we do this so we can allocate - // different roles depending on the type of services. e.g. we don't want web - // services talking directly to the runtime. TODO: find a better way to determine - // the type of service - serviceType := "service" - if strings.Contains(a.name, "api") { - serviceType = "api" - } else if strings.Contains(a.name, "web") { - serviceType = "web" - } - - // generate a new auth account for the service - name := fmt.Sprintf("%v-%v", a.name, a.id) - acc, err := aa.Generate(name, auth.WithNamespace(aaOpts.Namespace), auth.WithRoles(serviceType)) - if err != nil { - return err - } - token, err := aa.Token(auth.WithCredentials(acc.ID, acc.Secret)) - if err != nil { - return err + if aaOpts.Token != nil && !aaOpts.Token.Expired() { + ctx = metadata.Set(ctx, "Authorization", auth.BearerScheme+aaOpts.Token.AccessToken) + return a.Client.Call(ctx, req, rsp, opts...) } - aa.Init(auth.ClientToken(token)) - // use the token to execute the request - return callWithToken(token.AccessToken) + // call without an auth token + return a.Client.Call(ctx, req, rsp, opts...) } // AuthClient wraps requests with the auth header -func AuthClient(name string, id string, auth func() auth.Auth, c client.Client) client.Client { - return &authWrapper{c, name, id, auth} +func AuthClient(auth func() auth.Auth, c client.Client) client.Client { + return &authWrapper{c, auth} } // AuthHandler wraps a server handler to perform auth @@ -244,20 +191,28 @@ func AuthHandler(fn func() auth.Auth) server.HandlerWrapper { // Extract the token if present. Note: if noop is being used // then the token can be blank without erroring - var token string + var account *auth.Account if header, ok := metadata.Get(ctx, "Authorization"); ok { // Ensure the correct scheme is being used if !strings.HasPrefix(header, auth.BearerScheme) { return errors.Unauthorized(req.Service(), "invalid authorization header. expected Bearer schema") } - token = header[len(auth.BearerScheme):] + // Strip the prefix and inspect the resulting token + account, _ = a.Inspect(strings.TrimPrefix(header, auth.BearerScheme)) } - // Inspect the token and get the account - account, err := a.Inspect(token) - if err != nil { - account = &auth.Account{Namespace: a.Options().Namespace} + // Extract the namespace header + ns, ok := metadata.Get(ctx, "Micro-Namespace") + if !ok { + ns = a.Options().Namespace + ctx = metadata.Set(ctx, "Micro-Namespace", ns) + } + + // Check the issuer matches the services namespace. TODO: Stop allowing go.micro to access + // any namespace and instead check for the server issuer. + if account != nil && account.Issuer != ns && account.Issuer != "go.micro" { + return errors.Forbidden(req.Service(), "Account was not issued by %v", ns) } // construct the resource @@ -268,18 +223,90 @@ func AuthHandler(fn func() auth.Auth) server.HandlerWrapper { } // Verify the caller has access to the resource - err = a.Verify(account, res) - if err != nil && len(account.ID) > 0 { + err := a.Verify(account, res, auth.VerifyContext(ctx)) + if err != nil && account != nil { return errors.Forbidden(req.Service(), "Forbidden call made to %v:%v by %v", req.Service(), req.Endpoint(), account.ID) } else if err != nil { - return errors.Unauthorized(req.Service(), "Unauthorised call made to %v:%v", req.Service(), req.Endpoint()) + return errors.Unauthorized(req.Service(), "Unauthorized call made to %v:%v", req.Service(), req.Endpoint()) } // There is an account, set it in the context - ctx = auth.ContextWithAccount(ctx, account) + if account != nil { + ctx = auth.ContextWithAccount(ctx, account) + } // The user is authorised, allow the call return h(ctx, req, rsp) } } } + +type cacheWrapper struct { + cacheFn func() *client.Cache + client.Client +} + +// Call executes the request. If the CacheExpiry option was set, the response will be cached using +// a hash of the metadata and request as the key. +func (c *cacheWrapper) Call(ctx context.Context, req client.Request, rsp interface{}, opts ...client.CallOption) error { + // parse the options + var options client.CallOptions + for _, o := range opts { + o(&options) + } + + // if the client doesn't have a cacbe setup don't continue + cache := c.cacheFn() + if cache == nil { + return c.Client.Call(ctx, req, rsp, opts...) + } + + // if the cache expiry is not set, execute the call without the cache + if options.CacheExpiry == 0 { + return c.Client.Call(ctx, req, rsp, opts...) + } + + // if the response is nil don't call the cache since we can't assign the response + if rsp == nil { + return c.Client.Call(ctx, req, rsp, opts...) + } + + // check to see if there is a response cached, if there is assign it + if r, ok := cache.Get(ctx, &req); ok { + val := reflect.ValueOf(rsp).Elem() + val.Set(reflect.ValueOf(r).Elem()) + return nil + } + + // don't cache the result if there was an error + if err := c.Client.Call(ctx, req, rsp, opts...); err != nil { + return err + } + + // set the result in the cache + cache.Set(ctx, &req, rsp, options.CacheExpiry) + return nil +} + +// CacheClient wraps requests with the cache wrapper +func CacheClient(cacheFn func() *client.Cache, c client.Client) client.Client { + return &cacheWrapper{cacheFn, c} +} + +type staticClient struct { + address string + client.Client +} + +func (s *staticClient) Call(ctx context.Context, req client.Request, rsp interface{}, opts ...client.CallOption) error { + return s.Client.Call(ctx, req, rsp, append(opts, client.WithAddress(s.address))...) +} + +func (s *staticClient) Stream(ctx context.Context, req client.Request, opts ...client.CallOption) (client.Stream, error) { + return s.Client.Stream(ctx, req, append(opts, client.WithAddress(s.address))...) +} + +// StaticClient sets an address on every call +func StaticClient(address string, c client.Client) client.Client { + return &staticClient{address, c} +} diff --git a/vendor/github.com/micro/go-micro/v2/web/service.go b/vendor/github.com/micro/go-micro/v2/web/service.go index d8f01179f..643c9dbce 100644 --- a/vendor/github.com/micro/go-micro/v2/web/service.go +++ b/vendor/github.com/micro/go-micro/v2/web/service.go @@ -17,6 +17,8 @@ import ( "github.com/micro/go-micro/v2/logger" "github.com/micro/go-micro/v2/registry" maddr "github.com/micro/go-micro/v2/util/addr" + authutil "github.com/micro/go-micro/v2/util/auth" + "github.com/micro/go-micro/v2/util/backoff" mhttp "github.com/micro/go-micro/v2/util/http" mnet "github.com/micro/go-micro/v2/util/net" signalutil "github.com/micro/go-micro/v2/util/signal" @@ -63,7 +65,7 @@ func (s *service) genSrv() *registry.Service { // if it exists then use it, otherwise // use the address if len(s.opts.Advertise) > 0 { - host, port, err = net.SplitHostPort(s.opts.Address) + host, port, err = net.SplitHostPort(s.opts.Advertise) if err != nil { logger.Fatal(err) } @@ -111,8 +113,8 @@ func (s *service) run(exit chan bool) { } func (s *service) register() error { - s.RLock() - defer s.RUnlock() + s.Lock() + defer s.Unlock() if s.srv == nil { return nil @@ -137,12 +139,29 @@ func (s *service) register() error { return err } - return r.Register(s.srv, registry.RegisterTTL(s.opts.RegisterTTL)) + var regErr error + + // try three times if necessary + for i := 0; i < 3; i++ { + // attempt to register + if err := r.Register(s.srv, registry.RegisterTTL(s.opts.RegisterTTL)); err != nil { + // set the error + regErr = err + // backoff then retry + time.Sleep(backoff.Do(i + 1)) + continue + } + // success so nil error + regErr = nil + break + } + + return regErr } func (s *service) deregister() error { - s.RLock() - defer s.RUnlock() + s.Lock() + defer s.Unlock() if s.srv == nil { return nil @@ -405,7 +424,9 @@ func (s *service) Init(opts ...Option) error { s.RLock() // pass in own name and version - serviceOpts = append(serviceOpts, micro.Name(s.opts.Name)) + if s.opts.Service.Name() == "" { + serviceOpts = append(serviceOpts, micro.Name(s.opts.Name)) + } serviceOpts = append(serviceOpts, micro.Version(s.opts.Version)) s.RUnlock() @@ -421,6 +442,13 @@ func (s *service) Init(opts ...Option) error { } func (s *service) Run() error { + // generate an auth account + srvID := s.opts.Service.Server().Options().Id + srvName := s.Options().Name + if err := authutil.Generate(srvID, srvName, s.opts.Service.Options().Auth); err != nil { + return err + } + if err := s.start(); err != nil { return err } diff --git a/vendor/github.com/micro/go-micro/v2/web/web.go b/vendor/github.com/micro/go-micro/v2/web/web.go index 72f653b9a..6bd9c82b1 100644 --- a/vendor/github.com/micro/go-micro/v2/web/web.go +++ b/vendor/github.com/micro/go-micro/v2/web/web.go @@ -31,7 +31,7 @@ var ( DefaultAddress = ":0" // for registration - DefaultRegisterTTL = time.Minute + DefaultRegisterTTL = time.Second * 90 DefaultRegisterInterval = time.Second * 30 // static directory diff --git a/vendor/github.com/webrtcn/s3client/README.md b/vendor/github.com/webrtcn/s3client/README.md index a5c37493a..f8b40efd6 100644 --- a/vendor/github.com/webrtcn/s3client/README.md +++ b/vendor/github.com/webrtcn/s3client/README.md @@ -67,3 +67,7 @@ func main { } ``` + +## License + +Apache2.0 diff --git a/vendor/golang.org/x/net/http2/transport.go b/vendor/golang.org/x/net/http2/transport.go index 54acc1e36..76a92e0ca 100644 --- a/vendor/golang.org/x/net/http2/transport.go +++ b/vendor/golang.org/x/net/http2/transport.go @@ -108,6 +108,19 @@ type Transport struct { // waiting for their turn. StrictMaxConcurrentStreams bool + // ReadIdleTimeout is the timeout after which a health check using ping + // frame will be carried out if no frame is received on the connection. + // Note that a ping response will is considered a received frame, so if + // there is no other traffic on the connection, the health check will + // be performed every ReadIdleTimeout interval. + // If zero, no health check is performed. + ReadIdleTimeout time.Duration + + // PingTimeout is the timeout after which the connection will be closed + // if a response to Ping is not received. + // Defaults to 15s. + PingTimeout time.Duration + // t1, if non-nil, is the standard library Transport using // this transport. Its settings are used (but not its // RoundTrip method, etc). @@ -131,6 +144,14 @@ func (t *Transport) disableCompression() bool { return t.DisableCompression || (t.t1 != nil && t.t1.DisableCompression) } +func (t *Transport) pingTimeout() time.Duration { + if t.PingTimeout == 0 { + return 15 * time.Second + } + return t.PingTimeout + +} + // ConfigureTransport configures a net/http HTTP/1 Transport to use HTTP/2. // It returns an error if t1 has already been HTTP/2-enabled. func ConfigureTransport(t1 *http.Transport) error { @@ -675,6 +696,20 @@ func (t *Transport) newClientConn(c net.Conn, singleUse bool) (*ClientConn, erro return cc, nil } +func (cc *ClientConn) healthCheck() { + pingTimeout := cc.t.pingTimeout() + // We don't need to periodically ping in the health check, because the readLoop of ClientConn will + // trigger the healthCheck again if there is no frame received. + ctx, cancel := context.WithTimeout(context.Background(), pingTimeout) + defer cancel() + err := cc.Ping(ctx) + if err != nil { + cc.closeForLostPing() + cc.t.connPool().MarkDead(cc) + return + } +} + func (cc *ClientConn) setGoAway(f *GoAwayFrame) { cc.mu.Lock() defer cc.mu.Unlock() @@ -846,14 +881,12 @@ func (cc *ClientConn) sendGoAway() error { return nil } -// Close closes the client connection immediately. -// -// In-flight requests are interrupted. For a graceful shutdown, use Shutdown instead. -func (cc *ClientConn) Close() error { +// closes the client connection immediately. In-flight requests are interrupted. +// err is sent to streams. +func (cc *ClientConn) closeForError(err error) error { cc.mu.Lock() defer cc.cond.Broadcast() defer cc.mu.Unlock() - err := errors.New("http2: client connection force closed via ClientConn.Close") for id, cs := range cc.streams { select { case cs.resc <- resAndError{err: err}: @@ -866,6 +899,20 @@ func (cc *ClientConn) Close() error { return cc.tconn.Close() } +// Close closes the client connection immediately. +// +// In-flight requests are interrupted. For a graceful shutdown, use Shutdown instead. +func (cc *ClientConn) Close() error { + err := errors.New("http2: client connection force closed via ClientConn.Close") + return cc.closeForError(err) +} + +// closes the client connection immediately. In-flight requests are interrupted. +func (cc *ClientConn) closeForLostPing() error { + err := errors.New("http2: client connection lost") + return cc.closeForError(err) +} + const maxAllocFrameSize = 512 << 10 // frameBuffer returns a scratch buffer suitable for writing DATA frames. @@ -1737,8 +1784,17 @@ func (rl *clientConnReadLoop) run() error { rl.closeWhenIdle = cc.t.disableKeepAlives() || cc.singleUse gotReply := false // ever saw a HEADERS reply gotSettings := false + readIdleTimeout := cc.t.ReadIdleTimeout + var t *time.Timer + if readIdleTimeout != 0 { + t = time.AfterFunc(readIdleTimeout, cc.healthCheck) + defer t.Stop() + } for { f, err := cc.fr.ReadFrame() + if t != nil { + t.Reset(readIdleTimeout) + } if err != nil { cc.vlogf("http2: Transport readFrame error on conn %p: (%T) %v", cc, err, err) } diff --git a/vendor/golang.org/x/sys/cpu/cpu_aix_ppc64.go b/vendor/golang.org/x/sys/cpu/cpu_aix_ppc64.go deleted file mode 100644 index be6027224..000000000 --- a/vendor/golang.org/x/sys/cpu/cpu_aix_ppc64.go +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright 2019 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build aix,ppc64 - -package cpu - -const cacheLineSize = 128 - -const ( - // getsystemcfg constants - _SC_IMPL = 2 - _IMPL_POWER8 = 0x10000 - _IMPL_POWER9 = 0x20000 -) - -func init() { - impl := getsystemcfg(_SC_IMPL) - if impl&_IMPL_POWER8 != 0 { - PPC64.IsPOWER8 = true - } - if impl&_IMPL_POWER9 != 0 { - PPC64.IsPOWER9 = true - } - - Initialized = true -} - -func getsystemcfg(label int) (n uint64) { - r0, _ := callgetsystemcfg(label) - n = uint64(r0) - return -} diff --git a/vendor/golang.org/x/sys/cpu/cpu_arm64.go b/vendor/golang.org/x/sys/cpu/cpu_arm64.go index 9c87677ae..7bcb36c7b 100644 --- a/vendor/golang.org/x/sys/cpu/cpu_arm64.go +++ b/vendor/golang.org/x/sys/cpu/cpu_arm64.go @@ -10,8 +10,14 @@ const cacheLineSize = 64 func init() { switch runtime.GOOS { - case "android", "darwin": + case "android", "darwin", "netbsd": // Android and iOS don't seem to allow reading these registers. + // + // NetBSD: + // ID_AA64ISAR0_EL1 is a privileged register and cannot be read from EL0. + // It can be read via sysctl(3). Example for future implementers: + // https://nxr.netbsd.org/xref/src/usr.sbin/cpuctl/arch/aarch64.c + // // Fake the minimal features expected by // TestARM64minimalFeatures. ARM64.HasASIMD = true diff --git a/vendor/golang.org/x/sys/unix/README.md b/vendor/golang.org/x/sys/unix/README.md index ab433ccfb..579d2d735 100644 --- a/vendor/golang.org/x/sys/unix/README.md +++ b/vendor/golang.org/x/sys/unix/README.md @@ -89,7 +89,7 @@ constants. Adding new syscall numbers is mostly done by running the build on a sufficiently new installation of the target OS (or updating the source checkouts for the -new build system). However, depending on the OS, you make need to update the +new build system). However, depending on the OS, you may need to update the parsing in mksysnum. ### mksyscall.go @@ -163,7 +163,7 @@ The merge is performed in the following steps: ## Generated files -### `zerror_${GOOS}_${GOARCH}.go` +### `zerrors_${GOOS}_${GOARCH}.go` A file containing all of the system's generated error numbers, error strings, signal numbers, and constants. Generated by `mkerrors.sh` (see above). diff --git a/vendor/golang.org/x/sys/unix/mkerrors.sh b/vendor/golang.org/x/sys/unix/mkerrors.sh index bc076cf62..780e387e3 100644 --- a/vendor/golang.org/x/sys/unix/mkerrors.sh +++ b/vendor/golang.org/x/sys/unix/mkerrors.sh @@ -187,6 +187,7 @@ struct ltchars { #include #include #include +#include #include #include #include @@ -200,6 +201,7 @@ struct ltchars { #include #include #include +#include #include #include #include @@ -479,12 +481,13 @@ ccflags="$@" $2 ~ /^(MS|MNT|UMOUNT)_/ || $2 ~ /^NS_GET_/ || $2 ~ /^TUN(SET|GET|ATTACH|DETACH)/ || - $2 ~ /^(O|F|[ES]?FD|NAME|S|PTRACE|PT)_/ || + $2 ~ /^(O|F|[ES]?FD|NAME|S|PTRACE|PT|TFD)_/ || $2 ~ /^KEXEC_/ || $2 ~ /^LINUX_REBOOT_CMD_/ || $2 ~ /^LINUX_REBOOT_MAGIC[12]$/ || $2 ~ /^MODULE_INIT_/ || $2 !~ "NLA_TYPE_MASK" && + $2 !~ /^RTC_VL_(ACCURACY|BACKUP|DATA)/ && $2 ~ /^(NETLINK|NLM|NLMSG|NLA|IFA|IFAN|RT|RTC|RTCF|RTN|RTPROT|RTNH|ARPHRD|ETH_P|NETNSA)_/ || $2 ~ /^SIOC/ || $2 ~ /^TIOC/ || @@ -506,7 +509,8 @@ ccflags="$@" $2 ~ /^CAP_/ || $2 ~ /^ALG_/ || $2 ~ /^FS_(POLICY_FLAGS|KEY_DESC|ENCRYPTION_MODE|[A-Z0-9_]+_KEY_SIZE)/ || - $2 ~ /^FS_IOC_.*ENCRYPTION/ || + $2 ~ /^FS_IOC_.*(ENCRYPTION|VERITY|GETFLAGS)/ || + $2 ~ /^FS_VERITY_/ || $2 ~ /^FSCRYPT_/ || $2 ~ /^GRND_/ || $2 ~ /^RND/ || diff --git a/vendor/golang.org/x/sys/unix/syscall_darwin.1_13.go b/vendor/golang.org/x/sys/unix/syscall_darwin.1_13.go index f911617be..dc0befee3 100644 --- a/vendor/golang.org/x/sys/unix/syscall_darwin.1_13.go +++ b/vendor/golang.org/x/sys/unix/syscall_darwin.1_13.go @@ -6,7 +6,11 @@ package unix -import "unsafe" +import ( + "unsafe" + + "golang.org/x/sys/internal/unsafeheader" +) //sys closedir(dir uintptr) (err error) //sys readdir_r(dir uintptr, entry *Dirent, result **Dirent) (res Errno) @@ -71,6 +75,7 @@ func Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) { cnt++ continue } + reclen := int(entry.Reclen) if reclen > len(buf) { // Not enough room. Return for now. @@ -79,13 +84,15 @@ func Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) { // restarting is O(n^2) in the length of the directory. Oh well. break } + // Copy entry into return buffer. - s := struct { - ptr unsafe.Pointer - siz int - cap int - }{ptr: unsafe.Pointer(&entry), siz: reclen, cap: reclen} - copy(buf, *(*[]byte)(unsafe.Pointer(&s))) + var s []byte + hdr := (*unsafeheader.Slice)(unsafe.Pointer(&s)) + hdr.Data = unsafe.Pointer(&entry) + hdr.Cap = reclen + hdr.Len = reclen + copy(buf, s) + buf = buf[reclen:] n += reclen cnt++ diff --git a/vendor/golang.org/x/sys/unix/syscall_darwin.go b/vendor/golang.org/x/sys/unix/syscall_darwin.go index 9a5a6ee54..0cf31acf0 100644 --- a/vendor/golang.org/x/sys/unix/syscall_darwin.go +++ b/vendor/golang.org/x/sys/unix/syscall_darwin.go @@ -423,6 +423,7 @@ func Sendfile(outfd int, infd int, offset *int64, count int) (written int, err e //sysnb Getrlimit(which int, lim *Rlimit) (err error) //sysnb Getrusage(who int, rusage *Rusage) (err error) //sysnb Getsid(pid int) (sid int, err error) +//sysnb Gettimeofday(tp *Timeval) (err error) //sysnb Getuid() (uid int) //sysnb Issetugid() (tainted bool) //sys Kqueue() (fd int, err error) diff --git a/vendor/golang.org/x/sys/unix/syscall_darwin_386.go b/vendor/golang.org/x/sys/unix/syscall_darwin_386.go index 707ba4f59..2724e3a51 100644 --- a/vendor/golang.org/x/sys/unix/syscall_darwin_386.go +++ b/vendor/golang.org/x/sys/unix/syscall_darwin_386.go @@ -20,17 +20,6 @@ func setTimeval(sec, usec int64) Timeval { return Timeval{Sec: int32(sec), Usec: int32(usec)} } -//sysnb gettimeofday(tp *Timeval) (sec int32, usec int32, err error) -func Gettimeofday(tv *Timeval) (err error) { - // The tv passed to gettimeofday must be non-nil - // but is otherwise unused. The answers come back - // in the two registers. - sec, usec, err := gettimeofday(tv) - tv.Sec = int32(sec) - tv.Usec = int32(usec) - return err -} - func SetKevent(k *Kevent_t, fd, mode, flags int) { k.Ident = uint32(fd) k.Filter = int16(mode) diff --git a/vendor/golang.org/x/sys/unix/syscall_darwin_amd64.go b/vendor/golang.org/x/sys/unix/syscall_darwin_amd64.go index fdbfb5911..ce2e0d249 100644 --- a/vendor/golang.org/x/sys/unix/syscall_darwin_amd64.go +++ b/vendor/golang.org/x/sys/unix/syscall_darwin_amd64.go @@ -20,17 +20,6 @@ func setTimeval(sec, usec int64) Timeval { return Timeval{Sec: sec, Usec: int32(usec)} } -//sysnb gettimeofday(tp *Timeval) (sec int64, usec int32, err error) -func Gettimeofday(tv *Timeval) (err error) { - // The tv passed to gettimeofday must be non-nil - // but is otherwise unused. The answers come back - // in the two registers. - sec, usec, err := gettimeofday(tv) - tv.Sec = sec - tv.Usec = usec - return err -} - func SetKevent(k *Kevent_t, fd, mode, flags int) { k.Ident = uint64(fd) k.Filter = int16(mode) diff --git a/vendor/golang.org/x/sys/unix/syscall_darwin_arm.go b/vendor/golang.org/x/sys/unix/syscall_darwin_arm.go index f8bc4cfb1..fc17a3f23 100644 --- a/vendor/golang.org/x/sys/unix/syscall_darwin_arm.go +++ b/vendor/golang.org/x/sys/unix/syscall_darwin_arm.go @@ -20,17 +20,6 @@ func setTimeval(sec, usec int64) Timeval { return Timeval{Sec: int32(sec), Usec: int32(usec)} } -//sysnb gettimeofday(tp *Timeval) (sec int32, usec int32, err error) -func Gettimeofday(tv *Timeval) (err error) { - // The tv passed to gettimeofday must be non-nil - // but is otherwise unused. The answers come back - // in the two registers. - sec, usec, err := gettimeofday(tv) - tv.Sec = int32(sec) - tv.Usec = int32(usec) - return err -} - func SetKevent(k *Kevent_t, fd, mode, flags int) { k.Ident = uint32(fd) k.Filter = int16(mode) diff --git a/vendor/golang.org/x/sys/unix/syscall_darwin_arm64.go b/vendor/golang.org/x/sys/unix/syscall_darwin_arm64.go index 5ede3ac31..1e91ddf32 100644 --- a/vendor/golang.org/x/sys/unix/syscall_darwin_arm64.go +++ b/vendor/golang.org/x/sys/unix/syscall_darwin_arm64.go @@ -22,17 +22,6 @@ func setTimeval(sec, usec int64) Timeval { return Timeval{Sec: sec, Usec: int32(usec)} } -//sysnb gettimeofday(tp *Timeval) (sec int64, usec int32, err error) -func Gettimeofday(tv *Timeval) (err error) { - // The tv passed to gettimeofday must be non-nil - // but is otherwise unused. The answers come back - // in the two registers. - sec, usec, err := gettimeofday(tv) - tv.Sec = sec - tv.Usec = usec - return err -} - func SetKevent(k *Kevent_t, fd, mode, flags int) { k.Ident = uint64(fd) k.Filter = int16(mode) diff --git a/vendor/golang.org/x/sys/unix/syscall_linux.go b/vendor/golang.org/x/sys/unix/syscall_linux.go index bbe1abbce..942a4bbf7 100644 --- a/vendor/golang.org/x/sys/unix/syscall_linux.go +++ b/vendor/golang.org/x/sys/unix/syscall_linux.go @@ -1633,6 +1633,15 @@ func Sendfile(outfd int, infd int, offset *int64, count int) (written int, err e //sys CopyFileRange(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int, err error) //sys DeleteModule(name string, flags int) (err error) //sys Dup(oldfd int) (fd int, err error) + +func Dup2(oldfd, newfd int) error { + // Android O and newer blocks dup2; riscv and arm64 don't implement dup2. + if runtime.GOOS == "android" || runtime.GOARCH == "riscv64" || runtime.GOARCH == "arm64" { + return Dup3(oldfd, newfd, 0) + } + return dup2(oldfd, newfd) +} + //sys Dup3(oldfd int, newfd int, flags int) (err error) //sysnb EpollCreate1(flag int) (fd int, err error) //sysnb EpollCtl(epfd int, op int, fd int, event *EpollEvent) (err error) @@ -1757,6 +1766,9 @@ func Signalfd(fd int, sigmask *Sigset_t, flags int) (newfd int, err error) { //sys Syncfs(fd int) (err error) //sysnb Sysinfo(info *Sysinfo_t) (err error) //sys Tee(rfd int, wfd int, len int, flags int) (n int64, err error) +//sysnb TimerfdCreate(clockid int, flags int) (fd int, err error) +//sysnb TimerfdGettime(fd int, currValue *ItimerSpec) (err error) +//sysnb TimerfdSettime(fd int, flags int, newValue *ItimerSpec, oldValue *ItimerSpec) (err error) //sysnb Tgkill(tgid int, tid int, sig syscall.Signal) (err error) //sysnb Times(tms *Tms) (ticks uintptr, err error) //sysnb Umask(mask int) (oldmask int) @@ -2178,7 +2190,6 @@ func Klogset(typ int, arg int) (err error) { // TimerGetoverrun // TimerGettime // TimerSettime -// Timerfd // Tkill (obsolete) // Tuxcall // Umount2 diff --git a/vendor/golang.org/x/sys/unix/syscall_linux_386.go b/vendor/golang.org/x/sys/unix/syscall_linux_386.go index a8374b67c..048d18e3c 100644 --- a/vendor/golang.org/x/sys/unix/syscall_linux_386.go +++ b/vendor/golang.org/x/sys/unix/syscall_linux_386.go @@ -49,7 +49,7 @@ func Pipe2(p []int, flags int) (err error) { // 64-bit file system and 32-bit uid calls // (386 default is 32-bit file system and 16-bit uid). -//sys Dup2(oldfd int, newfd int) (err error) +//sys dup2(oldfd int, newfd int) (err error) //sysnb EpollCreate(size int) (fd int, err error) //sys EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) //sys Fadvise(fd int, offset int64, length int64, advice int) (err error) = SYS_FADVISE64_64 diff --git a/vendor/golang.org/x/sys/unix/syscall_linux_amd64.go b/vendor/golang.org/x/sys/unix/syscall_linux_amd64.go index 8ed1d546f..72efe86ed 100644 --- a/vendor/golang.org/x/sys/unix/syscall_linux_amd64.go +++ b/vendor/golang.org/x/sys/unix/syscall_linux_amd64.go @@ -6,7 +6,7 @@ package unix -//sys Dup2(oldfd int, newfd int) (err error) +//sys dup2(oldfd int, newfd int) (err error) //sysnb EpollCreate(size int) (fd int, err error) //sys EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) //sys Fadvise(fd int, offset int64, length int64, advice int) (err error) = SYS_FADVISE64 diff --git a/vendor/golang.org/x/sys/unix/syscall_linux_arm.go b/vendor/golang.org/x/sys/unix/syscall_linux_arm.go index 99ae61373..e1913e2c9 100644 --- a/vendor/golang.org/x/sys/unix/syscall_linux_arm.go +++ b/vendor/golang.org/x/sys/unix/syscall_linux_arm.go @@ -80,7 +80,7 @@ func Seek(fd int, offset int64, whence int) (newoffset int64, err error) { // 64-bit file system and 32-bit uid calls // (16-bit uid calls are not always supported in newer kernels) -//sys Dup2(oldfd int, newfd int) (err error) +//sys dup2(oldfd int, newfd int) (err error) //sysnb EpollCreate(size int) (fd int, err error) //sys EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) //sys Fchown(fd int, uid int, gid int) (err error) = SYS_FCHOWN32 diff --git a/vendor/golang.org/x/sys/unix/syscall_linux_arm64.go b/vendor/golang.org/x/sys/unix/syscall_linux_arm64.go index 807a0b20c..c6de6b913 100644 --- a/vendor/golang.org/x/sys/unix/syscall_linux_arm64.go +++ b/vendor/golang.org/x/sys/unix/syscall_linux_arm64.go @@ -25,7 +25,7 @@ func EpollCreate(size int) (fd int, err error) { //sysnb Getegid() (egid int) //sysnb Geteuid() (euid int) //sysnb Getgid() (gid int) -//sysnb Getrlimit(resource int, rlim *Rlimit) (err error) +//sysnb getrlimit(resource int, rlim *Rlimit) (err error) //sysnb Getuid() (uid int) //sys Listen(s int, n int) (err error) //sys Pread(fd int, p []byte, offset int64) (n int, err error) = SYS_PREAD64 @@ -47,7 +47,7 @@ func Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err //sysnb Setregid(rgid int, egid int) (err error) //sysnb Setresgid(rgid int, egid int, sgid int) (err error) //sysnb Setresuid(ruid int, euid int, suid int) (err error) -//sysnb Setrlimit(resource int, rlim *Rlimit) (err error) +//sysnb setrlimit(resource int, rlim *Rlimit) (err error) //sysnb Setreuid(ruid int, euid int) (err error) //sys Shutdown(fd int, how int) (err error) //sys Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int64, err error) @@ -168,6 +168,24 @@ func Pipe2(p []int, flags int) (err error) { return } +// Getrlimit prefers the prlimit64 system call. See issue 38604. +func Getrlimit(resource int, rlim *Rlimit) error { + err := prlimit(0, resource, nil, rlim) + if err != ENOSYS { + return err + } + return getrlimit(resource, rlim) +} + +// Setrlimit prefers the prlimit64 system call. See issue 38604. +func Setrlimit(resource int, rlim *Rlimit) error { + err := prlimit(0, resource, rlim, nil) + if err != ENOSYS { + return err + } + return setrlimit(resource, rlim) +} + func (r *PtraceRegs) PC() uint64 { return r.Pc } func (r *PtraceRegs) SetPC(pc uint64) { r.Pc = pc } @@ -192,9 +210,9 @@ func InotifyInit() (fd int, err error) { return InotifyInit1(0) } -func Dup2(oldfd int, newfd int) (err error) { - return Dup3(oldfd, newfd, 0) -} +// dup2 exists because func Dup3 in syscall_linux.go references +// it in an unreachable path. dup2 isn't available on arm64. +func dup2(oldfd int, newfd int) error func Pause() error { _, err := ppoll(nil, 0, nil, nil) diff --git a/vendor/golang.org/x/sys/unix/syscall_linux_mips64x.go b/vendor/golang.org/x/sys/unix/syscall_linux_mips64x.go index af77e6e25..f0287476c 100644 --- a/vendor/golang.org/x/sys/unix/syscall_linux_mips64x.go +++ b/vendor/golang.org/x/sys/unix/syscall_linux_mips64x.go @@ -7,7 +7,7 @@ package unix -//sys Dup2(oldfd int, newfd int) (err error) +//sys dup2(oldfd int, newfd int) (err error) //sysnb EpollCreate(size int) (fd int, err error) //sys EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) //sys Fadvise(fd int, offset int64, length int64, advice int) (err error) = SYS_FADVISE64 diff --git a/vendor/golang.org/x/sys/unix/syscall_linux_mipsx.go b/vendor/golang.org/x/sys/unix/syscall_linux_mipsx.go index e286c6ba3..c11328111 100644 --- a/vendor/golang.org/x/sys/unix/syscall_linux_mipsx.go +++ b/vendor/golang.org/x/sys/unix/syscall_linux_mipsx.go @@ -14,7 +14,7 @@ import ( func Syscall9(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno) -//sys Dup2(oldfd int, newfd int) (err error) +//sys dup2(oldfd int, newfd int) (err error) //sysnb EpollCreate(size int) (fd int, err error) //sys EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) //sys Fadvise(fd int, offset int64, length int64, advice int) (err error) = SYS_FADVISE64 diff --git a/vendor/golang.org/x/sys/unix/syscall_linux_ppc64x.go b/vendor/golang.org/x/sys/unix/syscall_linux_ppc64x.go index ca0345aab..349374409 100644 --- a/vendor/golang.org/x/sys/unix/syscall_linux_ppc64x.go +++ b/vendor/golang.org/x/sys/unix/syscall_linux_ppc64x.go @@ -7,7 +7,7 @@ package unix -//sys Dup2(oldfd int, newfd int) (err error) +//sys dup2(oldfd int, newfd int) (err error) //sysnb EpollCreate(size int) (fd int, err error) //sys EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) //sys Fadvise(fd int, offset int64, length int64, advice int) (err error) = SYS_FADVISE64 diff --git a/vendor/golang.org/x/sys/unix/syscall_linux_riscv64.go b/vendor/golang.org/x/sys/unix/syscall_linux_riscv64.go index abdabbac3..b0b150556 100644 --- a/vendor/golang.org/x/sys/unix/syscall_linux_riscv64.go +++ b/vendor/golang.org/x/sys/unix/syscall_linux_riscv64.go @@ -191,10 +191,6 @@ func InotifyInit() (fd int, err error) { return InotifyInit1(0) } -func Dup2(oldfd int, newfd int) (err error) { - return Dup3(oldfd, newfd, 0) -} - func Pause() error { _, err := ppoll(nil, 0, nil, nil) return err @@ -228,3 +224,7 @@ func KexecFileLoad(kernelFd int, initrdFd int, cmdline string, flags int) error } return kexecFileLoad(kernelFd, initrdFd, cmdlineLen, cmdline, flags) } + +// dup2 exists because func Dup3 in syscall_linux.go references +// it in an unreachable path. dup2 isn't available on arm64. +func dup2(oldfd int, newfd int) error diff --git a/vendor/golang.org/x/sys/unix/syscall_linux_s390x.go b/vendor/golang.org/x/sys/unix/syscall_linux_s390x.go index 533e9305e..2363f7499 100644 --- a/vendor/golang.org/x/sys/unix/syscall_linux_s390x.go +++ b/vendor/golang.org/x/sys/unix/syscall_linux_s390x.go @@ -10,7 +10,7 @@ import ( "unsafe" ) -//sys Dup2(oldfd int, newfd int) (err error) +//sys dup2(oldfd int, newfd int) (err error) //sysnb EpollCreate(size int) (fd int, err error) //sys EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) //sys Fadvise(fd int, offset int64, length int64, advice int) (err error) = SYS_FADVISE64 diff --git a/vendor/golang.org/x/sys/unix/syscall_linux_sparc64.go b/vendor/golang.org/x/sys/unix/syscall_linux_sparc64.go index d890a227b..d389f1518 100644 --- a/vendor/golang.org/x/sys/unix/syscall_linux_sparc64.go +++ b/vendor/golang.org/x/sys/unix/syscall_linux_sparc64.go @@ -8,7 +8,7 @@ package unix //sys EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) //sys Fadvise(fd int, offset int64, length int64, advice int) (err error) = SYS_FADVISE64 -//sys Dup2(oldfd int, newfd int) (err error) +//sys dup2(oldfd int, newfd int) (err error) //sys Fchown(fd int, uid int, gid int) (err error) //sys Fstat(fd int, stat *Stat_t) (err error) //sys Fstatat(dirfd int, path string, stat *Stat_t, flags int) (err error) = SYS_FSTATAT64 diff --git a/vendor/golang.org/x/sys/unix/syscall_unix.go b/vendor/golang.org/x/sys/unix/syscall_unix.go index 8f710d014..400ba9fbc 100644 --- a/vendor/golang.org/x/sys/unix/syscall_unix.go +++ b/vendor/golang.org/x/sys/unix/syscall_unix.go @@ -12,6 +12,8 @@ import ( "sync" "syscall" "unsafe" + + "golang.org/x/sys/internal/unsafeheader" ) var ( @@ -113,15 +115,12 @@ func (m *mmapper) Mmap(fd int, offset int64, length int, prot int, flags int) (d return nil, errno } - // Slice memory layout - var sl = struct { - addr uintptr - len int - cap int - }{addr, length, length} - - // Use unsafe to turn sl into a []byte. - b := *(*[]byte)(unsafe.Pointer(&sl)) + // Use unsafe to convert addr into a []byte. + var b []byte + hdr := (*unsafeheader.Slice)(unsafe.Pointer(&b)) + hdr.Data = unsafe.Pointer(addr) + hdr.Cap = length + hdr.Len = length // Register mapping in m and return it. p := &b[cap(b)-1] diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux.go b/vendor/golang.org/x/sys/unix/zerrors_linux.go index 84c599c52..6e3cfec46 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux.go @@ -216,6 +216,7 @@ const ( BPF_F_RDONLY = 0x8 BPF_F_RDONLY_PROG = 0x80 BPF_F_RECOMPUTE_CSUM = 0x1 + BPF_F_REPLACE = 0x4 BPF_F_REUSE_STACKID = 0x400 BPF_F_SEQ_NUMBER = 0x8 BPF_F_SKIP_FIELD_MASK = 0xff @@ -389,6 +390,7 @@ const ( CLONE_NEWNET = 0x40000000 CLONE_NEWNS = 0x20000 CLONE_NEWPID = 0x20000000 + CLONE_NEWTIME = 0x80 CLONE_NEWUSER = 0x10000000 CLONE_NEWUTS = 0x4000000 CLONE_PARENT = 0x8000 @@ -671,6 +673,7 @@ const ( FS_IOC_ADD_ENCRYPTION_KEY = 0xc0506617 FS_IOC_GET_ENCRYPTION_KEY_STATUS = 0xc080661a FS_IOC_GET_ENCRYPTION_POLICY_EX = 0xc0096616 + FS_IOC_MEASURE_VERITY = 0xc0046686 FS_IOC_REMOVE_ENCRYPTION_KEY = 0xc0406618 FS_IOC_REMOVE_ENCRYPTION_KEY_ALL_USERS = 0xc0406619 FS_KEY_DESCRIPTOR_SIZE = 0x8 @@ -683,6 +686,9 @@ const ( FS_POLICY_FLAGS_PAD_8 = 0x1 FS_POLICY_FLAGS_PAD_MASK = 0x3 FS_POLICY_FLAGS_VALID = 0xf + FS_VERITY_FL = 0x100000 + FS_VERITY_HASH_ALG_SHA256 = 0x1 + FS_VERITY_HASH_ALG_SHA512 = 0x2 FUTEXFS_SUPER_MAGIC = 0xbad1dea F_ADD_SEALS = 0x409 F_DUPFD = 0x0 @@ -733,6 +739,7 @@ const ( GENL_NAMSIZ = 0x10 GENL_START_ALLOC = 0x13 GENL_UNS_ADMIN_PERM = 0x10 + GRND_INSECURE = 0x4 GRND_NONBLOCK = 0x1 GRND_RANDOM = 0x2 HDIO_DRIVE_CMD = 0x31f @@ -1483,6 +1490,7 @@ const ( PR_GET_FPEMU = 0x9 PR_GET_FPEXC = 0xb PR_GET_FP_MODE = 0x2e + PR_GET_IO_FLUSHER = 0x3a PR_GET_KEEPCAPS = 0x7 PR_GET_NAME = 0x10 PR_GET_NO_NEW_PRIVS = 0x27 @@ -1518,6 +1526,7 @@ const ( PR_SET_FPEMU = 0xa PR_SET_FPEXC = 0xc PR_SET_FP_MODE = 0x2d + PR_SET_IO_FLUSHER = 0x39 PR_SET_KEEPCAPS = 0x8 PR_SET_MM = 0x23 PR_SET_MM_ARG_END = 0x9 @@ -1746,12 +1755,15 @@ const ( RTM_DELRULE = 0x21 RTM_DELTCLASS = 0x29 RTM_DELTFILTER = 0x2d + RTM_DELVLAN = 0x71 RTM_F_CLONED = 0x200 RTM_F_EQUALIZE = 0x400 RTM_F_FIB_MATCH = 0x2000 RTM_F_LOOKUP_TABLE = 0x1000 RTM_F_NOTIFY = 0x100 + RTM_F_OFFLOAD = 0x4000 RTM_F_PREFIX = 0x800 + RTM_F_TRAP = 0x8000 RTM_GETACTION = 0x32 RTM_GETADDR = 0x16 RTM_GETADDRLABEL = 0x4a @@ -1773,7 +1785,8 @@ const ( RTM_GETSTATS = 0x5e RTM_GETTCLASS = 0x2a RTM_GETTFILTER = 0x2e - RTM_MAX = 0x6f + RTM_GETVLAN = 0x72 + RTM_MAX = 0x73 RTM_NEWACTION = 0x30 RTM_NEWADDR = 0x14 RTM_NEWADDRLABEL = 0x48 @@ -1788,6 +1801,7 @@ const ( RTM_NEWNETCONF = 0x50 RTM_NEWNEXTHOP = 0x68 RTM_NEWNSID = 0x58 + RTM_NEWNVLAN = 0x70 RTM_NEWPREFIX = 0x34 RTM_NEWQDISC = 0x24 RTM_NEWROUTE = 0x18 @@ -1795,8 +1809,8 @@ const ( RTM_NEWSTATS = 0x5c RTM_NEWTCLASS = 0x28 RTM_NEWTFILTER = 0x2c - RTM_NR_FAMILIES = 0x18 - RTM_NR_MSGTYPES = 0x60 + RTM_NR_FAMILIES = 0x19 + RTM_NR_MSGTYPES = 0x64 RTM_SETDCB = 0x4f RTM_SETLINK = 0x13 RTM_SETNEIGHTBL = 0x43 @@ -2086,7 +2100,7 @@ const ( TASKSTATS_GENL_NAME = "TASKSTATS" TASKSTATS_GENL_VERSION = 0x1 TASKSTATS_TYPE_MAX = 0x6 - TASKSTATS_VERSION = 0x9 + TASKSTATS_VERSION = 0xa TCIFLUSH = 0x0 TCIOFF = 0x2 TCIOFLUSH = 0x2 @@ -2151,6 +2165,8 @@ const ( TCP_USER_TIMEOUT = 0x12 TCP_WINDOW_CLAMP = 0xa TCP_ZEROCOPY_RECEIVE = 0x23 + TFD_TIMER_ABSTIME = 0x1 + TFD_TIMER_CANCEL_ON_SET = 0x2 TIMER_ABSTIME = 0x1 TIOCM_DTR = 0x2 TIOCM_LE = 0x1 @@ -2267,7 +2283,7 @@ const ( VMADDR_CID_ANY = 0xffffffff VMADDR_CID_HOST = 0x2 VMADDR_CID_HYPERVISOR = 0x0 - VMADDR_CID_RESERVED = 0x1 + VMADDR_CID_LOCAL = 0x1 VMADDR_PORT_ANY = 0xffffffff VM_SOCKETS_INVALID_VERSION = 0xffffffff VQUIT = 0x1 @@ -2394,6 +2410,7 @@ const ( XENFS_SUPER_MAGIC = 0xabba1974 XFS_SUPER_MAGIC = 0x58465342 Z3FOLD_MAGIC = 0x33 + ZONEFS_MAGIC = 0x5a4f4653 ZSMALLOC_MAGIC = 0x58295829 ) diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_386.go b/vendor/golang.org/x/sys/unix/zerrors_linux_386.go index 0876cf92f..5e974110d 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_386.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_386.go @@ -73,6 +73,8 @@ const ( FFDLY = 0x8000 FLUSHO = 0x1000 FP_XSTATE_MAGIC2 = 0x46505845 + FS_IOC_ENABLE_VERITY = 0x40806685 + FS_IOC_GETFLAGS = 0x80046601 FS_IOC_GET_ENCRYPTION_POLICY = 0x400c6615 FS_IOC_GET_ENCRYPTION_PWSALT = 0x40106614 FS_IOC_SET_ENCRYPTION_POLICY = 0x800c6613 @@ -340,6 +342,8 @@ const ( TCSETXF = 0x5434 TCSETXW = 0x5435 TCXONC = 0x540a + TFD_CLOEXEC = 0x80000 + TFD_NONBLOCK = 0x800 TIOCCBRK = 0x5428 TIOCCONS = 0x541d TIOCEXCL = 0x540c diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_amd64.go b/vendor/golang.org/x/sys/unix/zerrors_linux_amd64.go index d5be2e837..47a57fe46 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_amd64.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_amd64.go @@ -73,6 +73,8 @@ const ( FFDLY = 0x8000 FLUSHO = 0x1000 FP_XSTATE_MAGIC2 = 0x46505845 + FS_IOC_ENABLE_VERITY = 0x40806685 + FS_IOC_GETFLAGS = 0x80086601 FS_IOC_GET_ENCRYPTION_POLICY = 0x400c6615 FS_IOC_GET_ENCRYPTION_PWSALT = 0x40106614 FS_IOC_SET_ENCRYPTION_POLICY = 0x800c6613 @@ -341,6 +343,8 @@ const ( TCSETXF = 0x5434 TCSETXW = 0x5435 TCXONC = 0x540a + TFD_CLOEXEC = 0x80000 + TFD_NONBLOCK = 0x800 TIOCCBRK = 0x5428 TIOCCONS = 0x541d TIOCEXCL = 0x540c diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_arm.go b/vendor/golang.org/x/sys/unix/zerrors_linux_arm.go index fbeef8325..df2eea4bb 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_arm.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_arm.go @@ -72,6 +72,8 @@ const ( FF1 = 0x8000 FFDLY = 0x8000 FLUSHO = 0x1000 + FS_IOC_ENABLE_VERITY = 0x40806685 + FS_IOC_GETFLAGS = 0x80046601 FS_IOC_GET_ENCRYPTION_POLICY = 0x400c6615 FS_IOC_GET_ENCRYPTION_PWSALT = 0x40106614 FS_IOC_SET_ENCRYPTION_POLICY = 0x800c6613 @@ -347,6 +349,8 @@ const ( TCSETXF = 0x5434 TCSETXW = 0x5435 TCXONC = 0x540a + TFD_CLOEXEC = 0x80000 + TFD_NONBLOCK = 0x800 TIOCCBRK = 0x5428 TIOCCONS = 0x541d TIOCEXCL = 0x540c diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_arm64.go b/vendor/golang.org/x/sys/unix/zerrors_linux_arm64.go index 06daa50eb..4e1214217 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_arm64.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_arm64.go @@ -75,6 +75,8 @@ const ( FFDLY = 0x8000 FLUSHO = 0x1000 FPSIMD_MAGIC = 0x46508001 + FS_IOC_ENABLE_VERITY = 0x40806685 + FS_IOC_GETFLAGS = 0x80086601 FS_IOC_GET_ENCRYPTION_POLICY = 0x400c6615 FS_IOC_GET_ENCRYPTION_PWSALT = 0x40106614 FS_IOC_SET_ENCRYPTION_POLICY = 0x800c6613 @@ -334,6 +336,8 @@ const ( TCSETXF = 0x5434 TCSETXW = 0x5435 TCXONC = 0x540a + TFD_CLOEXEC = 0x80000 + TFD_NONBLOCK = 0x800 TIOCCBRK = 0x5428 TIOCCONS = 0x541d TIOCEXCL = 0x540c diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_mips.go b/vendor/golang.org/x/sys/unix/zerrors_linux_mips.go index 7c866b8f5..a23b08029 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_mips.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_mips.go @@ -72,6 +72,8 @@ const ( FF1 = 0x8000 FFDLY = 0x8000 FLUSHO = 0x2000 + FS_IOC_ENABLE_VERITY = 0x80806685 + FS_IOC_GETFLAGS = 0x40046601 FS_IOC_GET_ENCRYPTION_POLICY = 0x800c6615 FS_IOC_GET_ENCRYPTION_PWSALT = 0x80106614 FS_IOC_SET_ENCRYPTION_POLICY = 0x400c6613 @@ -337,6 +339,8 @@ const ( TCSETSW = 0x540f TCSETSW2 = 0x8030542c TCXONC = 0x5406 + TFD_CLOEXEC = 0x80000 + TFD_NONBLOCK = 0x80 TIOCCBRK = 0x5428 TIOCCONS = 0x80047478 TIOCEXCL = 0x740d diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_mips64.go b/vendor/golang.org/x/sys/unix/zerrors_linux_mips64.go index c42966d19..a5a921e43 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_mips64.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_mips64.go @@ -72,6 +72,8 @@ const ( FF1 = 0x8000 FFDLY = 0x8000 FLUSHO = 0x2000 + FS_IOC_ENABLE_VERITY = 0x80806685 + FS_IOC_GETFLAGS = 0x40086601 FS_IOC_GET_ENCRYPTION_POLICY = 0x800c6615 FS_IOC_GET_ENCRYPTION_PWSALT = 0x80106614 FS_IOC_SET_ENCRYPTION_POLICY = 0x400c6613 @@ -337,6 +339,8 @@ const ( TCSETSW = 0x540f TCSETSW2 = 0x8030542c TCXONC = 0x5406 + TFD_CLOEXEC = 0x80000 + TFD_NONBLOCK = 0x80 TIOCCBRK = 0x5428 TIOCCONS = 0x80047478 TIOCEXCL = 0x740d diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_mips64le.go b/vendor/golang.org/x/sys/unix/zerrors_linux_mips64le.go index a5b2b4273..d088e197b 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_mips64le.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_mips64le.go @@ -72,6 +72,8 @@ const ( FF1 = 0x8000 FFDLY = 0x8000 FLUSHO = 0x2000 + FS_IOC_ENABLE_VERITY = 0x80806685 + FS_IOC_GETFLAGS = 0x40086601 FS_IOC_GET_ENCRYPTION_POLICY = 0x800c6615 FS_IOC_GET_ENCRYPTION_PWSALT = 0x80106614 FS_IOC_SET_ENCRYPTION_POLICY = 0x400c6613 @@ -337,6 +339,8 @@ const ( TCSETSW = 0x540f TCSETSW2 = 0x8030542c TCXONC = 0x5406 + TFD_CLOEXEC = 0x80000 + TFD_NONBLOCK = 0x80 TIOCCBRK = 0x5428 TIOCCONS = 0x80047478 TIOCEXCL = 0x740d diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_mipsle.go b/vendor/golang.org/x/sys/unix/zerrors_linux_mipsle.go index 7f91881b8..0ddf9d5fe 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_mipsle.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_mipsle.go @@ -72,6 +72,8 @@ const ( FF1 = 0x8000 FFDLY = 0x8000 FLUSHO = 0x2000 + FS_IOC_ENABLE_VERITY = 0x80806685 + FS_IOC_GETFLAGS = 0x40046601 FS_IOC_GET_ENCRYPTION_POLICY = 0x800c6615 FS_IOC_GET_ENCRYPTION_PWSALT = 0x80106614 FS_IOC_SET_ENCRYPTION_POLICY = 0x400c6613 @@ -337,6 +339,8 @@ const ( TCSETSW = 0x540f TCSETSW2 = 0x8030542c TCXONC = 0x5406 + TFD_CLOEXEC = 0x80000 + TFD_NONBLOCK = 0x80 TIOCCBRK = 0x5428 TIOCCONS = 0x80047478 TIOCEXCL = 0x740d diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64.go b/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64.go index 63df35597..a93ffc180 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64.go @@ -72,6 +72,8 @@ const ( FF1 = 0x4000 FFDLY = 0x4000 FLUSHO = 0x800000 + FS_IOC_ENABLE_VERITY = 0x80806685 + FS_IOC_GETFLAGS = 0x40086601 FS_IOC_GET_ENCRYPTION_POLICY = 0x800c6615 FS_IOC_GET_ENCRYPTION_PWSALT = 0x80106614 FS_IOC_SET_ENCRYPTION_POLICY = 0x400c6613 @@ -391,6 +393,8 @@ const ( TCSETSF = 0x802c7416 TCSETSW = 0x802c7415 TCXONC = 0x2000741e + TFD_CLOEXEC = 0x80000 + TFD_NONBLOCK = 0x800 TIOCCBRK = 0x5428 TIOCCONS = 0x541d TIOCEXCL = 0x540c diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64le.go b/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64le.go index 7ab68f7c8..c1ea48b95 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64le.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64le.go @@ -72,6 +72,8 @@ const ( FF1 = 0x4000 FFDLY = 0x4000 FLUSHO = 0x800000 + FS_IOC_ENABLE_VERITY = 0x80806685 + FS_IOC_GETFLAGS = 0x40086601 FS_IOC_GET_ENCRYPTION_POLICY = 0x800c6615 FS_IOC_GET_ENCRYPTION_PWSALT = 0x80106614 FS_IOC_SET_ENCRYPTION_POLICY = 0x400c6613 @@ -391,6 +393,8 @@ const ( TCSETSF = 0x802c7416 TCSETSW = 0x802c7415 TCXONC = 0x2000741e + TFD_CLOEXEC = 0x80000 + TFD_NONBLOCK = 0x800 TIOCCBRK = 0x5428 TIOCCONS = 0x541d TIOCEXCL = 0x540c diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_riscv64.go b/vendor/golang.org/x/sys/unix/zerrors_linux_riscv64.go index f99cf1b9e..7def950ba 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_riscv64.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_riscv64.go @@ -72,6 +72,8 @@ const ( FF1 = 0x8000 FFDLY = 0x8000 FLUSHO = 0x1000 + FS_IOC_ENABLE_VERITY = 0x40806685 + FS_IOC_GETFLAGS = 0x80086601 FS_IOC_GET_ENCRYPTION_POLICY = 0x400c6615 FS_IOC_GET_ENCRYPTION_PWSALT = 0x40106614 FS_IOC_SET_ENCRYPTION_POLICY = 0x800c6613 @@ -328,6 +330,8 @@ const ( TCSETXF = 0x5434 TCSETXW = 0x5435 TCXONC = 0x540a + TFD_CLOEXEC = 0x80000 + TFD_NONBLOCK = 0x800 TIOCCBRK = 0x5428 TIOCCONS = 0x541d TIOCEXCL = 0x540c diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_s390x.go b/vendor/golang.org/x/sys/unix/zerrors_linux_s390x.go index 613ee237e..d39293c87 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_s390x.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_s390x.go @@ -72,6 +72,8 @@ const ( FF1 = 0x8000 FFDLY = 0x8000 FLUSHO = 0x1000 + FS_IOC_ENABLE_VERITY = 0x40806685 + FS_IOC_GETFLAGS = 0x80086601 FS_IOC_GET_ENCRYPTION_POLICY = 0x400c6615 FS_IOC_GET_ENCRYPTION_PWSALT = 0x40106614 FS_IOC_SET_ENCRYPTION_POLICY = 0x800c6613 @@ -401,6 +403,8 @@ const ( TCSETXF = 0x5434 TCSETXW = 0x5435 TCXONC = 0x540a + TFD_CLOEXEC = 0x80000 + TFD_NONBLOCK = 0x800 TIOCCBRK = 0x5428 TIOCCONS = 0x541d TIOCEXCL = 0x540c diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_sparc64.go b/vendor/golang.org/x/sys/unix/zerrors_linux_sparc64.go index 1f7a68d5c..3ff3ec681 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_sparc64.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_sparc64.go @@ -76,6 +76,8 @@ const ( FF1 = 0x8000 FFDLY = 0x8000 FLUSHO = 0x1000 + FS_IOC_ENABLE_VERITY = 0x80806685 + FS_IOC_GETFLAGS = 0x40086601 FS_IOC_GET_ENCRYPTION_POLICY = 0x800c6615 FS_IOC_GET_ENCRYPTION_PWSALT = 0x80106614 FS_IOC_SET_ENCRYPTION_POLICY = 0x400c6613 @@ -390,6 +392,8 @@ const ( TCSETSW = 0x8024540a TCSETSW2 = 0x802c540e TCXONC = 0x20005406 + TFD_CLOEXEC = 0x400000 + TFD_NONBLOCK = 0x4000 TIOCCBRK = 0x2000747a TIOCCONS = 0x20007424 TIOCEXCL = 0x2000740d diff --git a/vendor/golang.org/x/sys/unix/zsyscall_darwin_386.1_11.go b/vendor/golang.org/x/sys/unix/zsyscall_darwin_386.1_11.go index c1cc0a415..23e94d366 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_darwin_386.1_11.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_darwin_386.1_11.go @@ -966,6 +966,16 @@ func Getsid(pid int) (sid int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func Gettimeofday(tp *Timeval) (err error) { + _, _, e1 := RawSyscall(SYS_GETTIMEOFDAY, uintptr(unsafe.Pointer(tp)), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Getuid() (uid int) { r0, _, _ := RawSyscall(SYS_GETUID, 0, 0, 0) uid = int(r0) @@ -1709,18 +1719,6 @@ func ptrace(request int, pid int, addr uintptr, data uintptr) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func gettimeofday(tp *Timeval) (sec int32, usec int32, err error) { - r0, r1, e1 := RawSyscall(SYS_GETTIMEOFDAY, uintptr(unsafe.Pointer(tp)), 0, 0) - sec = int32(r0) - usec = int32(r1) - if e1 != 0 { - err = errnoErr(e1) - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - func Fstat(fd int, stat *Stat_t) (err error) { _, _, e1 := Syscall(SYS_FSTAT64, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0) if e1 != 0 { diff --git a/vendor/golang.org/x/sys/unix/zsyscall_darwin_386.go b/vendor/golang.org/x/sys/unix/zsyscall_darwin_386.go index a3fc49004..e2ffb3bed 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_darwin_386.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_darwin_386.go @@ -1376,6 +1376,21 @@ func libc_getsid_trampoline() // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func Gettimeofday(tp *Timeval) (err error) { + _, _, e1 := syscall_rawSyscall(funcPC(libc_gettimeofday_trampoline), uintptr(unsafe.Pointer(tp)), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +func libc_gettimeofday_trampoline() + +//go:linkname libc_gettimeofday libc_gettimeofday +//go:cgo_import_dynamic libc_gettimeofday gettimeofday "/usr/lib/libSystem.B.dylib" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Getuid() (uid int) { r0, _, _ := syscall_rawSyscall(funcPC(libc_getuid_trampoline), 0, 0, 0) uid = int(r0) @@ -2357,23 +2372,6 @@ func libc_ptrace_trampoline() // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func gettimeofday(tp *Timeval) (sec int32, usec int32, err error) { - r0, r1, e1 := syscall_rawSyscall(funcPC(libc_gettimeofday_trampoline), uintptr(unsafe.Pointer(tp)), 0, 0) - sec = int32(r0) - usec = int32(r1) - if e1 != 0 { - err = errnoErr(e1) - } - return -} - -func libc_gettimeofday_trampoline() - -//go:linkname libc_gettimeofday libc_gettimeofday -//go:cgo_import_dynamic libc_gettimeofday gettimeofday "/usr/lib/libSystem.B.dylib" - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - func Fstat(fd int, stat *Stat_t) (err error) { _, _, e1 := syscall_syscall(funcPC(libc_fstat64_trampoline), uintptr(fd), uintptr(unsafe.Pointer(stat)), 0) if e1 != 0 { diff --git a/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.1_11.go b/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.1_11.go index f8e5c37c5..102561730 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.1_11.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.1_11.go @@ -966,6 +966,16 @@ func Getsid(pid int) (sid int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func Gettimeofday(tp *Timeval) (err error) { + _, _, e1 := RawSyscall(SYS_GETTIMEOFDAY, uintptr(unsafe.Pointer(tp)), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Getuid() (uid int) { r0, _, _ := RawSyscall(SYS_GETUID, 0, 0, 0) uid = int(r0) @@ -1709,18 +1719,6 @@ func ptrace(request int, pid int, addr uintptr, data uintptr) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func gettimeofday(tp *Timeval) (sec int64, usec int32, err error) { - r0, r1, e1 := RawSyscall(SYS_GETTIMEOFDAY, uintptr(unsafe.Pointer(tp)), 0, 0) - sec = int64(r0) - usec = int32(r1) - if e1 != 0 { - err = errnoErr(e1) - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - func Fstat(fd int, stat *Stat_t) (err error) { _, _, e1 := Syscall(SYS_FSTAT64, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0) if e1 != 0 { diff --git a/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.go b/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.go index 50d6437e6..c67e336e2 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.go @@ -1376,6 +1376,21 @@ func libc_getsid_trampoline() // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func Gettimeofday(tp *Timeval) (err error) { + _, _, e1 := syscall_rawSyscall(funcPC(libc_gettimeofday_trampoline), uintptr(unsafe.Pointer(tp)), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +func libc_gettimeofday_trampoline() + +//go:linkname libc_gettimeofday libc_gettimeofday +//go:cgo_import_dynamic libc_gettimeofday gettimeofday "/usr/lib/libSystem.B.dylib" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Getuid() (uid int) { r0, _, _ := syscall_rawSyscall(funcPC(libc_getuid_trampoline), 0, 0, 0) uid = int(r0) @@ -2357,23 +2372,6 @@ func libc_ptrace_trampoline() // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func gettimeofday(tp *Timeval) (sec int64, usec int32, err error) { - r0, r1, e1 := syscall_rawSyscall(funcPC(libc_gettimeofday_trampoline), uintptr(unsafe.Pointer(tp)), 0, 0) - sec = int64(r0) - usec = int32(r1) - if e1 != 0 { - err = errnoErr(e1) - } - return -} - -func libc_gettimeofday_trampoline() - -//go:linkname libc_gettimeofday libc_gettimeofday -//go:cgo_import_dynamic libc_gettimeofday gettimeofday "/usr/lib/libSystem.B.dylib" - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - func Fstat(fd int, stat *Stat_t) (err error) { _, _, e1 := syscall_syscall(funcPC(libc_fstat64_trampoline), uintptr(fd), uintptr(unsafe.Pointer(stat)), 0) if e1 != 0 { diff --git a/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm.1_11.go b/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm.1_11.go index cea04e041..d34e6df2f 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm.1_11.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm.1_11.go @@ -966,6 +966,16 @@ func Getsid(pid int) (sid int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func Gettimeofday(tp *Timeval) (err error) { + _, _, e1 := RawSyscall(SYS_GETTIMEOFDAY, uintptr(unsafe.Pointer(tp)), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Getuid() (uid int) { r0, _, _ := RawSyscall(SYS_GETUID, 0, 0, 0) uid = int(r0) @@ -1682,18 +1692,6 @@ func writelen(fd int, buf *byte, nbuf int) (n int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func gettimeofday(tp *Timeval) (sec int32, usec int32, err error) { - r0, r1, e1 := RawSyscall(SYS_GETTIMEOFDAY, uintptr(unsafe.Pointer(tp)), 0, 0) - sec = int32(r0) - usec = int32(r1) - if e1 != 0 { - err = errnoErr(e1) - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - func Fstat(fd int, stat *Stat_t) (err error) { _, _, e1 := Syscall(SYS_FSTAT, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0) if e1 != 0 { diff --git a/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm.go b/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm.go index 63103950c..b759757a7 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm.go @@ -1376,6 +1376,21 @@ func libc_getsid_trampoline() // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func Gettimeofday(tp *Timeval) (err error) { + _, _, e1 := syscall_rawSyscall(funcPC(libc_gettimeofday_trampoline), uintptr(unsafe.Pointer(tp)), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +func libc_gettimeofday_trampoline() + +//go:linkname libc_gettimeofday libc_gettimeofday +//go:cgo_import_dynamic libc_gettimeofday gettimeofday "/usr/lib/libSystem.B.dylib" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Getuid() (uid int) { r0, _, _ := syscall_rawSyscall(funcPC(libc_getuid_trampoline), 0, 0, 0) uid = int(r0) @@ -2342,23 +2357,6 @@ func writelen(fd int, buf *byte, nbuf int) (n int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func gettimeofday(tp *Timeval) (sec int32, usec int32, err error) { - r0, r1, e1 := syscall_rawSyscall(funcPC(libc_gettimeofday_trampoline), uintptr(unsafe.Pointer(tp)), 0, 0) - sec = int32(r0) - usec = int32(r1) - if e1 != 0 { - err = errnoErr(e1) - } - return -} - -func libc_gettimeofday_trampoline() - -//go:linkname libc_gettimeofday libc_gettimeofday -//go:cgo_import_dynamic libc_gettimeofday gettimeofday "/usr/lib/libSystem.B.dylib" - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - func Fstat(fd int, stat *Stat_t) (err error) { _, _, e1 := syscall_syscall(funcPC(libc_fstat_trampoline), uintptr(fd), uintptr(unsafe.Pointer(stat)), 0) if e1 != 0 { diff --git a/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.1_11.go b/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.1_11.go index 8c3bb3a25..8d39a09f7 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.1_11.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.1_11.go @@ -966,6 +966,16 @@ func Getsid(pid int) (sid int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func Gettimeofday(tp *Timeval) (err error) { + _, _, e1 := RawSyscall(SYS_GETTIMEOFDAY, uintptr(unsafe.Pointer(tp)), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Getuid() (uid int) { r0, _, _ := RawSyscall(SYS_GETUID, 0, 0, 0) uid = int(r0) @@ -1682,18 +1692,6 @@ func writelen(fd int, buf *byte, nbuf int) (n int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func gettimeofday(tp *Timeval) (sec int64, usec int32, err error) { - r0, r1, e1 := RawSyscall(SYS_GETTIMEOFDAY, uintptr(unsafe.Pointer(tp)), 0, 0) - sec = int64(r0) - usec = int32(r1) - if e1 != 0 { - err = errnoErr(e1) - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - func Fstat(fd int, stat *Stat_t) (err error) { _, _, e1 := Syscall(SYS_FSTAT, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0) if e1 != 0 { diff --git a/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.go b/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.go index a8709f72d..b28861260 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.go @@ -1376,6 +1376,21 @@ func libc_getsid_trampoline() // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func Gettimeofday(tp *Timeval) (err error) { + _, _, e1 := syscall_rawSyscall(funcPC(libc_gettimeofday_trampoline), uintptr(unsafe.Pointer(tp)), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +func libc_gettimeofday_trampoline() + +//go:linkname libc_gettimeofday libc_gettimeofday +//go:cgo_import_dynamic libc_gettimeofday gettimeofday "/usr/lib/libSystem.B.dylib" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Getuid() (uid int) { r0, _, _ := syscall_rawSyscall(funcPC(libc_getuid_trampoline), 0, 0, 0) uid = int(r0) @@ -2342,23 +2357,6 @@ func writelen(fd int, buf *byte, nbuf int) (n int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func gettimeofday(tp *Timeval) (sec int64, usec int32, err error) { - r0, r1, e1 := syscall_rawSyscall(funcPC(libc_gettimeofday_trampoline), uintptr(unsafe.Pointer(tp)), 0, 0) - sec = int64(r0) - usec = int32(r1) - if e1 != 0 { - err = errnoErr(e1) - } - return -} - -func libc_gettimeofday_trampoline() - -//go:linkname libc_gettimeofday libc_gettimeofday -//go:cgo_import_dynamic libc_gettimeofday gettimeofday "/usr/lib/libSystem.B.dylib" - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - func Fstat(fd int, stat *Stat_t) (err error) { _, _, e1 := syscall_syscall(funcPC(libc_fstat_trampoline), uintptr(fd), uintptr(unsafe.Pointer(stat)), 0) if e1 != 0 { diff --git a/vendor/golang.org/x/sys/unix/zsyscall_linux.go b/vendor/golang.org/x/sys/unix/zsyscall_linux.go index fd2dae8e5..df217825f 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_linux.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_linux.go @@ -1450,6 +1450,37 @@ func Sysinfo(info *Sysinfo_t) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func TimerfdCreate(clockid int, flags int) (fd int, err error) { + r0, _, e1 := RawSyscall(SYS_TIMERFD_CREATE, uintptr(clockid), uintptr(flags), 0) + fd = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func TimerfdGettime(fd int, currValue *ItimerSpec) (err error) { + _, _, e1 := RawSyscall(SYS_TIMERFD_GETTIME, uintptr(fd), uintptr(unsafe.Pointer(currValue)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func TimerfdSettime(fd int, flags int, newValue *ItimerSpec, oldValue *ItimerSpec) (err error) { + _, _, e1 := RawSyscall6(SYS_TIMERFD_SETTIME, uintptr(fd), uintptr(flags), uintptr(unsafe.Pointer(newValue)), uintptr(unsafe.Pointer(oldValue)), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Tgkill(tgid int, tid int, sig syscall.Signal) (err error) { _, _, e1 := RawSyscall(SYS_TGKILL, uintptr(tgid), uintptr(tid), uintptr(sig)) if e1 != 0 { diff --git a/vendor/golang.org/x/sys/unix/zsyscall_linux_386.go b/vendor/golang.org/x/sys/unix/zsyscall_linux_386.go index ba63af7b0..19ebd3ff7 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_linux_386.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_linux_386.go @@ -55,7 +55,7 @@ func pipe(p *[2]_C_int) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Dup2(oldfd int, newfd int) (err error) { +func dup2(oldfd int, newfd int) (err error) { _, _, e1 := Syscall(SYS_DUP2, uintptr(oldfd), uintptr(newfd), 0) if e1 != 0 { err = errnoErr(e1) diff --git a/vendor/golang.org/x/sys/unix/zsyscall_linux_amd64.go b/vendor/golang.org/x/sys/unix/zsyscall_linux_amd64.go index f64adef41..5c562182a 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_linux_amd64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_linux_amd64.go @@ -45,7 +45,7 @@ func Tee(rfd int, wfd int, len int, flags int) (n int64, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Dup2(oldfd int, newfd int) (err error) { +func dup2(oldfd int, newfd int) (err error) { _, _, e1 := Syscall(SYS_DUP2, uintptr(oldfd), uintptr(newfd), 0) if e1 != 0 { err = errnoErr(e1) diff --git a/vendor/golang.org/x/sys/unix/zsyscall_linux_arm.go b/vendor/golang.org/x/sys/unix/zsyscall_linux_arm.go index ac19523e8..dc69d99c6 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_linux_arm.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_linux_arm.go @@ -234,7 +234,7 @@ func sendmsg(s int, msg *Msghdr, flags int) (n int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Dup2(oldfd int, newfd int) (err error) { +func dup2(oldfd int, newfd int) (err error) { _, _, e1 := Syscall(SYS_DUP2, uintptr(oldfd), uintptr(newfd), 0) if e1 != 0 { err = errnoErr(e1) diff --git a/vendor/golang.org/x/sys/unix/zsyscall_linux_arm64.go b/vendor/golang.org/x/sys/unix/zsyscall_linux_arm64.go index f0d2890b1..1b897dee0 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_linux_arm64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_linux_arm64.go @@ -151,7 +151,7 @@ func Getgid() (gid int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Getrlimit(resource int, rlim *Rlimit) (err error) { +func getrlimit(resource int, rlim *Rlimit) (err error) { _, _, e1 := RawSyscall(SYS_GETRLIMIT, uintptr(resource), uintptr(unsafe.Pointer(rlim)), 0) if e1 != 0 { err = errnoErr(e1) @@ -307,7 +307,7 @@ func Setresuid(ruid int, euid int, suid int) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Setrlimit(resource int, rlim *Rlimit) (err error) { +func setrlimit(resource int, rlim *Rlimit) (err error) { _, _, e1 := RawSyscall(SYS_SETRLIMIT, uintptr(resource), uintptr(unsafe.Pointer(rlim)), 0) if e1 != 0 { err = errnoErr(e1) diff --git a/vendor/golang.org/x/sys/unix/zsyscall_linux_mips.go b/vendor/golang.org/x/sys/unix/zsyscall_linux_mips.go index aecbbca75..49186843a 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_linux_mips.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_linux_mips.go @@ -45,7 +45,7 @@ func Tee(rfd int, wfd int, len int, flags int) (n int64, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Dup2(oldfd int, newfd int) (err error) { +func dup2(oldfd int, newfd int) (err error) { _, _, e1 := Syscall(SYS_DUP2, uintptr(oldfd), uintptr(newfd), 0) if e1 != 0 { err = errnoErr(e1) diff --git a/vendor/golang.org/x/sys/unix/zsyscall_linux_mips64.go b/vendor/golang.org/x/sys/unix/zsyscall_linux_mips64.go index 424fb7fb6..9171d3bd2 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_linux_mips64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_linux_mips64.go @@ -45,7 +45,7 @@ func Tee(rfd int, wfd int, len int, flags int) (n int64, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Dup2(oldfd int, newfd int) (err error) { +func dup2(oldfd int, newfd int) (err error) { _, _, e1 := Syscall(SYS_DUP2, uintptr(oldfd), uintptr(newfd), 0) if e1 != 0 { err = errnoErr(e1) diff --git a/vendor/golang.org/x/sys/unix/zsyscall_linux_mips64le.go b/vendor/golang.org/x/sys/unix/zsyscall_linux_mips64le.go index 28c7239cf..82286f04f 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_linux_mips64le.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_linux_mips64le.go @@ -45,7 +45,7 @@ func Tee(rfd int, wfd int, len int, flags int) (n int64, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Dup2(oldfd int, newfd int) (err error) { +func dup2(oldfd int, newfd int) (err error) { _, _, e1 := Syscall(SYS_DUP2, uintptr(oldfd), uintptr(newfd), 0) if e1 != 0 { err = errnoErr(e1) diff --git a/vendor/golang.org/x/sys/unix/zsyscall_linux_mipsle.go b/vendor/golang.org/x/sys/unix/zsyscall_linux_mipsle.go index 84596b300..15920621c 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_linux_mipsle.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_linux_mipsle.go @@ -45,7 +45,7 @@ func Tee(rfd int, wfd int, len int, flags int) (n int64, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Dup2(oldfd int, newfd int) (err error) { +func dup2(oldfd int, newfd int) (err error) { _, _, e1 := Syscall(SYS_DUP2, uintptr(oldfd), uintptr(newfd), 0) if e1 != 0 { err = errnoErr(e1) diff --git a/vendor/golang.org/x/sys/unix/zsyscall_linux_ppc64.go b/vendor/golang.org/x/sys/unix/zsyscall_linux_ppc64.go index de022639d..73a42e2cc 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_linux_ppc64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_linux_ppc64.go @@ -45,7 +45,7 @@ func Tee(rfd int, wfd int, len int, flags int) (n int64, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Dup2(oldfd int, newfd int) (err error) { +func dup2(oldfd int, newfd int) (err error) { _, _, e1 := Syscall(SYS_DUP2, uintptr(oldfd), uintptr(newfd), 0) if e1 != 0 { err = errnoErr(e1) diff --git a/vendor/golang.org/x/sys/unix/zsyscall_linux_ppc64le.go b/vendor/golang.org/x/sys/unix/zsyscall_linux_ppc64le.go index 888f21d37..6b8559536 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_linux_ppc64le.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_linux_ppc64le.go @@ -45,7 +45,7 @@ func Tee(rfd int, wfd int, len int, flags int) (n int64, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Dup2(oldfd int, newfd int) (err error) { +func dup2(oldfd int, newfd int) (err error) { _, _, e1 := Syscall(SYS_DUP2, uintptr(oldfd), uintptr(newfd), 0) if e1 != 0 { err = errnoErr(e1) diff --git a/vendor/golang.org/x/sys/unix/zsyscall_linux_s390x.go b/vendor/golang.org/x/sys/unix/zsyscall_linux_s390x.go index 9bc353f0c..d7032ab1e 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_linux_s390x.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_linux_s390x.go @@ -45,7 +45,7 @@ func Tee(rfd int, wfd int, len int, flags int) (n int64, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Dup2(oldfd int, newfd int) (err error) { +func dup2(oldfd int, newfd int) (err error) { _, _, e1 := Syscall(SYS_DUP2, uintptr(oldfd), uintptr(newfd), 0) if e1 != 0 { err = errnoErr(e1) diff --git a/vendor/golang.org/x/sys/unix/zsyscall_linux_sparc64.go b/vendor/golang.org/x/sys/unix/zsyscall_linux_sparc64.go index 854e816d6..bcbbdd906 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_linux_sparc64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_linux_sparc64.go @@ -72,7 +72,7 @@ func Fadvise(fd int, offset int64, length int64, advice int) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Dup2(oldfd int, newfd int) (err error) { +func dup2(oldfd int, newfd int) (err error) { _, _, e1 := Syscall(SYS_DUP2, uintptr(oldfd), uintptr(newfd), 0) if e1 != 0 { err = errnoErr(e1) diff --git a/vendor/golang.org/x/sys/unix/zsysctl_openbsd_386.go b/vendor/golang.org/x/sys/unix/zsysctl_openbsd_386.go index 37dcc74c2..102f1ab47 100644 --- a/vendor/golang.org/x/sys/unix/zsysctl_openbsd_386.go +++ b/vendor/golang.org/x/sys/unix/zsysctl_openbsd_386.go @@ -1,4 +1,4 @@ -// mksysctl_openbsd.pl +// go run mksysctl_openbsd.go // Code generated by the command above; DO NOT EDIT. // +build 386,openbsd @@ -30,6 +30,7 @@ var sysctlMib = []mibentry{ {"hw.model", []_C_int{6, 2}}, {"hw.ncpu", []_C_int{6, 3}}, {"hw.ncpufound", []_C_int{6, 21}}, + {"hw.ncpuonline", []_C_int{6, 25}}, {"hw.pagesize", []_C_int{6, 7}}, {"hw.physmem", []_C_int{6, 19}}, {"hw.product", []_C_int{6, 15}}, diff --git a/vendor/golang.org/x/sys/unix/zsysctl_openbsd_amd64.go b/vendor/golang.org/x/sys/unix/zsysctl_openbsd_amd64.go index fe6caa6eb..4866fced8 100644 --- a/vendor/golang.org/x/sys/unix/zsysctl_openbsd_amd64.go +++ b/vendor/golang.org/x/sys/unix/zsysctl_openbsd_amd64.go @@ -31,6 +31,7 @@ var sysctlMib = []mibentry{ {"hw.model", []_C_int{6, 2}}, {"hw.ncpu", []_C_int{6, 3}}, {"hw.ncpufound", []_C_int{6, 21}}, + {"hw.ncpuonline", []_C_int{6, 25}}, {"hw.pagesize", []_C_int{6, 7}}, {"hw.perfpolicy", []_C_int{6, 23}}, {"hw.physmem", []_C_int{6, 19}}, diff --git a/vendor/golang.org/x/sys/unix/zsysctl_openbsd_arm.go b/vendor/golang.org/x/sys/unix/zsysctl_openbsd_arm.go index 6eb8c0b08..d3801eb24 100644 --- a/vendor/golang.org/x/sys/unix/zsysctl_openbsd_arm.go +++ b/vendor/golang.org/x/sys/unix/zsysctl_openbsd_arm.go @@ -30,6 +30,7 @@ var sysctlMib = []mibentry{ {"hw.model", []_C_int{6, 2}}, {"hw.ncpu", []_C_int{6, 3}}, {"hw.ncpufound", []_C_int{6, 21}}, + {"hw.ncpuonline", []_C_int{6, 25}}, {"hw.pagesize", []_C_int{6, 7}}, {"hw.physmem", []_C_int{6, 19}}, {"hw.product", []_C_int{6, 15}}, diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_386.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_386.go index 7aae554f2..54559a895 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_386.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_386.go @@ -431,4 +431,6 @@ const ( SYS_FSPICK = 433 SYS_PIDFD_OPEN = 434 SYS_CLONE3 = 435 + SYS_OPENAT2 = 437 + SYS_PIDFD_GETFD = 438 ) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_amd64.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_amd64.go index 7968439a9..054a741b7 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_amd64.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_amd64.go @@ -353,4 +353,6 @@ const ( SYS_FSPICK = 433 SYS_PIDFD_OPEN = 434 SYS_CLONE3 = 435 + SYS_OPENAT2 = 437 + SYS_PIDFD_GETFD = 438 ) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_arm.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_arm.go index 3c663c69d..307f2ba12 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_arm.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_arm.go @@ -395,4 +395,6 @@ const ( SYS_FSPICK = 433 SYS_PIDFD_OPEN = 434 SYS_CLONE3 = 435 + SYS_OPENAT2 = 437 + SYS_PIDFD_GETFD = 438 ) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_arm64.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_arm64.go index 1f3b4d150..e9404dd54 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_arm64.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_arm64.go @@ -298,4 +298,6 @@ const ( SYS_FSPICK = 433 SYS_PIDFD_OPEN = 434 SYS_CLONE3 = 435 + SYS_OPENAT2 = 437 + SYS_PIDFD_GETFD = 438 ) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_mips.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_mips.go index 00da3de90..68bb6d29b 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_mips.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_mips.go @@ -416,4 +416,6 @@ const ( SYS_FSPICK = 4433 SYS_PIDFD_OPEN = 4434 SYS_CLONE3 = 4435 + SYS_OPENAT2 = 4437 + SYS_PIDFD_GETFD = 4438 ) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64.go index d404fbd4d..4e5251185 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64.go @@ -346,4 +346,6 @@ const ( SYS_FSPICK = 5433 SYS_PIDFD_OPEN = 5434 SYS_CLONE3 = 5435 + SYS_OPENAT2 = 5437 + SYS_PIDFD_GETFD = 5438 ) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64le.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64le.go index bfbf242f3..4d9aa3003 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64le.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64le.go @@ -346,4 +346,6 @@ const ( SYS_FSPICK = 5433 SYS_PIDFD_OPEN = 5434 SYS_CLONE3 = 5435 + SYS_OPENAT2 = 5437 + SYS_PIDFD_GETFD = 5438 ) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_mipsle.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_mipsle.go index 3826f497a..64af0707d 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_mipsle.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_mipsle.go @@ -416,4 +416,6 @@ const ( SYS_FSPICK = 4433 SYS_PIDFD_OPEN = 4434 SYS_CLONE3 = 4435 + SYS_OPENAT2 = 4437 + SYS_PIDFD_GETFD = 4438 ) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64.go index 52e3da649..cc3c067ba 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64.go @@ -395,4 +395,6 @@ const ( SYS_FSPICK = 433 SYS_PIDFD_OPEN = 434 SYS_CLONE3 = 435 + SYS_OPENAT2 = 437 + SYS_PIDFD_GETFD = 438 ) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64le.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64le.go index 6141f90a8..4050ff983 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64le.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64le.go @@ -395,4 +395,6 @@ const ( SYS_FSPICK = 433 SYS_PIDFD_OPEN = 434 SYS_CLONE3 = 435 + SYS_OPENAT2 = 437 + SYS_PIDFD_GETFD = 438 ) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_riscv64.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_riscv64.go index 4f7261a88..529abb6a7 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_riscv64.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_riscv64.go @@ -297,4 +297,6 @@ const ( SYS_FSPICK = 433 SYS_PIDFD_OPEN = 434 SYS_CLONE3 = 435 + SYS_OPENAT2 = 437 + SYS_PIDFD_GETFD = 438 ) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_s390x.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_s390x.go index f47014ac0..276650010 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_s390x.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_s390x.go @@ -360,4 +360,6 @@ const ( SYS_FSPICK = 433 SYS_PIDFD_OPEN = 434 SYS_CLONE3 = 435 + SYS_OPENAT2 = 437 + SYS_PIDFD_GETFD = 438 ) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_sparc64.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_sparc64.go index dd78abb0d..4dc82bb24 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_sparc64.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_sparc64.go @@ -374,4 +374,6 @@ const ( SYS_FSMOUNT = 432 SYS_FSPICK = 433 SYS_PIDFD_OPEN = 434 + SYS_OPENAT2 = 437 + SYS_PIDFD_GETFD = 438 ) diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux.go b/vendor/golang.org/x/sys/unix/ztypes_linux.go index cb5e06c60..416f7767e 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux.go @@ -18,6 +18,11 @@ type ( _C_long_long int64 ) +type ItimerSpec struct { + Interval Timespec + Value Timespec +} + const ( TIME_OK = 0x0 TIME_INS = 0x1 @@ -114,7 +119,8 @@ type FscryptKeySpecifier struct { type FscryptAddKeyArg struct { Key_spec FscryptKeySpecifier Raw_size uint32 - _ [9]uint32 + Key_id uint32 + _ [8]uint32 } type FscryptRemoveKeyArg struct { @@ -479,7 +485,7 @@ const ( IFLA_NEW_IFINDEX = 0x31 IFLA_MIN_MTU = 0x32 IFLA_MAX_MTU = 0x33 - IFLA_MAX = 0x35 + IFLA_MAX = 0x36 IFLA_INFO_KIND = 0x1 IFLA_INFO_DATA = 0x2 IFLA_INFO_XSTATS = 0x3 @@ -2291,3 +2297,49 @@ const ( DEVLINK_DPIPE_HEADER_IPV4 = 0x1 DEVLINK_DPIPE_HEADER_IPV6 = 0x2 ) + +type FsverityDigest struct { + Algorithm uint16 + Size uint16 +} + +type FsverityEnableArg struct { + Version uint32 + Hash_algorithm uint32 + Block_size uint32 + Salt_size uint32 + Salt_ptr uint64 + Sig_size uint32 + _ uint32 + Sig_ptr uint64 + _ [11]uint64 +} + +type Nhmsg struct { + Family uint8 + Scope uint8 + Protocol uint8 + Resvd uint8 + Flags uint32 +} + +type NexthopGrp struct { + Id uint32 + Weight uint8 + Resvd1 uint8 + Resvd2 uint16 +} + +const ( + NHA_UNSPEC = 0x0 + NHA_ID = 0x1 + NHA_GROUP = 0x2 + NHA_GROUP_TYPE = 0x3 + NHA_BLACKHOLE = 0x4 + NHA_OIF = 0x5 + NHA_GATEWAY = 0x6 + NHA_ENCAP_TYPE = 0x7 + NHA_ENCAP = 0x8 + NHA_GROUPS = 0x9 + NHA_MASTER = 0xa +) diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_386.go b/vendor/golang.org/x/sys/unix/ztypes_linux_386.go index fc6b3fb5c..761b67c86 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_386.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_386.go @@ -287,6 +287,7 @@ type Taskstats struct { Freepages_delay_total uint64 Thrashing_count uint64 Thrashing_delay_total uint64 + Ac_btime64 uint64 } type cpuMask uint32 diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_amd64.go b/vendor/golang.org/x/sys/unix/ztypes_linux_amd64.go index 26c30b84d..201fb3482 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_amd64.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_amd64.go @@ -298,6 +298,7 @@ type Taskstats struct { Freepages_delay_total uint64 Thrashing_count uint64 Thrashing_delay_total uint64 + Ac_btime64 uint64 } type cpuMask uint64 diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_arm.go b/vendor/golang.org/x/sys/unix/ztypes_linux_arm.go index 814d42d54..8051b5610 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_arm.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_arm.go @@ -276,6 +276,7 @@ type Taskstats struct { Freepages_delay_total uint64 Thrashing_count uint64 Thrashing_delay_total uint64 + Ac_btime64 uint64 } type cpuMask uint32 diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_arm64.go b/vendor/golang.org/x/sys/unix/ztypes_linux_arm64.go index d9664c713..a936f2169 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_arm64.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_arm64.go @@ -277,6 +277,7 @@ type Taskstats struct { Freepages_delay_total uint64 Thrashing_count uint64 Thrashing_delay_total uint64 + Ac_btime64 uint64 } type cpuMask uint64 diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_mips.go b/vendor/golang.org/x/sys/unix/ztypes_linux_mips.go index 0d721454f..aaca03dd7 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_mips.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_mips.go @@ -281,6 +281,7 @@ type Taskstats struct { Freepages_delay_total uint64 Thrashing_count uint64 Thrashing_delay_total uint64 + Ac_btime64 uint64 } type cpuMask uint32 diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_mips64.go b/vendor/golang.org/x/sys/unix/ztypes_linux_mips64.go index ef697684d..2e7f3b8ca 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_mips64.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_mips64.go @@ -280,6 +280,7 @@ type Taskstats struct { Freepages_delay_total uint64 Thrashing_count uint64 Thrashing_delay_total uint64 + Ac_btime64 uint64 } type cpuMask uint64 diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_mips64le.go b/vendor/golang.org/x/sys/unix/ztypes_linux_mips64le.go index 485fda70b..16add5a25 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_mips64le.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_mips64le.go @@ -280,6 +280,7 @@ type Taskstats struct { Freepages_delay_total uint64 Thrashing_count uint64 Thrashing_delay_total uint64 + Ac_btime64 uint64 } type cpuMask uint64 diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_mipsle.go b/vendor/golang.org/x/sys/unix/ztypes_linux_mipsle.go index 569477eef..4ed2c8e54 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_mipsle.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_mipsle.go @@ -281,6 +281,7 @@ type Taskstats struct { Freepages_delay_total uint64 Thrashing_count uint64 Thrashing_delay_total uint64 + Ac_btime64 uint64 } type cpuMask uint32 diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64.go b/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64.go index 602d8b4ee..741519099 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64.go @@ -287,6 +287,7 @@ type Taskstats struct { Freepages_delay_total uint64 Thrashing_count uint64 Thrashing_delay_total uint64 + Ac_btime64 uint64 } type cpuMask uint64 diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64le.go b/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64le.go index 6db9a7b73..046c2debd 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64le.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64le.go @@ -287,6 +287,7 @@ type Taskstats struct { Freepages_delay_total uint64 Thrashing_count uint64 Thrashing_delay_total uint64 + Ac_btime64 uint64 } type cpuMask uint64 diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_riscv64.go b/vendor/golang.org/x/sys/unix/ztypes_linux_riscv64.go index 52b5348c2..0f2f61a6a 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_riscv64.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_riscv64.go @@ -305,6 +305,7 @@ type Taskstats struct { Freepages_delay_total uint64 Thrashing_count uint64 Thrashing_delay_total uint64 + Ac_btime64 uint64 } type cpuMask uint64 diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_s390x.go b/vendor/golang.org/x/sys/unix/ztypes_linux_s390x.go index a111387b3..cca1b6be2 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_s390x.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_s390x.go @@ -300,6 +300,7 @@ type Taskstats struct { Freepages_delay_total uint64 Thrashing_count uint64 Thrashing_delay_total uint64 + Ac_btime64 uint64 } type cpuMask uint64 diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_sparc64.go b/vendor/golang.org/x/sys/unix/ztypes_linux_sparc64.go index 8153af181..33a73bf18 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_sparc64.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_sparc64.go @@ -282,6 +282,7 @@ type Taskstats struct { Freepages_delay_total uint64 Thrashing_count uint64 Thrashing_delay_total uint64 + Ac_btime64 uint64 } type cpuMask uint64 diff --git a/vendor/golang.org/x/sys/windows/dll_windows.go b/vendor/golang.org/x/sys/windows/dll_windows.go index d77711341..82076fb74 100644 --- a/vendor/golang.org/x/sys/windows/dll_windows.go +++ b/vendor/golang.org/x/sys/windows/dll_windows.go @@ -104,6 +104,35 @@ func (d *DLL) MustFindProc(name string) *Proc { return p } +// FindProcByOrdinal searches DLL d for procedure by ordinal and returns *Proc +// if found. It returns an error if search fails. +func (d *DLL) FindProcByOrdinal(ordinal uintptr) (proc *Proc, err error) { + a, e := GetProcAddressByOrdinal(d.Handle, ordinal) + name := "#" + itoa(int(ordinal)) + if e != nil { + return nil, &DLLError{ + Err: e, + ObjName: name, + Msg: "Failed to find " + name + " procedure in " + d.Name + ": " + e.Error(), + } + } + p := &Proc{ + Dll: d, + Name: name, + addr: a, + } + return p, nil +} + +// MustFindProcByOrdinal is like FindProcByOrdinal but panics if search fails. +func (d *DLL) MustFindProcByOrdinal(ordinal uintptr) *Proc { + p, e := d.FindProcByOrdinal(ordinal) + if e != nil { + panic(e) + } + return p +} + // Release unloads DLL d from memory. func (d *DLL) Release() (err error) { return FreeLibrary(d.Handle) diff --git a/vendor/golang.org/x/sys/windows/env_windows.go b/vendor/golang.org/x/sys/windows/env_windows.go index f482a9fab..92ac05ff4 100644 --- a/vendor/golang.org/x/sys/windows/env_windows.go +++ b/vendor/golang.org/x/sys/windows/env_windows.go @@ -8,7 +8,6 @@ package windows import ( "syscall" - "unicode/utf16" "unsafe" ) @@ -40,17 +39,11 @@ func (token Token) Environ(inheritExisting bool) (env []string, err error) { defer DestroyEnvironmentBlock(block) blockp := uintptr(unsafe.Pointer(block)) for { - entry := (*[(1 << 30) - 1]uint16)(unsafe.Pointer(blockp))[:] - for i, v := range entry { - if v == 0 { - entry = entry[:i] - break - } - } + entry := UTF16PtrToString((*uint16)(unsafe.Pointer(blockp))) if len(entry) == 0 { break } - env = append(env, string(utf16.Decode(entry))) + env = append(env, entry) blockp += 2 * (uintptr(len(entry)) + 1) } return env, nil diff --git a/vendor/golang.org/x/sys/windows/security_windows.go b/vendor/golang.org/x/sys/windows/security_windows.go index 4b6eff186..9e3c44a85 100644 --- a/vendor/golang.org/x/sys/windows/security_windows.go +++ b/vendor/golang.org/x/sys/windows/security_windows.go @@ -7,6 +7,8 @@ package windows import ( "syscall" "unsafe" + + "golang.org/x/sys/internal/unsafeheader" ) const ( @@ -1229,7 +1231,7 @@ func (sd *SECURITY_DESCRIPTOR) String() string { return "" } defer LocalFree(Handle(unsafe.Pointer(sddl))) - return UTF16ToString((*[(1 << 30) - 1]uint16)(unsafe.Pointer(sddl))[:]) + return UTF16PtrToString(sddl) } // ToAbsolute converts a self-relative security descriptor into an absolute one. @@ -1307,9 +1309,17 @@ func (absoluteSD *SECURITY_DESCRIPTOR) ToSelfRelative() (selfRelativeSD *SECURIT } func (selfRelativeSD *SECURITY_DESCRIPTOR) copySelfRelativeSecurityDescriptor() *SECURITY_DESCRIPTOR { - sdBytes := make([]byte, selfRelativeSD.Length()) - copy(sdBytes, (*[(1 << 31) - 1]byte)(unsafe.Pointer(selfRelativeSD))[:len(sdBytes)]) - return (*SECURITY_DESCRIPTOR)(unsafe.Pointer(&sdBytes[0])) + sdLen := (int)(selfRelativeSD.Length()) + + var src []byte + h := (*unsafeheader.Slice)(unsafe.Pointer(&src)) + h.Data = unsafe.Pointer(selfRelativeSD) + h.Len = sdLen + h.Cap = sdLen + + dst := make([]byte, sdLen) + copy(dst, src) + return (*SECURITY_DESCRIPTOR)(unsafe.Pointer(&dst[0])) } // SecurityDescriptorFromString converts an SDDL string describing a security descriptor into a @@ -1391,6 +1401,6 @@ func ACLFromEntries(explicitEntries []EXPLICIT_ACCESS, mergedACL *ACL) (acl *ACL } defer LocalFree(Handle(unsafe.Pointer(winHeapACL))) aclBytes := make([]byte, winHeapACL.aclSize) - copy(aclBytes, (*[(1 << 31) - 1]byte)(unsafe.Pointer(winHeapACL))[:len(aclBytes)]) + copy(aclBytes, (*[(1 << 31) - 1]byte)(unsafe.Pointer(winHeapACL))[:len(aclBytes):len(aclBytes)]) return (*ACL)(unsafe.Pointer(&aclBytes[0])), nil } diff --git a/vendor/golang.org/x/sys/windows/syscall_windows.go b/vendor/golang.org/x/sys/windows/syscall_windows.go index 053d664d0..12c0544cb 100644 --- a/vendor/golang.org/x/sys/windows/syscall_windows.go +++ b/vendor/golang.org/x/sys/windows/syscall_windows.go @@ -13,6 +13,8 @@ import ( "time" "unicode/utf16" "unsafe" + + "golang.org/x/sys/internal/unsafeheader" ) type Handle uintptr @@ -117,6 +119,32 @@ func UTF16PtrFromString(s string) (*uint16, error) { return &a[0], nil } +// UTF16PtrToString takes a pointer to a UTF-16 sequence and returns the corresponding UTF-8 encoded string. +// If the pointer is nil, this returns the empty string. This assumes that the UTF-16 sequence is terminated +// at a zero word; if the zero word is not present, the program may crash. +func UTF16PtrToString(p *uint16) string { + if p == nil { + return "" + } + if *p == 0 { + return "" + } + + // Find NUL terminator. + n := 0 + for ptr := unsafe.Pointer(p); *(*uint16)(ptr) != 0; n++ { + ptr = unsafe.Pointer(uintptr(ptr) + unsafe.Sizeof(*p)) + } + + var s []uint16 + h := (*unsafeheader.Slice)(unsafe.Pointer(&s)) + h.Data = unsafe.Pointer(p) + h.Len = n + h.Cap = n + + return string(utf16.Decode(s)) +} + func Getpagesize() int { return 4096 } // NewCallback converts a Go function to a function pointer conforming to the stdcall calling convention. @@ -1181,7 +1209,12 @@ type IPv6Mreq struct { Interface uint32 } -func GetsockoptInt(fd Handle, level, opt int) (int, error) { return -1, syscall.EWINDOWS } +func GetsockoptInt(fd Handle, level, opt int) (int, error) { + v := int32(0) + l := int32(unsafe.Sizeof(v)) + err := Getsockopt(fd, int32(level), int32(opt), (*byte)(unsafe.Pointer(&v)), &l) + return int(v), err +} func SetsockoptLinger(fd Handle, level, opt int, l *Linger) (err error) { sys := sysLinger{Onoff: uint16(l.Onoff), Linger: uint16(l.Linger)} @@ -1378,7 +1411,7 @@ func (t Token) KnownFolderPath(folderID *KNOWNFOLDERID, flags uint32) (string, e return "", err } defer CoTaskMemFree(unsafe.Pointer(p)) - return UTF16ToString((*[(1 << 30) - 1]uint16)(unsafe.Pointer(p))[:]), nil + return UTF16PtrToString(p), nil } // RtlGetVersion returns the version of the underlying operating system, ignoring diff --git a/vendor/modules.txt b/vendor/modules.txt index d1f2d07b5..57610bac9 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -2,7 +2,7 @@ cloud.google.com/go/compute/metadata # contrib.go.opencensus.io/exporter/ocagent v0.4.12 contrib.go.opencensus.io/exporter/ocagent -# github.com/Azure/azure-pipeline-go v0.2.1 +# github.com/Azure/azure-pipeline-go v0.2.2 github.com/Azure/azure-pipeline-go/pipeline # github.com/Azure/azure-sdk-for-go v32.4.0+incompatible github.com/Azure/azure-sdk-for-go/storage @@ -156,13 +156,14 @@ github.com/go-git/go-billy/v5/helper/chroot github.com/go-git/go-billy/v5/helper/polyfill github.com/go-git/go-billy/v5/osfs github.com/go-git/go-billy/v5/util -# github.com/go-git/go-git/v5 v5.0.0 +# github.com/go-git/go-git/v5 v5.1.0 github.com/go-git/go-git/v5 github.com/go-git/go-git/v5/config github.com/go-git/go-git/v5/internal/revision github.com/go-git/go-git/v5/internal/url github.com/go-git/go-git/v5/plumbing github.com/go-git/go-git/v5/plumbing/cache +github.com/go-git/go-git/v5/plumbing/color github.com/go-git/go-git/v5/plumbing/filemode github.com/go-git/go-git/v5/plumbing/format/config github.com/go-git/go-git/v5/plumbing/format/diff @@ -318,7 +319,7 @@ github.com/huaweicloud/huaweicloud-sdk-go-v3/core/response github.com/huaweicloud/huaweicloud-sdk-go-v3/core/sdkerr github.com/huaweicloud/huaweicloud-sdk-go-v3/services/evs/v2 github.com/huaweicloud/huaweicloud-sdk-go-v3/services/evs/v2/model -# github.com/imdario/mergo v0.3.8 +# github.com/imdario/mergo v0.3.9 github.com/imdario/mergo # github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 github.com/jbenet/go-context/io @@ -339,13 +340,13 @@ github.com/konsorten/go-windows-terminal-sequences github.com/kr/text # github.com/magiconair/properties v1.8.1 github.com/magiconair/properties -# github.com/mattn/go-ieproxy v0.0.0-20190610004146-91bb50d98149 +# github.com/mattn/go-ieproxy v0.0.0-20190702010315-6dee0af9227d github.com/mattn/go-ieproxy # github.com/micro/cli/v2 v2.1.2 github.com/micro/cli/v2 # github.com/micro/go-log v0.1.0 github.com/micro/go-log -# github.com/micro/go-micro/v2 v2.6.0 +# github.com/micro/go-micro/v2 v2.9.1 github.com/micro/go-micro/v2 github.com/micro/go-micro/v2/api github.com/micro/go-micro/v2/auth @@ -353,6 +354,7 @@ github.com/micro/go-micro/v2/auth/jwt github.com/micro/go-micro/v2/auth/provider github.com/micro/go-micro/v2/auth/provider/basic github.com/micro/go-micro/v2/auth/provider/oauth +github.com/micro/go-micro/v2/auth/rules github.com/micro/go-micro/v2/auth/service github.com/micro/go-micro/v2/auth/service/proto github.com/micro/go-micro/v2/auth/token @@ -436,12 +438,11 @@ github.com/micro/go-micro/v2/transport github.com/micro/go-micro/v2/transport/http github.com/micro/go-micro/v2/transport/memory github.com/micro/go-micro/v2/util/addr +github.com/micro/go-micro/v2/util/auth github.com/micro/go-micro/v2/util/backoff github.com/micro/go-micro/v2/util/buf -github.com/micro/go-micro/v2/util/config github.com/micro/go-micro/v2/util/grpc github.com/micro/go-micro/v2/util/http -github.com/micro/go-micro/v2/util/jitter github.com/micro/go-micro/v2/util/kubernetes/api github.com/micro/go-micro/v2/util/kubernetes/client github.com/micro/go-micro/v2/util/log @@ -455,6 +456,11 @@ github.com/micro/go-micro/v2/util/socket github.com/micro/go-micro/v2/util/tls github.com/micro/go-micro/v2/util/wrapper github.com/micro/go-micro/v2/web +# github.com/micro/go-plugins/registry/kubernetes/v2 v2.9.1 +github.com/micro/go-plugins/registry/kubernetes/v2 +github.com/micro/go-plugins/registry/kubernetes/v2/client +github.com/micro/go-plugins/registry/kubernetes/v2/client/api +github.com/micro/go-plugins/registry/kubernetes/v2/client/watch # github.com/miekg/dns v1.1.27 github.com/miekg/dns # github.com/mitchellh/go-homedir v1.1.0 @@ -528,7 +534,7 @@ github.com/stretchr/testify/mock github.com/subosito/gotenv # github.com/ugorji/go/codec v1.1.7 github.com/ugorji/go/codec -# github.com/webrtcn/s3client v0.0.0-20180425024203-6590fd04c8e8 +# github.com/webrtcn/s3client v0.0.0-20200722082950-4e45a005eff3 github.com/webrtcn/s3client github.com/webrtcn/s3client/models # github.com/xanzy/ssh-agent v0.2.1 @@ -595,7 +601,7 @@ golang.org/x/crypto/ssh/knownhosts # golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f golang.org/x/lint golang.org/x/lint/golint -# golang.org/x/net v0.0.0-20200506145744-7e3656a0809f +# golang.org/x/net v0.0.0-20200602114024-627f9648deb9 golang.org/x/net/bpf golang.org/x/net/context golang.org/x/net/context/ctxhttp @@ -622,8 +628,9 @@ golang.org/x/oauth2/jws golang.org/x/oauth2/jwt # golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e golang.org/x/sync/semaphore -# golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd +# golang.org/x/sys v0.0.0-20200523222454-059865788121 golang.org/x/sys/cpu +golang.org/x/sys/internal/unsafeheader golang.org/x/sys/unix golang.org/x/sys/windows golang.org/x/sys/windows/registry From c326810939c06181015eb3b300c630bc4034875d Mon Sep 17 00:00:00 2001 From: kumarashit Date: Sat, 27 Mar 2021 13:34:23 +0530 Subject: [PATCH 2/3] Adding script for create multicloud release and images and upload --- release_multicloud | 75 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100755 release_multicloud diff --git a/release_multicloud b/release_multicloud new file mode 100755 index 000000000..b79d3e719 --- /dev/null +++ b/release_multicloud @@ -0,0 +1,75 @@ +#!/usr/bin/env python3 + +# Copyright 2021 The SODA Authors. +# +# 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. + +import sys, os, argparse + +image_name = "sodafoundation/multi-cloud-" +service_list = ["api", "block", "file", "s3", "datamover", "dataflow", "backend"] +valid_input = ["y", "Y", "Yes", "YES"] +helper = ["-h" "--help"] + +#Make changes in the Makefile +def make_makefile_changes(tag): + with open("Makefile", "rt") as inp: + data = inp.read() + data = data.replace('latest', tag) + inp.close() + with open("Makefile", "wt") as inp: + inp.write(data) + inp.close() + +#revert changes in the Makefile +def revert_makefile_changes(tag): + with open("Makefile", "rt") as inp: + data = inp.read() + data = data.replace(tag, 'latest') + inp.close() + with open("Makefile", "wt") as inp: + inp.write(data) + inp.close() + +# make docker +def make_docker_image(): + os.system('make docker') + +# push the image to dockerhub +def push_image(tag): + for name in service_list: + image = image_name + name + ':' + tag + print("Pushing image %s" % image) + cmd = "docker push %s" % image + os.system(cmd) + +# Create release binary +def make_release_binary(): + os.system("make dist") + + +#Change the release version as per the input +if __name__ == "__main__": + value = input("Enter the release version: ") + os.environ["VERSION"] = value + os.system('echo $VERSION') + test_run = input("Do you want to run test coverage before build and release? ") + if test_run in valid_input: + cmd = "./install/CI/coverage" + os.system(cmd) + + make_makefile_changes(value) + make_docker_image() + push_image(value) + make_release_binary() + revert_makefile_changes(value) From f60ca52164fd24443f378540dee167ba0a00067c Mon Sep 17 00:00:00 2001 From: kumarashit Date: Sat, 27 Mar 2021 17:43:06 +0530 Subject: [PATCH 3/3] Adding mod vendor go flags --- Makefile | 14 +++++----- go.mod | 3 +-- go.sum | 80 +++++++++++++++++++++++++++++--------------------------- 3 files changed, 50 insertions(+), 47 deletions(-) diff --git a/Makefile b/Makefile index cbbdbf293..8f90b00a6 100644 --- a/Makefile +++ b/Makefile @@ -30,25 +30,25 @@ prebuild: mkdir -p $(BUILD_DIR) api: prebuild - CGO_ENABLED=0 GOOS=linux go build -ldflags '-w -s -extldflags "-static"' -o $(BUILD_DIR)/api github.com/opensds/multi-cloud/api/cmd + CGO_ENABLED=0 GOOS=linux go build -ldflags 'GOFLAGS=-mod=vendor -w -s -extldflags "-static"' -o $(BUILD_DIR)/api github.com/opensds/multi-cloud/api/cmd backend: prebuild - CGO_ENABLED=0 GOOS=linux go build -ldflags '-w -s -extldflags "-static"' -o $(BUILD_DIR)/backend github.com/opensds/multi-cloud/backend/cmd + CGO_ENABLED=0 GOOS=linux go build -ldflags 'GOFLAGS=-mod=vendor -w -s -extldflags "-static"' -o $(BUILD_DIR)/backend github.com/opensds/multi-cloud/backend/cmd s3: prebuild - CGO_ENABLED=1 GOOS=linux go build -ldflags '-w -s -extldflags "-dynamic"' -o $(BUILD_DIR)/s3 github.com/opensds/multi-cloud/s3/cmd + CGO_ENABLED=1 GOOS=linux go build -ldflags 'GOFLAGS=-mod=vendor -w -s -extldflags "-dynamic"' -o $(BUILD_DIR)/s3 github.com/opensds/multi-cloud/s3/cmd dataflow: prebuild - CGO_ENABLED=0 GOOS=linux go build -ldflags '-w -s -extldflags "-static"' -o $(BUILD_DIR)/dataflow github.com/opensds/multi-cloud/dataflow/cmd + CGO_ENABLED=0 GOOS=linux go build -ldflags 'GOFLAGS=-mod=vendor -w -s -extldflags "-static"' -o $(BUILD_DIR)/dataflow github.com/opensds/multi-cloud/dataflow/cmd datamover: prebuild - CGO_ENABLED=0 GOOS=linux go build -ldflags '-w -s -extldflags "-static"' -o $(BUILD_DIR)/datamover github.com/opensds/multi-cloud/datamover/cmd + CGO_ENABLED=0 GOOS=linux go build -ldflags 'GOFLAGS=-mod=vendor -w -s -extldflags "-static"' -o $(BUILD_DIR)/datamover github.com/opensds/multi-cloud/datamover/cmd file: prebuild - CGO_ENABLED=0 GOOS=linux go build -ldflags '-w -s -extldflags "-static"' -o $(BUILD_DIR)/file github.com/opensds/multi-cloud/file/cmd + CGO_ENABLED=0 GOOS=linux go build -ldflags 'GOFLAGS=-mod=vendor -w -s -extldflags "-static"' -o $(BUILD_DIR)/file github.com/opensds/multi-cloud/file/cmd block: prebuild - CGO_ENABLED=0 GOOS=linux go build -ldflags '-w -s -extldflags "-static"' -o $(BUILD_DIR)/block github.com/opensds/multi-cloud/block/cmd + CGO_ENABLED=0 GOOS=linux go build -ldflags 'GOFLAGS=-mod=vendor -w -s -extldflags "-static"' -o $(BUILD_DIR)/block github.com/opensds/multi-cloud/block/cmd docker: build diff --git a/go.mod b/go.mod index dffef4797..626d762a1 100644 --- a/go.mod +++ b/go.mod @@ -29,7 +29,6 @@ require ( github.com/huaweicloud/huaweicloud-sdk-go-v3 v0.0.16-beta github.com/journeymidnight/radoshttpd v0.0.0-20190617133011-609666b51136 github.com/journeymidnight/yig v2.0.0+incompatible - github.com/mholt/certmagic v0.9.3 // indirect github.com/micro/go-log v0.1.0 github.com/micro/go-micro/v2 v2.9.1 github.com/micro/go-plugins/registry/kubernetes/v2 v2.9.1 @@ -40,6 +39,7 @@ require ( github.com/spf13/afero v1.2.2 // indirect github.com/spf13/jwalterweatherman v1.1.0 // indirect github.com/spf13/viper v1.6.3 + github.com/stretchr/objx v0.2.0 // indirect github.com/stretchr/testify v1.5.1 github.com/ugorji/go/codec v1.1.7 github.com/webrtcn/s3client v0.0.0-20200722082950-4e45a005eff3 @@ -51,6 +51,5 @@ require ( google.golang.org/protobuf v1.22.0 gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f gopkg.in/natefinch/lumberjack.v2 v2.0.0 - gopkg.in/src-d/go-git.v4 v4.13.1 // indirect k8s.io/apimachinery v0.18.5 ) diff --git a/go.sum b/go.sum index 6552c7b79..a81b0cbdf 100644 --- a/go.sum +++ b/go.sum @@ -17,47 +17,32 @@ dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7 github.com/Azure/azure-pipeline-go v0.2.1/go.mod h1:UGSo8XybXnIGZ3epmeBw7Jdz+HiUVpqIlpz/HKHylF4= github.com/Azure/azure-pipeline-go v0.2.2 h1:6oiIS9yaG6XCCzhgAgKFfIWyo4LLCiDhZot6ltoThhY= github.com/Azure/azure-pipeline-go v0.2.2/go.mod h1:4rQ/NZncSvGqNkkOsNpOU1tgoNuIlp9AfUH5G1tvCHc= -github.com/Azure/azure-pipeline-go v0.2.3 h1:7U9HBg1JFK3jHl5qmo4CTZKFTVgMwdFHMVtCdfBE21U= -github.com/Azure/azure-pipeline-go v0.2.3/go.mod h1:x841ezTBIMG6O3lAcl8ATHnsOPVl2bqk7S3ta6S6u4k= github.com/Azure/azure-sdk-for-go v32.4.0+incompatible h1:1JP8SKfroEakYiQU2ZyPDosh8w2Tg9UopKt88VyQPt4= github.com/Azure/azure-sdk-for-go v32.4.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= github.com/Azure/azure-storage-blob-go v0.8.0 h1:53qhf0Oxa0nOjgbDeeYPUeyiNmafAFEY95rZLK0Tj6o= github.com/Azure/azure-storage-blob-go v0.8.0/go.mod h1:lPI3aLPpuLTeUwh1sViKXFxwl2B6teiRqI0deQUvsw0= -github.com/Azure/azure-storage-blob-go v0.9.0 h1:kORqvzXP8ORhKbW13FflGUaSE5CMyDWun9UwMxY8gPs= -github.com/Azure/azure-storage-blob-go v0.9.0/go.mod h1:8UBPbiOhrMQ4pLPi3gA1tXnpjrS76UYE/fo5A40vf4g= -github.com/Azure/azure-storage-blob-go v0.10.0 h1:evCwGreYo3XLeBV4vSxLbLiYb6e0SzsJiXQVRGsRXxs= -github.com/Azure/azure-storage-blob-go v0.10.0/go.mod h1:ep1edmW+kNQx4UfWM9heESNmQdijykocJ0YOxmMX8SE= github.com/Azure/azure-storage-file-go v0.7.0 h1:yWoV0MYwzmoSgWACcVkdPolvAULFPNamcQLpIvS/Et4= github.com/Azure/azure-storage-file-go v0.7.0/go.mod h1:3w3mufGcMjcOJ3w+4Gs+5wsSgkT7xDwWWqMMIrXtW4c= github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8= github.com/Azure/go-autorest/autorest v0.1.0/go.mod h1:AKyIcETwSUFxIcs/Wnq/C+kwCtlEYGUVd7FPNb2slmg= github.com/Azure/go-autorest/autorest v0.5.0 h1:Mlm9qy2fpQ9MvfyI41G2Zf5B4CsgjjNbLOWszfK6KrY= github.com/Azure/go-autorest/autorest v0.5.0/go.mod h1:9HLKlQjVBH6U3oDfsXOeVc56THsLPw1L03yban4xThw= -github.com/Azure/go-autorest/autorest v0.9.0 h1:MRvx8gncNaXJqOoLmhNjUAKh33JJF8LyxPhomEtOsjs= -github.com/Azure/go-autorest/autorest v0.9.0/go.mod h1:xyHB1BMZT0cuDHU7I0+g046+BFDTQ8rEZB0s4Yfa6bI= github.com/Azure/go-autorest/autorest/adal v0.1.0/go.mod h1:MeS4XhScH55IST095THyTxElntu7WqB7pNbZo8Q5G3E= github.com/Azure/go-autorest/autorest/adal v0.2.0 h1:7IBDu1jgh+ADHXnEYExkV9RE/ztOOlxdACkkPRthGKw= github.com/Azure/go-autorest/autorest/adal v0.2.0/go.mod h1:MeS4XhScH55IST095THyTxElntu7WqB7pNbZo8Q5G3E= -github.com/Azure/go-autorest/autorest/adal v0.5.0/go.mod h1:8Z9fGy2MpX0PvDjB1pEgQTmVqjGhiHBW7RJJEciWzS0= -github.com/Azure/go-autorest/autorest/adal v0.8.3 h1:O1AGG9Xig71FxdX9HO5pGNyZ7TbSyHaVg+5eJO/jSGw= -github.com/Azure/go-autorest/autorest/adal v0.8.3/go.mod h1:ZjhuQClTqx435SRJ2iMlOxPYt3d2C/T/7TiQCVZSn3Q= github.com/Azure/go-autorest/autorest/azure/auth v0.1.0/go.mod h1:Gf7/i2FUpyb/sGBLIFxTBzrNzBo7aPXXE3ZVeDRwdpM= github.com/Azure/go-autorest/autorest/azure/cli v0.1.0/go.mod h1:Dk8CUAt/b/PzkfeRsWzVG9Yj3ps8mS8ECztu43rdU8U= github.com/Azure/go-autorest/autorest/date v0.1.0 h1:YGrhWfrgtFs84+h0o46rJrlmsZtyZRg470CqAXTZaGM= github.com/Azure/go-autorest/autorest/date v0.1.0/go.mod h1:plvfp3oPSKwf2DNjlBjWF/7vwR+cUD/ELuzDCXwHUVA= -github.com/Azure/go-autorest/autorest/date v0.2.0 h1:yW+Zlqf26583pE43KhfnhFcdmSWlm5Ew6bxipnr/tbM= -github.com/Azure/go-autorest/autorest/date v0.2.0/go.mod h1:vcORJHLJEh643/Ioh9+vPmf1Ij9AEBM5FuBIXLmIy0g= +github.com/Azure/go-autorest/autorest/mocks v0.1.0 h1:Kx+AUU2Te+A3JIyYn6Dfs+cFgx5XorQKuIXrZGoq/SI= github.com/Azure/go-autorest/autorest/mocks v0.1.0/go.mod h1:OTyCOPRA2IgIlWxVYxBee2F5Gr4kF2zd2J5cFRaIDN0= -github.com/Azure/go-autorest/autorest/mocks v0.2.0/go.mod h1:OTyCOPRA2IgIlWxVYxBee2F5Gr4kF2zd2J5cFRaIDN0= -github.com/Azure/go-autorest/autorest/mocks v0.3.0/go.mod h1:a8FDP3DYzQ4RYfVAxAN3SVSiiO77gL2j2ronKKP0syM= +github.com/Azure/go-autorest/autorest/to v0.2.0 h1:nQOZzFCudTh+TvquAtCRjM01VEYx85e9qbwt5ncW4L8= github.com/Azure/go-autorest/autorest/to v0.2.0/go.mod h1:GunWKJp1AEqgMaGLV+iocmRAJWqST1wQYhyyjXJ3SJc= github.com/Azure/go-autorest/autorest/validation v0.1.0/go.mod h1:Ha3z/SqBeaalWQvokg3NZAlQTalVMtOIAs1aGK7G6u8= github.com/Azure/go-autorest/logger v0.1.0 h1:ruG4BSDXONFRrZZJ2GUXDiUyVpayPmb1GnWeHDdaNKY= github.com/Azure/go-autorest/logger v0.1.0/go.mod h1:oExouG+K6PryycPJfVSxi/koC6LSNgds39diKLz7Vrc= github.com/Azure/go-autorest/tracing v0.1.0 h1:TRBxC5Pj/fIuh4Qob0ZpkggbfT8RC0SubHbpV3p4/Vc= github.com/Azure/go-autorest/tracing v0.1.0/go.mod h1:ROEEAFwXycQw7Sn3DXNtEedEvdeRAgDr0izn4z5Ij88= -github.com/Azure/go-autorest/tracing v0.5.0 h1:TRn4WjSnkcSy5AEG3pnbtFSwNtwzjr4VYyQflFE619k= -github.com/Azure/go-autorest/tracing v0.5.0/go.mod h1:r/s2XiOKccPW3HrqB+W0TQzfbtp2fGCgRFtBroKn4Dk= github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= @@ -70,9 +55,11 @@ github.com/PuerkitoBio/purell v1.0.0/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbt github.com/PuerkitoBio/urlesc v0.0.0-20160726150825-5bd2802263f2/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= github.com/Shopify/sarama v1.19.0 h1:9oksLxC6uxVPHPVYUmq6xhr1BOF/hHobWH2UzO67z1s= github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo= +github.com/Shopify/toxiproxy v2.1.4+incompatible h1:TKdv8HiTLgE5wdJuEML90aBgNWsokNbMijUGhmcoBJc= github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI= github.com/akamai/AkamaiOPEN-edgegrid-golang v0.9.0/go.mod h1:zpDJeKyp9ScW4NNrbdr+Eyxvry3ilGPewKoXw3XGN1k= github.com/alangpierce/go-forceexport v0.0.0-20160317203124-8f1d6941cd75/go.mod h1:uAXEEpARkRhCZfEvy/y0Jcc888f9tHCc1W7/UeEtreE= +github.com/alcortesm/tgz v0.0.0-20161220082320-9c5fe88206d7 h1:uSoVVbwJiQipAclBbw+8quDsfcvFjOpI5iCf4p/cqCs= github.com/alcortesm/tgz v0.0.0-20161220082320-9c5fe88206d7/go.mod h1:6zEj6s6u/ghQa61ZWa/C2Aw3RkjiTBOix7dkqa1VLIs= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= @@ -80,29 +67,33 @@ github.com/aliyun/alibaba-cloud-sdk-go v0.0.0-20190808125512-07798873deee/go.mod github.com/aliyun/aliyun-oss-go-sdk v0.0.0-20190307165228-86c17b95fcd5/go.mod h1:T/Aws4fEfogEE9v+HPhhw+CntffsBHJ8nXQCwKr0/g8= github.com/aliyun/aliyun-oss-go-sdk v2.0.8+incompatible h1:WaOAKiuezSaRKAYeSf5IjxuAy/0Gx7ts6qWhKWPZf7s= github.com/aliyun/aliyun-oss-go-sdk v2.0.8+incompatible/go.mod h1:T/Aws4fEfogEE9v+HPhhw+CntffsBHJ8nXQCwKr0/g8= +github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239 h1:kFOfPq6dUM1hTo4JG6LR5AXSUEsOjtdm0kw0FtQtMJA= github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239/go.mod h1:2FmKhYUyUczH0OGQWaF5ceTx0UBShxjsH6f8oGKYe2c= github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= +github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= github.com/aws/aws-sdk-go v1.23.0/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= github.com/aws/aws-sdk-go v1.30.26 h1:wP0N6DBb/3EyHTtWNz4jzgGVi1l290zoFGfu4HFGeM0= github.com/aws/aws-sdk-go v1.30.26/go.mod h1:5zCpMtNQVjRREroY7sYe8lOMRSxkhG6MZveU8YkpAk0= +github.com/baiyubin/aliyun-sts-go-sdk v0.0.0-20180326062324-cfa1a18b161f h1:ZNv7On9kyUzm7fvRZumSyy/IUiSC7AzL0I1jKKtwooA= github.com/baiyubin/aliyun-sts-go-sdk v0.0.0-20180326062324-cfa1a18b161f/go.mod h1:AuiFmCCPBSrqvVMvuqFuk0qogytodnVFVSN5CeJB8Gc= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= +github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= github.com/bitly/go-simplejson v0.5.0 h1:6IH+V8/tVMab511d5bn4M7EwGXZf9Hj6i2xSwkNEM+Y= github.com/bitly/go-simplejson v0.5.0/go.mod h1:cXHtHw4XUPsvGaxgjIAn8PhEWG9NfngEKAMDJEczWVA= github.com/blang/semver v3.1.0+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk= +github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869 h1:DDGfHa7BWjL4YnC6+E63dPcxHo2sUxDIu8g3QgEJdRY= github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869/go.mod h1:Ekp36dRnpXw/yCqJaO+ZrUyxD+3VXMFFr56k5XYrpB4= github.com/bsm/sarama-cluster v2.1.15+incompatible h1:RkV6WiNRnqEEbp81druK8zYhmnIgdOjqSVi0+9Cnl2A= github.com/bsm/sarama-cluster v2.1.15+incompatible/go.mod h1:r7ao+4tTNXvWm+VRpRJchr2kQhqxgmAp2iEX5W96gMM= github.com/bwmarrin/discordgo v0.20.2/go.mod h1:O9S4p+ofTFwB02em7jkpkV8M3R0/PUVOwN61zSZ0r4Q= github.com/caddyserver/certmagic v0.10.6/go.mod h1:Y8jcUBctgk/IhpAzlHKfimZNyXCkfGgRTC0orl8gROQ= -github.com/cenkalti/backoff/v3 v3.0.0/go.mod h1:cIeZDE3IrqwwJl6VUwCN6trj1oXrTS4rc0ij+ULvLYs= github.com/cenkalti/backoff/v4 v4.0.0/go.mod h1:eEew/i+1Q6OrCDZh3WiXYv3+nJwBASZ8Bog/87DQnVg= github.com/census-instrumentation/opencensus-proto v0.2.0/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/census-instrumentation/opencensus-proto v0.2.1 h1:glEXhBS5PSLLv4IXzLA5yPRVX4bilULVyxxbrfOtDAk= @@ -123,11 +114,13 @@ github.com/containerd/go-runc v0.0.0-20180907222934-5a6d9f37cfa3/go.mod h1:IV7qH github.com/containerd/ttrpc v0.0.0-20190828154514-0e0f228740de/go.mod h1:PvCDdDGpgqzQIzDW1TphrGLssLDZp2GuS+X5DkEJB8o= github.com/containerd/typeurl v0.0.0-20180627222232-a93fcdb778cd/go.mod h1:Cm3kwCdlkCfMSHURc+r6fwoGH6/F1hH3S4sg0rLFWPc= github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= +github.com/coreos/bbolt v1.3.3 h1:n6AiVyVRKQFNb6mJlwESEvvLoDyiTzXX7ORAUlkeBdY= github.com/coreos/bbolt v1.3.3/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= github.com/coreos/etcd v3.3.13+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= github.com/coreos/etcd v3.3.18+incompatible h1:Zz1aXgDrFFi1nadh58tA9ktt06cmPTwNNP3dXwIq1lE= github.com/coreos/etcd v3.3.18+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= +github.com/coreos/go-semver v0.3.0 h1:wkHLiw0WNATZnSG7epLsujiMCgPAc9xhjJ4tgnAxmfM= github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/go-systemd v0.0.0-20190719114852-fd7a80b32e1f h1:JOrtw2xFKzlg+cbHpyrpLDmnN1HqhBfnX7WDiW7eG2c= @@ -138,7 +131,6 @@ github.com/cpu/goacmedns v0.0.1/go.mod h1:sesf/pNnCYwUevQEQfEwY0Y3DydlQWSGZbaMEl github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/cpuguy83/go-md2man/v2 v2.0.0 h1:EoUDS0afbrsXAZ9YQ9jdu/mZ2sXgT1/2yyNng4PGlyM= github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= -github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= 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= @@ -147,6 +139,7 @@ github.com/dgrijalva/jwt-go v3.2.0+incompatible h1:7qlOGliEKZXTDg6OTjfoBKDXWrumC github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= github.com/dimchansky/utfbom v1.1.0/go.mod h1:rO41eb7gLfo8SF1jd9F8HplJm1Fewwi4mQvIirEdv+8= +github.com/dnaeon/go-vcr v0.0.0-20180814043457-aafff18a5cc2 h1:G9/PqfhOrt8JXnw0DGTfVoOkKHDhOlEZqhE/cu+NvQM= github.com/dnaeon/go-vcr v0.0.0-20180814043457-aafff18a5cc2/go.mod h1:aBB1+wY4s93YsC3HHjMBMrwTj2R9FHDzUr9KyGc8n1E= github.com/dnsimple/dnsimple-go v0.30.0/go.mod h1:O5TJ0/U6r7AfT8niYNlmohpLbCSG+c71tQlGr9SeGrg= github.com/docker/distribution v2.7.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= @@ -176,6 +169,7 @@ github.com/evanphx/json-patch/v5 v5.0.0/go.mod h1:G79N1coSVB93tBe7j6PhzjmR3/2Vvl github.com/exoscale/egoscale v0.18.1/go.mod h1:Z7OOdzzTOz1Q1PjQXumlz9Wn/CddH0zSYdCF3rnBKXE= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= +github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568 h1:BHsljHzVlRcyQhjrss6TZTdY2VfCqZPbv5k3iBFa2ZQ= github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI435gkrCt3MPfRiAkVrwSbHsst4LCFVfpJc= github.com/forestgiant/sliceutil v0.0.0-20160425183142-94783f95db6c/go.mod h1:pFdJbAhRf7rh6YYMUdIQGyzne6zYL1tCUW8QV2B3UfY= github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I= @@ -185,10 +179,10 @@ github.com/ghodss/yaml v0.0.0-20150909031657-73d445a93680/go.mod h1:4dBDuWmgqj2H github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/ghodss/yaml v1.0.1-0.20190212211648-25d852aebe32 h1:Mn26/9ZMNWSw9C9ERFA1PUxfmGpolnw2v0bKOREu5ew= github.com/ghodss/yaml v1.0.1-0.20190212211648-25d852aebe32/go.mod h1:GIjDIg/heH5DOkXY3YJ/wNhfHsQHoXGjl8G8amsYQ1I= +github.com/gliderlabs/ssh v0.2.2 h1:6zsha5zo/TWhRhwqCD3+EarCAgZ2yN28ipRnGPnwkI0= github.com/gliderlabs/ssh v0.2.2/go.mod h1:U7qILu1NlMHj9FlMhZLlkCdDnU1DBEAqr0aevW3Awn0= github.com/globalsign/mgo v0.0.0-20181015135952-eeefdecb41b8 h1:DujepqpGd1hyOd7aW59XpK7Qymp8iy83xq74fLr21is= github.com/globalsign/mgo v0.0.0-20181015135952-eeefdecb41b8/go.mod h1:xkRDCp4j0OGD1HRkm4kmhM+pmpv3AKq5SU7GMg4oO/Q= -github.com/go-acme/lego/v3 v3.3.0/go.mod h1:iGSY2vQrvQs3WezicSB/oVbO2eCrD88dpWPwb1qLqu0= github.com/go-acme/lego/v3 v3.4.0/go.mod h1:xYbLDuxq3Hy4bMUT1t9JIuz6GWIWb3m5X+TeTHYaT7M= github.com/go-cmd/cmd v1.0.5/go.mod h1:y8q8qlK5wQibcw63djSl/ntiHUHXHGdCkPk0j4QeW4s= github.com/go-errors/errors v1.0.1/go.mod h1:f4zRHt4oKfwPJE5k8C9vpYG+aDHdBFUsgrm6/TyX73Q= @@ -196,6 +190,7 @@ github.com/go-git/gcfg v1.5.0 h1:Q5ViNfGF8zFgyJWPqYwA7qGFoMTEiBmdlkcfRmpIMa4= github.com/go-git/gcfg v1.5.0/go.mod h1:5m20vg6GwYabIxaOonVkTdrILxQMpEShl1xiMF4ua+E= github.com/go-git/go-billy/v5 v5.0.0 h1:7NQHvd9FVid8VL4qVUMm8XifBK+2xCoZ2lSk0agRrHM= github.com/go-git/go-billy/v5 v5.0.0/go.mod h1:pmpqyWchKfYfrkb/UVH4otLvyi/5gJlGI4Hb3ZqZ3W0= +github.com/go-git/go-git-fixtures/v4 v4.0.1 h1:q+IFMfLx200Q3scvt2hN79JsEzy4AmBTp/pqnefH+Bc= github.com/go-git/go-git-fixtures/v4 v4.0.1/go.mod h1:m+ICp2rF3jDhFgEZ/8yziagdT1C+ZpZcrJjappBCDSw= github.com/go-git/go-git/v5 v5.1.0 h1:HxJn9g/E7eYvKW3Fm7Jt4ee8LXfPOm/H1cdDu8vEssk= github.com/go-git/go-git/v5 v5.1.0/go.mod h1:ZKfuPUoY1ZqIG4QG9BDBh3G4gLM5zvPuSJAozQrZuyM= @@ -233,9 +228,11 @@ github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zV github.com/gogo/protobuf v1.3.1 h1:DqDEcV5aeaTmdFBePNpYsp3FlcVH/2ISVVM9Qf8PSls= github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= github.com/goji/httpauth v0.0.0-20160601135302-2da839ab0f4d/go.mod h1:nnjvkQ9ptGaCkuDUx6wNykzzlUixGxvkme+H/lnzb+A= +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/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e h1:1r7pUrabqp18hOBcwBwiTsbnFeTZHV9eER/QT5JVZxY= github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= @@ -257,10 +254,12 @@ github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8l github.com/golang/snappy v0.0.1 h1:Qgr9rKW7uDUkrbSmQeiDsGa8SjGyCOGtuasMWwvp2P4= github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/btree v1.0.0 h1:0udJVsspx3VBr5FwtLhQQtuAsVc79tTq0ocGIPAU6qo= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.4.0 h1:xsAVV57WRhGj6kEIi8ReJzQlHHqcBYCElAvkovg3B/4= github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= @@ -279,6 +278,7 @@ github.com/googleapis/gnostic v0.1.0/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTV github.com/gophercloud/gophercloud v0.3.0/go.mod h1:vxM41WHh5uqHVBMZHzuwNOHh8XEoIEcSTewFxm1c5g8= github.com/gophercloud/gophercloud v0.10.0 h1:Et+UGxoD72pK6K+46uOwyVxbtXJ6KBkWAegXBmqlf6c= github.com/gophercloud/gophercloud v0.10.0/go.mod h1:gmC5oQqMDOMO1t1gq5DquX/yAU808e/4mzjjDA76+Ss= +github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1 h1:EGx4pi6eqNxGaHF6qqu48+N2wcFQ5qg5FXgOdqsJ5d8= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg= github.com/gorilla/handlers v1.4.2/go.mod h1:Qkdc/uu4tH4g6mTK6auzZ766c4CA0Ng8+o/OAirnOIQ= @@ -286,9 +286,12 @@ github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2z github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= github.com/gorilla/websocket v1.2.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= +github.com/gorilla/websocket v1.4.1 h1:q7AeDBpnBk8AogcD4DSag/Ukw/KV+YhzLj2bP5HvKCM= github.com/gorilla/websocket v1.4.1/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= +github.com/grpc-ecosystem/go-grpc-middleware v1.1.0 h1:THDBEeQ9xZ8JEaCLyLQqXMMdRqNr0QAUJTIkQAUtFjg= github.com/grpc-ecosystem/go-grpc-middleware v1.1.0/go.mod h1:f5nM7jw/oeRSadq3xCzHAvxcr8HZnzsqU6ILg/0NiiE= +github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 h1:Ovs26xHkKqVztRpIrF/92BcuyuQ/YW4NSIpoGtfXNho= github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= github.com/grpc-ecosystem/grpc-gateway v1.8.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= @@ -344,6 +347,7 @@ github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJS github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= github.com/jmespath/go-jmespath v0.3.0 h1:OS12ieG61fsCg5+qLJ+SsW9NicxNkg3b25OyT2yCeUc= github.com/jmespath/go-jmespath v0.3.0/go.mod h1:9QtRXoHjLGCJ5IBSaohpXITPlowMeeYCZ7fLUTSywik= +github.com/jonboulle/clockwork v0.1.0 h1:VKV+ZcuP6l3yW9doeqz6ziZGgcynBVQO+obU0+0hcPo= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= github.com/journeymidnight/radoshttpd v0.0.0-20190617133011-609666b51136 h1:ioRwpqJIOz8DOhriRNkd2/DYXYLi44N61N9MnjozzuM= github.com/journeymidnight/radoshttpd v0.0.0-20190617133011-609666b51136/go.mod h1:crzxK1DDd3sNyFWzwbx/84lTNk4TO4wsvjl186nH+R4= @@ -357,6 +361,7 @@ github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/u github.com/json-iterator/go v1.1.10 h1:Kz6Cvnvv2wGdaG/V8yMvfkmNiXq9Ya2KUv4rouJJr68= github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= +github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo= github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= github.com/kevinburke/ssh_config v0.0.0-20190725054713-01f96b0aa0cd h1:Coekwdh0v2wtGp9Gmz1Ze3eVRAWJMLokvN3QjdzCHLY= @@ -364,7 +369,6 @@ github.com/kevinburke/ssh_config v0.0.0-20190725054713-01f96b0aa0cd/go.mod h1:CT github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/klauspost/cpuid v1.2.0/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= github.com/klauspost/cpuid v1.2.3/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= github.com/kolo/xmlrpc v0.0.0-20190717152603-07c4ee3fd181/go.mod h1:o03bZfuBwAXHetKXuInt4S7omeXUu62/A845kiycsSQ= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= @@ -372,10 +376,10 @@ github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxv github.com/konsorten/go-windows-terminal-sequences v1.0.3 h1:CE8S1cTafDpPvMhIxNJKvHsGVBgn1xWYf1NbHQhywc8= github.com/konsorten/go-windows-terminal-sequences v1.0.3/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/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/pty v1.1.5/go.mod h1:9r2w37qlBe7rQ6e1fg1S/9xpWHSnaqNdHD3WcMdbPDA= -github.com/kr/pty v1.1.8/go.mod h1:O1sed60cT9XZ5uDucP5qwvh+TE3NnUj51EiZO/lmSfw= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= @@ -395,14 +399,12 @@ github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaO github.com/mattn/go-ieproxy v0.0.0-20190610004146-91bb50d98149/go.mod h1:31jz6HNzdxOmlERGGEc4v/dMssOfmp2p5bT/okiKFFc= github.com/mattn/go-ieproxy v0.0.0-20190702010315-6dee0af9227d h1:oNAwILwmgWKFpuU+dXvI6dl9jG2mAWAZLX3r9s0PPiw= github.com/mattn/go-ieproxy v0.0.0-20190702010315-6dee0af9227d/go.mod h1:31jz6HNzdxOmlERGGEc4v/dMssOfmp2p5bT/okiKFFc= -github.com/mattn/go-ieproxy v0.0.1 h1:qiyop7gCflfhwCzGyeT0gro3sF9AIg9HU98JORTkqfI= -github.com/mattn/go-ieproxy v0.0.1/go.mod h1:pYabZ6IHcRpFh7vIaLfK7rdcWgFEb3SFJ6/gNWuh88E= github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= github.com/mattn/go-runewidth v0.0.4/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= github.com/mattn/go-tty v0.0.0-20180219170247-931426f7535a/go.mod h1:XPvLUNfbS4fJH25nqRHfWLMa1ONC8Amw+mIA639KxkE= +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/mholt/certmagic v0.9.3/go.mod h1:nu8jbsbtwK4205EDH/ZUMTKsfYpJA1Q7MKXHfgTihNw= github.com/micro/cli/v2 v2.1.2 h1:43J1lChg/rZCC1rvdqZNFSQDrGT7qfMrtp6/ztpIkEM= github.com/micro/cli/v2 v2.1.2/go.mod h1:EguNh6DAoWKm9nmk+k/Rg0H3lQnDxqzu5x5srOtGtYg= github.com/micro/go-log v0.1.0 h1:szYSR+yyTsomZM2jyinJC5562DlqffSjHmTZFaeZ2vY= @@ -440,6 +442,7 @@ github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+ github.com/namedotcom/go v0.0.0-20180403034216-08470befbe04/go.mod h1:5sN+Lt1CaY4wsPvgQH/jsuJi4XO2ssZbdsIizr4CVC8= github.com/nats-io/jwt v0.3.2 h1:+RB5hMpXUUA2dfxuhBTEkMOrYmM+gKIZYS1KjSostMI= github.com/nats-io/jwt v0.3.2/go.mod h1:/euKqTS1ZD+zzjYrY7pseZrTtWQSjujC7xjPc8wL6eU= +github.com/nats-io/nats-server/v2 v2.1.6 h1:qAaHZaS8pRRNQLFaiBA1rq5WynyEGp9DFgmMfoaiXGY= github.com/nats-io/nats-server/v2 v2.1.6/go.mod h1:BL1NOtaBQ5/y97djERRVWNouMW7GT3gxnmbE/eC8u8A= github.com/nats-io/nats.go v1.9.2 h1:oDeERm3NcZVrPpdR/JpGdWHMv3oJ8yY30YwxKq+DU2s= github.com/nats-io/nats.go v1.9.2/go.mod h1:AjGArbfyR50+afOUotNX2Xs5SYHf+CoOa5HH1eEl2HE= @@ -453,7 +456,6 @@ github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWb github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/nlopes/slack v0.6.1-0.20191106133607-d06c2a2b3249/go.mod h1:JzQ9m3PMAqcpeCam7UaHSuBuupz7CmpjehYMayT6YOk= github.com/nrdcg/auroradns v1.0.0/go.mod h1:6JPXKzIRzZzMqtTDgueIhTi6rFf1QvYE/HzqidhOhjw= -github.com/nrdcg/dnspod-go v0.3.0/go.mod h1:vZSoFSFeQVm2gWLMkyX61LZ8HI3BaqtHZWgPTGKr6KQ= github.com/nrdcg/dnspod-go v0.4.0/go.mod h1:vZSoFSFeQVm2gWLMkyX61LZ8HI3BaqtHZWgPTGKr6KQ= github.com/nrdcg/goinwx v0.6.1/go.mod h1:XPiut7enlbEdntAqalBIqcYcTEVhpv/dKWgDCX2SwKQ= github.com/nrdcg/namesilo v0.2.1/go.mod h1:lwMvfQTyYq+BbjJd30ylEG4GPSS6PII0Tia4rRpRiyw= @@ -463,9 +465,11 @@ github.com/olekukonko/tablewriter v0.0.1/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXW github.com/onsi/ginkgo v0.0.0-20170829012221-11459a886d9c/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.11.0 h1:JAKSXpt1YjtLA7YpPiqO9ss6sNXEsPfSGdwN0UHqzrw= github.com/onsi/ginkgo v1.11.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= +github.com/onsi/gomega v1.7.0 h1:XPnZz8VVBHjVsy1vzJmRwIcSwiUO+JFfrv/xGiigmME= github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/opencontainers/go-digest v0.0.0-20180430190053-c9281466c8b2/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= github.com/opencontainers/go-digest v1.0.0-rc1/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= @@ -483,7 +487,6 @@ github.com/oxtoacart/bpool v0.0.0-20190530202638-03653db5a59c/go.mod h1:X07ZCGwU github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/patrickmn/go-cache v2.1.0+incompatible h1:HRMgzkcYKYpi3C8ajMPV8OFXaaRUnok+kx1WdO15EQc= github.com/patrickmn/go-cache v2.1.0+incompatible/go.mod h1:3Qf8kWWT7OJRJbdiICTKqZju1ZixQ/KpMGzzAfe6+WQ= -github.com/pelletier/go-buffruneio v0.2.0/go.mod h1:JkE26KsDizTr40EUHkXVtNPvgGtbSNq5BcowyYOWdKo= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= github.com/pelletier/go-toml v1.4.0 h1:u3Z1r+oOXJIkxqw34zVhyPgjBsm6X2wn21NWs/HfSeg= github.com/pelletier/go-toml v1.4.0/go.mod h1:PN7xzY2wHTK0K9p34ErDQMlFxa51Fk0OUruD3k1mMwo= @@ -500,21 +503,25 @@ github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXP github.com/prometheus/client_golang v0.9.3-0.20190127221311-3c4408c8b829/go.mod h1:p2iRAGwDERtqlqzRXnrOVns+ignqQo//hLXqYxZYVNs= github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= +github.com/prometheus/client_golang v1.1.0 h1:BQ53HtBmfOitExawJ6LokA4x8ov/z0SYYb0+HxJfRI8= github.com/prometheus/client_golang v1.1.0/go.mod h1:I1FGZT9+L76gKKOs5djB6ezCbFQP1xR9D75/vuwEF3g= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4 h1:gQz4mCbXsO+nc9n1hCxHcGA3Zx3Eo+UHZoInFGUIXNM= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= github.com/prometheus/common v0.2.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= +github.com/prometheus/common v0.6.0 h1:kRhiuYSXR3+uv2IbVbZhUxK5zVD/2pp3Gd2PpvPkpEo= github.com/prometheus/common v0.6.0/go.mod h1:eBmuwkDJBwy6iBfxCBob6t6dR6ENT/y+J+Zk0j9GMYc= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.3/go.mod h1:4A/X28fw3Fc593LaREMrKMqOKvUAntwMDaekg4FpcdQ= +github.com/prometheus/procfs v0.0.5 h1:3+auTFlqw+ZaQYJARz6ArODtkaIwtvBTx3N2NehQlL8= github.com/prometheus/procfs v0.0.5/go.mod h1:4A/X28fw3Fc593LaREMrKMqOKvUAntwMDaekg4FpcdQ= github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= github.com/rainycape/memcache v0.0.0-20150622160815-1031fa0ce2f2/go.mod h1:7tZKcyumwBO6qip7RNQ5r77yrssm9bfCowcLEBcU5IA= @@ -532,7 +539,6 @@ github.com/ryanuber/go-glob v1.0.0/go.mod h1:807d1WSdnB0XRJzKNil9Om6lcp/3a0v4qIH github.com/sacloud/libsacloud v1.26.1/go.mod h1:79ZwATmHLIFZIMd7sxA3LwzVy/B77uj3LDoToVTxDoQ= github.com/satori/go.uuid v1.2.0 h1:0uYX9dsZ2yD7q2RtLRtPSdGDWzjeM3TbMJP9utgA0ww= github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0= -github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= github.com/sergi/go-diff v1.1.0 h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0= github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= github.com/shurcooL/sanitized_anchor_name v1.0.0 h1:PdmoCO6wvbs+7yrJyMORt4/BmY5IYyJwS/kOiWx8mHo= @@ -543,9 +549,12 @@ github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6Mwd github.com/sirupsen/logrus v1.6.0 h1:UBcNElsrwanuuMsnGSlYmtmgbb23qDR5dG+6X6Oo89I= github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= github.com/skratchdot/open-golang v0.0.0-20160302144031-75fb7ed4208c/go.mod h1:sUM3LWHvSMaG192sy56D9F7CNvL7jUJVXoqM1QKLnog= +github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d h1:zE9ykElWQ6/NYmHa3jpm/yHnI4xSofP+UP6SpjHcSeM= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= github.com/smartystreets/goconvey v0.0.0-20190330032615-68dc04aab96a/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= +github.com/smartystreets/goconvey v1.6.4 h1:fv0U8FUIMPNf1L9lnHLvLhgicrIVChEkdzIKYqbNC9s= github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= +github.com/soheilhy/cmux v0.1.4 h1:0HKaf1o97UwFjHH9o5XsHUOF+tqmdA7KEzXLpiyaw0E= github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= @@ -562,7 +571,6 @@ github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/spf13/viper v1.6.3 h1:pDDu1OyEDTKzpJwdq4TiuLyMsUgRa/BT5cn5O62NoHs= github.com/spf13/viper v1.6.3/go.mod h1:jUMtyi0/lB5yZH/FjyGAoH7IMNrIhlBf6pXZmbMDvzw= -github.com/src-d/gcfg v1.4.0/go.mod h1:p/UMsR43ujA89BJY9duynAwIpvqEujIH/jFlfL7jWoI= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.2.0 h1:Hbg2NidpLE8veEBkEZTL3CvlkUIVzuU9jDplZO54c48= @@ -578,6 +586,7 @@ github.com/syndtr/gocapability v0.0.0-20170704070218-db04d3cc01c8/go.mod h1:hkRG github.com/technoweenie/multipartstreamer v1.0.1/go.mod h1:jNVxdtShOxzAsukZwTSw6MDx5eUJoiEBsSvzDU9uzog= github.com/timewasted/linode v0.0.0-20160829202747-37e84520dcf7/go.mod h1:imsgLplxEC/etjIhdr3dNzV3JeT27LbVu5pYWm0JCBY= github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= +github.com/tmc/grpc-websocket-proxy v0.0.0-20200122045848-3419fae592fc h1:yUaosFVTJwnltaHbSNC3i82I92quFs+OFPRl8kNMVwo= github.com/tmc/grpc-websocket-proxy v0.0.0-20200122045848-3419fae592fc/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/transip/gotransip v0.0.0-20190812104329-6d8d9179b66f/go.mod h1:i0f4R4o2HM0m3DZYQWsj6/MEowD57VzoH0v3d7igeFY= github.com/uber-go/atomic v1.3.2/go.mod h1:/Ct5t2lcmbJ4OSe/waGBoaVvVqtO0bmtfVNex1PFV8g= @@ -596,11 +605,13 @@ github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2 github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ= github.com/xeipuuv/gojsonschema v0.0.0-20180618132009-1d523034197f/go.mod h1:5yf86TLmAcydyeJq5YvxkGPE2fm/u4myDekKRoLuqhs= github.com/xeipuuv/gojsonschema v1.1.0/go.mod h1:5yf86TLmAcydyeJq5YvxkGPE2fm/u4myDekKRoLuqhs= +github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2 h1:eY9dn8+vbi4tKz5Qo6v2eYzo7kUS51QINcR5jNpbZS8= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= github.com/xxtea/xxtea-go v0.0.0-20170828040851-35c4b17eecf6 h1:S+0oS/OPAe0kdSpQ7GAnCmpcDL7Jh2iJMjZTV6mYbPo= github.com/xxtea/xxtea-go v0.0.0-20170828040851-35c4b17eecf6/go.mod h1:2uvuCBt0VXxijrX5ieiAeeNT2+2MIsrs1DI9iXz7OOQ= go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= +go.etcd.io/bbolt v1.3.4 h1:hi1bXHMVrlQh6WwxAy+qZCV/SYIlqo+Ushwdpa4tAKg= go.etcd.io/bbolt v1.3.4/go.mod h1:G5EMThwa9y8QZGBClrRx5EY+Yw9kAhnjy3bSjsnlVTQ= go.opencensus.io v0.20.1/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= go.opencensus.io v0.20.2/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= @@ -636,7 +647,6 @@ golang.org/x/crypto v0.0.0-20190829043050-9756ffdc2472/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20190927123631-a832865fa7ad/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191202143827-86a70503ff7e/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20191206172530-e9b2fee46413/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200302210943-78000ba7a073/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200323165209-0ec3e9974c59/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200510223506-06a226fb4e37/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= @@ -687,7 +697,6 @@ golang.org/x/net v0.0.0-20190923162816-aa69164e4478/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20190930134127-c5a3c61f89f3/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20191004110552-13f9640d40b9/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20191027093000-83d349e8ac1a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20191112182307-2180aed22343/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20191126235420-ef20fe5d7933/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -736,15 +745,12 @@ golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190924154521-2837fb4f24fe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191022100944-742c48ecaeb7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191112214154-59a1497f0cea/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191128015809-6d18c012aee9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200523222454-059865788121 h1:rITEj+UZHYC927n8GT97eC3zrpzXdb/voyeOuVKS46o= golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200602225109-6fdc65e7d980 h1:OjiUf46hAmXblsZdnoSXsEUSKU8r1UEzcL5RVZ4gO9Y= -golang.org/x/sys v0.0.0-20200602225109-6fdc65e7d980/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/text v0.0.0-20160726164857-2910a502d2bf/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -773,7 +779,6 @@ golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBn golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190729092621-ff9f1409240a/go.mod h1:jcCCGcm9btYwXyDqrUWc6MKQKKGJCWEQ3AfLSRIbEuI= golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= @@ -786,6 +791,7 @@ golang.org/x/tools v0.0.0-20191216173652-a0e659d51361 h1:RIIXAeV6GvDBuADKumTODat golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/api v0.3.1/go.mod h1:6wY9I6uQWHQ8EM57III9mq/AjF+i8G65rmVagqKMtkk= google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= @@ -852,9 +858,6 @@ gopkg.in/resty.v1 v1.9.1/go.mod h1:vo52Hzryw9PnPHcJfPsBiFW62XhNx5OczbV9y+IMpgc= gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= 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/src-d/go-billy.v4 v4.3.2/go.mod h1:nDjArDMp+XMs1aFAESLRjfGSgfvoYN0hDfzEk0GjC98= -gopkg.in/src-d/go-git-fixtures.v3 v3.5.0/go.mod h1:dLBcvytrw/TYZsNTWCnkNF2DSIlzWYqTe3rJR56Ac7g= -gopkg.in/src-d/go-git.v4 v4.13.1/go.mod h1:nx5NYcxdKxq5fpltdHnPa2Exj4Sx0EclMWZQbYDu2z8= gopkg.in/telegram-bot-api.v4 v4.6.4/go.mod h1:5DpGO5dbumb40px+dXcwCpcjmeHNYLpk0bp3XRNvWDM= 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= @@ -888,4 +891,5 @@ rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8 sigs.k8s.io/structured-merge-diff/v3 v3.0.0-20200116222232-67a7b8c61874/go.mod h1:PlARxl6Hbt/+BC80dRLi1qAmnMqwqDg62YvvVkZjemw= sigs.k8s.io/structured-merge-diff/v3 v3.0.0/go.mod h1:PlARxl6Hbt/+BC80dRLi1qAmnMqwqDg62YvvVkZjemw= sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= +sigs.k8s.io/yaml v1.2.0 h1:kr/MCeFWJWTwyaHoR9c8EjH9OumOmoF9YGiZd7lFm/Q= sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc=