From 5485a83787e11f866df8b18bff5f680755fb2953 Mon Sep 17 00:00:00 2001 From: PoAn Yang Date: Wed, 17 Apr 2024 16:14:26 +0800 Subject: [PATCH 1/2] feat: add longhorn/types Signed-off-by: PoAn Yang --- go.mod | 2 +- go.sum | 89 +-------- vendor/github.com/longhorn/types/LICENSE | 177 +++++++++++++++++ .../types/pkg/generated/smrpc/smrpc.pb.go | 169 ++++++++++++++++ .../pkg/generated/smrpc/smrpc_grpc.pb.go | 184 ++++++++++++++++++ vendor/modules.txt | 5 +- 6 files changed, 537 insertions(+), 89 deletions(-) create mode 100644 vendor/github.com/longhorn/types/LICENSE create mode 100644 vendor/github.com/longhorn/types/pkg/generated/smrpc/smrpc.pb.go create mode 100644 vendor/github.com/longhorn/types/pkg/generated/smrpc/smrpc_grpc.pb.go diff --git a/go.mod b/go.mod index 1bbb1eb2..eacc19af 100644 --- a/go.mod +++ b/go.mod @@ -33,6 +33,7 @@ replace ( require ( github.com/google/fscrypt v0.3.5 github.com/longhorn/go-common-libs v0.0.0-20240411093823-b8862efb8e03 + github.com/longhorn/types v0.0.0-20240417064442-e7df610ea802 github.com/mitchellh/go-ps v1.0.0 github.com/pkg/errors v0.9.1 github.com/sirupsen/logrus v1.9.3 @@ -52,7 +53,6 @@ require ( github.com/fsnotify/fsnotify v1.7.0 // indirect github.com/go-logr/logr v1.3.0 // indirect github.com/go-ole/go-ole v1.2.6 // indirect - github.com/golang/protobuf v1.5.4 // indirect github.com/google/uuid v1.6.0 // indirect github.com/moby/sys/mountinfo v0.6.2 // indirect github.com/opencontainers/selinux v1.11.0 // indirect diff --git a/go.sum b/go.sum index e31246af..1a301546 100644 --- a/go.sum +++ b/go.sum @@ -1,10 +1,6 @@ -github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/BurntSushi/toml v0.4.1/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ= github.com/BurntSushi/toml v1.3.2/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ= github.com/c9s/goprocinfo v0.0.0-20210130143923-c95fcf8c64a8 h1:SjZ2GvvOononHOpK84APFuMvxqsk3tEIaKH/z4Rpu3g= github.com/c9s/goprocinfo v0.0.0-20210130143923-c95fcf8c64a8/go.mod h1:uEyr4WpAH4hio6LFriaPkL938XnrvLpNPmQHBdrmbIE= -github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= -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.2 h1:p1EgwI/C7NhT0JmVkwCD2ZBK8j4aeHQX2pMHHBfMQ6w= github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -16,16 +12,10 @@ github.com/go-logr/logr v1.3.0 h1:2y3SDp0ZXuc6/cjLSZ+Q3ir+QB9T/iG5yYRXqsagWSY= github.com/go-logr/logr v1.3.0/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-ole/go-ole v1.2.6 h1:/Fpf6oFPoeFik9ty7siob0G6Ke8QvQEuVcuChpwXzpY= github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= -github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= -github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= -github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= -github.com/google/fscrypt v0.3.4 h1:XGSVMIsQFooj82aRRfYn3JpgU/4fOTnzXPnjhxC8uH8= -github.com/google/fscrypt v0.3.4/go.mod h1:BRpw7vaeDitXGRvXa281i/ivQszAdBIiUYDWHjVTkcs= github.com/google/fscrypt v0.3.5 h1:RunYtVg2Z79hfh1W1ZP1k7TaSMYkbELUyMMzAmikyTc= github.com/google/fscrypt v0.3.5/go.mod h1:HyY8Z/kUPrnIKAwuhjrn2tSTM5/s9zfRRTqRMG0mHks= -github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= @@ -36,14 +26,10 @@ github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/longhorn/go-common-libs v0.0.0-20240307063052-6e77996eda29 h1:tyzIDCMjQGQzhqAtdJaeEMAaNUZJD/sHERXp+tYc+ms= -github.com/longhorn/go-common-libs v0.0.0-20240307063052-6e77996eda29/go.mod h1:ePLGb2r/PJBUIVoVhLOt4bLOeu0S72ZB+fWDWwC8H28= -github.com/longhorn/go-common-libs v0.0.0-20240315062830-5aa0ac1dac62 h1:ovotrq4HvaSRFgLozlNyUAvJp2eykdOwfpz4VIYZGIY= -github.com/longhorn/go-common-libs v0.0.0-20240315062830-5aa0ac1dac62/go.mod h1:ePLGb2r/PJBUIVoVhLOt4bLOeu0S72ZB+fWDWwC8H28= -github.com/longhorn/go-common-libs v0.0.0-20240319112414-b75404dc7fbc h1:Eh9Npc5yBcVD8E4zVQIGUtC62HcfqevrHjQ2kh7fJ/E= -github.com/longhorn/go-common-libs v0.0.0-20240319112414-b75404dc7fbc/go.mod h1:ESTw7LYBF+dB5VndQNKXKrD6B9s/hF94lotGKXLovlM= github.com/longhorn/go-common-libs v0.0.0-20240411093823-b8862efb8e03 h1:RN7mq4FrbHcAeemI5tDha9u4X+RSRrPugD1cY1FHdvo= github.com/longhorn/go-common-libs v0.0.0-20240411093823-b8862efb8e03/go.mod h1:7onp+E4hSg2DnB40dJU0Y7adrvykGg6jHxOb48imPGg= +github.com/longhorn/types v0.0.0-20240417064442-e7df610ea802 h1:evjIqn8Ta4toYsdcfvUBXOyV64ZEo72CYe+Vfd+3STQ= +github.com/longhorn/types v0.0.0-20240417064442-e7df610ea802/go.mod h1:pqT+7B8T+nkyUZYe8tL3CwPDCHjkbe3mHUDY5ntJFyQ= github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0/go.mod h1:zJYVVT2jmtg6P3p1VtQj7WsuWi/y4VnjVBn7F8KPB3I= github.com/mitchellh/go-ps v1.0.0 h1:i6ampVEEF4wQFF+bkYfwYgY+F/uYJDktmvLPf7qIgjc= github.com/mitchellh/go-ps v1.0.0/go.mod h1:J4lOc8z8yJs6vUwklHw2XEIiT4z4C40KtWVN3nvg8Pg= @@ -59,16 +45,12 @@ github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c h1:ncq/mPwQF github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog= -github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= -github.com/shirou/gopsutil/v3 v3.24.2 h1:kcR0erMbLg5/3LcInpw0X/rrPSqq4CDPyI6A6ZRC18Y= -github.com/shirou/gopsutil/v3 v3.24.2/go.mod h1:tSg/594BcA+8UdQU2XcW803GWYgdtauFFPgJCJKZlVk= github.com/shirou/gopsutil/v3 v3.24.3 h1:eoUGJSmdfLzJ3mxIhmOAhgKEKgQkeOwKpz1NbhVnuPE= github.com/shirou/gopsutil/v3 v3.24.3/go.mod h1:JpND7O217xa72ewWz9zN2eIIkPWsDN/3pl0H8Qt0uwg= github.com/shoenig/go-m1cpu v0.1.6/go.mod h1:1JJMcUBvfNwpq05QDQVAnx3gUHr9IYF7GNg9SUEw2VQ= github.com/shoenig/test v0.6.4/go.mod h1:byHiCGXqrVaflBLAMq/srcZIHynQPQgeyvkvXnjqq0k= -github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ= github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= @@ -78,116 +60,51 @@ github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/ github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= -github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= +github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/tklauser/go-sysconf v0.3.12/go.mod h1:Ho14jnntGE1fpdOqQEEaiKRpvIavV0hSfmBq8nJbHYI= github.com/tklauser/numcpus v0.6.1/go.mod h1:1XfjsgE2zo8GVw7POkMbHENHzVg3GzmoZ9fESEdAacY= -github.com/urfave/cli v1.22.5/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= github.com/urfave/cli v1.22.14 h1:ebbhrRiGK2i4naQJr+1Xj92HXZCrK7MsyTS/ob3HnAk= github.com/urfave/cli v1.22.14/go.mod h1:X0eDS6pD6Exaclxm99NJ3FiCDRED7vIHpx2mDOHLvkA= -github.com/wadey/gocovmerge v0.0.0-20160331181800-b5bfa59ec0ad/go.mod h1:Hy8o65+MXnS6EwGElrSRjUzQDLXreJlzYLlWiHtt8hM= -github.com/yuin/goldmark v1.4.1/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yusufpapurcu/wmi v1.2.4 h1:zFUKzehAFReQwLys1b/iSMl+JQGSCSjtVqQn9bBrPo0= github.com/yusufpapurcu/wmi v1.2.4/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0= -golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.0.0-20220408190544-5352b0902921/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.21.0 h1:X31++rzVUdKhX5sWmSOFZxx8UW/ldWx55cbf08iNAMA= golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs= -golang.org/x/exp/typeparams v0.0.0-20220218215828-6cf2b201936e/go.mod h1:AbB0pIl9nAr9wVwH+Z2ZpaocVmF5I4GyWCDIsVjR0bk= -golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= -golang.org/x/mod v0.6.0-dev.0.20220106191415-9b9b3d81d5e3/go.mod h1:3p9vT2HGsQu2K1YbXdKPJLVgG5VJdoTa1poYQBtP1AY= -golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.22.0 h1:9sGLhx7iRIHEiX0oAJ3MRZMUCElJgy7Br1nO+AMN3Tc= -golang.org/x/net v0.22.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= golang.org/x/net v0.23.0 h1:7EYJ93RZ9vYSZAIb2x3lnuvqO5zneoD6IvWjuhfxjTs= golang.org/x/net v0.23.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= -golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201204225414-ed752295db88/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220408201424-a24fb2fb8a0f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4= golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.19.0 h1:q5f1RH2jigJ1MoAWp2KTp3gm5zAGFUTarQZ5U386+4o= golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= -golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.1.11-0.20220316014157-77aa08bb151a/go.mod h1:Uh6Zz+xoGYZom868N8YTex3t7RhtHDBrE8Gzo9bV56E= -golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240123012728-ef4313101c80 h1:AjyfHzEPEFp/NpvfN5g+KDla3EMojjhRVZc1i7cj+oM= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240123012728-ef4313101c80/go.mod h1:PAREbraiVEVGVdTZsVWjSbbTtSyGbAgIIvni8a8CD5s= google.golang.org/genproto/googleapis/rpc v0.0.0-20240227224415-6ceb2ff114de h1:cZGRis4/ot9uVm639a+rHCUaG0JJHEsdyzSQTMX+suY= google.golang.org/genproto/googleapis/rpc v0.0.0-20240227224415-6ceb2ff114de/go.mod h1:H4O17MA/PE9BsGx3w+a+W2VOLLD1Qf7oJneAoU6WktY= -google.golang.org/grpc v1.62.1 h1:B4n+nfKzOICUXMgyrNd19h/I9oH0L1pizfk1d4zSgTk= -google.golang.org/grpc v1.62.1/go.mod h1:IWTG0VlJLCh1SkC58F7np9ka9mx/WNkjl4PGJaiq+QE= google.golang.org/grpc v1.63.2 h1:MUeiw1B2maTVZthpU5xvASfTh3LDbxHd6IJ6QQVU+xM= google.golang.org/grpc v1.63.2/go.mod h1:WAX/8DgncnokcFUldAxq7GeB5DXHDbMF+lLvDomNkRA= -google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= -google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI= google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= -gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -honnef.co/go/tools v0.3.0/go.mod h1:vlRD9XErLMGT+mDuofSr0mMMquscM/1nQqtRSsh6m70= -k8s.io/apimachinery v0.29.2 h1:EWGpfJ856oj11C52NRCHuU7rFDwxev48z+6DSlGNsV8= -k8s.io/apimachinery v0.29.2/go.mod h1:6HVkd1FwxIagpYrHSwJlQqZI3G9LfYWRPAkUvLnXTKU= -k8s.io/apimachinery v0.29.3 h1:2tbx+5L7RNvqJjn7RIuIKu9XTsIZ9Z5wX2G22XAa5EU= -k8s.io/apimachinery v0.29.3/go.mod h1:hx/S4V2PNW4OMg3WizRrHutyB5la0iCUbZym+W0EQIU= k8s.io/apimachinery v0.29.4 h1:RaFdJiDmuKs/8cm1M6Dh1Kvyh59YQFDcFuFTSmXes6Q= k8s.io/apimachinery v0.29.4/go.mod h1:i3FJVwhvSp/6n8Fl4K97PJEP8C+MM+aoDq4+ZJBf70Y= k8s.io/klog/v2 v2.110.1 h1:U/Af64HJf7FcwMcXyKm2RPM22WZzyR7OSpYj5tg3cL0= k8s.io/klog/v2 v2.110.1/go.mod h1:YGtd1984u+GgbuZ7e08/yBuAfKLSO0+uR1Fhi6ExXjo= -k8s.io/kubernetes v1.29.2 h1:8hh1cntqdulanjQt7wSSSsJfBgOyx6fUdFWslvGL5m0= -k8s.io/kubernetes v1.29.2/go.mod h1:xZPKU0yO0CBbLTnbd+XGyRmmtmaVuJykDb8gNCkeeUE= -k8s.io/kubernetes v1.29.3 h1:EuOAKN4zpiP+kBx/0e9yS5iBkPSyLml19juOqZxBtDw= -k8s.io/kubernetes v1.29.3/go.mod h1:CP+Z+S9haxyB7J+nV6ywYry4dqlphArPXjcc0CsBVXc= k8s.io/kubernetes v1.29.4 h1:n4VCbX9cUhxHI+zw+m2iZlzT73/mrEJBHIMeauh9g4U= k8s.io/kubernetes v1.29.4/go.mod h1:28sDhcb87LX5z3GWAKYmLrhrifxi4W9bEWua4DRTIvk= -k8s.io/mount-utils v0.29.2 h1:FrUfgvOo63nqJRPXKoqN/DW1lMnR/y0pzpFErKh6p2o= -k8s.io/mount-utils v0.29.2/go.mod h1:9IWJTMe8tG0MYMLEp60xK9GYVeCdA3g4LowmnVi+t9Y= -k8s.io/mount-utils v0.29.3 h1:iEcqPP7Vv8UClH8nnMfovtmy/04fIloRW9JuSXykoZ0= -k8s.io/mount-utils v0.29.3/go.mod h1:9IWJTMe8tG0MYMLEp60xK9GYVeCdA3g4LowmnVi+t9Y= k8s.io/mount-utils v0.29.4 h1:tW/URea4gtXlaVW7VObr52NQhS+z3SXTg1GUaFZjRL4= k8s.io/mount-utils v0.29.4/go.mod h1:SHUMR9n3b6tLgEmlyT36cL6fV6Sjwa5CJhc0guCXvb0= -k8s.io/utils v0.0.0-20240102154912-e7106e64919e h1:eQ/4ljkx21sObifjzXwlPKpdGLrCfRziVtos3ofG/sQ= -k8s.io/utils v0.0.0-20240102154912-e7106e64919e/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= k8s.io/utils v0.0.0-20240310230437-4693a0247e57 h1:gbqbevonBh57eILzModw6mrkbwM0gQBEuevE/AaBsHY= k8s.io/utils v0.0.0-20240310230437-4693a0247e57/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= diff --git a/vendor/github.com/longhorn/types/LICENSE b/vendor/github.com/longhorn/types/LICENSE new file mode 100644 index 00000000..f433b1a5 --- /dev/null +++ b/vendor/github.com/longhorn/types/LICENSE @@ -0,0 +1,177 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS diff --git a/vendor/github.com/longhorn/types/pkg/generated/smrpc/smrpc.pb.go b/vendor/github.com/longhorn/types/pkg/generated/smrpc/smrpc.pb.go new file mode 100644 index 00000000..8e67a17c --- /dev/null +++ b/vendor/github.com/longhorn/types/pkg/generated/smrpc/smrpc.pb.go @@ -0,0 +1,169 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.31.0 +// protoc v4.24.3 +// source: smrpc/smrpc.proto + +package smrpc + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + emptypb "google.golang.org/protobuf/types/known/emptypb" + reflect "reflect" + sync "sync" +) + +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) +) + +type FilesystemTrimRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + EncryptedDevice bool `protobuf:"varint,1,opt,name=encrypted_device,json=encryptedDevice,proto3" json:"encrypted_device,omitempty"` +} + +func (x *FilesystemTrimRequest) Reset() { + *x = FilesystemTrimRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_smrpc_smrpc_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FilesystemTrimRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FilesystemTrimRequest) ProtoMessage() {} + +func (x *FilesystemTrimRequest) ProtoReflect() protoreflect.Message { + mi := &file_smrpc_smrpc_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) +} + +// Deprecated: Use FilesystemTrimRequest.ProtoReflect.Descriptor instead. +func (*FilesystemTrimRequest) Descriptor() ([]byte, []int) { + return file_smrpc_smrpc_proto_rawDescGZIP(), []int{0} +} + +func (x *FilesystemTrimRequest) GetEncryptedDevice() bool { + if x != nil { + return x.EncryptedDevice + } + return false +} + +var File_smrpc_smrpc_proto protoreflect.FileDescriptor + +var file_smrpc_smrpc_proto_rawDesc = []byte{ + 0x0a, 0x11, 0x73, 0x6d, 0x72, 0x70, 0x63, 0x2f, 0x73, 0x6d, 0x72, 0x70, 0x63, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x1a, 0x1b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x22, 0x42, 0x0a, 0x15, 0x46, 0x69, 0x6c, 0x65, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x54, 0x72, + 0x69, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x29, 0x0a, 0x10, 0x65, 0x6e, 0x63, + 0x72, 0x79, 0x70, 0x74, 0x65, 0x64, 0x5f, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x08, 0x52, 0x0f, 0x65, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x65, 0x64, 0x44, 0x65, + 0x76, 0x69, 0x63, 0x65, 0x32, 0xd1, 0x01, 0x0a, 0x13, 0x53, 0x68, 0x61, 0x72, 0x65, 0x4d, 0x61, + 0x6e, 0x61, 0x67, 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x42, 0x0a, 0x0e, + 0x46, 0x69, 0x6c, 0x65, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x54, 0x72, 0x69, 0x6d, 0x12, 0x16, + 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x54, 0x72, 0x69, 0x6d, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x00, + 0x12, 0x3b, 0x0a, 0x07, 0x55, 0x6e, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x16, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, + 0x70, 0x74, 0x79, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x00, 0x12, 0x39, 0x0a, + 0x05, 0x4d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x16, + 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x00, 0x42, 0x2f, 0x5a, 0x2d, 0x67, 0x69, 0x74, 0x68, + 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6c, 0x6f, 0x6e, 0x67, 0x68, 0x6f, 0x72, 0x6e, 0x2f, + 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, + 0x74, 0x65, 0x64, 0x2f, 0x73, 0x6d, 0x72, 0x70, 0x63, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x33, +} + +var ( + file_smrpc_smrpc_proto_rawDescOnce sync.Once + file_smrpc_smrpc_proto_rawDescData = file_smrpc_smrpc_proto_rawDesc +) + +func file_smrpc_smrpc_proto_rawDescGZIP() []byte { + file_smrpc_smrpc_proto_rawDescOnce.Do(func() { + file_smrpc_smrpc_proto_rawDescData = protoimpl.X.CompressGZIP(file_smrpc_smrpc_proto_rawDescData) + }) + return file_smrpc_smrpc_proto_rawDescData +} + +var file_smrpc_smrpc_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_smrpc_smrpc_proto_goTypes = []interface{}{ + (*FilesystemTrimRequest)(nil), // 0: FilesystemTrimRequest + (*emptypb.Empty)(nil), // 1: google.protobuf.Empty +} +var file_smrpc_smrpc_proto_depIdxs = []int32{ + 0, // 0: ShareManagerService.FilesystemTrim:input_type -> FilesystemTrimRequest + 1, // 1: ShareManagerService.Unmount:input_type -> google.protobuf.Empty + 1, // 2: ShareManagerService.Mount:input_type -> google.protobuf.Empty + 1, // 3: ShareManagerService.FilesystemTrim:output_type -> google.protobuf.Empty + 1, // 4: ShareManagerService.Unmount:output_type -> google.protobuf.Empty + 1, // 5: ShareManagerService.Mount:output_type -> google.protobuf.Empty + 3, // [3:6] is the sub-list for method output_type + 0, // [0:3] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_smrpc_smrpc_proto_init() } +func file_smrpc_smrpc_proto_init() { + if File_smrpc_smrpc_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_smrpc_smrpc_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FilesystemTrimRequest); 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_smrpc_smrpc_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_smrpc_smrpc_proto_goTypes, + DependencyIndexes: file_smrpc_smrpc_proto_depIdxs, + MessageInfos: file_smrpc_smrpc_proto_msgTypes, + }.Build() + File_smrpc_smrpc_proto = out.File + file_smrpc_smrpc_proto_rawDesc = nil + file_smrpc_smrpc_proto_goTypes = nil + file_smrpc_smrpc_proto_depIdxs = nil +} diff --git a/vendor/github.com/longhorn/types/pkg/generated/smrpc/smrpc_grpc.pb.go b/vendor/github.com/longhorn/types/pkg/generated/smrpc/smrpc_grpc.pb.go new file mode 100644 index 00000000..26492c8f --- /dev/null +++ b/vendor/github.com/longhorn/types/pkg/generated/smrpc/smrpc_grpc.pb.go @@ -0,0 +1,184 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc v4.24.3 +// source: smrpc/smrpc.proto + +package smrpc + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + emptypb "google.golang.org/protobuf/types/known/emptypb" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +const ( + ShareManagerService_FilesystemTrim_FullMethodName = "/ShareManagerService/FilesystemTrim" + ShareManagerService_Unmount_FullMethodName = "/ShareManagerService/Unmount" + ShareManagerService_Mount_FullMethodName = "/ShareManagerService/Mount" +) + +// ShareManagerServiceClient is the client API for ShareManagerService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type ShareManagerServiceClient interface { + FilesystemTrim(ctx context.Context, in *FilesystemTrimRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) + Unmount(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*emptypb.Empty, error) + Mount(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*emptypb.Empty, error) +} + +type shareManagerServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewShareManagerServiceClient(cc grpc.ClientConnInterface) ShareManagerServiceClient { + return &shareManagerServiceClient{cc} +} + +func (c *shareManagerServiceClient) FilesystemTrim(ctx context.Context, in *FilesystemTrimRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, ShareManagerService_FilesystemTrim_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *shareManagerServiceClient) Unmount(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*emptypb.Empty, error) { + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, ShareManagerService_Unmount_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *shareManagerServiceClient) Mount(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*emptypb.Empty, error) { + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, ShareManagerService_Mount_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// ShareManagerServiceServer is the server API for ShareManagerService service. +// All implementations must embed UnimplementedShareManagerServiceServer +// for forward compatibility +type ShareManagerServiceServer interface { + FilesystemTrim(context.Context, *FilesystemTrimRequest) (*emptypb.Empty, error) + Unmount(context.Context, *emptypb.Empty) (*emptypb.Empty, error) + Mount(context.Context, *emptypb.Empty) (*emptypb.Empty, error) + mustEmbedUnimplementedShareManagerServiceServer() +} + +// UnimplementedShareManagerServiceServer must be embedded to have forward compatible implementations. +type UnimplementedShareManagerServiceServer struct { +} + +func (UnimplementedShareManagerServiceServer) FilesystemTrim(context.Context, *FilesystemTrimRequest) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method FilesystemTrim not implemented") +} +func (UnimplementedShareManagerServiceServer) Unmount(context.Context, *emptypb.Empty) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method Unmount not implemented") +} +func (UnimplementedShareManagerServiceServer) Mount(context.Context, *emptypb.Empty) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method Mount not implemented") +} +func (UnimplementedShareManagerServiceServer) mustEmbedUnimplementedShareManagerServiceServer() {} + +// UnsafeShareManagerServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to ShareManagerServiceServer will +// result in compilation errors. +type UnsafeShareManagerServiceServer interface { + mustEmbedUnimplementedShareManagerServiceServer() +} + +func RegisterShareManagerServiceServer(s grpc.ServiceRegistrar, srv ShareManagerServiceServer) { + s.RegisterService(&ShareManagerService_ServiceDesc, srv) +} + +func _ShareManagerService_FilesystemTrim_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(FilesystemTrimRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ShareManagerServiceServer).FilesystemTrim(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ShareManagerService_FilesystemTrim_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ShareManagerServiceServer).FilesystemTrim(ctx, req.(*FilesystemTrimRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ShareManagerService_Unmount_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(emptypb.Empty) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ShareManagerServiceServer).Unmount(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ShareManagerService_Unmount_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ShareManagerServiceServer).Unmount(ctx, req.(*emptypb.Empty)) + } + return interceptor(ctx, in, info, handler) +} + +func _ShareManagerService_Mount_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(emptypb.Empty) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ShareManagerServiceServer).Mount(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ShareManagerService_Mount_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ShareManagerServiceServer).Mount(ctx, req.(*emptypb.Empty)) + } + return interceptor(ctx, in, info, handler) +} + +// ShareManagerService_ServiceDesc is the grpc.ServiceDesc for ShareManagerService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var ShareManagerService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "ShareManagerService", + HandlerType: (*ShareManagerServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "FilesystemTrim", + Handler: _ShareManagerService_FilesystemTrim_Handler, + }, + { + MethodName: "Unmount", + Handler: _ShareManagerService_Unmount_Handler, + }, + { + MethodName: "Mount", + Handler: _ShareManagerService_Mount_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "smrpc/smrpc.proto", +} diff --git a/vendor/modules.txt b/vendor/modules.txt index 1ab7b5d7..34a5a29f 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -15,8 +15,6 @@ github.com/go-logr/logr/slogr ## explicit; go 1.12 github.com/go-ole/go-ole github.com/go-ole/go-ole/oleutil -# github.com/golang/protobuf v1.5.4 -## explicit; go 1.17 # github.com/google/fscrypt v0.3.5 ## explicit; go 1.18 github.com/google/fscrypt/filesystem @@ -35,6 +33,9 @@ github.com/longhorn/go-common-libs/sync github.com/longhorn/go-common-libs/sys github.com/longhorn/go-common-libs/types github.com/longhorn/go-common-libs/utils +# github.com/longhorn/types v0.0.0-20240417064442-e7df610ea802 +## explicit; go 1.21 +github.com/longhorn/types/pkg/generated/smrpc # github.com/mitchellh/go-ps v1.0.0 ## explicit; go 1.13 github.com/mitchellh/go-ps From 09e975ebddbb1c4c10488745d02a1fd324122ae3 Mon Sep 17 00:00:00 2001 From: PoAn Yang Date: Wed, 17 Apr 2024 16:14:36 +0800 Subject: [PATCH 2/2] feat: remove proto Signed-off-by: PoAn Yang --- app/cmd/server.go | 7 +- generate_grpc.sh | 30 -- .../pkg/rpc/smrpc_pb2.py | 30 -- .../pkg/rpc/smrpc_pb2_grpc.py | 133 ------- pkg/client/share_manager_client.go | 2 +- pkg/rpc/server.go | 15 +- pkg/rpc/smrpc.pb.go | 328 ------------------ pkg/rpc/smrpc.proto | 15 - .../protobuf/src/google/protobuf/empty.proto | 51 --- 9 files changed, 12 insertions(+), 599 deletions(-) delete mode 100755 generate_grpc.sh delete mode 100644 integration/rpc/share_manager/github/com/longhorn/longhorn_share_manager/pkg/rpc/smrpc_pb2.py delete mode 100644 integration/rpc/share_manager/github/com/longhorn/longhorn_share_manager/pkg/rpc/smrpc_pb2_grpc.py delete mode 100644 pkg/rpc/smrpc.pb.go delete mode 100644 pkg/rpc/smrpc.proto delete mode 100644 proto/vendor/protobuf/src/google/protobuf/empty.proto diff --git a/app/cmd/server.go b/app/cmd/server.go index 1d7ab19e..d649fe52 100644 --- a/app/cmd/server.go +++ b/app/cmd/server.go @@ -9,11 +9,12 @@ import ( "github.com/sirupsen/logrus" "github.com/urfave/cli" + "github.com/longhorn/types/pkg/generated/smrpc" "google.golang.org/grpc" healthpb "google.golang.org/grpc/health/grpc_health_v1" "google.golang.org/grpc/reflection" - smrpc "github.com/longhorn/longhorn-share-manager/pkg/rpc" + "github.com/longhorn/longhorn-share-manager/pkg/rpc" "github.com/longhorn/longhorn-share-manager/pkg/server" "github.com/longhorn/longhorn-share-manager/pkg/util" "github.com/longhorn/longhorn-share-manager/pkg/volume" @@ -126,9 +127,9 @@ func start(vol volume.Volume) error { } s := grpc.NewServer() - srv := smrpc.NewShareManagerServer(manager) + srv := rpc.NewShareManagerServer(manager) smrpc.RegisterShareManagerServiceServer(s, srv) - healthpb.RegisterHealthServer(s, smrpc.NewShareManagerHealthCheckServer(srv)) + healthpb.RegisterHealthServer(s, rpc.NewShareManagerHealthCheckServer(srv)) reflection.Register(s) logrus.Infof("Listening on share manager gRPC server %s", listenPort) diff --git a/generate_grpc.sh b/generate_grpc.sh deleted file mode 100755 index 6a5a3504..00000000 --- a/generate_grpc.sh +++ /dev/null @@ -1,30 +0,0 @@ -#!/bin/bash - -set -e - -# check and download dependency for gRPC code generate -if [ ! -e ./proto/vendor/protobuf/src/google/protobuf ]; then - rm -rf ./proto/vendor/protobuf/src/google/protobuf - DIR="./proto/vendor/protobuf/src/google/protobuf" - mkdir -p $DIR - wget https://raw.githubusercontent.com/protocolbuffers/protobuf/v24.3/src/google/protobuf/empty.proto -P $DIR -fi - -# Due to https://github.com/golang/protobuf/issues/1122, our .proto file names must be globally unique to avoid -# namespace conflicts (https://protobuf.dev/reference/go/faq/#namespace-conflict). The best way to achieve this is to -# include the whole Go import path in the name that gets compiled into the .pb.go file (e.g. -# "github.com/longhorn/backing-image-manager/pkg/rpc.proto" instead of "rpc.proto"). This formulation does the -# compilation inside a temporary directory prefixed with the full desired path before copying the .pb.go file out -# (similar to the way https://github.com/container-storage-interface/spec/blob/master/lib/go/Makefile does it). -PKG_DIR="pkg/rpc" -TMP_DIR_BASE=".protobuild" -TMP_DIR="${TMP_DIR_BASE}/github.com/longhorn/longhorn-share-manager/pkg/rpc" -mkdir -p "${TMP_DIR}" -cp "${PKG_DIR}/smrpc.proto" "${TMP_DIR}/smrpc.proto" -python3 -m grpc_tools.protoc -I "${TMP_DIR_BASE}" -I "proto/vendor/" -I "proto/vendor/protobuf/src/" --python_out=integration/rpc/share_manager --grpc_python_out=integration/rpc/share_manager "${TMP_DIR}/smrpc.proto" -mv integration/rpc/share_manager/github.com/longhorn/longhorn_share_manager/pkg/rpc/smrpc_pb2_grpc.py integration/rpc/share_manager/github/com/longhorn/longhorn_share_manager/pkg/rpc/smrpc_pb2_grpc.py -rm -rf integration/rpc/share_manager/github.com - -protoc -I "${TMP_DIR_BASE}" -I "proto/vendor/protobuf/src/" "${TMP_DIR}/smrpc.proto" --go_out=plugins=grpc:"${TMP_DIR_BASE}" -mv "${TMP_DIR_BASE}/github.com/longhorn/longhorn-share-manager/pkg/smrpc/smrpc.pb.go" "${PKG_DIR}/smrpc.pb.go" -rm -rf "${TMP_DIR_BASE}" diff --git a/integration/rpc/share_manager/github/com/longhorn/longhorn_share_manager/pkg/rpc/smrpc_pb2.py b/integration/rpc/share_manager/github/com/longhorn/longhorn_share_manager/pkg/rpc/smrpc_pb2.py deleted file mode 100644 index 99ec672e..00000000 --- a/integration/rpc/share_manager/github/com/longhorn/longhorn_share_manager/pkg/rpc/smrpc_pb2.py +++ /dev/null @@ -1,30 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: github.com/longhorn/longhorn-share-manager/pkg/rpc/smrpc.proto -"""Generated protocol buffer code.""" -from google.protobuf import descriptor as _descriptor -from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import symbol_database as _symbol_database -from google.protobuf.internal import builder as _builder -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 - - -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n>github.com/longhorn/longhorn-share-manager/pkg/rpc/smrpc.proto\x1a\x1bgoogle/protobuf/empty.proto\"1\n\x15\x46ilesystemTrimRequest\x12\x18\n\x10\x65ncrypted_device\x18\x01 \x01(\x08\x32\xd1\x01\n\x13ShareManagerService\x12\x42\n\x0e\x46ilesystemTrim\x12\x16.FilesystemTrimRequest\x1a\x16.google.protobuf.Empty\"\x00\x12;\n\x07Unmount\x12\x16.google.protobuf.Empty\x1a\x16.google.protobuf.Empty\"\x00\x12\x39\n\x05Mount\x12\x16.google.protobuf.Empty\x1a\x16.google.protobuf.Empty\"\x00\x42\x36Z4github.com/longhorn/longhorn-share-manager/pkg/smrpcb\x06proto3') - -_globals = globals() -_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'github.com.longhorn.longhorn_share_manager.pkg.rpc.smrpc_pb2', _globals) -if _descriptor._USE_C_DESCRIPTORS == False: - - DESCRIPTOR._options = None - DESCRIPTOR._serialized_options = b'Z4github.com/longhorn/longhorn-share-manager/pkg/smrpc' - _globals['_FILESYSTEMTRIMREQUEST']._serialized_start=95 - _globals['_FILESYSTEMTRIMREQUEST']._serialized_end=144 - _globals['_SHAREMANAGERSERVICE']._serialized_start=147 - _globals['_SHAREMANAGERSERVICE']._serialized_end=356 -# @@protoc_insertion_point(module_scope) diff --git a/integration/rpc/share_manager/github/com/longhorn/longhorn_share_manager/pkg/rpc/smrpc_pb2_grpc.py b/integration/rpc/share_manager/github/com/longhorn/longhorn_share_manager/pkg/rpc/smrpc_pb2_grpc.py deleted file mode 100644 index 0b6d075e..00000000 --- a/integration/rpc/share_manager/github/com/longhorn/longhorn_share_manager/pkg/rpc/smrpc_pb2_grpc.py +++ /dev/null @@ -1,133 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -"""Client and server classes corresponding to protobuf-defined services.""" -import grpc - -from github.com.longhorn.longhorn_share_manager.pkg.rpc import smrpc_pb2 as github_dot_com_dot_longhorn_dot_longhorn__share__manager_dot_pkg_dot_rpc_dot_smrpc__pb2 -from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 - - -class ShareManagerServiceStub(object): - """Missing associated documentation comment in .proto file.""" - - def __init__(self, channel): - """Constructor. - - Args: - channel: A grpc.Channel. - """ - self.FilesystemTrim = channel.unary_unary( - '/ShareManagerService/FilesystemTrim', - request_serializer=github_dot_com_dot_longhorn_dot_longhorn__share__manager_dot_pkg_dot_rpc_dot_smrpc__pb2.FilesystemTrimRequest.SerializeToString, - response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, - ) - self.Unmount = channel.unary_unary( - '/ShareManagerService/Unmount', - request_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, - response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, - ) - self.Mount = channel.unary_unary( - '/ShareManagerService/Mount', - request_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, - response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, - ) - - -class ShareManagerServiceServicer(object): - """Missing associated documentation comment in .proto file.""" - - def FilesystemTrim(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def Unmount(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def Mount(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - -def add_ShareManagerServiceServicer_to_server(servicer, server): - rpc_method_handlers = { - 'FilesystemTrim': grpc.unary_unary_rpc_method_handler( - servicer.FilesystemTrim, - request_deserializer=github_dot_com_dot_longhorn_dot_longhorn__share__manager_dot_pkg_dot_rpc_dot_smrpc__pb2.FilesystemTrimRequest.FromString, - response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, - ), - 'Unmount': grpc.unary_unary_rpc_method_handler( - servicer.Unmount, - request_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, - response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, - ), - 'Mount': grpc.unary_unary_rpc_method_handler( - servicer.Mount, - request_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, - response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, - ), - } - generic_handler = grpc.method_handlers_generic_handler( - 'ShareManagerService', rpc_method_handlers) - server.add_generic_rpc_handlers((generic_handler,)) - - - # This class is part of an EXPERIMENTAL API. -class ShareManagerService(object): - """Missing associated documentation comment in .proto file.""" - - @staticmethod - def FilesystemTrim(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary(request, target, '/ShareManagerService/FilesystemTrim', - github_dot_com_dot_longhorn_dot_longhorn__share__manager_dot_pkg_dot_rpc_dot_smrpc__pb2.FilesystemTrimRequest.SerializeToString, - google_dot_protobuf_dot_empty__pb2.Empty.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - - @staticmethod - def Unmount(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary(request, target, '/ShareManagerService/Unmount', - google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, - google_dot_protobuf_dot_empty__pb2.Empty.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - - @staticmethod - def Mount(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary(request, target, '/ShareManagerService/Mount', - google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, - google_dot_protobuf_dot_empty__pb2.Empty.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) diff --git a/pkg/client/share_manager_client.go b/pkg/client/share_manager_client.go index df7cdca7..0f509e3b 100644 --- a/pkg/client/share_manager_client.go +++ b/pkg/client/share_manager_client.go @@ -3,11 +3,11 @@ package client import ( "context" + rpc "github.com/longhorn/types/pkg/generated/smrpc" "github.com/pkg/errors" "google.golang.org/grpc" "google.golang.org/protobuf/types/known/emptypb" - rpc "github.com/longhorn/longhorn-share-manager/pkg/rpc" "github.com/longhorn/longhorn-share-manager/pkg/types" ) diff --git a/pkg/rpc/server.go b/pkg/rpc/server.go index c7b28343..953fd151 100644 --- a/pkg/rpc/server.go +++ b/pkg/rpc/server.go @@ -1,4 +1,4 @@ -package smrpc +package rpc import ( "fmt" @@ -8,19 +8,17 @@ import ( "time" "github.com/google/fscrypt/filesystem" + lhexec "github.com/longhorn/go-common-libs/exec" + lhtypes "github.com/longhorn/go-common-libs/types" + "github.com/longhorn/types/pkg/generated/smrpc" "github.com/pkg/errors" "github.com/sirupsen/logrus" "golang.org/x/net/context" - - "k8s.io/mount-utils" - grpccodes "google.golang.org/grpc/codes" healthpb "google.golang.org/grpc/health/grpc_health_v1" grpcstatus "google.golang.org/grpc/status" "google.golang.org/protobuf/types/known/emptypb" - - lhexec "github.com/longhorn/go-common-libs/exec" - lhtypes "github.com/longhorn/go-common-libs/types" + "k8s.io/mount-utils" "github.com/longhorn/longhorn-share-manager/pkg/server" "github.com/longhorn/longhorn-share-manager/pkg/server/nfs" @@ -37,6 +35,7 @@ const ( ) type ShareManagerServer struct { + smrpc.UnimplementedShareManagerServiceServer sync.RWMutex logger logrus.FieldLogger @@ -50,7 +49,7 @@ func NewShareManagerServer(manager *server.ShareManager) *ShareManagerServer { } } -func (s *ShareManagerServer) FilesystemTrim(ctx context.Context, req *FilesystemTrimRequest) (resp *emptypb.Empty, err error) { +func (s *ShareManagerServer) FilesystemTrim(ctx context.Context, req *smrpc.FilesystemTrimRequest) (resp *emptypb.Empty, err error) { s.Lock() defer s.Unlock() diff --git a/pkg/rpc/smrpc.pb.go b/pkg/rpc/smrpc.pb.go deleted file mode 100644 index 5d2c65c2..00000000 --- a/pkg/rpc/smrpc.pb.go +++ /dev/null @@ -1,328 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.26.0 -// protoc v4.24.3 -// source: github.com/longhorn/longhorn-share-manager/pkg/rpc/smrpc.proto - -package smrpc - -import ( - context "context" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - emptypb "google.golang.org/protobuf/types/known/emptypb" - reflect "reflect" - sync "sync" -) - -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) -) - -type FilesystemTrimRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - EncryptedDevice bool `protobuf:"varint,1,opt,name=encrypted_device,json=encryptedDevice,proto3" json:"encrypted_device,omitempty"` -} - -func (x *FilesystemTrimRequest) Reset() { - *x = FilesystemTrimRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_longhorn_longhorn_share_manager_pkg_rpc_smrpc_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *FilesystemTrimRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*FilesystemTrimRequest) ProtoMessage() {} - -func (x *FilesystemTrimRequest) ProtoReflect() protoreflect.Message { - mi := &file_github_com_longhorn_longhorn_share_manager_pkg_rpc_smrpc_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) -} - -// Deprecated: Use FilesystemTrimRequest.ProtoReflect.Descriptor instead. -func (*FilesystemTrimRequest) Descriptor() ([]byte, []int) { - return file_github_com_longhorn_longhorn_share_manager_pkg_rpc_smrpc_proto_rawDescGZIP(), []int{0} -} - -func (x *FilesystemTrimRequest) GetEncryptedDevice() bool { - if x != nil { - return x.EncryptedDevice - } - return false -} - -var File_github_com_longhorn_longhorn_share_manager_pkg_rpc_smrpc_proto protoreflect.FileDescriptor - -var file_github_com_longhorn_longhorn_share_manager_pkg_rpc_smrpc_proto_rawDesc = []byte{ - 0x0a, 0x3e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6c, 0x6f, 0x6e, - 0x67, 0x68, 0x6f, 0x72, 0x6e, 0x2f, 0x6c, 0x6f, 0x6e, 0x67, 0x68, 0x6f, 0x72, 0x6e, 0x2d, 0x73, - 0x68, 0x61, 0x72, 0x65, 0x2d, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2f, 0x70, 0x6b, 0x67, - 0x2f, 0x72, 0x70, 0x63, 0x2f, 0x73, 0x6d, 0x72, 0x70, 0x63, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x1a, 0x1b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, - 0x66, 0x2f, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x42, 0x0a, - 0x15, 0x46, 0x69, 0x6c, 0x65, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x54, 0x72, 0x69, 0x6d, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x29, 0x0a, 0x10, 0x65, 0x6e, 0x63, 0x72, 0x79, 0x70, - 0x74, 0x65, 0x64, 0x5f, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, - 0x52, 0x0f, 0x65, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x65, 0x64, 0x44, 0x65, 0x76, 0x69, 0x63, - 0x65, 0x32, 0xd1, 0x01, 0x0a, 0x13, 0x53, 0x68, 0x61, 0x72, 0x65, 0x4d, 0x61, 0x6e, 0x61, 0x67, - 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x42, 0x0a, 0x0e, 0x46, 0x69, 0x6c, - 0x65, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x54, 0x72, 0x69, 0x6d, 0x12, 0x16, 0x2e, 0x46, 0x69, - 0x6c, 0x65, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x54, 0x72, 0x69, 0x6d, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x00, 0x12, 0x3b, 0x0a, - 0x07, 0x55, 0x6e, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, - 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, - 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x00, 0x12, 0x39, 0x0a, 0x05, 0x4d, 0x6f, - 0x75, 0x6e, 0x74, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x16, 0x2e, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, - 0x70, 0x74, 0x79, 0x22, 0x00, 0x42, 0x36, 0x5a, 0x34, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, - 0x63, 0x6f, 0x6d, 0x2f, 0x6c, 0x6f, 0x6e, 0x67, 0x68, 0x6f, 0x72, 0x6e, 0x2f, 0x6c, 0x6f, 0x6e, - 0x67, 0x68, 0x6f, 0x72, 0x6e, 0x2d, 0x73, 0x68, 0x61, 0x72, 0x65, 0x2d, 0x6d, 0x61, 0x6e, 0x61, - 0x67, 0x65, 0x72, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x73, 0x6d, 0x72, 0x70, 0x63, 0x62, 0x06, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_github_com_longhorn_longhorn_share_manager_pkg_rpc_smrpc_proto_rawDescOnce sync.Once - file_github_com_longhorn_longhorn_share_manager_pkg_rpc_smrpc_proto_rawDescData = file_github_com_longhorn_longhorn_share_manager_pkg_rpc_smrpc_proto_rawDesc -) - -func file_github_com_longhorn_longhorn_share_manager_pkg_rpc_smrpc_proto_rawDescGZIP() []byte { - file_github_com_longhorn_longhorn_share_manager_pkg_rpc_smrpc_proto_rawDescOnce.Do(func() { - file_github_com_longhorn_longhorn_share_manager_pkg_rpc_smrpc_proto_rawDescData = protoimpl.X.CompressGZIP(file_github_com_longhorn_longhorn_share_manager_pkg_rpc_smrpc_proto_rawDescData) - }) - return file_github_com_longhorn_longhorn_share_manager_pkg_rpc_smrpc_proto_rawDescData -} - -var file_github_com_longhorn_longhorn_share_manager_pkg_rpc_smrpc_proto_msgTypes = make([]protoimpl.MessageInfo, 1) -var file_github_com_longhorn_longhorn_share_manager_pkg_rpc_smrpc_proto_goTypes = []interface{}{ - (*FilesystemTrimRequest)(nil), // 0: FilesystemTrimRequest - (*emptypb.Empty)(nil), // 1: google.protobuf.Empty -} -var file_github_com_longhorn_longhorn_share_manager_pkg_rpc_smrpc_proto_depIdxs = []int32{ - 0, // 0: ShareManagerService.FilesystemTrim:input_type -> FilesystemTrimRequest - 1, // 1: ShareManagerService.Unmount:input_type -> google.protobuf.Empty - 1, // 2: ShareManagerService.Mount:input_type -> google.protobuf.Empty - 1, // 3: ShareManagerService.FilesystemTrim:output_type -> google.protobuf.Empty - 1, // 4: ShareManagerService.Unmount:output_type -> google.protobuf.Empty - 1, // 5: ShareManagerService.Mount:output_type -> google.protobuf.Empty - 3, // [3:6] is the sub-list for method output_type - 0, // [0:3] is the sub-list for method input_type - 0, // [0:0] is the sub-list for extension type_name - 0, // [0:0] is the sub-list for extension extendee - 0, // [0:0] is the sub-list for field type_name -} - -func init() { file_github_com_longhorn_longhorn_share_manager_pkg_rpc_smrpc_proto_init() } -func file_github_com_longhorn_longhorn_share_manager_pkg_rpc_smrpc_proto_init() { - if File_github_com_longhorn_longhorn_share_manager_pkg_rpc_smrpc_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_github_com_longhorn_longhorn_share_manager_pkg_rpc_smrpc_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*FilesystemTrimRequest); 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_longhorn_longhorn_share_manager_pkg_rpc_smrpc_proto_rawDesc, - NumEnums: 0, - NumMessages: 1, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_github_com_longhorn_longhorn_share_manager_pkg_rpc_smrpc_proto_goTypes, - DependencyIndexes: file_github_com_longhorn_longhorn_share_manager_pkg_rpc_smrpc_proto_depIdxs, - MessageInfos: file_github_com_longhorn_longhorn_share_manager_pkg_rpc_smrpc_proto_msgTypes, - }.Build() - File_github_com_longhorn_longhorn_share_manager_pkg_rpc_smrpc_proto = out.File - file_github_com_longhorn_longhorn_share_manager_pkg_rpc_smrpc_proto_rawDesc = nil - file_github_com_longhorn_longhorn_share_manager_pkg_rpc_smrpc_proto_goTypes = nil - file_github_com_longhorn_longhorn_share_manager_pkg_rpc_smrpc_proto_depIdxs = nil -} - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConnInterface - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion6 - -// ShareManagerServiceClient is the client API for ShareManagerService service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type ShareManagerServiceClient interface { - FilesystemTrim(ctx context.Context, in *FilesystemTrimRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) - Unmount(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*emptypb.Empty, error) - Mount(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*emptypb.Empty, error) -} - -type shareManagerServiceClient struct { - cc grpc.ClientConnInterface -} - -func NewShareManagerServiceClient(cc grpc.ClientConnInterface) ShareManagerServiceClient { - return &shareManagerServiceClient{cc} -} - -func (c *shareManagerServiceClient) FilesystemTrim(ctx context.Context, in *FilesystemTrimRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { - out := new(emptypb.Empty) - err := c.cc.Invoke(ctx, "/ShareManagerService/FilesystemTrim", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *shareManagerServiceClient) Unmount(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*emptypb.Empty, error) { - out := new(emptypb.Empty) - err := c.cc.Invoke(ctx, "/ShareManagerService/Unmount", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *shareManagerServiceClient) Mount(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*emptypb.Empty, error) { - out := new(emptypb.Empty) - err := c.cc.Invoke(ctx, "/ShareManagerService/Mount", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// ShareManagerServiceServer is the server API for ShareManagerService service. -type ShareManagerServiceServer interface { - FilesystemTrim(context.Context, *FilesystemTrimRequest) (*emptypb.Empty, error) - Unmount(context.Context, *emptypb.Empty) (*emptypb.Empty, error) - Mount(context.Context, *emptypb.Empty) (*emptypb.Empty, error) -} - -// UnimplementedShareManagerServiceServer can be embedded to have forward compatible implementations. -type UnimplementedShareManagerServiceServer struct { -} - -func (*UnimplementedShareManagerServiceServer) FilesystemTrim(context.Context, *FilesystemTrimRequest) (*emptypb.Empty, error) { - return nil, status.Errorf(codes.Unimplemented, "method FilesystemTrim not implemented") -} -func (*UnimplementedShareManagerServiceServer) Unmount(context.Context, *emptypb.Empty) (*emptypb.Empty, error) { - return nil, status.Errorf(codes.Unimplemented, "method Unmount not implemented") -} -func (*UnimplementedShareManagerServiceServer) Mount(context.Context, *emptypb.Empty) (*emptypb.Empty, error) { - return nil, status.Errorf(codes.Unimplemented, "method Mount not implemented") -} - -func RegisterShareManagerServiceServer(s *grpc.Server, srv ShareManagerServiceServer) { - s.RegisterService(&_ShareManagerService_serviceDesc, srv) -} - -func _ShareManagerService_FilesystemTrim_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(FilesystemTrimRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ShareManagerServiceServer).FilesystemTrim(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/ShareManagerService/FilesystemTrim", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ShareManagerServiceServer).FilesystemTrim(ctx, req.(*FilesystemTrimRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _ShareManagerService_Unmount_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(emptypb.Empty) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ShareManagerServiceServer).Unmount(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/ShareManagerService/Unmount", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ShareManagerServiceServer).Unmount(ctx, req.(*emptypb.Empty)) - } - return interceptor(ctx, in, info, handler) -} - -func _ShareManagerService_Mount_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(emptypb.Empty) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ShareManagerServiceServer).Mount(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/ShareManagerService/Mount", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ShareManagerServiceServer).Mount(ctx, req.(*emptypb.Empty)) - } - return interceptor(ctx, in, info, handler) -} - -var _ShareManagerService_serviceDesc = grpc.ServiceDesc{ - ServiceName: "ShareManagerService", - HandlerType: (*ShareManagerServiceServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "FilesystemTrim", - Handler: _ShareManagerService_FilesystemTrim_Handler, - }, - { - MethodName: "Unmount", - Handler: _ShareManagerService_Unmount_Handler, - }, - { - MethodName: "Mount", - Handler: _ShareManagerService_Mount_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "github.com/longhorn/longhorn-share-manager/pkg/rpc/smrpc.proto", -} diff --git a/pkg/rpc/smrpc.proto b/pkg/rpc/smrpc.proto deleted file mode 100644 index 73b3c949..00000000 --- a/pkg/rpc/smrpc.proto +++ /dev/null @@ -1,15 +0,0 @@ -syntax="proto3"; - -option go_package = "github.com/longhorn/longhorn-share-manager/pkg/smrpc"; - -import "google/protobuf/empty.proto"; - -service ShareManagerService { - rpc FilesystemTrim(FilesystemTrimRequest) returns (google.protobuf.Empty) {} - rpc Unmount(google.protobuf.Empty) returns (google.protobuf.Empty) {} - rpc Mount(google.protobuf.Empty) returns (google.protobuf.Empty) {} -} - -message FilesystemTrimRequest { - bool encrypted_device = 1; -} diff --git a/proto/vendor/protobuf/src/google/protobuf/empty.proto b/proto/vendor/protobuf/src/google/protobuf/empty.proto deleted file mode 100644 index b87c89dc..00000000 --- a/proto/vendor/protobuf/src/google/protobuf/empty.proto +++ /dev/null @@ -1,51 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -syntax = "proto3"; - -package google.protobuf; - -option go_package = "google.golang.org/protobuf/types/known/emptypb"; -option java_package = "com.google.protobuf"; -option java_outer_classname = "EmptyProto"; -option java_multiple_files = true; -option objc_class_prefix = "GPB"; -option csharp_namespace = "Google.Protobuf.WellKnownTypes"; -option cc_enable_arenas = true; - -// A generic empty message that you can re-use to avoid defining duplicated -// empty messages in your APIs. A typical example is to use it as the request -// or the response type of an API method. For instance: -// -// service Foo { -// rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); -// } -// -message Empty {}