diff --git a/build/grpc.sh b/build/grpc.sh deleted file mode 100755 index 4c39872b..00000000 --- a/build/grpc.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/usr/bin/env bash - -ADMIN_PROJECT="../../EdgeAdmin" -NODE_PROJECT="../../EdgeNode" - -rm -f ../internal/rpc/pb/* -protoc --go_out=plugins=grpc:../internal/rpc --proto_path=../internal/rpc/protos ../internal/rpc/protos/*.proto - -# admin -function pub() { - cp ../internal/rpc/protos/service_${2}.proto ${1}/internal/rpc/protos/ - cp ../internal/rpc/pb/service_${2}.pb.go ${1}/internal/rpc/pb/ -} - -pub ${ADMIN_PROJECT} admin -pub ${ADMIN_PROJECT} node -pub ${ADMIN_PROJECT} node_cluster -pub ${ADMIN_PROJECT} node_grant -pub ${ADMIN_PROJECT} node_ip_address -pub ${ADMIN_PROJECT} server -pub ${ADMIN_PROJECT} api_node - -cp ../internal/rpc/pb/model_*.go ${ADMIN_PROJECT}/internal/rpc/pb/ - -# node -pub ${NODE_PROJECT} node - -cp ../internal/rpc/pb/model_node.pb.go ${NODE_PROJECT}/internal/rpc/pb/ -cp ../internal/rpc/pb/model_node_login.pb.go ${NODE_PROJECT}/internal/rpc/pb/ -cp ../internal/rpc/pb/model_node_grant.pb.go ${NODE_PROJECT}/internal/rpc/pb/ -cp ../internal/rpc/pb/model_node_cluster.pb.go ${NODE_PROJECT}/internal/rpc/pb/ \ No newline at end of file diff --git a/go.mod b/go.mod index c98ab169..b87b01c3 100644 --- a/go.mod +++ b/go.mod @@ -1,14 +1,17 @@ module github.com/TeaOSLab/EdgeAPI -go 1.14 +go 1.15 + +replace github.com/TeaOSLab/EdgeCommon => ../EdgeCommon require ( + github.com/TeaOSLab/EdgeCommon v0.0.0-00010101000000-000000000000 github.com/go-sql-driver/mysql v1.5.0 github.com/go-yaml/yaml v2.1.0+incompatible github.com/golang/protobuf v1.4.2 - github.com/iwind/TeaGo v0.0.0-20200727075925-7e7e67b44f2d + github.com/iwind/TeaGo v0.0.0-20200910072805-729cffe36729 github.com/pkg/sftp v1.12.0 golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a - google.golang.org/grpc v1.30.0 + google.golang.org/grpc v1.32.0 google.golang.org/protobuf v1.25.0 ) diff --git a/go.sum b/go.sum index 1618ab3c..7ec9b64b 100644 --- a/go.sum +++ b/go.sum @@ -1,18 +1,30 @@ cloud.google.com/go v0.26.0 h1:e0WKqKTd5BnrG8aKH3J3h+QvEIQtSUcf2n5UZ5ZgLtQ= cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= +github.com/DataDog/sketches-go v0.0.0-20190923095040-43f19ad77ff7/go.mod h1:Q5DbzQ+3AkgGwymQO7aZFNP7ns2lZKGtvRBzRXfdi60= +github.com/StackExchange/wmi v0.0.0-20190523213315-cbe66965904d/go.mod h1:3eOhrUMpNV+6aFIbp5/iudMxNCF27Vw2OZgy4xEx0Fg= +github.com/benbjohnson/clock v1.0.3/go.mod h1:bGMdMPoPVvcYyt1gHDf4J2KE153Yf9BuiUKYMaxlTDM= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= +github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/dgryski/go-rendezvous v0.0.0-20200624174652-8d2f3be8b2d9/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= +github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= +github.com/go-ole/go-ole v1.2.4/go.mod h1:XCwSNxSkXRo4vlyPy93sltvi/qJq0jqQhjqQNIwKuxM= github.com/go-redis/redis v6.15.8+incompatible/go.mod h1:NAIEuMOZ/fxfXJIrKDQDz8wamY7mA7PouImQ2Jvg6kA= +github.com/go-redis/redis/v8 v8.0.0-beta.7/go.mod h1:FGJAWDWFht1sQ4qxyJHZZbVyvnVcKQN0E3u5/5lRz+g= github.com/go-sql-driver/mysql v1.5.0 h1:ozyZYNQW3x3HtqT1jira07DN2PArx2v7/mN66gGcHOs= github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= github.com/go-yaml/yaml v2.1.0+incompatible h1:RYi2hDdss1u4YE7GwixGzWwVo47T8UQwnTLB6vQiq+o= @@ -39,49 +51,78 @@ 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-cmp v0.5.0 h1:/QaMHBdZ26BB3SSst0Iwl10Epc+xhTquomWX0oZEB6w= github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= -github.com/iwind/TeaGo v0.0.0-20200727075925-7e7e67b44f2d h1:V7HA0wUOdmZbXJTVpiUEvSD4ARKHwMLMmiCccfkqf24= -github.com/iwind/TeaGo v0.0.0-20200727075925-7e7e67b44f2d/go.mod h1:zjM7k+b+Jthhf0T0fKwuF0iy4TWb5SsU1gmKR2l+OmE= +github.com/iwind/TeaGo v0.0.0-20200822074248-b1cf7248c98a/go.mod h1:KU4mS7QNiZ7QWEuDBk1zw0/Q2LrAPZv3tycEFBsuUwc= +github.com/iwind/TeaGo v0.0.0-20200910072805-729cffe36729 h1:/v0WhSFVeNay/dA5zU9iCBXlgVDfxnztuanlauXE0gM= +github.com/iwind/TeaGo v0.0.0-20200910072805-729cffe36729/go.mod h1:KU4mS7QNiZ7QWEuDBk1zw0/Q2LrAPZv3tycEFBsuUwc= +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/kr/fs v0.1.0 h1:Jskdu9ieNAYnjxsi0LbQp1ulIKZV1LAFgK1tWhpZgl8= github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= +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/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421 h1:ZqeYNhU3OHLH3mGKHDcjJRFFRrJa6eAM5H+CtDdOsPc= +github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742 h1:Esafd1046DLDQ0W1YjYsBW+p8U2u7vzgW2SQVmlNazg= +github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/modern-go/reflect2 v1.0.1 h1:9f412s+6RmYXLWZSEzVVgPGK7C2PphHj5RJrvfx9AWI= +github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/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/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.10.1/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= +github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= +github.com/opentracing/opentracing-go v1.1.1-0.20190913142402-a7454ce5950e/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/sftp v1.12.0 h1:/f3b24xrDhkhddlaobPe2JgBqfdt+gC/NYl0QY9IOuI= github.com/pkg/sftp v1.12.0/go.mod h1:fUqqXB5vEgVCZ131L+9say31RAri6aF6KDViawhxKK8= 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/pquerna/ffjson v0.0.0-20190930134022-aa0246cd15f7 h1:xoIK0ctDddBMnc74udxJYBqlo9Ylnsp1waqjLsnef20= github.com/pquerna/ffjson v0.0.0-20190930134022-aa0246cd15f7/go.mod h1:YARuvh7BUWHNhzDq2OM5tzR2RiCcN2D7sapiKyCel/M= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/shirou/gopsutil v2.20.7+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +go.opentelemetry.io/otel v0.7.0/go.mod h1:aZMyHG5TqDOXEgH2tyLiXSUKly1jT3yqE9PmrzIeCdo= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2 h1:VklqNMn3ovrHsnt90PveolxSbWFaJdECFbxSq0Mqo2M= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a h1:vclmkQCjlDX5OydZ9wv8rBCcS0QyQY66Mpf/7BZbInM= golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a/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-20200513190911-00229845015e/go.mod h1:4M0jN8W1tt0AVLNr8HDosyJCDCDuyL9N9+3m7wDWgKw= +golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= +golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= +golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= +golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a h1:oWX7TPOiFAMXLq8o0ikBYfCJVlRHBcsciT5bXOrH628= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3 h1:0GoQqolDA55aaLxZyTzK/Y2ePZzZTUrRacwib7cNsYQ= 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-20190923162816-aa69164e4478/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7 h1:AeiKBIuRw3UomYXSbLy0Mc2dDLfdtbT/IVn4keq83P0= golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be h1:vEDujvNQGv4jgYKudGeI/+DAX4Jffq6hpD55MmoEvKs= @@ -93,9 +134,13 @@ golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5h golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a h1:1BGLXjeY4akVXGgbC9HugT3Jv3hCI0z56oJR5vAMgBU= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190412213103-97732733099d h1:+R4KGOnez64A81RvjARKc4UT5/tI9ujCIVX+P5KiHuI= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191010194322-b09406accb47/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200519105757-fe76b779f299 h1:DYfZAGf2WMFjMxbgTjaC+2HC7NkNAQs+6Q8b9WEB/F4= @@ -109,6 +154,8 @@ golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGm golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +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/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= @@ -116,6 +163,7 @@ google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7 google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55 h1:gSJIx1SDwno+2ElGhA4+qG2zF97qiUzTM+rQ0klBOcE= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20191009194640-548a555dbc03/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013 h1:+kGHl1aib/qcwaRi1CbqBZ1rk19r85MNUf8HaBghugY= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= @@ -124,6 +172,8 @@ google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQ google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.30.0 h1:M5a8xTlYTxwMn5ZFkwhRabsygDY5G8TYLyQDBxJNAxE= google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.32.0 h1:zWTV+LMdc3kaiJMSTOFz2UgSBgx8RNQoTGiZu3fR9S0= +google.golang.org/grpc v1.32.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= 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= @@ -134,15 +184,21 @@ google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2 google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.25.0 h1:Ejskq+SyPohKW+1uil0JJMtmHCgJPJ/qWTxr8qp+R4c= google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 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/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= +gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.7/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.3.0 h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776 h1:tQIYjPdBoyREyB9XMu+nnTclpTYkz2zFM+lzLJFO4gQ= +gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= diff --git a/internal/apis/api_node.go b/internal/apis/api_node.go index 69527934..835c9284 100644 --- a/internal/apis/api_node.go +++ b/internal/apis/api_node.go @@ -3,9 +3,9 @@ package apis import ( "errors" "github.com/TeaOSLab/EdgeAPI/internal/configs" - "github.com/TeaOSLab/EdgeAPI/internal/rpc/pb" "github.com/TeaOSLab/EdgeAPI/internal/rpc/services" "github.com/TeaOSLab/EdgeAPI/internal/utils" + "github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb" "github.com/iwind/TeaGo/logs" "google.golang.org/grpc" "net" @@ -58,6 +58,7 @@ func (this *APINode) listenRPC() error { pb.RegisterNodeClusterServiceServer(rpcServer, &services.NodeClusterService{}) pb.RegisterNodeIPAddressServiceServer(rpcServer, &services.NodeIPAddressService{}) pb.RegisterAPINodeServiceServer(rpcServer, &services.APINodeService{}) + pb.RegisterOriginServerServiceServer(rpcServer, &services.OriginServerService{}) err = rpcServer.Serve(listener) if err != nil { return errors.New("[API]start rpc failed: " + err.Error()) diff --git a/internal/db/models/api_node_model_ext.go b/internal/db/models/api_node_model_ext.go index 2640e7f9..cb50b153 100644 --- a/internal/db/models/api_node_model_ext.go +++ b/internal/db/models/api_node_model_ext.go @@ -1 +1,8 @@ package models + +import "strconv" + +// 地址 +func (this *APINode) Address() string { + return this.Host + ":" + strconv.Itoa(int(this.Port)) +} diff --git a/internal/db/models/file_chunk_dao.go b/internal/db/models/file_chunk_dao.go new file mode 100644 index 00000000..5ef14889 --- /dev/null +++ b/internal/db/models/file_chunk_dao.go @@ -0,0 +1,53 @@ +package models + +import ( + "errors" + _ "github.com/go-sql-driver/mysql" + "github.com/iwind/TeaGo/Tea" + "github.com/iwind/TeaGo/dbs" +) + +type FileChunkDAO dbs.DAO + +func NewFileChunkDAO() *FileChunkDAO { + return dbs.NewDAO(&FileChunkDAO{ + DAOObject: dbs.DAOObject{ + DB: Tea.Env, + Table: "edgeFileChunks", + Model: new(FileChunk), + PkName: "id", + }, + }).(*FileChunkDAO) +} + +var SharedFileChunkDAO = NewFileChunkDAO() + +// 创建文件Chunk +func (this *FileChunkDAO) CreateFileChunk(fileId int, data []byte) error { + op := NewFileChunkOperator() + op.FileId = fileId + op.Data = data + _, err := this.Save(op) + return err +} + +// 列出所有的文件Chunk +func (this *FileChunkDAO) FindAllFileChunks(fileId int) (result []*FileChunk, err error) { + _, err = this.Query(). + Attr("fileId", fileId). + AscPk(). + Slice(&result). + FindAll() + return +} + +// 删除以前的文件 +func (this *FileChunkDAO) DeleteFileChunks(fileId int) error { + if fileId <= 0 { + return errors.New("invalid fileId") + } + _, err := this.Query(). + Attr("fileId", fileId). + Delete() + return err +} diff --git a/internal/db/models/file_chunk_dao_test.go b/internal/db/models/file_chunk_dao_test.go new file mode 100644 index 00000000..97c24b56 --- /dev/null +++ b/internal/db/models/file_chunk_dao_test.go @@ -0,0 +1,5 @@ +package models + +import ( + _ "github.com/go-sql-driver/mysql" +) diff --git a/internal/db/models/file_chunk_model.go b/internal/db/models/file_chunk_model.go new file mode 100644 index 00000000..37bcd6e1 --- /dev/null +++ b/internal/db/models/file_chunk_model.go @@ -0,0 +1,18 @@ +package models + +// +type FileChunk struct { + Id uint32 `field:"id"` // ID + FileId uint32 `field:"fileId"` // 文件ID + Data string `field:"data"` // 分块内容 +} + +type FileChunkOperator struct { + Id interface{} // ID + FileId interface{} // 文件ID + Data interface{} // 分块内容 +} + +func NewFileChunkOperator() *FileChunkOperator { + return &FileChunkOperator{} +} diff --git a/internal/db/models/file_chunk_model_ext.go b/internal/db/models/file_chunk_model_ext.go new file mode 100644 index 00000000..2640e7f9 --- /dev/null +++ b/internal/db/models/file_chunk_model_ext.go @@ -0,0 +1 @@ +package models diff --git a/internal/db/models/file_dao.go b/internal/db/models/file_dao.go new file mode 100644 index 00000000..c65abb3b --- /dev/null +++ b/internal/db/models/file_dao.go @@ -0,0 +1,141 @@ +package models + +import ( + _ "github.com/go-sql-driver/mysql" + "github.com/iwind/TeaGo/Tea" + "github.com/iwind/TeaGo/dbs" + "github.com/iwind/TeaGo/types" + "mime/multipart" + "os" +) + +const ( + FileStateEnabled = 1 // 已启用 + FileStateDisabled = 0 // 已禁用 +) + +type FileDAO dbs.DAO + +func NewFileDAO() *FileDAO { + return dbs.NewDAO(&FileDAO{ + DAOObject: dbs.DAOObject{ + DB: Tea.Env, + Table: "edgeFiles", + Model: new(File), + PkName: "id", + }, + }).(*FileDAO) +} + +var SharedFileDAO = NewFileDAO() + +// 启用条目 +func (this *FileDAO) EnableFile(id int64) error { + _, err := this.Query(). + Pk(id). + Set("state", FileStateEnabled). + Update() + return err +} + +// 禁用条目 +func (this *FileDAO) DisableFile(id int64) error { + _, err := this.Query(). + Pk(id). + Set("state", FileStateDisabled). + Update() + return err +} + +// 查找启用中的条目 +func (this *FileDAO) FindEnabledFile(id int64) (*File, error) { + result, err := this.Query(). + Pk(id). + Attr("state", FileStateEnabled). + Find() + if result == nil { + return nil, err + } + return result.(*File), err +} + +// 创建文件 +func (this *FileDAO) CreateFileFromReader(businessType, description string, filename string, body *multipart.FileHeader, order int) (int, error) { + file, err := body.Open() + if err != nil { + return 0, err + } + + op := NewFileOperator() + op.Type = businessType + op.Description = description + op.State = FileStateEnabled + op.Size = body.Size + op.Order = order + op.Filename = filename + _, err = this.Save(op) + if err != nil { + return 0, err + } + + fileId := types.Int(op.Id) + + // 保存chunk + buf := make([]byte, 512*1024) + for { + n, err := file.Read(buf) + if n > 0 { + err1 := SharedFileChunkDAO.CreateFileChunk(fileId, buf[:n]) + if err1 != nil { + return 0, err1 + } + } + if err != nil { + break + } + } + + return fileId, nil +} + +// 创建一个空文件 +func (this *FileDAO) UploadLocalFile(businessType string, localFile string, filename string) (fileId int, err error) { + reader, err := os.Open(localFile) + if err != nil { + return 0, err + } + defer func() { + _ = reader.Close() + }() + stat, err := reader.Stat() + if err != nil { + return 0, err + } + + op := NewFileOperator() + op.Type = businessType + op.Filename = filename + op.Size = stat.Size() + op.State = FileStateEnabled + _, err = this.Save(op) + if err != nil { + return + } + fileId = types.Int(op.Id) + + buf := make([]byte, 512*1024) + for { + n, err := reader.Read(buf) + if n > 0 { + err1 := SharedFileChunkDAO.CreateFileChunk(fileId, buf[:n]) + if err1 != nil { + return 0, err1 + } + } + if err != nil { + break + } + } + + return fileId, nil +} diff --git a/internal/db/models/file_dao_test.go b/internal/db/models/file_dao_test.go new file mode 100644 index 00000000..97c24b56 --- /dev/null +++ b/internal/db/models/file_dao_test.go @@ -0,0 +1,5 @@ +package models + +import ( + _ "github.com/go-sql-driver/mysql" +) diff --git a/internal/db/models/file_model.go b/internal/db/models/file_model.go new file mode 100644 index 00000000..e51f15fc --- /dev/null +++ b/internal/db/models/file_model.go @@ -0,0 +1,28 @@ +package models + +// +type File struct { + Id uint32 `field:"id"` // ID + Description string `field:"description"` // 文件描述 + Filename string `field:"filename"` // 文件名 + Size uint32 `field:"size"` // 文件尺寸 + CreatedAt uint32 `field:"createdAt"` // 创建时间 + Order uint32 `field:"order"` // 排序 + Type string `field:"type"` // 类型 + State uint8 `field:"state"` // 状态 +} + +type FileOperator struct { + Id interface{} // ID + Description interface{} // 文件描述 + Filename interface{} // 文件名 + Size interface{} // 文件尺寸 + CreatedAt interface{} // 创建时间 + Order interface{} // 排序 + Type interface{} // 类型 + State interface{} // 状态 +} + +func NewFileOperator() *FileOperator { + return &FileOperator{} +} diff --git a/internal/db/models/file_model_ext.go b/internal/db/models/file_model_ext.go new file mode 100644 index 00000000..2640e7f9 --- /dev/null +++ b/internal/db/models/file_model_ext.go @@ -0,0 +1 @@ +package models diff --git a/internal/db/models/http_cache_policy_dao.go b/internal/db/models/http_cache_policy_dao.go new file mode 100644 index 00000000..a39dfae5 --- /dev/null +++ b/internal/db/models/http_cache_policy_dao.go @@ -0,0 +1,65 @@ +package models + +import ( + _ "github.com/go-sql-driver/mysql" + "github.com/iwind/TeaGo/Tea" + "github.com/iwind/TeaGo/dbs" +) + +const ( + HTTPCachePolicyStateEnabled = 1 // 已启用 + HTTPCachePolicyStateDisabled = 0 // 已禁用 +) + +type HTTPCachePolicyDAO dbs.DAO + +func NewHTTPCachePolicyDAO() *HTTPCachePolicyDAO { + return dbs.NewDAO(&HTTPCachePolicyDAO{ + DAOObject: dbs.DAOObject{ + DB: Tea.Env, + Table: "edgeHTTPCachePolicies", + Model: new(HTTPCachePolicy), + PkName: "id", + }, + }).(*HTTPCachePolicyDAO) +} + +var SharedHTTPCachePolicyDAO = NewHTTPCachePolicyDAO() + +// 启用条目 +func (this *HTTPCachePolicyDAO) EnableHTTPCachePolicy(id int64) error { + _, err := this.Query(). + Pk(id). + Set("state", HTTPCachePolicyStateEnabled). + Update() + return err +} + +// 禁用条目 +func (this *HTTPCachePolicyDAO) DisableHTTPCachePolicy(id int64) error { + _, err := this.Query(). + Pk(id). + Set("state", HTTPCachePolicyStateDisabled). + Update() + return err +} + +// 查找启用中的条目 +func (this *HTTPCachePolicyDAO) FindEnabledHTTPCachePolicy(id int64) (*HTTPCachePolicy, error) { + result, err := this.Query(). + Pk(id). + Attr("state", HTTPCachePolicyStateEnabled). + Find() + if result == nil { + return nil, err + } + return result.(*HTTPCachePolicy), err +} + +// 根据主键查找名称 +func (this *HTTPCachePolicyDAO) FindHTTPCachePolicyName(id int64) (string, error) { + return this.Query(). + Pk(id). + Result("name"). + FindStringCol("") +} diff --git a/internal/db/models/http_cache_policy_dao_test.go b/internal/db/models/http_cache_policy_dao_test.go new file mode 100644 index 00000000..97c24b56 --- /dev/null +++ b/internal/db/models/http_cache_policy_dao_test.go @@ -0,0 +1,5 @@ +package models + +import ( + _ "github.com/go-sql-driver/mysql" +) diff --git a/internal/db/models/http_cache_policy_model.go b/internal/db/models/http_cache_policy_model.go new file mode 100644 index 00000000..9f94c632 --- /dev/null +++ b/internal/db/models/http_cache_policy_model.go @@ -0,0 +1,44 @@ +package models + +// +type HTTPCachePolicy struct { + Id uint32 `field:"id"` // ID + AdminId uint32 `field:"adminId"` // 管理员ID + UserId uint32 `field:"userId"` // 用户ID + IsOn uint8 `field:"isOn"` // 是否启用 + Name string `field:"name"` // 名称 + Key string `field:"key"` // 缓存Key规则 + Capacity string `field:"capacity"` // 容量数据 + Life string `field:"life"` // 有效期 + Status string `field:"status"` // HTTP状态码列表 + MaxSize string `field:"maxSize"` // 最大尺寸 + SkipCacheControlValues string `field:"skipCacheControlValues"` // 忽略的cache-control + SkipSetCookie uint8 `field:"skipSetCookie"` // 是否忽略Set-Cookie Header + EnableRequestCachePragma uint8 `field:"enableRequestCachePragma"` // 是否支持客户端的Pragma: no-cache + Cond string `field:"cond"` // 请求条件 + CreatedAt uint32 `field:"createdAt"` // 创建时间 + State uint8 `field:"state"` // 状态 +} + +type HTTPCachePolicyOperator struct { + Id interface{} // ID + AdminId interface{} // 管理员ID + UserId interface{} // 用户ID + IsOn interface{} // 是否启用 + Name interface{} // 名称 + Key interface{} // 缓存Key规则 + Capacity interface{} // 容量数据 + Life interface{} // 有效期 + Status interface{} // HTTP状态码列表 + MaxSize interface{} // 最大尺寸 + SkipCacheControlValues interface{} // 忽略的cache-control + SkipSetCookie interface{} // 是否忽略Set-Cookie Header + EnableRequestCachePragma interface{} // 是否支持客户端的Pragma: no-cache + Cond interface{} // 请求条件 + CreatedAt interface{} // 创建时间 + State interface{} // 状态 +} + +func NewHTTPCachePolicyOperator() *HTTPCachePolicyOperator { + return &HTTPCachePolicyOperator{} +} diff --git a/internal/db/models/http_cache_policy_model_ext.go b/internal/db/models/http_cache_policy_model_ext.go new file mode 100644 index 00000000..2640e7f9 --- /dev/null +++ b/internal/db/models/http_cache_policy_model_ext.go @@ -0,0 +1 @@ +package models diff --git a/internal/db/models/http_header_dao.go b/internal/db/models/http_header_dao.go new file mode 100644 index 00000000..6c0036a7 --- /dev/null +++ b/internal/db/models/http_header_dao.go @@ -0,0 +1,65 @@ +package models + +import ( + _ "github.com/go-sql-driver/mysql" + "github.com/iwind/TeaGo/Tea" + "github.com/iwind/TeaGo/dbs" +) + +const ( + HTTPHeaderStateEnabled = 1 // 已启用 + HTTPHeaderStateDisabled = 0 // 已禁用 +) + +type HTTPHeaderDAO dbs.DAO + +func NewHTTPHeaderDAO() *HTTPHeaderDAO { + return dbs.NewDAO(&HTTPHeaderDAO{ + DAOObject: dbs.DAOObject{ + DB: Tea.Env, + Table: "edgeHTTPHeaders", + Model: new(HTTPHeader), + PkName: "id", + }, + }).(*HTTPHeaderDAO) +} + +var SharedHTTPHeaderDAO = NewHTTPHeaderDAO() + +// 启用条目 +func (this *HTTPHeaderDAO) EnableHTTPHeader(id uint32) error { + _, err := this.Query(). + Pk(id). + Set("state", HTTPHeaderStateEnabled). + Update() + return err +} + +// 禁用条目 +func (this *HTTPHeaderDAO) DisableHTTPHeader(id uint32) error { + _, err := this.Query(). + Pk(id). + Set("state", HTTPHeaderStateDisabled). + Update() + return err +} + +// 查找启用中的条目 +func (this *HTTPHeaderDAO) FindEnabledHTTPHeader(id uint32) (*HTTPHeader, error) { + result, err := this.Query(). + Pk(id). + Attr("state", HTTPHeaderStateEnabled). + Find() + if result == nil { + return nil, err + } + return result.(*HTTPHeader), err +} + +// 根据主键查找名称 +func (this *HTTPHeaderDAO) FindHTTPHeaderName(id uint32) (string, error) { + return this.Query(). + Pk(id). + Result("name"). + FindStringCol("") +} diff --git a/internal/db/models/http_header_dao_test.go b/internal/db/models/http_header_dao_test.go new file mode 100644 index 00000000..97c24b56 --- /dev/null +++ b/internal/db/models/http_header_dao_test.go @@ -0,0 +1,5 @@ +package models + +import ( + _ "github.com/go-sql-driver/mysql" +) diff --git a/internal/db/models/http_header_model.go b/internal/db/models/http_header_model.go new file mode 100644 index 00000000..ee068756 --- /dev/null +++ b/internal/db/models/http_header_model.go @@ -0,0 +1,32 @@ +package models + +// +type HTTPHeader struct { + Id uint32 `field:"id"` // ID + AdminId uint32 `field:"adminId"` // 管理员ID + UserId uint32 `field:"userId"` // 用户ID + IsOn uint8 `field:"isOn"` // 是否启用 + Name string `field:"name"` // 名称 + Value string `field:"value"` // 值 + Order uint32 `field:"order"` // 排序 + Status string `field:"status"` // 状态码设置 + State uint8 `field:"state"` // 状态 + CreatedAt uint32 `field:"createdAt"` // 创建时间 +} + +type HTTPHeaderOperator struct { + Id interface{} // ID + AdminId interface{} // 管理员ID + UserId interface{} // 用户ID + IsOn interface{} // 是否启用 + Name interface{} // 名称 + Value interface{} // 值 + Order interface{} // 排序 + Status interface{} // 状态码设置 + State interface{} // 状态 + CreatedAt interface{} // 创建时间 +} + +func NewHTTPHeaderOperator() *HTTPHeaderOperator { + return &HTTPHeaderOperator{} +} diff --git a/internal/db/models/http_header_model_ext.go b/internal/db/models/http_header_model_ext.go new file mode 100644 index 00000000..2640e7f9 --- /dev/null +++ b/internal/db/models/http_header_model_ext.go @@ -0,0 +1 @@ +package models diff --git a/internal/db/models/node_dao.go b/internal/db/models/node_dao.go index ee3e4204..697ebaf4 100644 --- a/internal/db/models/node_dao.go +++ b/internal/db/models/node_dao.go @@ -1,6 +1,7 @@ package models import ( + "encoding/json" "errors" _ "github.com/go-sql-driver/mysql" "github.com/iwind/TeaGo/Tea" @@ -12,6 +13,10 @@ import ( const ( NodeStateEnabled = 1 // 已启用 NodeStateDisabled = 0 // 已禁用 + + NodeInstallStateAll = 0 // 全部 + NodeInstallStateInstalled = 1 // 已安装 + NodeInstallStateNotInstalled = 2 // 未安装 ) type NodeDAO dbs.DAO @@ -177,7 +182,7 @@ func (this *NodeDAO) CountAllEnabledNodes() (int64, error) { } // 列出单页节点 -func (this *NodeDAO) ListEnabledNodesMatch(offset int64, size int64, clusterId int64) (result []*Node, err error) { +func (this *NodeDAO) ListEnabledNodesMatch(offset int64, size int64, clusterId int64, installState int8) (result []*Node, err error) { query := this.Query(). State(NodeStateEnabled). Offset(offset). @@ -185,10 +190,21 @@ func (this *NodeDAO) ListEnabledNodesMatch(offset int64, size int64, clusterId i DescPk(). Slice(&result) + // 集群 if clusterId > 0 { query.Attr("clusterId", clusterId) } + // 安装状态 + switch installState { + case NodeInstallStateAll: + // 不做任何事情 + case NodeInstallStateInstalled: + query.Attr("isInstalled", 1) + case NodeInstallStateNotInstalled: + query.Attr("isInstalled", 0) + } + _, err = query.FindAll() return } @@ -250,12 +266,25 @@ func (this *NodeDAO) FindAllNodeIdsMatch(clusterId int64) (result []int64, err e } // 计算节点数量 -func (this *NodeDAO) CountAllEnabledNodesMatch(clusterId int64) (int64, error) { +func (this *NodeDAO) CountAllEnabledNodesMatch(clusterId int64, installState int8) (int64, error) { query := this.Query() query.State(NodeStateEnabled) + + // 集群 if clusterId > 0 { query.Attr("clusterId", clusterId) } + + // 安装状态 + switch installState { + case NodeInstallStateAll: + // 不做任何事情 + case NodeInstallStateInstalled: + query.Attr("isInstalled", 1) + case NodeInstallStateNotInstalled: + query.Attr("isInstalled", 0) + } + return query.Count() } @@ -273,6 +302,47 @@ func (this *NodeDAO) UpdateNodeIsInstalled(nodeId int64, isInstalled bool) error _, err := this.Query(). Pk(nodeId). Set("isInstalled", isInstalled). + Set("installStatus", "null"). // 重置安装状态 + Update() + return err +} + +// 查询节点的安装状态 +func (this *NodeDAO) FindNodeInstallStatus(nodeId int64) (*NodeInstallStatus, error) { + installStatus, err := this.Query(). + Pk(nodeId). + Result("installStatus"). + FindStringCol("") + if err != nil { + return nil, err + } + + if len(installStatus) == 0 { + return NewNodeInstallStatus(), nil + } + + status := &NodeInstallStatus{} + err = json.Unmarshal([]byte(installStatus), status) + return status, err +} + +// 修改节点的安装状态 +func (this *NodeDAO) UpdateNodeInstallStatus(nodeId int64, status *NodeInstallStatus) error { + if status == nil { + _, err := this.Query(). + Pk(nodeId). + Set("installStatus", "null"). + Update() + return err + } + + data, err := json.Marshal(status) + if err != nil { + return err + } + _, err = this.Query(). + Pk(nodeId). + Set("installStatus", string(data)). Update() return err } diff --git a/internal/db/models/node_install_status.go b/internal/db/models/node_install_status.go new file mode 100644 index 00000000..145941b8 --- /dev/null +++ b/internal/db/models/node_install_status.go @@ -0,0 +1,15 @@ +package models + +// 节点安装状态 +type NodeInstallStatus struct { + IsRunning bool `json:"isRunning"` // 是否在运行 + IsFinished bool `json:"isFinished"` // 是否已结束 + IsOk bool `json:"isOk"` // 是否正确安装 + Error string `json:"error"` // 错误信息 + UpdatedAt int64 `json:"updatedAt"` // 更新时间,安装过程中需要每隔N秒钟更新这个状态,以便于让系统知道安装仍在进行中 + Steps []*NodeInstallStatusStep `json:"steps"` // 步骤 +} + +func NewNodeInstallStatus() *NodeInstallStatus { + return &NodeInstallStatus{} +} diff --git a/internal/db/models/node_install_status_step.go b/internal/db/models/node_install_status_step.go new file mode 100644 index 00000000..72e4fa1b --- /dev/null +++ b/internal/db/models/node_install_status_step.go @@ -0,0 +1,7 @@ +package models + +type NodeInstallStatusStep struct { + Name string `json:"name"` + Description string `json:"description"` + Percent int `json:"percent"` +} diff --git a/internal/db/models/node_login_dao.go b/internal/db/models/node_login_dao.go index 35d1ff21..d5d08b24 100644 --- a/internal/db/models/node_login_dao.go +++ b/internal/db/models/node_login_dao.go @@ -11,6 +11,8 @@ import ( const ( NodeLoginStateEnabled = 1 // 已启用 NodeLoginStateDisabled = 0 // 已禁用 + + NodeLoginTypeSSH = "ssh" ) type NodeLoginDAO dbs.DAO diff --git a/internal/db/models/node_login_model_ext.go b/internal/db/models/node_login_model_ext.go index 2640e7f9..69a946d3 100644 --- a/internal/db/models/node_login_model_ext.go +++ b/internal/db/models/node_login_model_ext.go @@ -1 +1,25 @@ package models + +import ( + "encoding/json" + "errors" +) + +// 解析SSH登录参数 +func (this *NodeLogin) DecodeSSHParams() (*NodeLoginSSHParams, error) { + if this.Type != NodeLoginTypeSSH { + return nil, errors.New("invalid login type '" + this.Type + "'") + } + + if len(this.Params) == 0 || this.Params == "null" { + return nil, errors.New("'params' should not be empty") + } + + params := &NodeLoginSSHParams{} + err := json.Unmarshal([]byte(this.Params), params) + if err != nil { + return nil, err + } + + return params, nil +} diff --git a/internal/db/models/node_login_params_ssh.go b/internal/db/models/node_login_params_ssh.go new file mode 100644 index 00000000..3bff6a6e --- /dev/null +++ b/internal/db/models/node_login_params_ssh.go @@ -0,0 +1,7 @@ +package models + +type NodeLoginSSHParams struct { + GrantId int64 `json:"grantId"` + Host string `json:"host"` + Port int `json:"port"` +} diff --git a/internal/db/models/node_model.go b/internal/db/models/node_model.go index 3a64cda5..351caa27 100644 --- a/internal/db/models/node_model.go +++ b/internal/db/models/node_model.go @@ -17,6 +17,7 @@ type Node struct { LatestVersion uint32 `field:"latestVersion"` // 最后版本号 InstallDir string `field:"installDir"` // 安装目录 IsInstalled uint8 `field:"isInstalled"` // 是否已安装 + InstallStatus string `field:"installStatus"` // 安装状态 State uint8 `field:"state"` // 状态 } @@ -36,6 +37,7 @@ type NodeOperator struct { LatestVersion interface{} // 最后版本号 InstallDir interface{} // 安装目录 IsInstalled interface{} // 是否已安装 + InstallStatus interface{} // 安装状态 State interface{} // 状态 } diff --git a/internal/db/models/node_model_ext.go b/internal/db/models/node_model_ext.go index 2640e7f9..9eda54b0 100644 --- a/internal/db/models/node_model_ext.go +++ b/internal/db/models/node_model_ext.go @@ -1 +1,27 @@ package models + +import ( + "encoding/json" + "time" +) + +// 安装状态 +func (this *Node) DecodeInstallStatus() (*NodeInstallStatus, error) { + if len(this.InstallStatus) == 0 || this.InstallStatus == "null" { + return NewNodeInstallStatus(), nil + } + status := &NodeInstallStatus{} + err := json.Unmarshal([]byte(this.InstallStatus), status) + if err != nil { + return NewNodeInstallStatus(), err + } + + // 如果N秒钟没有更新状态,则认为不在运行 + if status.IsRunning && status.UpdatedAt < time.Now().Unix()-10 { + status.IsRunning = false + status.IsFinished = true + status.Error = "timeout" + } + + return status, nil +} diff --git a/internal/db/models/origin_server_dao.go b/internal/db/models/origin_server_dao.go new file mode 100644 index 00000000..df412bbe --- /dev/null +++ b/internal/db/models/origin_server_dao.go @@ -0,0 +1,97 @@ +package models + +import ( + "errors" + _ "github.com/go-sql-driver/mysql" + "github.com/iwind/TeaGo/Tea" + "github.com/iwind/TeaGo/dbs" + "github.com/iwind/TeaGo/types" +) + +const ( + OriginServerStateEnabled = 1 // 已启用 + OriginServerStateDisabled = 0 // 已禁用 +) + +type OriginServerDAO dbs.DAO + +func NewOriginServerDAO() *OriginServerDAO { + return dbs.NewDAO(&OriginServerDAO{ + DAOObject: dbs.DAOObject{ + DB: Tea.Env, + Table: "edgeOriginServers", + Model: new(OriginServer), + PkName: "id", + }, + }).(*OriginServerDAO) +} + +var SharedOriginServerDAO = NewOriginServerDAO() + +// 启用条目 +func (this *OriginServerDAO) EnableOriginServer(id int64) error { + _, err := this.Query(). + Pk(id). + Set("state", OriginServerStateEnabled). + Update() + return err +} + +// 禁用条目 +func (this *OriginServerDAO) DisableOriginServer(id int64) error { + _, err := this.Query(). + Pk(id). + Set("state", OriginServerStateDisabled). + Update() + return err +} + +// 查找启用中的条目 +func (this *OriginServerDAO) FindEnabledOriginServer(id int64) (*OriginServer, error) { + result, err := this.Query(). + Pk(id). + Attr("state", OriginServerStateEnabled). + Find() + if result == nil { + return nil, err + } + return result.(*OriginServer), err +} + +// 根据主键查找名称 +func (this *OriginServerDAO) FindOriginServerName(id int64) (string, error) { + return this.Query(). + Pk(id). + Result("name"). + FindStringCol("") +} + +// 创建源站 +func (this *OriginServerDAO) CreateOriginServer(name string, addrJSON string, description string) (originId int64, err error) { + op := NewOriginServerOperator() + op.IsOn = true + op.Name = name + op.Addr = addrJSON + op.Description = description + op.State = OriginServerStateEnabled + _, err = this.Save(op) + if err != nil { + return + } + return types.Int64(op.Id), nil +} + +// 修改源站 +func (this *OriginServerDAO) UpdateOriginServer(originId int64, name string, addrJSON string, description string) error { + if originId <= 0 { + return errors.New("invalid originId") + } + op := NewOriginServerOperator() + op.Id = originId + op.Name = name + op.Addr = addrJSON + op.Description = description + op.Version = dbs.SQL("version+1") + _, err := this.Save(op) + return err +} diff --git a/internal/db/models/origin_server_dao_test.go b/internal/db/models/origin_server_dao_test.go new file mode 100644 index 00000000..97c24b56 --- /dev/null +++ b/internal/db/models/origin_server_dao_test.go @@ -0,0 +1,5 @@ +package models + +import ( + _ "github.com/go-sql-driver/mysql" +) diff --git a/internal/db/models/origin_server_model.go b/internal/db/models/origin_server_model.go new file mode 100644 index 00000000..f8b0506f --- /dev/null +++ b/internal/db/models/origin_server_model.go @@ -0,0 +1,60 @@ +package models + +// 源站 +type OriginServer struct { + Id uint32 `field:"id"` // ID + IsOn uint8 `field:"isOn"` // 是否启用 + Name string `field:"name"` // 名称 + Version uint32 `field:"version"` // 版本 + Addr string `field:"addr"` // 地址 + Description string `field:"description"` // 描述 + Code string `field:"code"` // 代号 + Weight uint32 `field:"weight"` // 权重 + ConnTimeout string `field:"connTimeout"` // 连接超时 + ReadTimeout string `field:"readTimeout"` // 读超时 + IdleTimeout string `field:"idleTimeout"` // 空闲连接超时 + MaxFails uint32 `field:"maxFails"` // 最多失败次数 + MaxConns uint32 `field:"maxConns"` // 最大并发连接数 + MaxIdleConns uint32 `field:"maxIdleConns"` // 最多空闲连接数 + HttpRequestURI string `field:"httpRequestURI"` // 转发后的请求URI + HttpRequestHeaders string `field:"httpRequestHeaders"` // 请求Headers配置 + HttpResponseHeaders string `field:"httpResponseHeaders"` // 响应Headers配置 + Host string `field:"host"` // 自定义主机名 + HealthCheck string `field:"healthCheck"` // 健康检查设置 + IsDown uint8 `field:"isDown"` // 是否处于健康检查失败状态 + Cert string `field:"cert"` // 证书设置 + Ftp string `field:"ftp"` // FTP相关设置 + CreatedAt uint32 `field:"createdAt"` // 创建时间 + State uint8 `field:"state"` // 状态 +} + +type OriginServerOperator struct { + Id interface{} // ID + IsOn interface{} // 是否启用 + Name interface{} // 名称 + Version interface{} // 版本 + Addr interface{} // 地址 + Description interface{} // 描述 + Code interface{} // 代号 + Weight interface{} // 权重 + ConnTimeout interface{} // 连接超时 + ReadTimeout interface{} // 读超时 + IdleTimeout interface{} // 空闲连接超时 + MaxFails interface{} // 最多失败次数 + MaxConns interface{} // 最大并发连接数 + MaxIdleConns interface{} // 最多空闲连接数 + HttpRequestURI interface{} // 转发后的请求URI + HttpRequestHeaders interface{} // 请求Headers配置 + HttpResponseHeaders interface{} // 响应Headers配置 + Host interface{} // 自定义主机名 + HealthCheck interface{} // 健康检查设置 + IsDown interface{} // 是否处于健康检查失败状态 + Cert interface{} // 证书设置 + Ftp interface{} // FTP相关设置 + CreatedAt interface{} // 创建时间 + State interface{} // 状态 +} + +func NewOriginServerOperator() *OriginServerOperator { + return &OriginServerOperator{} +} diff --git a/internal/db/models/origin_server_model_ext.go b/internal/db/models/origin_server_model_ext.go new file mode 100644 index 00000000..2e82bd42 --- /dev/null +++ b/internal/db/models/origin_server_model_ext.go @@ -0,0 +1,17 @@ +package models + +import ( + "encoding/json" + "errors" + "github.com/TeaOSLab/EdgeCommon/pkg/serverconfigs" +) + +// 解析地址 +func (this *OriginServer) DecodeAddr() (*serverconfigs.NetworkAddressConfig, error) { + if len(this.Addr) == 0 || this.Addr == "null" { + return nil, errors.New("addr is empty") + } + addr := &serverconfigs.NetworkAddressConfig{} + err := json.Unmarshal([]byte(this.Addr), addr) + return addr, err +} diff --git a/internal/db/models/server_dao.go b/internal/db/models/server_dao.go index a9d318eb..9291bc85 100644 --- a/internal/db/models/server_dao.go +++ b/internal/db/models/server_dao.go @@ -2,6 +2,7 @@ package models import ( "errors" + "github.com/TeaOSLab/EdgeCommon/pkg/serverconfigs" _ "github.com/go-sql-driver/mysql" "github.com/iwind/TeaGo/Tea" "github.com/iwind/TeaGo/dbs" @@ -59,7 +60,7 @@ func (this *ServerDAO) FindEnabledServer(id int64) (*Server, error) { } // 创建服务 -func (this *ServerDAO) CreateServer(adminId int64, userId int64, clusterId int64, configJSON string, includeNodesJSON string, excludeNodesJSON string) (serverId int64, err error) { +func (this *ServerDAO) CreateServer(adminId int64, userId int64, serverType serverconfigs.ServerType, name string, description string, clusterId int64, configJSON string, includeNodesJSON string, excludeNodesJSON string) (serverId int64, err error) { uniqueId, err := this.genUniqueId() if err != nil { return 0, err @@ -69,6 +70,9 @@ func (this *ServerDAO) CreateServer(adminId int64, userId int64, clusterId int64 op.UniqueId = uniqueId op.UserId = userId op.AdminId = adminId + op.Name = name + op.Type = serverType + op.Description = description op.ClusterId = clusterId if len(configJSON) > 0 { op.Config = configJSON @@ -87,28 +91,33 @@ func (this *ServerDAO) CreateServer(adminId int64, userId int64, clusterId int64 return types.Int64(op.Id), err } -// 修改服务 -func (this *ServerDAO) UpdateServer(serverId int64, clusterId int64, configJSON string, includeNodesJSON string, excludeNodesJSON string) error { +// 修改服务基本信息 +func (this *ServerDAO) UpdateServerBasic(serverId int64, name string, description string, clusterId int64) error { if serverId <= 0 { return errors.New("serverId should not be smaller than 0") } op := NewServerOperator() op.Id = serverId + op.Name = name + op.Description = description op.ClusterId = clusterId - if len(configJSON) > 0 { - op.Config = configJSON - } - if len(includeNodesJSON) > 0 { - op.IncludeNodes = includeNodesJSON - } - if len(excludeNodesJSON) > 0 { - op.ExcludeNodes = excludeNodesJSON - } op.Version = dbs.SQL("version=version+1") _, err := this.Save(op) return err } +// 修改服务配置 +func (this *ServerDAO) UpdateServerConfig(serverId int64, config []byte) error { + if serverId <= 0 { + return errors.New("serverId should not be smaller than 0") + } + _, err := this.Query(). + Pk(serverId). + Set("config", string(config)). + Update() + return err +} + // 计算所有可用服务数量 func (this *ServerDAO) CountAllEnabledServers() (int64, error) { return this.Query(). @@ -148,6 +157,7 @@ func (this *ServerDAO) FindAllEnabledServersWithNode(nodeId int64) (result []*Se return } + // 生成唯一ID func (this *ServerDAO) genUniqueId() (string, error) { for { diff --git a/internal/db/models/server_model.go b/internal/db/models/server_model.go index 8c0c6730..1cb5f961 100644 --- a/internal/db/models/server_model.go +++ b/internal/db/models/server_model.go @@ -3,10 +3,13 @@ package models // 服务 type Server struct { Id uint32 `field:"id"` // ID - UniqueId string `field:"uniqueId"` // 唯一ID IsOn uint8 `field:"isOn"` // 是否启用 + UniqueId string `field:"uniqueId"` // 唯一ID UserId uint32 `field:"userId"` // 用户ID AdminId uint32 `field:"adminId"` // 管理员ID + Type string `field:"type"` // 服务类型 + Name string `field:"name"` // 名称 + Description string `field:"description"` // 描述 GroupIds string `field:"groupIds"` // 分组ID列表 Config string `field:"config"` // 服务配置,自动生成 ClusterId uint32 `field:"clusterId"` // 集群ID @@ -19,10 +22,13 @@ type Server struct { type ServerOperator struct { Id interface{} // ID - UniqueId interface{} // 唯一ID IsOn interface{} // 是否启用 + UniqueId interface{} // 唯一ID UserId interface{} // 用户ID AdminId interface{} // 管理员ID + Type interface{} // 服务类型 + Name interface{} // 名称 + Description interface{} // 描述 GroupIds interface{} // 分组ID列表 Config interface{} // 服务配置,自动生成 ClusterId interface{} // 集群ID diff --git a/internal/installers/installer_node.go b/internal/installers/installer_node.go index 3176805a..d8337c72 100644 --- a/internal/installers/installer_node.go +++ b/internal/installers/installer_node.go @@ -62,7 +62,7 @@ func (this *NodeInstaller) Install(dir string, params interface{}) error { return err } - data = bytes.ReplaceAll(data, []byte("${endpoint}"), []byte(nodeParams.Endpoint)) + data = bytes.ReplaceAll(data, []byte("${endpoints}"), []byte(nodeParams.QuoteEndpoints())) data = bytes.ReplaceAll(data, []byte("${nodeId}"), []byte(nodeParams.NodeId)) data = bytes.ReplaceAll(data, []byte("${nodeSecret}"), []byte(nodeParams.Secret)) diff --git a/internal/installers/installer_node_test.go b/internal/installers/installer_node_test.go index 39c55e36..60e8bded 100644 --- a/internal/installers/installer_node_test.go +++ b/internal/installers/installer_node_test.go @@ -25,9 +25,9 @@ func TestNodeInstaller_Install(t *testing.T) { // 安装 err = installer.Install("/opt/edge", &NodeParams{ - Endpoint: "192.168.2.40:8003", - NodeId: "313fdb1b90d0a63c736f307b4d1ca358", - Secret: "Pl3u5kYqBDZddp7raw6QfHiuGPRCWF54", + Endpoints: []string{"192.168.2.40:8003"}, + NodeId: "313fdb1b90d0a63c736f307b4d1ca358", + Secret: "Pl3u5kYqBDZddp7raw6QfHiuGPRCWF54", }) if err != nil { t.Fatal(err) diff --git a/internal/installers/params_node.go b/internal/installers/params_node.go index f750f31b..1f7bdbca 100644 --- a/internal/installers/params_node.go +++ b/internal/installers/params_node.go @@ -1,15 +1,18 @@ package installers -import "errors" +import ( + "errors" + "strings" +) type NodeParams struct { - Endpoint string - NodeId string - Secret string + Endpoints []string + NodeId string + Secret string } func (this *NodeParams) Validate() error { - if len(this.Endpoint) == 0 { + if len(this.Endpoints) == 0 { return errors.New("'endpoint' should not be empty") } if len(this.NodeId) == 0 { @@ -20,3 +23,10 @@ func (this *NodeParams) Validate() error { } return nil } + +func (this *NodeParams) QuoteEndpoints() string { + if len(this.Endpoints) == 0 { + return "" + } + return "\"" + strings.Join(this.Endpoints, "\", \"") + "\"" +} diff --git a/internal/installers/queue.go b/internal/installers/queue.go new file mode 100644 index 00000000..a61b0ee7 --- /dev/null +++ b/internal/installers/queue.go @@ -0,0 +1,162 @@ +package installers + +import ( + "errors" + "fmt" + "github.com/TeaOSLab/EdgeAPI/internal/db/models" + "github.com/TeaOSLab/EdgeAPI/internal/utils" + "github.com/iwind/TeaGo/logs" + "strconv" + "time" +) + +var sharedQueue = NewQueue() + +type Queue struct { +} + +func NewQueue() *Queue { + return &Queue{} +} + +func SharedQueue() *Queue { + return sharedQueue +} + +// 安装边缘节点流程控制 +func (this *Queue) InstallNodeProcess(nodeId int64) error { + installStatus := models.NewNodeInstallStatus() + installStatus.IsRunning = true + installStatus.UpdatedAt = time.Now().Unix() + + err := models.SharedNodeDAO.UpdateNodeInstallStatus(nodeId, installStatus) + if err != nil { + return err + } + + // 更新时间 + ticker := utils.NewTicker(3 * time.Second) + go func() { + for ticker.Wait() { + installStatus.UpdatedAt = time.Now().Unix() + err := models.SharedNodeDAO.UpdateNodeInstallStatus(nodeId, installStatus) + if err != nil { + logs.Println("[INSTALL]" + err.Error()) + continue + } + } + }() + defer func() { + ticker.Stop() + }() + + // 开始安装 + err = this.InstallNode(nodeId) + + // 安装结束 + installStatus.IsRunning = false + installStatus.IsFinished = true + if err != nil { + installStatus.Error = err.Error() + } else { + installStatus.IsOk = true + } + err = models.SharedNodeDAO.UpdateNodeInstallStatus(nodeId, installStatus) + if err != nil { + return err + } + + // 修改为已安装 + if installStatus.IsOk { + err = models.SharedNodeDAO.UpdateNodeIsInstalled(nodeId, true) + if err != nil { + return err + } + } + + return nil +} + +// 安装边缘节点 +func (this *Queue) InstallNode(nodeId int64) error { + node, err := models.SharedNodeDAO.FindEnabledNode(nodeId) + if err != nil { + return err + } + if node == nil { + return errors.New("can not find node, ID:'" + strconv.FormatInt(nodeId, 10) + "'") + } + + // 登录信息 + login, err := models.SharedNodeLoginDAO.FindEnabledNodeLoginWithNodeId(nodeId) + if err != nil { + return err + } + if login == nil { + return errors.New("can not find node login information") + } + loginParams, err := login.DecodeSSHParams() + if err != nil { + return err + } + + grant, err := models.SharedNodeGrantDAO.FindEnabledNodeGrant(loginParams.GrantId) + if err != nil { + return err + } + if grant == nil { + return errors.New("can not find user grant with id '" + strconv.FormatInt(loginParams.GrantId, 10) + "'") + } + + // 安装目录 + installDir := node.InstallDir + if len(installDir) == 0 { + clusterId := node.ClusterId + cluster, err := models.SharedNodeClusterDAO.FindEnabledNodeCluster(int64(clusterId)) + if err != nil { + return err + } + if cluster == nil { + return errors.New("can not find cluster, ID:'" + fmt.Sprintf("%d", clusterId) + "'") + } + installDir = cluster.InstallDir + if len(installDir) == 0 { + return errors.New("unable to find installation dir") + } + } + + // API终端 + apiNodes, err := models.SharedAPINodeDAO.FindAllEnabledAPINodes() + if err != nil { + return err + } + if len(apiNodes) == 0 { + return errors.New("no available api nodes") + } + + apiEndpoints := []string{} + for _, apiNode := range apiNodes { + apiEndpoints = append(apiEndpoints, apiNode.Host+":"+strconv.Itoa(int(apiNode.Port))) + } + + params := &NodeParams{ + Endpoints: apiEndpoints, + NodeId: node.UniqueId, + Secret: node.Secret, + } + + installer := &NodeInstaller{} + err = installer.Login(&Credentials{ + Host: loginParams.Host, + Port: loginParams.Port, + Username: grant.Username, + Password: grant.Password, + PrivateKey: grant.PrivateKey, + }) + if err != nil { + return err + } + + err = installer.Install(installDir, params) + return err +} diff --git a/internal/installers/queue_test.go b/internal/installers/queue_test.go new file mode 100644 index 00000000..ea2b78c3 --- /dev/null +++ b/internal/installers/queue_test.go @@ -0,0 +1,19 @@ +package installers + +import ( + "testing" + "time" +) + +func TestQueue_InstallNode(t *testing.T) { + queue := NewQueue() + err := queue.InstallNodeProcess(16) + if err != nil { + t.Fatal(err) + } + + time.Sleep(1 * time.Second) + + t.Log("OK") + +} diff --git a/internal/rpc/pb/model_api_node.pb.go b/internal/rpc/pb/model_api_node.pb.go deleted file mode 100644 index e41c5d59..00000000 --- a/internal/rpc/pb/model_api_node.pb.go +++ /dev/null @@ -1,222 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.25.0 -// protoc v3.12.3 -// source: model_api_node.proto - -package pb - -import ( - proto "github.com/golang/protobuf/proto" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - 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) -) - -// 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 APINode struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` - IsOn bool `protobuf:"varint,2,opt,name=isOn,proto3" json:"isOn,omitempty"` - ClusterId int64 `protobuf:"varint,3,opt,name=clusterId,proto3" json:"clusterId,omitempty"` - UniqueId string `protobuf:"bytes,4,opt,name=uniqueId,proto3" json:"uniqueId,omitempty"` - Secret string `protobuf:"bytes,5,opt,name=secret,proto3" json:"secret,omitempty"` - Name string `protobuf:"bytes,6,opt,name=name,proto3" json:"name,omitempty"` - Description string `protobuf:"bytes,7,opt,name=description,proto3" json:"description,omitempty"` - Host string `protobuf:"bytes,8,opt,name=host,proto3" json:"host,omitempty"` - Port int32 `protobuf:"varint,9,opt,name=port,proto3" json:"port,omitempty"` -} - -func (x *APINode) Reset() { - *x = APINode{} - if protoimpl.UnsafeEnabled { - mi := &file_model_api_node_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *APINode) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*APINode) ProtoMessage() {} - -func (x *APINode) ProtoReflect() protoreflect.Message { - mi := &file_model_api_node_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 APINode.ProtoReflect.Descriptor instead. -func (*APINode) Descriptor() ([]byte, []int) { - return file_model_api_node_proto_rawDescGZIP(), []int{0} -} - -func (x *APINode) GetId() int64 { - if x != nil { - return x.Id - } - return 0 -} - -func (x *APINode) GetIsOn() bool { - if x != nil { - return x.IsOn - } - return false -} - -func (x *APINode) GetClusterId() int64 { - if x != nil { - return x.ClusterId - } - return 0 -} - -func (x *APINode) GetUniqueId() string { - if x != nil { - return x.UniqueId - } - return "" -} - -func (x *APINode) GetSecret() string { - if x != nil { - return x.Secret - } - return "" -} - -func (x *APINode) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *APINode) GetDescription() string { - if x != nil { - return x.Description - } - return "" -} - -func (x *APINode) GetHost() string { - if x != nil { - return x.Host - } - return "" -} - -func (x *APINode) GetPort() int32 { - if x != nil { - return x.Port - } - return 0 -} - -var File_model_api_node_proto protoreflect.FileDescriptor - -var file_model_api_node_proto_rawDesc = []byte{ - 0x0a, 0x14, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5f, 0x61, 0x70, 0x69, 0x5f, 0x6e, 0x6f, 0x64, 0x65, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, 0x62, 0x22, 0xdd, 0x01, 0x0a, 0x07, 0x41, - 0x50, 0x49, 0x4e, 0x6f, 0x64, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x69, 0x73, 0x4f, 0x6e, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x08, 0x52, 0x04, 0x69, 0x73, 0x4f, 0x6e, 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x6c, - 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x63, - 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x6e, 0x69, 0x71, - 0x75, 0x65, 0x49, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x6e, 0x69, 0x71, - 0x75, 0x65, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x18, 0x05, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x12, 0x12, 0x0a, 0x04, - 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, - 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, - 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, - 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x68, 0x6f, 0x73, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x04, 0x68, 0x6f, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x09, - 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x70, 0x6f, 0x72, 0x74, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, - 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_model_api_node_proto_rawDescOnce sync.Once - file_model_api_node_proto_rawDescData = file_model_api_node_proto_rawDesc -) - -func file_model_api_node_proto_rawDescGZIP() []byte { - file_model_api_node_proto_rawDescOnce.Do(func() { - file_model_api_node_proto_rawDescData = protoimpl.X.CompressGZIP(file_model_api_node_proto_rawDescData) - }) - return file_model_api_node_proto_rawDescData -} - -var file_model_api_node_proto_msgTypes = make([]protoimpl.MessageInfo, 1) -var file_model_api_node_proto_goTypes = []interface{}{ - (*APINode)(nil), // 0: pb.APINode -} -var file_model_api_node_proto_depIdxs = []int32{ - 0, // [0:0] is the sub-list for method output_type - 0, // [0:0] 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_model_api_node_proto_init() } -func file_model_api_node_proto_init() { - if File_model_api_node_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_model_api_node_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*APINode); 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_model_api_node_proto_rawDesc, - NumEnums: 0, - NumMessages: 1, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_model_api_node_proto_goTypes, - DependencyIndexes: file_model_api_node_proto_depIdxs, - MessageInfos: file_model_api_node_proto_msgTypes, - }.Build() - File_model_api_node_proto = out.File - file_model_api_node_proto_rawDesc = nil - file_model_api_node_proto_goTypes = nil - file_model_api_node_proto_depIdxs = nil -} diff --git a/internal/rpc/pb/model_node.pb.go b/internal/rpc/pb/model_node.pb.go deleted file mode 100644 index bbe3b28a..00000000 --- a/internal/rpc/pb/model_node.pb.go +++ /dev/null @@ -1,243 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.25.0 -// protoc v3.12.3 -// source: model_node.proto - -package pb - -import ( - proto "github.com/golang/protobuf/proto" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - 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) -) - -// 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 Node struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - Status string `protobuf:"bytes,3,opt,name=status,proto3" json:"status,omitempty"` - InstallDir string `protobuf:"bytes,4,opt,name=installDir,proto3" json:"installDir,omitempty"` - IsInstalled bool `protobuf:"varint,5,opt,name=isInstalled,proto3" json:"isInstalled,omitempty"` - Code string `protobuf:"bytes,6,opt,name=code,proto3" json:"code,omitempty"` - UniqueId string `protobuf:"bytes,7,opt,name=uniqueId,proto3" json:"uniqueId,omitempty"` - Secret string `protobuf:"bytes,8,opt,name=secret,proto3" json:"secret,omitempty"` - Cluster *NodeCluster `protobuf:"bytes,32,opt,name=cluster,proto3" json:"cluster,omitempty"` - Login *NodeLogin `protobuf:"bytes,33,opt,name=login,proto3" json:"login,omitempty"` -} - -func (x *Node) Reset() { - *x = Node{} - if protoimpl.UnsafeEnabled { - mi := &file_model_node_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Node) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Node) ProtoMessage() {} - -func (x *Node) ProtoReflect() protoreflect.Message { - mi := &file_model_node_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 Node.ProtoReflect.Descriptor instead. -func (*Node) Descriptor() ([]byte, []int) { - return file_model_node_proto_rawDescGZIP(), []int{0} -} - -func (x *Node) GetId() int64 { - if x != nil { - return x.Id - } - return 0 -} - -func (x *Node) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *Node) GetStatus() string { - if x != nil { - return x.Status - } - return "" -} - -func (x *Node) GetInstallDir() string { - if x != nil { - return x.InstallDir - } - return "" -} - -func (x *Node) GetIsInstalled() bool { - if x != nil { - return x.IsInstalled - } - return false -} - -func (x *Node) GetCode() string { - if x != nil { - return x.Code - } - return "" -} - -func (x *Node) GetUniqueId() string { - if x != nil { - return x.UniqueId - } - return "" -} - -func (x *Node) GetSecret() string { - if x != nil { - return x.Secret - } - return "" -} - -func (x *Node) GetCluster() *NodeCluster { - if x != nil { - return x.Cluster - } - return nil -} - -func (x *Node) GetLogin() *NodeLogin { - if x != nil { - return x.Login - } - return nil -} - -var File_model_node_proto protoreflect.FileDescriptor - -var file_model_node_proto_rawDesc = []byte{ - 0x0a, 0x10, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5f, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x12, 0x02, 0x70, 0x62, 0x1a, 0x18, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5f, 0x6e, 0x6f, - 0x64, 0x65, 0x5f, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x1a, 0x16, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5f, 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x6c, 0x6f, 0x67, - 0x69, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x9c, 0x02, 0x0a, 0x04, 0x4e, 0x6f, 0x64, - 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, - 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1e, 0x0a, - 0x0a, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x44, 0x69, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x0a, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x44, 0x69, 0x72, 0x12, 0x20, 0x0a, - 0x0b, 0x69, 0x73, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x65, 0x64, 0x18, 0x05, 0x20, 0x01, - 0x28, 0x08, 0x52, 0x0b, 0x69, 0x73, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x65, 0x64, 0x12, - 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x63, - 0x6f, 0x64, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x6e, 0x69, 0x71, 0x75, 0x65, 0x49, 0x64, 0x18, - 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x6e, 0x69, 0x71, 0x75, 0x65, 0x49, 0x64, 0x12, - 0x16, 0x0a, 0x06, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x06, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x12, 0x29, 0x0a, 0x07, 0x63, 0x6c, 0x75, 0x73, 0x74, - 0x65, 0x72, 0x18, 0x20, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x70, 0x62, 0x2e, 0x4e, 0x6f, - 0x64, 0x65, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x52, 0x07, 0x63, 0x6c, 0x75, 0x73, 0x74, - 0x65, 0x72, 0x12, 0x23, 0x0a, 0x05, 0x6c, 0x6f, 0x67, 0x69, 0x6e, 0x18, 0x21, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x0d, 0x2e, 0x70, 0x62, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x4c, 0x6f, 0x67, 0x69, 0x6e, - 0x52, 0x05, 0x6c, 0x6f, 0x67, 0x69, 0x6e, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62, - 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_model_node_proto_rawDescOnce sync.Once - file_model_node_proto_rawDescData = file_model_node_proto_rawDesc -) - -func file_model_node_proto_rawDescGZIP() []byte { - file_model_node_proto_rawDescOnce.Do(func() { - file_model_node_proto_rawDescData = protoimpl.X.CompressGZIP(file_model_node_proto_rawDescData) - }) - return file_model_node_proto_rawDescData -} - -var file_model_node_proto_msgTypes = make([]protoimpl.MessageInfo, 1) -var file_model_node_proto_goTypes = []interface{}{ - (*Node)(nil), // 0: pb.Node - (*NodeCluster)(nil), // 1: pb.NodeCluster - (*NodeLogin)(nil), // 2: pb.NodeLogin -} -var file_model_node_proto_depIdxs = []int32{ - 1, // 0: pb.Node.cluster:type_name -> pb.NodeCluster - 2, // 1: pb.Node.login:type_name -> pb.NodeLogin - 2, // [2:2] is the sub-list for method output_type - 2, // [2:2] is the sub-list for method input_type - 2, // [2:2] is the sub-list for extension type_name - 2, // [2:2] is the sub-list for extension extendee - 0, // [0:2] is the sub-list for field type_name -} - -func init() { file_model_node_proto_init() } -func file_model_node_proto_init() { - if File_model_node_proto != nil { - return - } - file_model_node_cluster_proto_init() - file_model_node_login_proto_init() - if !protoimpl.UnsafeEnabled { - file_model_node_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Node); 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_model_node_proto_rawDesc, - NumEnums: 0, - NumMessages: 1, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_model_node_proto_goTypes, - DependencyIndexes: file_model_node_proto_depIdxs, - MessageInfos: file_model_node_proto_msgTypes, - }.Build() - File_model_node_proto = out.File - file_model_node_proto_rawDesc = nil - file_model_node_proto_goTypes = nil - file_model_node_proto_depIdxs = nil -} diff --git a/internal/rpc/pb/model_node_cluster.pb.go b/internal/rpc/pb/model_node_cluster.pb.go deleted file mode 100644 index 4c4ec07c..00000000 --- a/internal/rpc/pb/model_node_cluster.pb.go +++ /dev/null @@ -1,185 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.25.0 -// protoc v3.12.3 -// source: model_node_cluster.proto - -package pb - -import ( - proto "github.com/golang/protobuf/proto" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - 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) -) - -// 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 NodeCluster struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - CreatedAt int64 `protobuf:"varint,3,opt,name=createdAt,proto3" json:"createdAt,omitempty"` - GrantId int64 `protobuf:"varint,4,opt,name=grantId,proto3" json:"grantId,omitempty"` - InstallDir string `protobuf:"bytes,5,opt,name=installDir,proto3" json:"installDir,omitempty"` -} - -func (x *NodeCluster) Reset() { - *x = NodeCluster{} - if protoimpl.UnsafeEnabled { - mi := &file_model_node_cluster_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *NodeCluster) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*NodeCluster) ProtoMessage() {} - -func (x *NodeCluster) ProtoReflect() protoreflect.Message { - mi := &file_model_node_cluster_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 NodeCluster.ProtoReflect.Descriptor instead. -func (*NodeCluster) Descriptor() ([]byte, []int) { - return file_model_node_cluster_proto_rawDescGZIP(), []int{0} -} - -func (x *NodeCluster) GetId() int64 { - if x != nil { - return x.Id - } - return 0 -} - -func (x *NodeCluster) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *NodeCluster) GetCreatedAt() int64 { - if x != nil { - return x.CreatedAt - } - return 0 -} - -func (x *NodeCluster) GetGrantId() int64 { - if x != nil { - return x.GrantId - } - return 0 -} - -func (x *NodeCluster) GetInstallDir() string { - if x != nil { - return x.InstallDir - } - return "" -} - -var File_model_node_cluster_proto protoreflect.FileDescriptor - -var file_model_node_cluster_proto_rawDesc = []byte{ - 0x0a, 0x18, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5f, 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x63, 0x6c, 0x75, - 0x73, 0x74, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, 0x62, 0x22, 0x89, - 0x01, 0x0a, 0x0b, 0x4e, 0x6f, 0x64, 0x65, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x12, 0x0e, - 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, - 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, - 0x6d, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, - 0x12, 0x18, 0x0a, 0x07, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x49, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, - 0x03, 0x52, 0x07, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x69, 0x6e, - 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x44, 0x69, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, - 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x44, 0x69, 0x72, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, - 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_model_node_cluster_proto_rawDescOnce sync.Once - file_model_node_cluster_proto_rawDescData = file_model_node_cluster_proto_rawDesc -) - -func file_model_node_cluster_proto_rawDescGZIP() []byte { - file_model_node_cluster_proto_rawDescOnce.Do(func() { - file_model_node_cluster_proto_rawDescData = protoimpl.X.CompressGZIP(file_model_node_cluster_proto_rawDescData) - }) - return file_model_node_cluster_proto_rawDescData -} - -var file_model_node_cluster_proto_msgTypes = make([]protoimpl.MessageInfo, 1) -var file_model_node_cluster_proto_goTypes = []interface{}{ - (*NodeCluster)(nil), // 0: pb.NodeCluster -} -var file_model_node_cluster_proto_depIdxs = []int32{ - 0, // [0:0] is the sub-list for method output_type - 0, // [0:0] 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_model_node_cluster_proto_init() } -func file_model_node_cluster_proto_init() { - if File_model_node_cluster_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_model_node_cluster_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*NodeCluster); 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_model_node_cluster_proto_rawDesc, - NumEnums: 0, - NumMessages: 1, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_model_node_cluster_proto_goTypes, - DependencyIndexes: file_model_node_cluster_proto_depIdxs, - MessageInfos: file_model_node_cluster_proto_msgTypes, - }.Build() - File_model_node_cluster_proto = out.File - file_model_node_cluster_proto_rawDesc = nil - file_model_node_cluster_proto_goTypes = nil - file_model_node_cluster_proto_depIdxs = nil -} diff --git a/internal/rpc/pb/model_node_grant.pb.go b/internal/rpc/pb/model_node_grant.pb.go deleted file mode 100644 index cb227aab..00000000 --- a/internal/rpc/pb/model_node_grant.pb.go +++ /dev/null @@ -1,223 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.25.0 -// protoc v3.12.3 -// source: model_node_grant.proto - -package pb - -import ( - proto "github.com/golang/protobuf/proto" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - 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) -) - -// 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 NodeGrant struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - Method string `protobuf:"bytes,3,opt,name=method,proto3" json:"method,omitempty"` - Username string `protobuf:"bytes,4,opt,name=username,proto3" json:"username,omitempty"` - Password string `protobuf:"bytes,5,opt,name=password,proto3" json:"password,omitempty"` - Su bool `protobuf:"varint,6,opt,name=su,proto3" json:"su,omitempty"` - PrivateKey string `protobuf:"bytes,7,opt,name=privateKey,proto3" json:"privateKey,omitempty"` - Description string `protobuf:"bytes,8,opt,name=description,proto3" json:"description,omitempty"` - NodeId int64 `protobuf:"varint,9,opt,name=nodeId,proto3" json:"nodeId,omitempty"` -} - -func (x *NodeGrant) Reset() { - *x = NodeGrant{} - if protoimpl.UnsafeEnabled { - mi := &file_model_node_grant_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *NodeGrant) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*NodeGrant) ProtoMessage() {} - -func (x *NodeGrant) ProtoReflect() protoreflect.Message { - mi := &file_model_node_grant_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 NodeGrant.ProtoReflect.Descriptor instead. -func (*NodeGrant) Descriptor() ([]byte, []int) { - return file_model_node_grant_proto_rawDescGZIP(), []int{0} -} - -func (x *NodeGrant) GetId() int64 { - if x != nil { - return x.Id - } - return 0 -} - -func (x *NodeGrant) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *NodeGrant) GetMethod() string { - if x != nil { - return x.Method - } - return "" -} - -func (x *NodeGrant) GetUsername() string { - if x != nil { - return x.Username - } - return "" -} - -func (x *NodeGrant) GetPassword() string { - if x != nil { - return x.Password - } - return "" -} - -func (x *NodeGrant) GetSu() bool { - if x != nil { - return x.Su - } - return false -} - -func (x *NodeGrant) GetPrivateKey() string { - if x != nil { - return x.PrivateKey - } - return "" -} - -func (x *NodeGrant) GetDescription() string { - if x != nil { - return x.Description - } - return "" -} - -func (x *NodeGrant) GetNodeId() int64 { - if x != nil { - return x.NodeId - } - return 0 -} - -var File_model_node_grant_proto protoreflect.FileDescriptor - -var file_model_node_grant_proto_rawDesc = []byte{ - 0x0a, 0x16, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5f, 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x67, 0x72, 0x61, - 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, 0x62, 0x22, 0xe9, 0x01, 0x0a, - 0x09, 0x4e, 0x6f, 0x64, 0x65, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, - 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x16, - 0x0a, 0x06, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, - 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, - 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, - 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x05, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x0e, - 0x0a, 0x02, 0x73, 0x75, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x02, 0x73, 0x75, 0x12, 0x1e, - 0x0a, 0x0a, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x4b, 0x65, 0x79, 0x18, 0x07, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x0a, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x4b, 0x65, 0x79, 0x12, 0x20, - 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x08, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, - 0x12, 0x16, 0x0a, 0x06, 0x6e, 0x6f, 0x64, 0x65, 0x49, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, 0x03, - 0x52, 0x06, 0x6e, 0x6f, 0x64, 0x65, 0x49, 0x64, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62, - 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_model_node_grant_proto_rawDescOnce sync.Once - file_model_node_grant_proto_rawDescData = file_model_node_grant_proto_rawDesc -) - -func file_model_node_grant_proto_rawDescGZIP() []byte { - file_model_node_grant_proto_rawDescOnce.Do(func() { - file_model_node_grant_proto_rawDescData = protoimpl.X.CompressGZIP(file_model_node_grant_proto_rawDescData) - }) - return file_model_node_grant_proto_rawDescData -} - -var file_model_node_grant_proto_msgTypes = make([]protoimpl.MessageInfo, 1) -var file_model_node_grant_proto_goTypes = []interface{}{ - (*NodeGrant)(nil), // 0: pb.NodeGrant -} -var file_model_node_grant_proto_depIdxs = []int32{ - 0, // [0:0] is the sub-list for method output_type - 0, // [0:0] 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_model_node_grant_proto_init() } -func file_model_node_grant_proto_init() { - if File_model_node_grant_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_model_node_grant_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*NodeGrant); 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_model_node_grant_proto_rawDesc, - NumEnums: 0, - NumMessages: 1, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_model_node_grant_proto_goTypes, - DependencyIndexes: file_model_node_grant_proto_depIdxs, - MessageInfos: file_model_node_grant_proto_msgTypes, - }.Build() - File_model_node_grant_proto = out.File - file_model_node_grant_proto_rawDesc = nil - file_model_node_grant_proto_goTypes = nil - file_model_node_grant_proto_depIdxs = nil -} diff --git a/internal/rpc/pb/model_node_ip_address.pb.go b/internal/rpc/pb/model_node_ip_address.pb.go deleted file mode 100644 index 8a1b4722..00000000 --- a/internal/rpc/pb/model_node_ip_address.pb.go +++ /dev/null @@ -1,203 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.25.0 -// protoc v3.12.3 -// source: model_node_ip_address.proto - -package pb - -import ( - proto "github.com/golang/protobuf/proto" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - 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) -) - -// 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 NodeIPAddress struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` - NodeId int64 `protobuf:"varint,2,opt,name=nodeId,proto3" json:"nodeId,omitempty"` - Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` - Ip string `protobuf:"bytes,4,opt,name=ip,proto3" json:"ip,omitempty"` - Description string `protobuf:"bytes,5,opt,name=description,proto3" json:"description,omitempty"` - State int64 `protobuf:"varint,6,opt,name=state,proto3" json:"state,omitempty"` - Order int64 `protobuf:"varint,7,opt,name=order,proto3" json:"order,omitempty"` -} - -func (x *NodeIPAddress) Reset() { - *x = NodeIPAddress{} - if protoimpl.UnsafeEnabled { - mi := &file_model_node_ip_address_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *NodeIPAddress) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*NodeIPAddress) ProtoMessage() {} - -func (x *NodeIPAddress) ProtoReflect() protoreflect.Message { - mi := &file_model_node_ip_address_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 NodeIPAddress.ProtoReflect.Descriptor instead. -func (*NodeIPAddress) Descriptor() ([]byte, []int) { - return file_model_node_ip_address_proto_rawDescGZIP(), []int{0} -} - -func (x *NodeIPAddress) GetId() int64 { - if x != nil { - return x.Id - } - return 0 -} - -func (x *NodeIPAddress) GetNodeId() int64 { - if x != nil { - return x.NodeId - } - return 0 -} - -func (x *NodeIPAddress) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *NodeIPAddress) GetIp() string { - if x != nil { - return x.Ip - } - return "" -} - -func (x *NodeIPAddress) GetDescription() string { - if x != nil { - return x.Description - } - return "" -} - -func (x *NodeIPAddress) GetState() int64 { - if x != nil { - return x.State - } - return 0 -} - -func (x *NodeIPAddress) GetOrder() int64 { - if x != nil { - return x.Order - } - return 0 -} - -var File_model_node_ip_address_proto protoreflect.FileDescriptor - -var file_model_node_ip_address_proto_rawDesc = []byte{ - 0x0a, 0x1b, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5f, 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x69, 0x70, 0x5f, - 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, - 0x62, 0x22, 0xa9, 0x01, 0x0a, 0x0d, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x50, 0x41, 0x64, 0x64, 0x72, - 0x65, 0x73, 0x73, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, - 0x02, 0x69, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x6e, 0x6f, 0x64, 0x65, 0x49, 0x64, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x03, 0x52, 0x06, 0x6e, 0x6f, 0x64, 0x65, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, - 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, - 0x0e, 0x0a, 0x02, 0x69, 0x70, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x70, 0x12, - 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x05, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, - 0x6e, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, - 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x6f, 0x72, 0x64, 0x65, 0x72, - 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x42, 0x06, 0x5a, - 0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_model_node_ip_address_proto_rawDescOnce sync.Once - file_model_node_ip_address_proto_rawDescData = file_model_node_ip_address_proto_rawDesc -) - -func file_model_node_ip_address_proto_rawDescGZIP() []byte { - file_model_node_ip_address_proto_rawDescOnce.Do(func() { - file_model_node_ip_address_proto_rawDescData = protoimpl.X.CompressGZIP(file_model_node_ip_address_proto_rawDescData) - }) - return file_model_node_ip_address_proto_rawDescData -} - -var file_model_node_ip_address_proto_msgTypes = make([]protoimpl.MessageInfo, 1) -var file_model_node_ip_address_proto_goTypes = []interface{}{ - (*NodeIPAddress)(nil), // 0: pb.NodeIPAddress -} -var file_model_node_ip_address_proto_depIdxs = []int32{ - 0, // [0:0] is the sub-list for method output_type - 0, // [0:0] 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_model_node_ip_address_proto_init() } -func file_model_node_ip_address_proto_init() { - if File_model_node_ip_address_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_model_node_ip_address_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*NodeIPAddress); 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_model_node_ip_address_proto_rawDesc, - NumEnums: 0, - NumMessages: 1, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_model_node_ip_address_proto_goTypes, - DependencyIndexes: file_model_node_ip_address_proto_depIdxs, - MessageInfos: file_model_node_ip_address_proto_msgTypes, - }.Build() - File_model_node_ip_address_proto = out.File - file_model_node_ip_address_proto_rawDesc = nil - file_model_node_ip_address_proto_goTypes = nil - file_model_node_ip_address_proto_depIdxs = nil -} diff --git a/internal/rpc/pb/model_node_login.pb.go b/internal/rpc/pb/model_node_login.pb.go deleted file mode 100644 index 75582e24..00000000 --- a/internal/rpc/pb/model_node_login.pb.go +++ /dev/null @@ -1,174 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.25.0 -// protoc v3.12.3 -// source: model_node_login.proto - -package pb - -import ( - proto "github.com/golang/protobuf/proto" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - 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) -) - -// 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 NodeLogin struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - Type string `protobuf:"bytes,3,opt,name=type,proto3" json:"type,omitempty"` - Params []byte `protobuf:"bytes,4,opt,name=params,proto3" json:"params,omitempty"` -} - -func (x *NodeLogin) Reset() { - *x = NodeLogin{} - if protoimpl.UnsafeEnabled { - mi := &file_model_node_login_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *NodeLogin) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*NodeLogin) ProtoMessage() {} - -func (x *NodeLogin) ProtoReflect() protoreflect.Message { - mi := &file_model_node_login_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 NodeLogin.ProtoReflect.Descriptor instead. -func (*NodeLogin) Descriptor() ([]byte, []int) { - return file_model_node_login_proto_rawDescGZIP(), []int{0} -} - -func (x *NodeLogin) GetId() int64 { - if x != nil { - return x.Id - } - return 0 -} - -func (x *NodeLogin) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *NodeLogin) GetType() string { - if x != nil { - return x.Type - } - return "" -} - -func (x *NodeLogin) GetParams() []byte { - if x != nil { - return x.Params - } - return nil -} - -var File_model_node_login_proto protoreflect.FileDescriptor - -var file_model_node_login_proto_rawDesc = []byte{ - 0x0a, 0x16, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5f, 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x6c, 0x6f, 0x67, - 0x69, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, 0x62, 0x22, 0x5b, 0x0a, 0x09, - 0x4e, 0x6f, 0x64, 0x65, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, - 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, - 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, - 0x65, 0x12, 0x16, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, - 0x0c, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70, - 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_model_node_login_proto_rawDescOnce sync.Once - file_model_node_login_proto_rawDescData = file_model_node_login_proto_rawDesc -) - -func file_model_node_login_proto_rawDescGZIP() []byte { - file_model_node_login_proto_rawDescOnce.Do(func() { - file_model_node_login_proto_rawDescData = protoimpl.X.CompressGZIP(file_model_node_login_proto_rawDescData) - }) - return file_model_node_login_proto_rawDescData -} - -var file_model_node_login_proto_msgTypes = make([]protoimpl.MessageInfo, 1) -var file_model_node_login_proto_goTypes = []interface{}{ - (*NodeLogin)(nil), // 0: pb.NodeLogin -} -var file_model_node_login_proto_depIdxs = []int32{ - 0, // [0:0] is the sub-list for method output_type - 0, // [0:0] 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_model_node_login_proto_init() } -func file_model_node_login_proto_init() { - if File_model_node_login_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_model_node_login_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*NodeLogin); 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_model_node_login_proto_rawDesc, - NumEnums: 0, - NumMessages: 1, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_model_node_login_proto_goTypes, - DependencyIndexes: file_model_node_login_proto_depIdxs, - MessageInfos: file_model_node_login_proto_msgTypes, - }.Build() - File_model_node_login_proto = out.File - file_model_node_login_proto_rawDesc = nil - file_model_node_login_proto_goTypes = nil - file_model_node_login_proto_depIdxs = nil -} diff --git a/internal/rpc/pb/model_server.pb.go b/internal/rpc/pb/model_server.pb.go deleted file mode 100644 index 5bf1f640..00000000 --- a/internal/rpc/pb/model_server.pb.go +++ /dev/null @@ -1,201 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.25.0 -// protoc v3.12.3 -// source: model_server.proto - -package pb - -import ( - proto "github.com/golang/protobuf/proto" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - 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) -) - -// 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 Server struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` - Config []byte `protobuf:"bytes,2,opt,name=config,proto3" json:"config,omitempty"` - IncludeNodes []byte `protobuf:"bytes,3,opt,name=includeNodes,proto3" json:"includeNodes,omitempty"` - ExcludeNodes []byte `protobuf:"bytes,4,opt,name=excludeNodes,proto3" json:"excludeNodes,omitempty"` - CreatedAt int64 `protobuf:"varint,5,opt,name=createdAt,proto3" json:"createdAt,omitempty"` - Cluster *NodeCluster `protobuf:"bytes,6,opt,name=cluster,proto3" json:"cluster,omitempty"` -} - -func (x *Server) Reset() { - *x = Server{} - if protoimpl.UnsafeEnabled { - mi := &file_model_server_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Server) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Server) ProtoMessage() {} - -func (x *Server) ProtoReflect() protoreflect.Message { - mi := &file_model_server_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 Server.ProtoReflect.Descriptor instead. -func (*Server) Descriptor() ([]byte, []int) { - return file_model_server_proto_rawDescGZIP(), []int{0} -} - -func (x *Server) GetId() int64 { - if x != nil { - return x.Id - } - return 0 -} - -func (x *Server) GetConfig() []byte { - if x != nil { - return x.Config - } - return nil -} - -func (x *Server) GetIncludeNodes() []byte { - if x != nil { - return x.IncludeNodes - } - return nil -} - -func (x *Server) GetExcludeNodes() []byte { - if x != nil { - return x.ExcludeNodes - } - return nil -} - -func (x *Server) GetCreatedAt() int64 { - if x != nil { - return x.CreatedAt - } - return 0 -} - -func (x *Server) GetCluster() *NodeCluster { - if x != nil { - return x.Cluster - } - return nil -} - -var File_model_server_proto protoreflect.FileDescriptor - -var file_model_server_proto_rawDesc = []byte{ - 0x0a, 0x12, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, 0x62, 0x1a, 0x18, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5f, - 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x22, 0xc1, 0x01, 0x0a, 0x06, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x12, 0x0e, 0x0a, - 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x16, 0x0a, - 0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x63, - 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x22, 0x0a, 0x0c, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, - 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0c, 0x69, 0x6e, 0x63, - 0x6c, 0x75, 0x64, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x12, 0x22, 0x0a, 0x0c, 0x65, 0x78, 0x63, - 0x6c, 0x75, 0x64, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, - 0x0c, 0x65, 0x78, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x12, 0x1c, 0x0a, - 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, - 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x29, 0x0a, 0x07, 0x63, - 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x70, - 0x62, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x52, 0x07, 0x63, - 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_model_server_proto_rawDescOnce sync.Once - file_model_server_proto_rawDescData = file_model_server_proto_rawDesc -) - -func file_model_server_proto_rawDescGZIP() []byte { - file_model_server_proto_rawDescOnce.Do(func() { - file_model_server_proto_rawDescData = protoimpl.X.CompressGZIP(file_model_server_proto_rawDescData) - }) - return file_model_server_proto_rawDescData -} - -var file_model_server_proto_msgTypes = make([]protoimpl.MessageInfo, 1) -var file_model_server_proto_goTypes = []interface{}{ - (*Server)(nil), // 0: pb.Server - (*NodeCluster)(nil), // 1: pb.NodeCluster -} -var file_model_server_proto_depIdxs = []int32{ - 1, // 0: pb.Server.cluster:type_name -> pb.NodeCluster - 1, // [1:1] is the sub-list for method output_type - 1, // [1:1] is the sub-list for method input_type - 1, // [1:1] is the sub-list for extension type_name - 1, // [1:1] is the sub-list for extension extendee - 0, // [0:1] is the sub-list for field type_name -} - -func init() { file_model_server_proto_init() } -func file_model_server_proto_init() { - if File_model_server_proto != nil { - return - } - file_model_node_cluster_proto_init() - if !protoimpl.UnsafeEnabled { - file_model_server_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Server); 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_model_server_proto_rawDesc, - NumEnums: 0, - NumMessages: 1, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_model_server_proto_goTypes, - DependencyIndexes: file_model_server_proto_depIdxs, - MessageInfos: file_model_server_proto_msgTypes, - }.Build() - File_model_server_proto = out.File - file_model_server_proto_rawDesc = nil - file_model_server_proto_goTypes = nil - file_model_server_proto_depIdxs = nil -} diff --git a/internal/rpc/pb/service_admin.pb.go b/internal/rpc/pb/service_admin.pb.go deleted file mode 100644 index ba7ec823..00000000 --- a/internal/rpc/pb/service_admin.pb.go +++ /dev/null @@ -1,883 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.25.0 -// protoc v3.12.3 -// source: service_admin.proto - -package pb - -import ( - context "context" - proto "github.com/golang/protobuf/proto" - 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" - 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) -) - -// 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 LoginAdminRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"` - Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"` -} - -func (x *LoginAdminRequest) Reset() { - *x = LoginAdminRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_service_admin_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *LoginAdminRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*LoginAdminRequest) ProtoMessage() {} - -func (x *LoginAdminRequest) ProtoReflect() protoreflect.Message { - mi := &file_service_admin_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 LoginAdminRequest.ProtoReflect.Descriptor instead. -func (*LoginAdminRequest) Descriptor() ([]byte, []int) { - return file_service_admin_proto_rawDescGZIP(), []int{0} -} - -func (x *LoginAdminRequest) GetUsername() string { - if x != nil { - return x.Username - } - return "" -} - -func (x *LoginAdminRequest) GetPassword() string { - if x != nil { - return x.Password - } - return "" -} - -type LoginAdminResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - AdminId int64 `protobuf:"varint,1,opt,name=adminId,proto3" json:"adminId,omitempty"` - IsOk bool `protobuf:"varint,2,opt,name=isOk,proto3" json:"isOk,omitempty"` - Message string `protobuf:"bytes,3,opt,name=message,proto3" json:"message,omitempty"` -} - -func (x *LoginAdminResponse) Reset() { - *x = LoginAdminResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_service_admin_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *LoginAdminResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*LoginAdminResponse) ProtoMessage() {} - -func (x *LoginAdminResponse) ProtoReflect() protoreflect.Message { - mi := &file_service_admin_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) -} - -// Deprecated: Use LoginAdminResponse.ProtoReflect.Descriptor instead. -func (*LoginAdminResponse) Descriptor() ([]byte, []int) { - return file_service_admin_proto_rawDescGZIP(), []int{1} -} - -func (x *LoginAdminResponse) GetAdminId() int64 { - if x != nil { - return x.AdminId - } - return 0 -} - -func (x *LoginAdminResponse) GetIsOk() bool { - if x != nil { - return x.IsOk - } - return false -} - -func (x *LoginAdminResponse) GetMessage() string { - if x != nil { - return x.Message - } - return "" -} - -type CreateAdminLogRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Level string `protobuf:"bytes,1,opt,name=level,proto3" json:"level,omitempty"` - Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` - Action string `protobuf:"bytes,3,opt,name=action,proto3" json:"action,omitempty"` - Ip string `protobuf:"bytes,4,opt,name=ip,proto3" json:"ip,omitempty"` -} - -func (x *CreateAdminLogRequest) Reset() { - *x = CreateAdminLogRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_service_admin_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CreateAdminLogRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CreateAdminLogRequest) ProtoMessage() {} - -func (x *CreateAdminLogRequest) ProtoReflect() protoreflect.Message { - mi := &file_service_admin_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) -} - -// Deprecated: Use CreateAdminLogRequest.ProtoReflect.Descriptor instead. -func (*CreateAdminLogRequest) Descriptor() ([]byte, []int) { - return file_service_admin_proto_rawDescGZIP(), []int{2} -} - -func (x *CreateAdminLogRequest) GetLevel() string { - if x != nil { - return x.Level - } - return "" -} - -func (x *CreateAdminLogRequest) GetDescription() string { - if x != nil { - return x.Description - } - return "" -} - -func (x *CreateAdminLogRequest) GetAction() string { - if x != nil { - return x.Action - } - return "" -} - -func (x *CreateAdminLogRequest) GetIp() string { - if x != nil { - return x.Ip - } - return "" -} - -type CreateAdminLogResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - IsOk bool `protobuf:"varint,1,opt,name=isOk,proto3" json:"isOk,omitempty"` -} - -func (x *CreateAdminLogResponse) Reset() { - *x = CreateAdminLogResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_service_admin_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CreateAdminLogResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CreateAdminLogResponse) ProtoMessage() {} - -func (x *CreateAdminLogResponse) ProtoReflect() protoreflect.Message { - mi := &file_service_admin_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) -} - -// Deprecated: Use CreateAdminLogResponse.ProtoReflect.Descriptor instead. -func (*CreateAdminLogResponse) Descriptor() ([]byte, []int) { - return file_service_admin_proto_rawDescGZIP(), []int{3} -} - -func (x *CreateAdminLogResponse) GetIsOk() bool { - if x != nil { - return x.IsOk - } - return false -} - -type CheckAdminExistsRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - AdminId int64 `protobuf:"varint,1,opt,name=adminId,proto3" json:"adminId,omitempty"` -} - -func (x *CheckAdminExistsRequest) Reset() { - *x = CheckAdminExistsRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_service_admin_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CheckAdminExistsRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CheckAdminExistsRequest) ProtoMessage() {} - -func (x *CheckAdminExistsRequest) ProtoReflect() protoreflect.Message { - mi := &file_service_admin_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) -} - -// Deprecated: Use CheckAdminExistsRequest.ProtoReflect.Descriptor instead. -func (*CheckAdminExistsRequest) Descriptor() ([]byte, []int) { - return file_service_admin_proto_rawDescGZIP(), []int{4} -} - -func (x *CheckAdminExistsRequest) GetAdminId() int64 { - if x != nil { - return x.AdminId - } - return 0 -} - -type CheckAdminExistsResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - IsOk bool `protobuf:"varint,1,opt,name=isOk,proto3" json:"isOk,omitempty"` - Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` -} - -func (x *CheckAdminExistsResponse) Reset() { - *x = CheckAdminExistsResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_service_admin_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CheckAdminExistsResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CheckAdminExistsResponse) ProtoMessage() {} - -func (x *CheckAdminExistsResponse) ProtoReflect() protoreflect.Message { - mi := &file_service_admin_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) -} - -// Deprecated: Use CheckAdminExistsResponse.ProtoReflect.Descriptor instead. -func (*CheckAdminExistsResponse) Descriptor() ([]byte, []int) { - return file_service_admin_proto_rawDescGZIP(), []int{5} -} - -func (x *CheckAdminExistsResponse) GetIsOk() bool { - if x != nil { - return x.IsOk - } - return false -} - -func (x *CheckAdminExistsResponse) GetMessage() string { - if x != nil { - return x.Message - } - return "" -} - -type FindAdminNameRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - AdminId int64 `protobuf:"varint,1,opt,name=adminId,proto3" json:"adminId,omitempty"` -} - -func (x *FindAdminNameRequest) Reset() { - *x = FindAdminNameRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_service_admin_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *FindAdminNameRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*FindAdminNameRequest) ProtoMessage() {} - -func (x *FindAdminNameRequest) ProtoReflect() protoreflect.Message { - mi := &file_service_admin_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) -} - -// Deprecated: Use FindAdminNameRequest.ProtoReflect.Descriptor instead. -func (*FindAdminNameRequest) Descriptor() ([]byte, []int) { - return file_service_admin_proto_rawDescGZIP(), []int{6} -} - -func (x *FindAdminNameRequest) GetAdminId() int64 { - if x != nil { - return x.AdminId - } - return 0 -} - -type FindAdminNameResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Fullname string `protobuf:"bytes,1,opt,name=fullname,proto3" json:"fullname,omitempty"` -} - -func (x *FindAdminNameResponse) Reset() { - *x = FindAdminNameResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_service_admin_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *FindAdminNameResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*FindAdminNameResponse) ProtoMessage() {} - -func (x *FindAdminNameResponse) ProtoReflect() protoreflect.Message { - mi := &file_service_admin_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) -} - -// Deprecated: Use FindAdminNameResponse.ProtoReflect.Descriptor instead. -func (*FindAdminNameResponse) Descriptor() ([]byte, []int) { - return file_service_admin_proto_rawDescGZIP(), []int{7} -} - -func (x *FindAdminNameResponse) GetFullname() string { - if x != nil { - return x.Fullname - } - return "" -} - -var File_service_admin_proto protoreflect.FileDescriptor - -var file_service_admin_proto_rawDesc = []byte{ - 0x0a, 0x13, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, 0x62, 0x22, 0x4b, 0x0a, 0x11, 0x4c, 0x6f, 0x67, - 0x69, 0x6e, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1a, - 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x61, - 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x61, - 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x22, 0x5c, 0x0a, 0x12, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x41, - 0x64, 0x6d, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, - 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x61, - 0x64, 0x6d, 0x69, 0x6e, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x69, 0x73, 0x4f, 0x6b, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x08, 0x52, 0x04, 0x69, 0x73, 0x4f, 0x6b, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, - 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, - 0x73, 0x61, 0x67, 0x65, 0x22, 0x77, 0x0a, 0x15, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x64, - 0x6d, 0x69, 0x6e, 0x4c, 0x6f, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, - 0x05, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6c, 0x65, - 0x76, 0x65, 0x6c, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, - 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, - 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x0e, 0x0a, - 0x02, 0x69, 0x70, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x70, 0x22, 0x2c, 0x0a, - 0x16, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x4c, 0x6f, 0x67, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x69, 0x73, 0x4f, 0x6b, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x04, 0x69, 0x73, 0x4f, 0x6b, 0x22, 0x33, 0x0a, 0x17, 0x43, - 0x68, 0x65, 0x63, 0x6b, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x45, 0x78, 0x69, 0x73, 0x74, 0x73, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x49, - 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x49, 0x64, - 0x22, 0x48, 0x0a, 0x18, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x45, 0x78, - 0x69, 0x73, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x12, 0x0a, 0x04, - 0x69, 0x73, 0x4f, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x04, 0x69, 0x73, 0x4f, 0x6b, - 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x30, 0x0a, 0x14, 0x46, 0x69, - 0x6e, 0x64, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x49, 0x64, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x03, 0x52, 0x07, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x49, 0x64, 0x22, 0x33, 0x0a, 0x15, - 0x46, 0x69, 0x6e, 0x64, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x66, 0x75, 0x6c, 0x6c, 0x6e, 0x61, 0x6d, - 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x66, 0x75, 0x6c, 0x6c, 0x6e, 0x61, 0x6d, - 0x65, 0x32, 0xb5, 0x02, 0x0a, 0x0c, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, - 0x63, 0x65, 0x12, 0x3d, 0x0a, 0x0a, 0x6c, 0x6f, 0x67, 0x69, 0x6e, 0x41, 0x64, 0x6d, 0x69, 0x6e, - 0x12, 0x15, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x41, 0x64, 0x6d, 0x69, 0x6e, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x6f, 0x67, - 0x69, 0x6e, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, - 0x00, 0x12, 0x49, 0x0a, 0x0e, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x64, 0x6d, 0x69, 0x6e, - 0x4c, 0x6f, 0x67, 0x12, 0x19, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, - 0x64, 0x6d, 0x69, 0x6e, 0x4c, 0x6f, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, - 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x4c, - 0x6f, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x4f, 0x0a, 0x10, - 0x63, 0x68, 0x65, 0x63, 0x6b, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x45, 0x78, 0x69, 0x73, 0x74, 0x73, - 0x12, 0x1b, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x41, 0x64, 0x6d, 0x69, 0x6e, - 0x45, 0x78, 0x69, 0x73, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, - 0x70, 0x62, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x45, 0x78, 0x69, - 0x73, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x4a, 0x0a, - 0x11, 0x66, 0x69, 0x6e, 0x64, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x46, 0x75, 0x6c, 0x6c, 0x6e, 0x61, - 0x6d, 0x65, 0x12, 0x18, 0x2e, 0x70, 0x62, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x41, 0x64, 0x6d, 0x69, - 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x70, - 0x62, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70, - 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_service_admin_proto_rawDescOnce sync.Once - file_service_admin_proto_rawDescData = file_service_admin_proto_rawDesc -) - -func file_service_admin_proto_rawDescGZIP() []byte { - file_service_admin_proto_rawDescOnce.Do(func() { - file_service_admin_proto_rawDescData = protoimpl.X.CompressGZIP(file_service_admin_proto_rawDescData) - }) - return file_service_admin_proto_rawDescData -} - -var file_service_admin_proto_msgTypes = make([]protoimpl.MessageInfo, 8) -var file_service_admin_proto_goTypes = []interface{}{ - (*LoginAdminRequest)(nil), // 0: pb.LoginAdminRequest - (*LoginAdminResponse)(nil), // 1: pb.LoginAdminResponse - (*CreateAdminLogRequest)(nil), // 2: pb.CreateAdminLogRequest - (*CreateAdminLogResponse)(nil), // 3: pb.CreateAdminLogResponse - (*CheckAdminExistsRequest)(nil), // 4: pb.CheckAdminExistsRequest - (*CheckAdminExistsResponse)(nil), // 5: pb.CheckAdminExistsResponse - (*FindAdminNameRequest)(nil), // 6: pb.FindAdminNameRequest - (*FindAdminNameResponse)(nil), // 7: pb.FindAdminNameResponse -} -var file_service_admin_proto_depIdxs = []int32{ - 0, // 0: pb.AdminService.loginAdmin:input_type -> pb.LoginAdminRequest - 2, // 1: pb.AdminService.createAdminLog:input_type -> pb.CreateAdminLogRequest - 4, // 2: pb.AdminService.checkAdminExists:input_type -> pb.CheckAdminExistsRequest - 6, // 3: pb.AdminService.findAdminFullname:input_type -> pb.FindAdminNameRequest - 1, // 4: pb.AdminService.loginAdmin:output_type -> pb.LoginAdminResponse - 3, // 5: pb.AdminService.createAdminLog:output_type -> pb.CreateAdminLogResponse - 5, // 6: pb.AdminService.checkAdminExists:output_type -> pb.CheckAdminExistsResponse - 7, // 7: pb.AdminService.findAdminFullname:output_type -> pb.FindAdminNameResponse - 4, // [4:8] is the sub-list for method output_type - 0, // [0:4] 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_service_admin_proto_init() } -func file_service_admin_proto_init() { - if File_service_admin_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_service_admin_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*LoginAdminRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_service_admin_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*LoginAdminResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_service_admin_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreateAdminLogRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_service_admin_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreateAdminLogResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_service_admin_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CheckAdminExistsRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_service_admin_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CheckAdminExistsResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_service_admin_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*FindAdminNameRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_service_admin_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*FindAdminNameResponse); 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_service_admin_proto_rawDesc, - NumEnums: 0, - NumMessages: 8, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_service_admin_proto_goTypes, - DependencyIndexes: file_service_admin_proto_depIdxs, - MessageInfos: file_service_admin_proto_msgTypes, - }.Build() - File_service_admin_proto = out.File - file_service_admin_proto_rawDesc = nil - file_service_admin_proto_goTypes = nil - file_service_admin_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 - -// AdminServiceClient is the client API for AdminService service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type AdminServiceClient interface { - // 登录 - LoginAdmin(ctx context.Context, in *LoginAdminRequest, opts ...grpc.CallOption) (*LoginAdminResponse, error) - // 创建操作日志 - CreateAdminLog(ctx context.Context, in *CreateAdminLogRequest, opts ...grpc.CallOption) (*CreateAdminLogResponse, error) - // 检查管理员是否存在 - CheckAdminExists(ctx context.Context, in *CheckAdminExistsRequest, opts ...grpc.CallOption) (*CheckAdminExistsResponse, error) - // 获取管理员名称 - FindAdminFullname(ctx context.Context, in *FindAdminNameRequest, opts ...grpc.CallOption) (*FindAdminNameResponse, error) -} - -type adminServiceClient struct { - cc grpc.ClientConnInterface -} - -func NewAdminServiceClient(cc grpc.ClientConnInterface) AdminServiceClient { - return &adminServiceClient{cc} -} - -func (c *adminServiceClient) LoginAdmin(ctx context.Context, in *LoginAdminRequest, opts ...grpc.CallOption) (*LoginAdminResponse, error) { - out := new(LoginAdminResponse) - err := c.cc.Invoke(ctx, "/pb.AdminService/loginAdmin", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *adminServiceClient) CreateAdminLog(ctx context.Context, in *CreateAdminLogRequest, opts ...grpc.CallOption) (*CreateAdminLogResponse, error) { - out := new(CreateAdminLogResponse) - err := c.cc.Invoke(ctx, "/pb.AdminService/createAdminLog", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *adminServiceClient) CheckAdminExists(ctx context.Context, in *CheckAdminExistsRequest, opts ...grpc.CallOption) (*CheckAdminExistsResponse, error) { - out := new(CheckAdminExistsResponse) - err := c.cc.Invoke(ctx, "/pb.AdminService/checkAdminExists", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *adminServiceClient) FindAdminFullname(ctx context.Context, in *FindAdminNameRequest, opts ...grpc.CallOption) (*FindAdminNameResponse, error) { - out := new(FindAdminNameResponse) - err := c.cc.Invoke(ctx, "/pb.AdminService/findAdminFullname", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// AdminServiceServer is the server API for AdminService service. -type AdminServiceServer interface { - // 登录 - LoginAdmin(context.Context, *LoginAdminRequest) (*LoginAdminResponse, error) - // 创建操作日志 - CreateAdminLog(context.Context, *CreateAdminLogRequest) (*CreateAdminLogResponse, error) - // 检查管理员是否存在 - CheckAdminExists(context.Context, *CheckAdminExistsRequest) (*CheckAdminExistsResponse, error) - // 获取管理员名称 - FindAdminFullname(context.Context, *FindAdminNameRequest) (*FindAdminNameResponse, error) -} - -// UnimplementedAdminServiceServer can be embedded to have forward compatible implementations. -type UnimplementedAdminServiceServer struct { -} - -func (*UnimplementedAdminServiceServer) LoginAdmin(context.Context, *LoginAdminRequest) (*LoginAdminResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method LoginAdmin not implemented") -} -func (*UnimplementedAdminServiceServer) CreateAdminLog(context.Context, *CreateAdminLogRequest) (*CreateAdminLogResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method CreateAdminLog not implemented") -} -func (*UnimplementedAdminServiceServer) CheckAdminExists(context.Context, *CheckAdminExistsRequest) (*CheckAdminExistsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method CheckAdminExists not implemented") -} -func (*UnimplementedAdminServiceServer) FindAdminFullname(context.Context, *FindAdminNameRequest) (*FindAdminNameResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method FindAdminFullname not implemented") -} - -func RegisterAdminServiceServer(s *grpc.Server, srv AdminServiceServer) { - s.RegisterService(&_AdminService_serviceDesc, srv) -} - -func _AdminService_LoginAdmin_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(LoginAdminRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AdminServiceServer).LoginAdmin(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/pb.AdminService/LoginAdmin", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AdminServiceServer).LoginAdmin(ctx, req.(*LoginAdminRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _AdminService_CreateAdminLog_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(CreateAdminLogRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AdminServiceServer).CreateAdminLog(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/pb.AdminService/CreateAdminLog", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AdminServiceServer).CreateAdminLog(ctx, req.(*CreateAdminLogRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _AdminService_CheckAdminExists_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(CheckAdminExistsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AdminServiceServer).CheckAdminExists(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/pb.AdminService/CheckAdminExists", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AdminServiceServer).CheckAdminExists(ctx, req.(*CheckAdminExistsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _AdminService_FindAdminFullname_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(FindAdminNameRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AdminServiceServer).FindAdminFullname(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/pb.AdminService/FindAdminFullname", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AdminServiceServer).FindAdminFullname(ctx, req.(*FindAdminNameRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _AdminService_serviceDesc = grpc.ServiceDesc{ - ServiceName: "pb.AdminService", - HandlerType: (*AdminServiceServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "loginAdmin", - Handler: _AdminService_LoginAdmin_Handler, - }, - { - MethodName: "createAdminLog", - Handler: _AdminService_CreateAdminLog_Handler, - }, - { - MethodName: "checkAdminExists", - Handler: _AdminService_CheckAdminExists_Handler, - }, - { - MethodName: "findAdminFullname", - Handler: _AdminService_FindAdminFullname_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "service_admin.proto", -} diff --git a/internal/rpc/pb/service_api_node.pb.go b/internal/rpc/pb/service_api_node.pb.go deleted file mode 100644 index 7105fb6c..00000000 --- a/internal/rpc/pb/service_api_node.pb.go +++ /dev/null @@ -1,1385 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.25.0 -// protoc v3.12.3 -// source: service_api_node.proto - -package pb - -import ( - context "context" - proto "github.com/golang/protobuf/proto" - 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" - 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) -) - -// This is a compile-time assertion that a sufficiently up-to-date version -// of the legacy proto package is being used. -const _ = proto.ProtoPackageIsVersion4 - -// 创建API节点 -type CreateAPINodeRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` - Host string `protobuf:"bytes,3,opt,name=host,proto3" json:"host,omitempty"` - Port int32 `protobuf:"varint,4,opt,name=port,proto3" json:"port,omitempty"` -} - -func (x *CreateAPINodeRequest) Reset() { - *x = CreateAPINodeRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_service_api_node_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CreateAPINodeRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CreateAPINodeRequest) ProtoMessage() {} - -func (x *CreateAPINodeRequest) ProtoReflect() protoreflect.Message { - mi := &file_service_api_node_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 CreateAPINodeRequest.ProtoReflect.Descriptor instead. -func (*CreateAPINodeRequest) Descriptor() ([]byte, []int) { - return file_service_api_node_proto_rawDescGZIP(), []int{0} -} - -func (x *CreateAPINodeRequest) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *CreateAPINodeRequest) GetDescription() string { - if x != nil { - return x.Description - } - return "" -} - -func (x *CreateAPINodeRequest) GetHost() string { - if x != nil { - return x.Host - } - return "" -} - -func (x *CreateAPINodeRequest) GetPort() int32 { - if x != nil { - return x.Port - } - return 0 -} - -type CreateAPINodeResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - NodeId int64 `protobuf:"varint,1,opt,name=nodeId,proto3" json:"nodeId,omitempty"` -} - -func (x *CreateAPINodeResponse) Reset() { - *x = CreateAPINodeResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_service_api_node_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CreateAPINodeResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CreateAPINodeResponse) ProtoMessage() {} - -func (x *CreateAPINodeResponse) ProtoReflect() protoreflect.Message { - mi := &file_service_api_node_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) -} - -// Deprecated: Use CreateAPINodeResponse.ProtoReflect.Descriptor instead. -func (*CreateAPINodeResponse) Descriptor() ([]byte, []int) { - return file_service_api_node_proto_rawDescGZIP(), []int{1} -} - -func (x *CreateAPINodeResponse) GetNodeId() int64 { - if x != nil { - return x.NodeId - } - return 0 -} - -// 修改API节点 -type UpdateAPINodeRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - NodeId int64 `protobuf:"varint,1,opt,name=nodeId,proto3" json:"nodeId,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` - Host string `protobuf:"bytes,4,opt,name=host,proto3" json:"host,omitempty"` - Port int32 `protobuf:"varint,5,opt,name=port,proto3" json:"port,omitempty"` -} - -func (x *UpdateAPINodeRequest) Reset() { - *x = UpdateAPINodeRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_service_api_node_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *UpdateAPINodeRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UpdateAPINodeRequest) ProtoMessage() {} - -func (x *UpdateAPINodeRequest) ProtoReflect() protoreflect.Message { - mi := &file_service_api_node_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) -} - -// Deprecated: Use UpdateAPINodeRequest.ProtoReflect.Descriptor instead. -func (*UpdateAPINodeRequest) Descriptor() ([]byte, []int) { - return file_service_api_node_proto_rawDescGZIP(), []int{2} -} - -func (x *UpdateAPINodeRequest) GetNodeId() int64 { - if x != nil { - return x.NodeId - } - return 0 -} - -func (x *UpdateAPINodeRequest) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *UpdateAPINodeRequest) GetDescription() string { - if x != nil { - return x.Description - } - return "" -} - -func (x *UpdateAPINodeRequest) GetHost() string { - if x != nil { - return x.Host - } - return "" -} - -func (x *UpdateAPINodeRequest) GetPort() int32 { - if x != nil { - return x.Port - } - return 0 -} - -type UpdateAPINodeResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *UpdateAPINodeResponse) Reset() { - *x = UpdateAPINodeResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_service_api_node_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *UpdateAPINodeResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UpdateAPINodeResponse) ProtoMessage() {} - -func (x *UpdateAPINodeResponse) ProtoReflect() protoreflect.Message { - mi := &file_service_api_node_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) -} - -// Deprecated: Use UpdateAPINodeResponse.ProtoReflect.Descriptor instead. -func (*UpdateAPINodeResponse) Descriptor() ([]byte, []int) { - return file_service_api_node_proto_rawDescGZIP(), []int{3} -} - -// 删除API节点 -type DeleteAPINodeRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - NodeId int64 `protobuf:"varint,1,opt,name=nodeId,proto3" json:"nodeId,omitempty"` -} - -func (x *DeleteAPINodeRequest) Reset() { - *x = DeleteAPINodeRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_service_api_node_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *DeleteAPINodeRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DeleteAPINodeRequest) ProtoMessage() {} - -func (x *DeleteAPINodeRequest) ProtoReflect() protoreflect.Message { - mi := &file_service_api_node_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) -} - -// Deprecated: Use DeleteAPINodeRequest.ProtoReflect.Descriptor instead. -func (*DeleteAPINodeRequest) Descriptor() ([]byte, []int) { - return file_service_api_node_proto_rawDescGZIP(), []int{4} -} - -func (x *DeleteAPINodeRequest) GetNodeId() int64 { - if x != nil { - return x.NodeId - } - return 0 -} - -type DeleteAPINodeResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *DeleteAPINodeResponse) Reset() { - *x = DeleteAPINodeResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_service_api_node_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *DeleteAPINodeResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DeleteAPINodeResponse) ProtoMessage() {} - -func (x *DeleteAPINodeResponse) ProtoReflect() protoreflect.Message { - mi := &file_service_api_node_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) -} - -// Deprecated: Use DeleteAPINodeResponse.ProtoReflect.Descriptor instead. -func (*DeleteAPINodeResponse) Descriptor() ([]byte, []int) { - return file_service_api_node_proto_rawDescGZIP(), []int{5} -} - -// 列出所有可用API节点 -type FindAllEnabledAPINodesRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *FindAllEnabledAPINodesRequest) Reset() { - *x = FindAllEnabledAPINodesRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_service_api_node_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *FindAllEnabledAPINodesRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*FindAllEnabledAPINodesRequest) ProtoMessage() {} - -func (x *FindAllEnabledAPINodesRequest) ProtoReflect() protoreflect.Message { - mi := &file_service_api_node_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) -} - -// Deprecated: Use FindAllEnabledAPINodesRequest.ProtoReflect.Descriptor instead. -func (*FindAllEnabledAPINodesRequest) Descriptor() ([]byte, []int) { - return file_service_api_node_proto_rawDescGZIP(), []int{6} -} - -type FindAllEnabledAPINodesResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Nodes []*APINode `protobuf:"bytes,1,rep,name=nodes,proto3" json:"nodes,omitempty"` -} - -func (x *FindAllEnabledAPINodesResponse) Reset() { - *x = FindAllEnabledAPINodesResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_service_api_node_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *FindAllEnabledAPINodesResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*FindAllEnabledAPINodesResponse) ProtoMessage() {} - -func (x *FindAllEnabledAPINodesResponse) ProtoReflect() protoreflect.Message { - mi := &file_service_api_node_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) -} - -// Deprecated: Use FindAllEnabledAPINodesResponse.ProtoReflect.Descriptor instead. -func (*FindAllEnabledAPINodesResponse) Descriptor() ([]byte, []int) { - return file_service_api_node_proto_rawDescGZIP(), []int{7} -} - -func (x *FindAllEnabledAPINodesResponse) GetNodes() []*APINode { - if x != nil { - return x.Nodes - } - return nil -} - -// 计算API节点数量 -type CountAllEnabledAPINodesRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *CountAllEnabledAPINodesRequest) Reset() { - *x = CountAllEnabledAPINodesRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_service_api_node_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CountAllEnabledAPINodesRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CountAllEnabledAPINodesRequest) ProtoMessage() {} - -func (x *CountAllEnabledAPINodesRequest) ProtoReflect() protoreflect.Message { - mi := &file_service_api_node_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) -} - -// Deprecated: Use CountAllEnabledAPINodesRequest.ProtoReflect.Descriptor instead. -func (*CountAllEnabledAPINodesRequest) Descriptor() ([]byte, []int) { - return file_service_api_node_proto_rawDescGZIP(), []int{8} -} - -type CountAllEnabledAPINodesResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Count int64 `protobuf:"varint,1,opt,name=count,proto3" json:"count,omitempty"` -} - -func (x *CountAllEnabledAPINodesResponse) Reset() { - *x = CountAllEnabledAPINodesResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_service_api_node_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CountAllEnabledAPINodesResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CountAllEnabledAPINodesResponse) ProtoMessage() {} - -func (x *CountAllEnabledAPINodesResponse) ProtoReflect() protoreflect.Message { - mi := &file_service_api_node_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) -} - -// Deprecated: Use CountAllEnabledAPINodesResponse.ProtoReflect.Descriptor instead. -func (*CountAllEnabledAPINodesResponse) Descriptor() ([]byte, []int) { - return file_service_api_node_proto_rawDescGZIP(), []int{9} -} - -func (x *CountAllEnabledAPINodesResponse) GetCount() int64 { - if x != nil { - return x.Count - } - return 0 -} - -// 列出单页的API节点 -type ListEnabledAPINodesRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Offset int64 `protobuf:"varint,1,opt,name=offset,proto3" json:"offset,omitempty"` - Size int64 `protobuf:"varint,2,opt,name=size,proto3" json:"size,omitempty"` -} - -func (x *ListEnabledAPINodesRequest) Reset() { - *x = ListEnabledAPINodesRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_service_api_node_proto_msgTypes[10] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListEnabledAPINodesRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListEnabledAPINodesRequest) ProtoMessage() {} - -func (x *ListEnabledAPINodesRequest) ProtoReflect() protoreflect.Message { - mi := &file_service_api_node_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) -} - -// Deprecated: Use ListEnabledAPINodesRequest.ProtoReflect.Descriptor instead. -func (*ListEnabledAPINodesRequest) Descriptor() ([]byte, []int) { - return file_service_api_node_proto_rawDescGZIP(), []int{10} -} - -func (x *ListEnabledAPINodesRequest) GetOffset() int64 { - if x != nil { - return x.Offset - } - return 0 -} - -func (x *ListEnabledAPINodesRequest) GetSize() int64 { - if x != nil { - return x.Size - } - return 0 -} - -type ListEnabledAPINodesResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Nodes []*APINode `protobuf:"bytes,1,rep,name=nodes,proto3" json:"nodes,omitempty"` -} - -func (x *ListEnabledAPINodesResponse) Reset() { - *x = ListEnabledAPINodesResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_service_api_node_proto_msgTypes[11] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListEnabledAPINodesResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListEnabledAPINodesResponse) ProtoMessage() {} - -func (x *ListEnabledAPINodesResponse) ProtoReflect() protoreflect.Message { - mi := &file_service_api_node_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) -} - -// Deprecated: Use ListEnabledAPINodesResponse.ProtoReflect.Descriptor instead. -func (*ListEnabledAPINodesResponse) Descriptor() ([]byte, []int) { - return file_service_api_node_proto_rawDescGZIP(), []int{11} -} - -func (x *ListEnabledAPINodesResponse) GetNodes() []*APINode { - if x != nil { - return x.Nodes - } - return nil -} - -// 根据ID查找节点 -type FindEnabledAPINodeRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - NodeId int64 `protobuf:"varint,1,opt,name=nodeId,proto3" json:"nodeId,omitempty"` -} - -func (x *FindEnabledAPINodeRequest) Reset() { - *x = FindEnabledAPINodeRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_service_api_node_proto_msgTypes[12] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *FindEnabledAPINodeRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*FindEnabledAPINodeRequest) ProtoMessage() {} - -func (x *FindEnabledAPINodeRequest) ProtoReflect() protoreflect.Message { - mi := &file_service_api_node_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) -} - -// Deprecated: Use FindEnabledAPINodeRequest.ProtoReflect.Descriptor instead. -func (*FindEnabledAPINodeRequest) Descriptor() ([]byte, []int) { - return file_service_api_node_proto_rawDescGZIP(), []int{12} -} - -func (x *FindEnabledAPINodeRequest) GetNodeId() int64 { - if x != nil { - return x.NodeId - } - return 0 -} - -type FindEnabledAPINodeResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Node *APINode `protobuf:"bytes,1,opt,name=node,proto3" json:"node,omitempty"` -} - -func (x *FindEnabledAPINodeResponse) Reset() { - *x = FindEnabledAPINodeResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_service_api_node_proto_msgTypes[13] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *FindEnabledAPINodeResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*FindEnabledAPINodeResponse) ProtoMessage() {} - -func (x *FindEnabledAPINodeResponse) ProtoReflect() protoreflect.Message { - mi := &file_service_api_node_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) -} - -// Deprecated: Use FindEnabledAPINodeResponse.ProtoReflect.Descriptor instead. -func (*FindEnabledAPINodeResponse) Descriptor() ([]byte, []int) { - return file_service_api_node_proto_rawDescGZIP(), []int{13} -} - -func (x *FindEnabledAPINodeResponse) GetNode() *APINode { - if x != nil { - return x.Node - } - return nil -} - -var File_service_api_node_proto protoreflect.FileDescriptor - -var file_service_api_node_proto_rawDesc = []byte{ - 0x0a, 0x16, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x61, 0x70, 0x69, 0x5f, 0x6e, 0x6f, - 0x64, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, 0x62, 0x1a, 0x14, 0x6d, 0x6f, - 0x64, 0x65, 0x6c, 0x5f, 0x61, 0x70, 0x69, 0x5f, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x22, 0x74, 0x0a, 0x14, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x50, 0x49, 0x4e, - 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, - 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x20, - 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, - 0x12, 0x12, 0x0a, 0x04, 0x68, 0x6f, 0x73, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, - 0x68, 0x6f, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x05, 0x52, 0x04, 0x70, 0x6f, 0x72, 0x74, 0x22, 0x2f, 0x0a, 0x15, 0x43, 0x72, 0x65, 0x61, - 0x74, 0x65, 0x41, 0x50, 0x49, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x16, 0x0a, 0x06, 0x6e, 0x6f, 0x64, 0x65, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x03, 0x52, 0x06, 0x6e, 0x6f, 0x64, 0x65, 0x49, 0x64, 0x22, 0x8c, 0x01, 0x0a, 0x14, 0x55, 0x70, - 0x64, 0x61, 0x74, 0x65, 0x41, 0x50, 0x49, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x6e, 0x6f, 0x64, 0x65, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x03, 0x52, 0x06, 0x6e, 0x6f, 0x64, 0x65, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, - 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x20, - 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, - 0x12, 0x12, 0x0a, 0x04, 0x68, 0x6f, 0x73, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, - 0x68, 0x6f, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x05, 0x20, 0x01, - 0x28, 0x05, 0x52, 0x04, 0x70, 0x6f, 0x72, 0x74, 0x22, 0x17, 0x0a, 0x15, 0x55, 0x70, 0x64, 0x61, - 0x74, 0x65, 0x41, 0x50, 0x49, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x22, 0x2e, 0x0a, 0x14, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x41, 0x50, 0x49, 0x4e, 0x6f, - 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x6e, 0x6f, 0x64, - 0x65, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x6e, 0x6f, 0x64, 0x65, 0x49, - 0x64, 0x22, 0x17, 0x0a, 0x15, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x41, 0x50, 0x49, 0x4e, 0x6f, - 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1f, 0x0a, 0x1d, 0x46, 0x69, - 0x6e, 0x64, 0x41, 0x6c, 0x6c, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x41, 0x50, 0x49, 0x4e, - 0x6f, 0x64, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x43, 0x0a, 0x1e, 0x46, - 0x69, 0x6e, 0x64, 0x41, 0x6c, 0x6c, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x41, 0x50, 0x49, - 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x21, 0x0a, - 0x05, 0x6e, 0x6f, 0x64, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x70, - 0x62, 0x2e, 0x41, 0x50, 0x49, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x05, 0x6e, 0x6f, 0x64, 0x65, 0x73, - 0x22, 0x20, 0x0a, 0x1e, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x41, 0x6c, 0x6c, 0x45, 0x6e, 0x61, 0x62, - 0x6c, 0x65, 0x64, 0x41, 0x50, 0x49, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x22, 0x37, 0x0a, 0x1f, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x41, 0x6c, 0x6c, 0x45, 0x6e, - 0x61, 0x62, 0x6c, 0x65, 0x64, 0x41, 0x50, 0x49, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x48, 0x0a, 0x1a, 0x4c, - 0x69, 0x73, 0x74, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x41, 0x50, 0x49, 0x4e, 0x6f, 0x64, - 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x66, 0x66, - 0x73, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, - 0x74, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, - 0x04, 0x73, 0x69, 0x7a, 0x65, 0x22, 0x40, 0x0a, 0x1b, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x6e, 0x61, - 0x62, 0x6c, 0x65, 0x64, 0x41, 0x50, 0x49, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x21, 0x0a, 0x05, 0x6e, 0x6f, 0x64, 0x65, 0x73, 0x18, 0x01, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x70, 0x62, 0x2e, 0x41, 0x50, 0x49, 0x4e, 0x6f, 0x64, 0x65, - 0x52, 0x05, 0x6e, 0x6f, 0x64, 0x65, 0x73, 0x22, 0x33, 0x0a, 0x19, 0x46, 0x69, 0x6e, 0x64, 0x45, - 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x41, 0x50, 0x49, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x6e, 0x6f, 0x64, 0x65, 0x49, 0x64, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x6e, 0x6f, 0x64, 0x65, 0x49, 0x64, 0x22, 0x3d, 0x0a, 0x1a, - 0x46, 0x69, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x41, 0x50, 0x49, 0x4e, 0x6f, - 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1f, 0x0a, 0x04, 0x6e, 0x6f, - 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x70, 0x62, 0x2e, 0x41, 0x50, - 0x49, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x04, 0x6e, 0x6f, 0x64, 0x65, 0x32, 0xd4, 0x04, 0x0a, 0x0e, - 0x41, 0x50, 0x49, 0x4e, 0x6f, 0x64, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x44, - 0x0a, 0x0d, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x50, 0x49, 0x4e, 0x6f, 0x64, 0x65, 0x12, - 0x18, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x50, 0x49, 0x4e, 0x6f, - 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x70, 0x62, 0x2e, 0x43, - 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x50, 0x49, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x44, 0x0a, 0x0d, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x50, - 0x49, 0x4e, 0x6f, 0x64, 0x65, 0x12, 0x18, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, - 0x65, 0x41, 0x50, 0x49, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x19, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x50, 0x49, 0x4e, 0x6f, - 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x44, 0x0a, 0x0d, 0x64, 0x65, - 0x6c, 0x65, 0x74, 0x65, 0x41, 0x50, 0x49, 0x4e, 0x6f, 0x64, 0x65, 0x12, 0x18, 0x2e, 0x70, 0x62, - 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x41, 0x50, 0x49, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, - 0x65, 0x41, 0x50, 0x49, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x5f, 0x0a, 0x16, 0x66, 0x69, 0x6e, 0x64, 0x41, 0x6c, 0x6c, 0x45, 0x6e, 0x61, 0x62, 0x6c, - 0x65, 0x64, 0x41, 0x50, 0x49, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x12, 0x21, 0x2e, 0x70, 0x62, 0x2e, - 0x46, 0x69, 0x6e, 0x64, 0x41, 0x6c, 0x6c, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x41, 0x50, - 0x49, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x22, 0x2e, - 0x70, 0x62, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x41, 0x6c, 0x6c, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, - 0x64, 0x41, 0x50, 0x49, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x62, 0x0a, 0x17, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x41, 0x6c, 0x6c, 0x45, 0x6e, 0x61, - 0x62, 0x6c, 0x65, 0x64, 0x41, 0x50, 0x49, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x12, 0x22, 0x2e, 0x70, - 0x62, 0x2e, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x41, 0x6c, 0x6c, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, - 0x64, 0x41, 0x50, 0x49, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x23, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x41, 0x6c, 0x6c, 0x45, 0x6e, - 0x61, 0x62, 0x6c, 0x65, 0x64, 0x41, 0x50, 0x49, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x56, 0x0a, 0x13, 0x6c, 0x69, 0x73, 0x74, 0x45, 0x6e, 0x61, - 0x62, 0x6c, 0x65, 0x64, 0x41, 0x50, 0x49, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x12, 0x1e, 0x2e, 0x70, - 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x41, 0x50, 0x49, - 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x70, - 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x41, 0x50, 0x49, - 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x53, 0x0a, - 0x12, 0x66, 0x69, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x41, 0x50, 0x49, 0x4e, - 0x6f, 0x64, 0x65, 0x12, 0x1d, 0x2e, 0x70, 0x62, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x45, 0x6e, 0x61, - 0x62, 0x6c, 0x65, 0x64, 0x41, 0x50, 0x49, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x70, 0x62, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, - 0x6c, 0x65, 0x64, 0x41, 0x50, 0x49, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x33, -} - -var ( - file_service_api_node_proto_rawDescOnce sync.Once - file_service_api_node_proto_rawDescData = file_service_api_node_proto_rawDesc -) - -func file_service_api_node_proto_rawDescGZIP() []byte { - file_service_api_node_proto_rawDescOnce.Do(func() { - file_service_api_node_proto_rawDescData = protoimpl.X.CompressGZIP(file_service_api_node_proto_rawDescData) - }) - return file_service_api_node_proto_rawDescData -} - -var file_service_api_node_proto_msgTypes = make([]protoimpl.MessageInfo, 14) -var file_service_api_node_proto_goTypes = []interface{}{ - (*CreateAPINodeRequest)(nil), // 0: pb.CreateAPINodeRequest - (*CreateAPINodeResponse)(nil), // 1: pb.CreateAPINodeResponse - (*UpdateAPINodeRequest)(nil), // 2: pb.UpdateAPINodeRequest - (*UpdateAPINodeResponse)(nil), // 3: pb.UpdateAPINodeResponse - (*DeleteAPINodeRequest)(nil), // 4: pb.DeleteAPINodeRequest - (*DeleteAPINodeResponse)(nil), // 5: pb.DeleteAPINodeResponse - (*FindAllEnabledAPINodesRequest)(nil), // 6: pb.FindAllEnabledAPINodesRequest - (*FindAllEnabledAPINodesResponse)(nil), // 7: pb.FindAllEnabledAPINodesResponse - (*CountAllEnabledAPINodesRequest)(nil), // 8: pb.CountAllEnabledAPINodesRequest - (*CountAllEnabledAPINodesResponse)(nil), // 9: pb.CountAllEnabledAPINodesResponse - (*ListEnabledAPINodesRequest)(nil), // 10: pb.ListEnabledAPINodesRequest - (*ListEnabledAPINodesResponse)(nil), // 11: pb.ListEnabledAPINodesResponse - (*FindEnabledAPINodeRequest)(nil), // 12: pb.FindEnabledAPINodeRequest - (*FindEnabledAPINodeResponse)(nil), // 13: pb.FindEnabledAPINodeResponse - (*APINode)(nil), // 14: pb.APINode -} -var file_service_api_node_proto_depIdxs = []int32{ - 14, // 0: pb.FindAllEnabledAPINodesResponse.nodes:type_name -> pb.APINode - 14, // 1: pb.ListEnabledAPINodesResponse.nodes:type_name -> pb.APINode - 14, // 2: pb.FindEnabledAPINodeResponse.node:type_name -> pb.APINode - 0, // 3: pb.APINodeService.createAPINode:input_type -> pb.CreateAPINodeRequest - 2, // 4: pb.APINodeService.updateAPINode:input_type -> pb.UpdateAPINodeRequest - 4, // 5: pb.APINodeService.deleteAPINode:input_type -> pb.DeleteAPINodeRequest - 6, // 6: pb.APINodeService.findAllEnabledAPINodes:input_type -> pb.FindAllEnabledAPINodesRequest - 8, // 7: pb.APINodeService.countAllEnabledAPINodes:input_type -> pb.CountAllEnabledAPINodesRequest - 10, // 8: pb.APINodeService.listEnabledAPINodes:input_type -> pb.ListEnabledAPINodesRequest - 12, // 9: pb.APINodeService.findEnabledAPINode:input_type -> pb.FindEnabledAPINodeRequest - 1, // 10: pb.APINodeService.createAPINode:output_type -> pb.CreateAPINodeResponse - 3, // 11: pb.APINodeService.updateAPINode:output_type -> pb.UpdateAPINodeResponse - 5, // 12: pb.APINodeService.deleteAPINode:output_type -> pb.DeleteAPINodeResponse - 7, // 13: pb.APINodeService.findAllEnabledAPINodes:output_type -> pb.FindAllEnabledAPINodesResponse - 9, // 14: pb.APINodeService.countAllEnabledAPINodes:output_type -> pb.CountAllEnabledAPINodesResponse - 11, // 15: pb.APINodeService.listEnabledAPINodes:output_type -> pb.ListEnabledAPINodesResponse - 13, // 16: pb.APINodeService.findEnabledAPINode:output_type -> pb.FindEnabledAPINodeResponse - 10, // [10:17] is the sub-list for method output_type - 3, // [3:10] is the sub-list for method input_type - 3, // [3:3] is the sub-list for extension type_name - 3, // [3:3] is the sub-list for extension extendee - 0, // [0:3] is the sub-list for field type_name -} - -func init() { file_service_api_node_proto_init() } -func file_service_api_node_proto_init() { - if File_service_api_node_proto != nil { - return - } - file_model_api_node_proto_init() - if !protoimpl.UnsafeEnabled { - file_service_api_node_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreateAPINodeRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_service_api_node_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreateAPINodeResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_service_api_node_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UpdateAPINodeRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_service_api_node_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UpdateAPINodeResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_service_api_node_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DeleteAPINodeRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_service_api_node_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DeleteAPINodeResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_service_api_node_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*FindAllEnabledAPINodesRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_service_api_node_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*FindAllEnabledAPINodesResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_service_api_node_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CountAllEnabledAPINodesRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_service_api_node_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CountAllEnabledAPINodesResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_service_api_node_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListEnabledAPINodesRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_service_api_node_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListEnabledAPINodesResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_service_api_node_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*FindEnabledAPINodeRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_service_api_node_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*FindEnabledAPINodeResponse); 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_service_api_node_proto_rawDesc, - NumEnums: 0, - NumMessages: 14, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_service_api_node_proto_goTypes, - DependencyIndexes: file_service_api_node_proto_depIdxs, - MessageInfos: file_service_api_node_proto_msgTypes, - }.Build() - File_service_api_node_proto = out.File - file_service_api_node_proto_rawDesc = nil - file_service_api_node_proto_goTypes = nil - file_service_api_node_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 - -// APINodeServiceClient is the client API for APINodeService service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type APINodeServiceClient interface { - // 创建API节点 - CreateAPINode(ctx context.Context, in *CreateAPINodeRequest, opts ...grpc.CallOption) (*CreateAPINodeResponse, error) - // 修改API节点 - UpdateAPINode(ctx context.Context, in *UpdateAPINodeRequest, opts ...grpc.CallOption) (*UpdateAPINodeResponse, error) - // 删除API节点 - DeleteAPINode(ctx context.Context, in *DeleteAPINodeRequest, opts ...grpc.CallOption) (*DeleteAPINodeResponse, error) - // 列出所有可用API节点 - FindAllEnabledAPINodes(ctx context.Context, in *FindAllEnabledAPINodesRequest, opts ...grpc.CallOption) (*FindAllEnabledAPINodesResponse, error) - // 计算API节点数量 - CountAllEnabledAPINodes(ctx context.Context, in *CountAllEnabledAPINodesRequest, opts ...grpc.CallOption) (*CountAllEnabledAPINodesResponse, error) - // 列出单页的API节点 - ListEnabledAPINodes(ctx context.Context, in *ListEnabledAPINodesRequest, opts ...grpc.CallOption) (*ListEnabledAPINodesResponse, error) - // 根据ID查找节点 - FindEnabledAPINode(ctx context.Context, in *FindEnabledAPINodeRequest, opts ...grpc.CallOption) (*FindEnabledAPINodeResponse, error) -} - -type aPINodeServiceClient struct { - cc grpc.ClientConnInterface -} - -func NewAPINodeServiceClient(cc grpc.ClientConnInterface) APINodeServiceClient { - return &aPINodeServiceClient{cc} -} - -func (c *aPINodeServiceClient) CreateAPINode(ctx context.Context, in *CreateAPINodeRequest, opts ...grpc.CallOption) (*CreateAPINodeResponse, error) { - out := new(CreateAPINodeResponse) - err := c.cc.Invoke(ctx, "/pb.APINodeService/createAPINode", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *aPINodeServiceClient) UpdateAPINode(ctx context.Context, in *UpdateAPINodeRequest, opts ...grpc.CallOption) (*UpdateAPINodeResponse, error) { - out := new(UpdateAPINodeResponse) - err := c.cc.Invoke(ctx, "/pb.APINodeService/updateAPINode", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *aPINodeServiceClient) DeleteAPINode(ctx context.Context, in *DeleteAPINodeRequest, opts ...grpc.CallOption) (*DeleteAPINodeResponse, error) { - out := new(DeleteAPINodeResponse) - err := c.cc.Invoke(ctx, "/pb.APINodeService/deleteAPINode", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *aPINodeServiceClient) FindAllEnabledAPINodes(ctx context.Context, in *FindAllEnabledAPINodesRequest, opts ...grpc.CallOption) (*FindAllEnabledAPINodesResponse, error) { - out := new(FindAllEnabledAPINodesResponse) - err := c.cc.Invoke(ctx, "/pb.APINodeService/findAllEnabledAPINodes", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *aPINodeServiceClient) CountAllEnabledAPINodes(ctx context.Context, in *CountAllEnabledAPINodesRequest, opts ...grpc.CallOption) (*CountAllEnabledAPINodesResponse, error) { - out := new(CountAllEnabledAPINodesResponse) - err := c.cc.Invoke(ctx, "/pb.APINodeService/countAllEnabledAPINodes", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *aPINodeServiceClient) ListEnabledAPINodes(ctx context.Context, in *ListEnabledAPINodesRequest, opts ...grpc.CallOption) (*ListEnabledAPINodesResponse, error) { - out := new(ListEnabledAPINodesResponse) - err := c.cc.Invoke(ctx, "/pb.APINodeService/listEnabledAPINodes", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *aPINodeServiceClient) FindEnabledAPINode(ctx context.Context, in *FindEnabledAPINodeRequest, opts ...grpc.CallOption) (*FindEnabledAPINodeResponse, error) { - out := new(FindEnabledAPINodeResponse) - err := c.cc.Invoke(ctx, "/pb.APINodeService/findEnabledAPINode", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// APINodeServiceServer is the server API for APINodeService service. -type APINodeServiceServer interface { - // 创建API节点 - CreateAPINode(context.Context, *CreateAPINodeRequest) (*CreateAPINodeResponse, error) - // 修改API节点 - UpdateAPINode(context.Context, *UpdateAPINodeRequest) (*UpdateAPINodeResponse, error) - // 删除API节点 - DeleteAPINode(context.Context, *DeleteAPINodeRequest) (*DeleteAPINodeResponse, error) - // 列出所有可用API节点 - FindAllEnabledAPINodes(context.Context, *FindAllEnabledAPINodesRequest) (*FindAllEnabledAPINodesResponse, error) - // 计算API节点数量 - CountAllEnabledAPINodes(context.Context, *CountAllEnabledAPINodesRequest) (*CountAllEnabledAPINodesResponse, error) - // 列出单页的API节点 - ListEnabledAPINodes(context.Context, *ListEnabledAPINodesRequest) (*ListEnabledAPINodesResponse, error) - // 根据ID查找节点 - FindEnabledAPINode(context.Context, *FindEnabledAPINodeRequest) (*FindEnabledAPINodeResponse, error) -} - -// UnimplementedAPINodeServiceServer can be embedded to have forward compatible implementations. -type UnimplementedAPINodeServiceServer struct { -} - -func (*UnimplementedAPINodeServiceServer) CreateAPINode(context.Context, *CreateAPINodeRequest) (*CreateAPINodeResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method CreateAPINode not implemented") -} -func (*UnimplementedAPINodeServiceServer) UpdateAPINode(context.Context, *UpdateAPINodeRequest) (*UpdateAPINodeResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method UpdateAPINode not implemented") -} -func (*UnimplementedAPINodeServiceServer) DeleteAPINode(context.Context, *DeleteAPINodeRequest) (*DeleteAPINodeResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method DeleteAPINode not implemented") -} -func (*UnimplementedAPINodeServiceServer) FindAllEnabledAPINodes(context.Context, *FindAllEnabledAPINodesRequest) (*FindAllEnabledAPINodesResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method FindAllEnabledAPINodes not implemented") -} -func (*UnimplementedAPINodeServiceServer) CountAllEnabledAPINodes(context.Context, *CountAllEnabledAPINodesRequest) (*CountAllEnabledAPINodesResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method CountAllEnabledAPINodes not implemented") -} -func (*UnimplementedAPINodeServiceServer) ListEnabledAPINodes(context.Context, *ListEnabledAPINodesRequest) (*ListEnabledAPINodesResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ListEnabledAPINodes not implemented") -} -func (*UnimplementedAPINodeServiceServer) FindEnabledAPINode(context.Context, *FindEnabledAPINodeRequest) (*FindEnabledAPINodeResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method FindEnabledAPINode not implemented") -} - -func RegisterAPINodeServiceServer(s *grpc.Server, srv APINodeServiceServer) { - s.RegisterService(&_APINodeService_serviceDesc, srv) -} - -func _APINodeService_CreateAPINode_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(CreateAPINodeRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(APINodeServiceServer).CreateAPINode(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/pb.APINodeService/CreateAPINode", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(APINodeServiceServer).CreateAPINode(ctx, req.(*CreateAPINodeRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _APINodeService_UpdateAPINode_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(UpdateAPINodeRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(APINodeServiceServer).UpdateAPINode(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/pb.APINodeService/UpdateAPINode", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(APINodeServiceServer).UpdateAPINode(ctx, req.(*UpdateAPINodeRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _APINodeService_DeleteAPINode_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DeleteAPINodeRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(APINodeServiceServer).DeleteAPINode(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/pb.APINodeService/DeleteAPINode", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(APINodeServiceServer).DeleteAPINode(ctx, req.(*DeleteAPINodeRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _APINodeService_FindAllEnabledAPINodes_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(FindAllEnabledAPINodesRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(APINodeServiceServer).FindAllEnabledAPINodes(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/pb.APINodeService/FindAllEnabledAPINodes", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(APINodeServiceServer).FindAllEnabledAPINodes(ctx, req.(*FindAllEnabledAPINodesRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _APINodeService_CountAllEnabledAPINodes_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(CountAllEnabledAPINodesRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(APINodeServiceServer).CountAllEnabledAPINodes(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/pb.APINodeService/CountAllEnabledAPINodes", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(APINodeServiceServer).CountAllEnabledAPINodes(ctx, req.(*CountAllEnabledAPINodesRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _APINodeService_ListEnabledAPINodes_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ListEnabledAPINodesRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(APINodeServiceServer).ListEnabledAPINodes(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/pb.APINodeService/ListEnabledAPINodes", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(APINodeServiceServer).ListEnabledAPINodes(ctx, req.(*ListEnabledAPINodesRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _APINodeService_FindEnabledAPINode_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(FindEnabledAPINodeRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(APINodeServiceServer).FindEnabledAPINode(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/pb.APINodeService/FindEnabledAPINode", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(APINodeServiceServer).FindEnabledAPINode(ctx, req.(*FindEnabledAPINodeRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _APINodeService_serviceDesc = grpc.ServiceDesc{ - ServiceName: "pb.APINodeService", - HandlerType: (*APINodeServiceServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "createAPINode", - Handler: _APINodeService_CreateAPINode_Handler, - }, - { - MethodName: "updateAPINode", - Handler: _APINodeService_UpdateAPINode_Handler, - }, - { - MethodName: "deleteAPINode", - Handler: _APINodeService_DeleteAPINode_Handler, - }, - { - MethodName: "findAllEnabledAPINodes", - Handler: _APINodeService_FindAllEnabledAPINodes_Handler, - }, - { - MethodName: "countAllEnabledAPINodes", - Handler: _APINodeService_CountAllEnabledAPINodes_Handler, - }, - { - MethodName: "listEnabledAPINodes", - Handler: _APINodeService_ListEnabledAPINodes_Handler, - }, - { - MethodName: "findEnabledAPINode", - Handler: _APINodeService_FindEnabledAPINode_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "service_api_node.proto", -} diff --git a/internal/rpc/pb/service_log.pb.go b/internal/rpc/pb/service_log.pb.go deleted file mode 100644 index 061770ee..00000000 --- a/internal/rpc/pb/service_log.pb.go +++ /dev/null @@ -1,66 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.25.0 -// protoc v3.12.3 -// source: service_log.proto - -package pb - -import ( - proto "github.com/golang/protobuf/proto" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" -) - -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 - -var File_service_log_proto protoreflect.FileDescriptor - -var file_service_log_proto_rawDesc = []byte{ - 0x0a, 0x11, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x6c, 0x6f, 0x67, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, 0x62, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62, - 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var file_service_log_proto_goTypes = []interface{}{} -var file_service_log_proto_depIdxs = []int32{ - 0, // [0:0] is the sub-list for method output_type - 0, // [0:0] 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_service_log_proto_init() } -func file_service_log_proto_init() { - if File_service_log_proto != nil { - return - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_service_log_proto_rawDesc, - NumEnums: 0, - NumMessages: 0, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_service_log_proto_goTypes, - DependencyIndexes: file_service_log_proto_depIdxs, - }.Build() - File_service_log_proto = out.File - file_service_log_proto_rawDesc = nil - file_service_log_proto_goTypes = nil - file_service_log_proto_depIdxs = nil -} diff --git a/internal/rpc/pb/service_node.pb.go b/internal/rpc/pb/service_node.pb.go deleted file mode 100644 index be439cfa..00000000 --- a/internal/rpc/pb/service_node.pb.go +++ /dev/null @@ -1,2245 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.25.0 -// protoc v3.12.3 -// source: service_node.proto - -package pb - -import ( - context "context" - proto "github.com/golang/protobuf/proto" - 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" - 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) -) - -// 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 CreateNodeRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - ClusterId int64 `protobuf:"varint,2,opt,name=clusterId,proto3" json:"clusterId,omitempty"` - Login *NodeLogin `protobuf:"bytes,3,opt,name=Login,proto3" json:"Login,omitempty"` -} - -func (x *CreateNodeRequest) Reset() { - *x = CreateNodeRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_service_node_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CreateNodeRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CreateNodeRequest) ProtoMessage() {} - -func (x *CreateNodeRequest) ProtoReflect() protoreflect.Message { - mi := &file_service_node_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 CreateNodeRequest.ProtoReflect.Descriptor instead. -func (*CreateNodeRequest) Descriptor() ([]byte, []int) { - return file_service_node_proto_rawDescGZIP(), []int{0} -} - -func (x *CreateNodeRequest) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *CreateNodeRequest) GetClusterId() int64 { - if x != nil { - return x.ClusterId - } - return 0 -} - -func (x *CreateNodeRequest) GetLogin() *NodeLogin { - if x != nil { - return x.Login - } - return nil -} - -type CreateNodeResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - NodeId int64 `protobuf:"varint,1,opt,name=nodeId,proto3" json:"nodeId,omitempty"` -} - -func (x *CreateNodeResponse) Reset() { - *x = CreateNodeResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_service_node_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CreateNodeResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CreateNodeResponse) ProtoMessage() {} - -func (x *CreateNodeResponse) ProtoReflect() protoreflect.Message { - mi := &file_service_node_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) -} - -// Deprecated: Use CreateNodeResponse.ProtoReflect.Descriptor instead. -func (*CreateNodeResponse) Descriptor() ([]byte, []int) { - return file_service_node_proto_rawDescGZIP(), []int{1} -} - -func (x *CreateNodeResponse) GetNodeId() int64 { - if x != nil { - return x.NodeId - } - return 0 -} - -// 节点数量 -type CountAllEnabledNodesRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *CountAllEnabledNodesRequest) Reset() { - *x = CountAllEnabledNodesRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_service_node_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CountAllEnabledNodesRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CountAllEnabledNodesRequest) ProtoMessage() {} - -func (x *CountAllEnabledNodesRequest) ProtoReflect() protoreflect.Message { - mi := &file_service_node_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) -} - -// Deprecated: Use CountAllEnabledNodesRequest.ProtoReflect.Descriptor instead. -func (*CountAllEnabledNodesRequest) Descriptor() ([]byte, []int) { - return file_service_node_proto_rawDescGZIP(), []int{2} -} - -type CountAllEnabledNodesResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Count int64 `protobuf:"varint,1,opt,name=count,proto3" json:"count,omitempty"` -} - -func (x *CountAllEnabledNodesResponse) Reset() { - *x = CountAllEnabledNodesResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_service_node_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CountAllEnabledNodesResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CountAllEnabledNodesResponse) ProtoMessage() {} - -func (x *CountAllEnabledNodesResponse) ProtoReflect() protoreflect.Message { - mi := &file_service_node_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) -} - -// Deprecated: Use CountAllEnabledNodesResponse.ProtoReflect.Descriptor instead. -func (*CountAllEnabledNodesResponse) Descriptor() ([]byte, []int) { - return file_service_node_proto_rawDescGZIP(), []int{3} -} - -func (x *CountAllEnabledNodesResponse) GetCount() int64 { - if x != nil { - return x.Count - } - return 0 -} - -// 列出单页节点 -type ListEnabledNodesMatchRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Offset int64 `protobuf:"varint,1,opt,name=offset,proto3" json:"offset,omitempty"` - Size int64 `protobuf:"varint,2,opt,name=size,proto3" json:"size,omitempty"` - ClusterId int64 `protobuf:"varint,3,opt,name=clusterId,proto3" json:"clusterId,omitempty"` -} - -func (x *ListEnabledNodesMatchRequest) Reset() { - *x = ListEnabledNodesMatchRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_service_node_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListEnabledNodesMatchRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListEnabledNodesMatchRequest) ProtoMessage() {} - -func (x *ListEnabledNodesMatchRequest) ProtoReflect() protoreflect.Message { - mi := &file_service_node_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) -} - -// Deprecated: Use ListEnabledNodesMatchRequest.ProtoReflect.Descriptor instead. -func (*ListEnabledNodesMatchRequest) Descriptor() ([]byte, []int) { - return file_service_node_proto_rawDescGZIP(), []int{4} -} - -func (x *ListEnabledNodesMatchRequest) GetOffset() int64 { - if x != nil { - return x.Offset - } - return 0 -} - -func (x *ListEnabledNodesMatchRequest) GetSize() int64 { - if x != nil { - return x.Size - } - return 0 -} - -func (x *ListEnabledNodesMatchRequest) GetClusterId() int64 { - if x != nil { - return x.ClusterId - } - return 0 -} - -type ListEnabledNodesMatchResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Nodes []*Node `protobuf:"bytes,1,rep,name=nodes,proto3" json:"nodes,omitempty"` -} - -func (x *ListEnabledNodesMatchResponse) Reset() { - *x = ListEnabledNodesMatchResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_service_node_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListEnabledNodesMatchResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListEnabledNodesMatchResponse) ProtoMessage() {} - -func (x *ListEnabledNodesMatchResponse) ProtoReflect() protoreflect.Message { - mi := &file_service_node_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) -} - -// Deprecated: Use ListEnabledNodesMatchResponse.ProtoReflect.Descriptor instead. -func (*ListEnabledNodesMatchResponse) Descriptor() ([]byte, []int) { - return file_service_node_proto_rawDescGZIP(), []int{5} -} - -func (x *ListEnabledNodesMatchResponse) GetNodes() []*Node { - if x != nil { - return x.Nodes - } - return nil -} - -// 禁用节点 -type DisableNodeRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - NodeId int64 `protobuf:"varint,1,opt,name=nodeId,proto3" json:"nodeId,omitempty"` -} - -func (x *DisableNodeRequest) Reset() { - *x = DisableNodeRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_service_node_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *DisableNodeRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DisableNodeRequest) ProtoMessage() {} - -func (x *DisableNodeRequest) ProtoReflect() protoreflect.Message { - mi := &file_service_node_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) -} - -// Deprecated: Use DisableNodeRequest.ProtoReflect.Descriptor instead. -func (*DisableNodeRequest) Descriptor() ([]byte, []int) { - return file_service_node_proto_rawDescGZIP(), []int{6} -} - -func (x *DisableNodeRequest) GetNodeId() int64 { - if x != nil { - return x.NodeId - } - return 0 -} - -type DisableNodeResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *DisableNodeResponse) Reset() { - *x = DisableNodeResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_service_node_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *DisableNodeResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DisableNodeResponse) ProtoMessage() {} - -func (x *DisableNodeResponse) ProtoReflect() protoreflect.Message { - mi := &file_service_node_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) -} - -// Deprecated: Use DisableNodeResponse.ProtoReflect.Descriptor instead. -func (*DisableNodeResponse) Descriptor() ([]byte, []int) { - return file_service_node_proto_rawDescGZIP(), []int{7} -} - -// 修改节点 -type UpdateNodeRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - NodeId int64 `protobuf:"varint,1,opt,name=nodeId,proto3" json:"nodeId,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - ClusterId int64 `protobuf:"varint,3,opt,name=clusterId,proto3" json:"clusterId,omitempty"` - Login *NodeLogin `protobuf:"bytes,4,opt,name=Login,proto3" json:"Login,omitempty"` -} - -func (x *UpdateNodeRequest) Reset() { - *x = UpdateNodeRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_service_node_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *UpdateNodeRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UpdateNodeRequest) ProtoMessage() {} - -func (x *UpdateNodeRequest) ProtoReflect() protoreflect.Message { - mi := &file_service_node_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) -} - -// Deprecated: Use UpdateNodeRequest.ProtoReflect.Descriptor instead. -func (*UpdateNodeRequest) Descriptor() ([]byte, []int) { - return file_service_node_proto_rawDescGZIP(), []int{8} -} - -func (x *UpdateNodeRequest) GetNodeId() int64 { - if x != nil { - return x.NodeId - } - return 0 -} - -func (x *UpdateNodeRequest) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *UpdateNodeRequest) GetClusterId() int64 { - if x != nil { - return x.ClusterId - } - return 0 -} - -func (x *UpdateNodeRequest) GetLogin() *NodeLogin { - if x != nil { - return x.Login - } - return nil -} - -type UpdateNodeResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *UpdateNodeResponse) Reset() { - *x = UpdateNodeResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_service_node_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *UpdateNodeResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UpdateNodeResponse) ProtoMessage() {} - -func (x *UpdateNodeResponse) ProtoReflect() protoreflect.Message { - mi := &file_service_node_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) -} - -// Deprecated: Use UpdateNodeResponse.ProtoReflect.Descriptor instead. -func (*UpdateNodeResponse) Descriptor() ([]byte, []int) { - return file_service_node_proto_rawDescGZIP(), []int{9} -} - -// 查找节点 -type FindEnabledNodeRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - NodeId int64 `protobuf:"varint,1,opt,name=nodeId,proto3" json:"nodeId,omitempty"` -} - -func (x *FindEnabledNodeRequest) Reset() { - *x = FindEnabledNodeRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_service_node_proto_msgTypes[10] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *FindEnabledNodeRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*FindEnabledNodeRequest) ProtoMessage() {} - -func (x *FindEnabledNodeRequest) ProtoReflect() protoreflect.Message { - mi := &file_service_node_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) -} - -// Deprecated: Use FindEnabledNodeRequest.ProtoReflect.Descriptor instead. -func (*FindEnabledNodeRequest) Descriptor() ([]byte, []int) { - return file_service_node_proto_rawDescGZIP(), []int{10} -} - -func (x *FindEnabledNodeRequest) GetNodeId() int64 { - if x != nil { - return x.NodeId - } - return 0 -} - -type FindEnabledNodeResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Node *Node `protobuf:"bytes,1,opt,name=node,proto3" json:"node,omitempty"` -} - -func (x *FindEnabledNodeResponse) Reset() { - *x = FindEnabledNodeResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_service_node_proto_msgTypes[11] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *FindEnabledNodeResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*FindEnabledNodeResponse) ProtoMessage() {} - -func (x *FindEnabledNodeResponse) ProtoReflect() protoreflect.Message { - mi := &file_service_node_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) -} - -// Deprecated: Use FindEnabledNodeResponse.ProtoReflect.Descriptor instead. -func (*FindEnabledNodeResponse) Descriptor() ([]byte, []int) { - return file_service_node_proto_rawDescGZIP(), []int{11} -} - -func (x *FindEnabledNodeResponse) GetNode() *Node { - if x != nil { - return x.Node - } - return nil -} - -// 组合单个节点配置 -type ComposeNodeConfigRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *ComposeNodeConfigRequest) Reset() { - *x = ComposeNodeConfigRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_service_node_proto_msgTypes[12] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ComposeNodeConfigRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ComposeNodeConfigRequest) ProtoMessage() {} - -func (x *ComposeNodeConfigRequest) ProtoReflect() protoreflect.Message { - mi := &file_service_node_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) -} - -// Deprecated: Use ComposeNodeConfigRequest.ProtoReflect.Descriptor instead. -func (*ComposeNodeConfigRequest) Descriptor() ([]byte, []int) { - return file_service_node_proto_rawDescGZIP(), []int{12} -} - -type ComposeNodeConfigResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - ConfigJSON []byte `protobuf:"bytes,1,opt,name=configJSON,proto3" json:"configJSON,omitempty"` -} - -func (x *ComposeNodeConfigResponse) Reset() { - *x = ComposeNodeConfigResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_service_node_proto_msgTypes[13] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ComposeNodeConfigResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ComposeNodeConfigResponse) ProtoMessage() {} - -func (x *ComposeNodeConfigResponse) ProtoReflect() protoreflect.Message { - mi := &file_service_node_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) -} - -// Deprecated: Use ComposeNodeConfigResponse.ProtoReflect.Descriptor instead. -func (*ComposeNodeConfigResponse) Descriptor() ([]byte, []int) { - return file_service_node_proto_rawDescGZIP(), []int{13} -} - -func (x *ComposeNodeConfigResponse) GetConfigJSON() []byte { - if x != nil { - return x.ConfigJSON - } - return nil -} - -// 节点stream -type NodeStreamRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *NodeStreamRequest) Reset() { - *x = NodeStreamRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_service_node_proto_msgTypes[14] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *NodeStreamRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*NodeStreamRequest) ProtoMessage() {} - -func (x *NodeStreamRequest) ProtoReflect() protoreflect.Message { - mi := &file_service_node_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) -} - -// Deprecated: Use NodeStreamRequest.ProtoReflect.Descriptor instead. -func (*NodeStreamRequest) Descriptor() ([]byte, []int) { - return file_service_node_proto_rawDescGZIP(), []int{14} -} - -type NodeStreamResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *NodeStreamResponse) Reset() { - *x = NodeStreamResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_service_node_proto_msgTypes[15] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *NodeStreamResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*NodeStreamResponse) ProtoMessage() {} - -func (x *NodeStreamResponse) ProtoReflect() protoreflect.Message { - mi := &file_service_node_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) -} - -// Deprecated: Use NodeStreamResponse.ProtoReflect.Descriptor instead. -func (*NodeStreamResponse) Descriptor() ([]byte, []int) { - return file_service_node_proto_rawDescGZIP(), []int{15} -} - -// 更新节点状态 -type UpdateNodeStatusRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - NodeId int64 `protobuf:"varint,1,opt,name=nodeId,proto3" json:"nodeId,omitempty"` - StatusJSON []byte `protobuf:"bytes,2,opt,name=statusJSON,proto3" json:"statusJSON,omitempty"` -} - -func (x *UpdateNodeStatusRequest) Reset() { - *x = UpdateNodeStatusRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_service_node_proto_msgTypes[16] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *UpdateNodeStatusRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UpdateNodeStatusRequest) ProtoMessage() {} - -func (x *UpdateNodeStatusRequest) ProtoReflect() protoreflect.Message { - mi := &file_service_node_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) -} - -// Deprecated: Use UpdateNodeStatusRequest.ProtoReflect.Descriptor instead. -func (*UpdateNodeStatusRequest) Descriptor() ([]byte, []int) { - return file_service_node_proto_rawDescGZIP(), []int{16} -} - -func (x *UpdateNodeStatusRequest) GetNodeId() int64 { - if x != nil { - return x.NodeId - } - return 0 -} - -func (x *UpdateNodeStatusRequest) GetStatusJSON() []byte { - if x != nil { - return x.StatusJSON - } - return nil -} - -type UpdateNodeStatusResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *UpdateNodeStatusResponse) Reset() { - *x = UpdateNodeStatusResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_service_node_proto_msgTypes[17] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *UpdateNodeStatusResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UpdateNodeStatusResponse) ProtoMessage() {} - -func (x *UpdateNodeStatusResponse) ProtoReflect() protoreflect.Message { - mi := &file_service_node_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) -} - -// Deprecated: Use UpdateNodeStatusResponse.ProtoReflect.Descriptor instead. -func (*UpdateNodeStatusResponse) Descriptor() ([]byte, []int) { - return file_service_node_proto_rawDescGZIP(), []int{17} -} - -// 同步集群中的节点版本 -type SyncNodesVersionWithClusterRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - ClusterId int64 `protobuf:"varint,1,opt,name=clusterId,proto3" json:"clusterId,omitempty"` -} - -func (x *SyncNodesVersionWithClusterRequest) Reset() { - *x = SyncNodesVersionWithClusterRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_service_node_proto_msgTypes[18] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *SyncNodesVersionWithClusterRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SyncNodesVersionWithClusterRequest) ProtoMessage() {} - -func (x *SyncNodesVersionWithClusterRequest) ProtoReflect() protoreflect.Message { - mi := &file_service_node_proto_msgTypes[18] - 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 SyncNodesVersionWithClusterRequest.ProtoReflect.Descriptor instead. -func (*SyncNodesVersionWithClusterRequest) Descriptor() ([]byte, []int) { - return file_service_node_proto_rawDescGZIP(), []int{18} -} - -func (x *SyncNodesVersionWithClusterRequest) GetClusterId() int64 { - if x != nil { - return x.ClusterId - } - return 0 -} - -type SyncNodesVersionWithClusterResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *SyncNodesVersionWithClusterResponse) Reset() { - *x = SyncNodesVersionWithClusterResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_service_node_proto_msgTypes[19] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *SyncNodesVersionWithClusterResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SyncNodesVersionWithClusterResponse) ProtoMessage() {} - -func (x *SyncNodesVersionWithClusterResponse) ProtoReflect() protoreflect.Message { - mi := &file_service_node_proto_msgTypes[19] - 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 SyncNodesVersionWithClusterResponse.ProtoReflect.Descriptor instead. -func (*SyncNodesVersionWithClusterResponse) Descriptor() ([]byte, []int) { - return file_service_node_proto_rawDescGZIP(), []int{19} -} - -// 计算匹配的节点数量 -type CountAllEnabledNodesMatchRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - ClusterId int64 `protobuf:"varint,1,opt,name=clusterId,proto3" json:"clusterId,omitempty"` -} - -func (x *CountAllEnabledNodesMatchRequest) Reset() { - *x = CountAllEnabledNodesMatchRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_service_node_proto_msgTypes[20] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CountAllEnabledNodesMatchRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CountAllEnabledNodesMatchRequest) ProtoMessage() {} - -func (x *CountAllEnabledNodesMatchRequest) ProtoReflect() protoreflect.Message { - mi := &file_service_node_proto_msgTypes[20] - 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 CountAllEnabledNodesMatchRequest.ProtoReflect.Descriptor instead. -func (*CountAllEnabledNodesMatchRequest) Descriptor() ([]byte, []int) { - return file_service_node_proto_rawDescGZIP(), []int{20} -} - -func (x *CountAllEnabledNodesMatchRequest) GetClusterId() int64 { - if x != nil { - return x.ClusterId - } - return 0 -} - -type CountAllEnabledNodesMatchResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Count int64 `protobuf:"varint,1,opt,name=count,proto3" json:"count,omitempty"` -} - -func (x *CountAllEnabledNodesMatchResponse) Reset() { - *x = CountAllEnabledNodesMatchResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_service_node_proto_msgTypes[21] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CountAllEnabledNodesMatchResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CountAllEnabledNodesMatchResponse) ProtoMessage() {} - -func (x *CountAllEnabledNodesMatchResponse) ProtoReflect() protoreflect.Message { - mi := &file_service_node_proto_msgTypes[21] - 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 CountAllEnabledNodesMatchResponse.ProtoReflect.Descriptor instead. -func (*CountAllEnabledNodesMatchResponse) Descriptor() ([]byte, []int) { - return file_service_node_proto_rawDescGZIP(), []int{21} -} - -func (x *CountAllEnabledNodesMatchResponse) GetCount() int64 { - if x != nil { - return x.Count - } - return 0 -} - -// 修改节点安装状态 -type UpdateNodeIsInstalledRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - NodeId int64 `protobuf:"varint,1,opt,name=nodeId,proto3" json:"nodeId,omitempty"` - IsInstalled bool `protobuf:"varint,2,opt,name=isInstalled,proto3" json:"isInstalled,omitempty"` -} - -func (x *UpdateNodeIsInstalledRequest) Reset() { - *x = UpdateNodeIsInstalledRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_service_node_proto_msgTypes[22] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *UpdateNodeIsInstalledRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UpdateNodeIsInstalledRequest) ProtoMessage() {} - -func (x *UpdateNodeIsInstalledRequest) ProtoReflect() protoreflect.Message { - mi := &file_service_node_proto_msgTypes[22] - 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 UpdateNodeIsInstalledRequest.ProtoReflect.Descriptor instead. -func (*UpdateNodeIsInstalledRequest) Descriptor() ([]byte, []int) { - return file_service_node_proto_rawDescGZIP(), []int{22} -} - -func (x *UpdateNodeIsInstalledRequest) GetNodeId() int64 { - if x != nil { - return x.NodeId - } - return 0 -} - -func (x *UpdateNodeIsInstalledRequest) GetIsInstalled() bool { - if x != nil { - return x.IsInstalled - } - return false -} - -type UpdateNodeIsInstalledResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *UpdateNodeIsInstalledResponse) Reset() { - *x = UpdateNodeIsInstalledResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_service_node_proto_msgTypes[23] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *UpdateNodeIsInstalledResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UpdateNodeIsInstalledResponse) ProtoMessage() {} - -func (x *UpdateNodeIsInstalledResponse) ProtoReflect() protoreflect.Message { - mi := &file_service_node_proto_msgTypes[23] - 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 UpdateNodeIsInstalledResponse.ProtoReflect.Descriptor instead. -func (*UpdateNodeIsInstalledResponse) Descriptor() ([]byte, []int) { - return file_service_node_proto_rawDescGZIP(), []int{23} -} - -var File_service_node_proto protoreflect.FileDescriptor - -var file_service_node_proto_rawDesc = []byte{ - 0x0a, 0x12, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, 0x62, 0x1a, 0x10, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5f, - 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x16, 0x6d, 0x6f, 0x64, 0x65, - 0x6c, 0x5f, 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x6c, 0x6f, 0x67, 0x69, 0x6e, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x22, 0x6a, 0x0a, 0x11, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4e, 0x6f, 0x64, 0x65, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x63, - 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, - 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x64, 0x12, 0x23, 0x0a, 0x05, 0x4c, 0x6f, 0x67, - 0x69, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x70, 0x62, 0x2e, 0x4e, 0x6f, - 0x64, 0x65, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x05, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x22, 0x2c, - 0x0a, 0x12, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x6e, 0x6f, 0x64, 0x65, 0x49, 0x64, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x6e, 0x6f, 0x64, 0x65, 0x49, 0x64, 0x22, 0x1d, 0x0a, 0x1b, - 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x41, 0x6c, 0x6c, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x4e, - 0x6f, 0x64, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x34, 0x0a, 0x1c, 0x43, - 0x6f, 0x75, 0x6e, 0x74, 0x41, 0x6c, 0x6c, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x4e, 0x6f, - 0x64, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x63, - 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, - 0x74, 0x22, 0x68, 0x0a, 0x1c, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, - 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x03, 0x52, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x69, 0x7a, - 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x12, 0x1c, 0x0a, - 0x09, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, - 0x52, 0x09, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x64, 0x22, 0x3f, 0x0a, 0x1d, 0x4c, - 0x69, 0x73, 0x74, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x4d, - 0x61, 0x74, 0x63, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1e, 0x0a, 0x05, - 0x6e, 0x6f, 0x64, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x70, 0x62, - 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x05, 0x6e, 0x6f, 0x64, 0x65, 0x73, 0x22, 0x2c, 0x0a, 0x12, - 0x44, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x6e, 0x6f, 0x64, 0x65, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x03, 0x52, 0x06, 0x6e, 0x6f, 0x64, 0x65, 0x49, 0x64, 0x22, 0x15, 0x0a, 0x13, 0x44, 0x69, - 0x73, 0x61, 0x62, 0x6c, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x22, 0x82, 0x01, 0x0a, 0x11, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4e, 0x6f, 0x64, 0x65, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x6e, 0x6f, 0x64, 0x65, 0x49, - 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x6e, 0x6f, 0x64, 0x65, 0x49, 0x64, 0x12, - 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, - 0x61, 0x6d, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x64, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, - 0x64, 0x12, 0x23, 0x0a, 0x05, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x0d, 0x2e, 0x70, 0x62, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, - 0x05, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x22, 0x14, 0x0a, 0x12, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, - 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x30, 0x0a, 0x16, - 0x46, 0x69, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x4e, 0x6f, 0x64, 0x65, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x6e, 0x6f, 0x64, 0x65, 0x49, 0x64, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x6e, 0x6f, 0x64, 0x65, 0x49, 0x64, 0x22, 0x37, - 0x0a, 0x17, 0x46, 0x69, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x4e, 0x6f, 0x64, - 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1c, 0x0a, 0x04, 0x6e, 0x6f, 0x64, - 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x70, 0x62, 0x2e, 0x4e, 0x6f, 0x64, - 0x65, 0x52, 0x04, 0x6e, 0x6f, 0x64, 0x65, 0x22, 0x1a, 0x0a, 0x18, 0x43, 0x6f, 0x6d, 0x70, 0x6f, - 0x73, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x22, 0x3b, 0x0a, 0x19, 0x43, 0x6f, 0x6d, 0x70, 0x6f, 0x73, 0x65, 0x4e, 0x6f, - 0x64, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x4a, 0x53, 0x4f, 0x4e, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0a, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x4a, 0x53, 0x4f, 0x4e, - 0x22, 0x13, 0x0a, 0x11, 0x4e, 0x6f, 0x64, 0x65, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x14, 0x0a, 0x12, 0x4e, 0x6f, 0x64, 0x65, 0x53, 0x74, 0x72, - 0x65, 0x61, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x51, 0x0a, 0x17, 0x55, - 0x70, 0x64, 0x61, 0x74, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x6e, 0x6f, 0x64, 0x65, 0x49, 0x64, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x6e, 0x6f, 0x64, 0x65, 0x49, 0x64, 0x12, 0x1e, - 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x4a, 0x53, 0x4f, 0x4e, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x0c, 0x52, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x4a, 0x53, 0x4f, 0x4e, 0x22, 0x1a, - 0x0a, 0x18, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x53, 0x74, 0x61, 0x74, - 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x42, 0x0a, 0x22, 0x53, 0x79, - 0x6e, 0x63, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x57, 0x69, - 0x74, 0x68, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x64, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x03, 0x52, 0x09, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x64, 0x22, 0x25, - 0x0a, 0x23, 0x53, 0x79, 0x6e, 0x63, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x56, 0x65, 0x72, 0x73, 0x69, - 0x6f, 0x6e, 0x57, 0x69, 0x74, 0x68, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x40, 0x0a, 0x20, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x41, 0x6c, - 0x6c, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x4d, 0x61, 0x74, - 0x63, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x6c, 0x75, - 0x73, 0x74, 0x65, 0x72, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x63, 0x6c, - 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x64, 0x22, 0x39, 0x0a, 0x21, 0x43, 0x6f, 0x75, 0x6e, 0x74, - 0x41, 0x6c, 0x6c, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x4d, - 0x61, 0x74, 0x63, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, - 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x63, 0x6f, 0x75, - 0x6e, 0x74, 0x22, 0x58, 0x0a, 0x1c, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4e, 0x6f, 0x64, 0x65, - 0x49, 0x73, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x65, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x6e, 0x6f, 0x64, 0x65, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x03, 0x52, 0x06, 0x6e, 0x6f, 0x64, 0x65, 0x49, 0x64, 0x12, 0x20, 0x0a, 0x0b, 0x69, 0x73, - 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, - 0x0b, 0x69, 0x73, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x65, 0x64, 0x22, 0x1f, 0x0a, 0x1d, - 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x73, 0x49, 0x6e, 0x73, 0x74, - 0x61, 0x6c, 0x6c, 0x65, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0xe6, 0x07, - 0x0a, 0x0b, 0x4e, 0x6f, 0x64, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x3b, 0x0a, - 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x12, 0x15, 0x2e, 0x70, 0x62, - 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4e, 0x6f, - 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x59, 0x0a, 0x14, 0x63, 0x6f, - 0x75, 0x6e, 0x74, 0x41, 0x6c, 0x6c, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x4e, 0x6f, 0x64, - 0x65, 0x73, 0x12, 0x1f, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x41, 0x6c, 0x6c, - 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x41, 0x6c, - 0x6c, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x68, 0x0a, 0x19, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x41, 0x6c, - 0x6c, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x4d, 0x61, 0x74, - 0x63, 0x68, 0x12, 0x24, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x41, 0x6c, 0x6c, - 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x4d, 0x61, 0x74, 0x63, - 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x6f, - 0x75, 0x6e, 0x74, 0x41, 0x6c, 0x6c, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x4e, 0x6f, 0x64, - 0x65, 0x73, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, - 0x5c, 0x0a, 0x15, 0x6c, 0x69, 0x73, 0x74, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x4e, 0x6f, - 0x64, 0x65, 0x73, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x12, 0x20, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x69, - 0x73, 0x74, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x4d, 0x61, - 0x74, 0x63, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x70, 0x62, 0x2e, - 0x4c, 0x69, 0x73, 0x74, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x4e, 0x6f, 0x64, 0x65, 0x73, - 0x4d, 0x61, 0x74, 0x63, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3e, 0x0a, - 0x0b, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x12, 0x16, 0x2e, 0x70, - 0x62, 0x2e, 0x44, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x69, 0x73, 0x61, 0x62, 0x6c, - 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3b, 0x0a, - 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x12, 0x15, 0x2e, 0x70, 0x62, - 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4e, 0x6f, - 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4a, 0x0a, 0x0f, 0x66, 0x69, - 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x4e, 0x6f, 0x64, 0x65, 0x12, 0x1a, 0x2e, - 0x70, 0x62, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x4e, 0x6f, - 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x70, 0x62, 0x2e, 0x46, - 0x69, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x50, 0x0a, 0x11, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x73, - 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x1c, 0x2e, 0x70, 0x62, - 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x6f, 0x73, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x43, 0x6f, 0x6e, 0x66, - 0x69, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x70, 0x62, 0x2e, 0x43, - 0x6f, 0x6d, 0x70, 0x6f, 0x73, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3f, 0x0a, 0x0a, 0x6e, 0x6f, 0x64, 0x65, - 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x12, 0x15, 0x2e, 0x70, 0x62, 0x2e, 0x4e, 0x6f, 0x64, 0x65, - 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, - 0x70, 0x62, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x28, 0x01, 0x30, 0x01, 0x12, 0x4d, 0x0a, 0x10, 0x75, 0x70, 0x64, - 0x61, 0x74, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1b, 0x2e, - 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x53, 0x74, 0x61, - 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x70, 0x62, 0x2e, - 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x6e, 0x0a, 0x1b, 0x73, 0x79, 0x6e, 0x63, - 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x57, 0x69, 0x74, 0x68, - 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x12, 0x26, 0x2e, 0x70, 0x62, 0x2e, 0x53, 0x79, 0x6e, - 0x63, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x57, 0x69, 0x74, - 0x68, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x27, 0x2e, 0x70, 0x62, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x56, 0x65, - 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x57, 0x69, 0x74, 0x68, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x5c, 0x0a, 0x15, 0x75, 0x70, 0x64, 0x61, - 0x74, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x73, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x65, - 0x64, 0x12, 0x20, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4e, 0x6f, 0x64, - 0x65, 0x49, 0x73, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x65, 0x64, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4e, - 0x6f, 0x64, 0x65, 0x49, 0x73, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x65, 0x64, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_service_node_proto_rawDescOnce sync.Once - file_service_node_proto_rawDescData = file_service_node_proto_rawDesc -) - -func file_service_node_proto_rawDescGZIP() []byte { - file_service_node_proto_rawDescOnce.Do(func() { - file_service_node_proto_rawDescData = protoimpl.X.CompressGZIP(file_service_node_proto_rawDescData) - }) - return file_service_node_proto_rawDescData -} - -var file_service_node_proto_msgTypes = make([]protoimpl.MessageInfo, 24) -var file_service_node_proto_goTypes = []interface{}{ - (*CreateNodeRequest)(nil), // 0: pb.CreateNodeRequest - (*CreateNodeResponse)(nil), // 1: pb.CreateNodeResponse - (*CountAllEnabledNodesRequest)(nil), // 2: pb.CountAllEnabledNodesRequest - (*CountAllEnabledNodesResponse)(nil), // 3: pb.CountAllEnabledNodesResponse - (*ListEnabledNodesMatchRequest)(nil), // 4: pb.ListEnabledNodesMatchRequest - (*ListEnabledNodesMatchResponse)(nil), // 5: pb.ListEnabledNodesMatchResponse - (*DisableNodeRequest)(nil), // 6: pb.DisableNodeRequest - (*DisableNodeResponse)(nil), // 7: pb.DisableNodeResponse - (*UpdateNodeRequest)(nil), // 8: pb.UpdateNodeRequest - (*UpdateNodeResponse)(nil), // 9: pb.UpdateNodeResponse - (*FindEnabledNodeRequest)(nil), // 10: pb.FindEnabledNodeRequest - (*FindEnabledNodeResponse)(nil), // 11: pb.FindEnabledNodeResponse - (*ComposeNodeConfigRequest)(nil), // 12: pb.ComposeNodeConfigRequest - (*ComposeNodeConfigResponse)(nil), // 13: pb.ComposeNodeConfigResponse - (*NodeStreamRequest)(nil), // 14: pb.NodeStreamRequest - (*NodeStreamResponse)(nil), // 15: pb.NodeStreamResponse - (*UpdateNodeStatusRequest)(nil), // 16: pb.UpdateNodeStatusRequest - (*UpdateNodeStatusResponse)(nil), // 17: pb.UpdateNodeStatusResponse - (*SyncNodesVersionWithClusterRequest)(nil), // 18: pb.SyncNodesVersionWithClusterRequest - (*SyncNodesVersionWithClusterResponse)(nil), // 19: pb.SyncNodesVersionWithClusterResponse - (*CountAllEnabledNodesMatchRequest)(nil), // 20: pb.CountAllEnabledNodesMatchRequest - (*CountAllEnabledNodesMatchResponse)(nil), // 21: pb.CountAllEnabledNodesMatchResponse - (*UpdateNodeIsInstalledRequest)(nil), // 22: pb.UpdateNodeIsInstalledRequest - (*UpdateNodeIsInstalledResponse)(nil), // 23: pb.UpdateNodeIsInstalledResponse - (*NodeLogin)(nil), // 24: pb.NodeLogin - (*Node)(nil), // 25: pb.Node -} -var file_service_node_proto_depIdxs = []int32{ - 24, // 0: pb.CreateNodeRequest.Login:type_name -> pb.NodeLogin - 25, // 1: pb.ListEnabledNodesMatchResponse.nodes:type_name -> pb.Node - 24, // 2: pb.UpdateNodeRequest.Login:type_name -> pb.NodeLogin - 25, // 3: pb.FindEnabledNodeResponse.node:type_name -> pb.Node - 0, // 4: pb.NodeService.createNode:input_type -> pb.CreateNodeRequest - 2, // 5: pb.NodeService.countAllEnabledNodes:input_type -> pb.CountAllEnabledNodesRequest - 20, // 6: pb.NodeService.countAllEnabledNodesMatch:input_type -> pb.CountAllEnabledNodesMatchRequest - 4, // 7: pb.NodeService.listEnabledNodesMatch:input_type -> pb.ListEnabledNodesMatchRequest - 6, // 8: pb.NodeService.disableNode:input_type -> pb.DisableNodeRequest - 8, // 9: pb.NodeService.updateNode:input_type -> pb.UpdateNodeRequest - 10, // 10: pb.NodeService.findEnabledNode:input_type -> pb.FindEnabledNodeRequest - 12, // 11: pb.NodeService.composeNodeConfig:input_type -> pb.ComposeNodeConfigRequest - 14, // 12: pb.NodeService.nodeStream:input_type -> pb.NodeStreamRequest - 16, // 13: pb.NodeService.updateNodeStatus:input_type -> pb.UpdateNodeStatusRequest - 18, // 14: pb.NodeService.syncNodesVersionWithCluster:input_type -> pb.SyncNodesVersionWithClusterRequest - 22, // 15: pb.NodeService.updateNodeIsInstalled:input_type -> pb.UpdateNodeIsInstalledRequest - 1, // 16: pb.NodeService.createNode:output_type -> pb.CreateNodeResponse - 3, // 17: pb.NodeService.countAllEnabledNodes:output_type -> pb.CountAllEnabledNodesResponse - 21, // 18: pb.NodeService.countAllEnabledNodesMatch:output_type -> pb.CountAllEnabledNodesMatchResponse - 5, // 19: pb.NodeService.listEnabledNodesMatch:output_type -> pb.ListEnabledNodesMatchResponse - 7, // 20: pb.NodeService.disableNode:output_type -> pb.DisableNodeResponse - 9, // 21: pb.NodeService.updateNode:output_type -> pb.UpdateNodeResponse - 11, // 22: pb.NodeService.findEnabledNode:output_type -> pb.FindEnabledNodeResponse - 13, // 23: pb.NodeService.composeNodeConfig:output_type -> pb.ComposeNodeConfigResponse - 15, // 24: pb.NodeService.nodeStream:output_type -> pb.NodeStreamResponse - 17, // 25: pb.NodeService.updateNodeStatus:output_type -> pb.UpdateNodeStatusResponse - 19, // 26: pb.NodeService.syncNodesVersionWithCluster:output_type -> pb.SyncNodesVersionWithClusterResponse - 23, // 27: pb.NodeService.updateNodeIsInstalled:output_type -> pb.UpdateNodeIsInstalledResponse - 16, // [16:28] is the sub-list for method output_type - 4, // [4:16] is the sub-list for method input_type - 4, // [4:4] is the sub-list for extension type_name - 4, // [4:4] is the sub-list for extension extendee - 0, // [0:4] is the sub-list for field type_name -} - -func init() { file_service_node_proto_init() } -func file_service_node_proto_init() { - if File_service_node_proto != nil { - return - } - file_model_node_proto_init() - file_model_node_login_proto_init() - if !protoimpl.UnsafeEnabled { - file_service_node_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreateNodeRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_service_node_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreateNodeResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_service_node_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CountAllEnabledNodesRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_service_node_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CountAllEnabledNodesResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_service_node_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListEnabledNodesMatchRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_service_node_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListEnabledNodesMatchResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_service_node_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DisableNodeRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_service_node_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DisableNodeResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_service_node_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UpdateNodeRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_service_node_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UpdateNodeResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_service_node_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*FindEnabledNodeRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_service_node_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*FindEnabledNodeResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_service_node_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ComposeNodeConfigRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_service_node_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ComposeNodeConfigResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_service_node_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*NodeStreamRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_service_node_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*NodeStreamResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_service_node_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UpdateNodeStatusRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_service_node_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UpdateNodeStatusResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_service_node_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SyncNodesVersionWithClusterRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_service_node_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SyncNodesVersionWithClusterResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_service_node_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CountAllEnabledNodesMatchRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_service_node_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CountAllEnabledNodesMatchResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_service_node_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UpdateNodeIsInstalledRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_service_node_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UpdateNodeIsInstalledResponse); 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_service_node_proto_rawDesc, - NumEnums: 0, - NumMessages: 24, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_service_node_proto_goTypes, - DependencyIndexes: file_service_node_proto_depIdxs, - MessageInfos: file_service_node_proto_msgTypes, - }.Build() - File_service_node_proto = out.File - file_service_node_proto_rawDesc = nil - file_service_node_proto_goTypes = nil - file_service_node_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 - -// NodeServiceClient is the client API for NodeService service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type NodeServiceClient interface { - // 创建节点 - CreateNode(ctx context.Context, in *CreateNodeRequest, opts ...grpc.CallOption) (*CreateNodeResponse, error) - // 节点数量 - CountAllEnabledNodes(ctx context.Context, in *CountAllEnabledNodesRequest, opts ...grpc.CallOption) (*CountAllEnabledNodesResponse, error) - // 计算匹配的节点数量 - CountAllEnabledNodesMatch(ctx context.Context, in *CountAllEnabledNodesMatchRequest, opts ...grpc.CallOption) (*CountAllEnabledNodesMatchResponse, error) - // 列出单页节点 - ListEnabledNodesMatch(ctx context.Context, in *ListEnabledNodesMatchRequest, opts ...grpc.CallOption) (*ListEnabledNodesMatchResponse, error) - // 禁用节点 - DisableNode(ctx context.Context, in *DisableNodeRequest, opts ...grpc.CallOption) (*DisableNodeResponse, error) - // 修改节点 - UpdateNode(ctx context.Context, in *UpdateNodeRequest, opts ...grpc.CallOption) (*UpdateNodeResponse, error) - // 查看单个节点 - FindEnabledNode(ctx context.Context, in *FindEnabledNodeRequest, opts ...grpc.CallOption) (*FindEnabledNodeResponse, error) - // 组合单个节点配置 - ComposeNodeConfig(ctx context.Context, in *ComposeNodeConfigRequest, opts ...grpc.CallOption) (*ComposeNodeConfigResponse, error) - // 节点stream - NodeStream(ctx context.Context, opts ...grpc.CallOption) (NodeService_NodeStreamClient, error) - // 更新节点状态 - UpdateNodeStatus(ctx context.Context, in *UpdateNodeStatusRequest, opts ...grpc.CallOption) (*UpdateNodeStatusResponse, error) - // 同步集群中的节点版本 - SyncNodesVersionWithCluster(ctx context.Context, in *SyncNodesVersionWithClusterRequest, opts ...grpc.CallOption) (*SyncNodesVersionWithClusterResponse, error) - // 修改节点安装状态 - UpdateNodeIsInstalled(ctx context.Context, in *UpdateNodeIsInstalledRequest, opts ...grpc.CallOption) (*UpdateNodeIsInstalledResponse, error) -} - -type nodeServiceClient struct { - cc grpc.ClientConnInterface -} - -func NewNodeServiceClient(cc grpc.ClientConnInterface) NodeServiceClient { - return &nodeServiceClient{cc} -} - -func (c *nodeServiceClient) CreateNode(ctx context.Context, in *CreateNodeRequest, opts ...grpc.CallOption) (*CreateNodeResponse, error) { - out := new(CreateNodeResponse) - err := c.cc.Invoke(ctx, "/pb.NodeService/createNode", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *nodeServiceClient) CountAllEnabledNodes(ctx context.Context, in *CountAllEnabledNodesRequest, opts ...grpc.CallOption) (*CountAllEnabledNodesResponse, error) { - out := new(CountAllEnabledNodesResponse) - err := c.cc.Invoke(ctx, "/pb.NodeService/countAllEnabledNodes", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *nodeServiceClient) CountAllEnabledNodesMatch(ctx context.Context, in *CountAllEnabledNodesMatchRequest, opts ...grpc.CallOption) (*CountAllEnabledNodesMatchResponse, error) { - out := new(CountAllEnabledNodesMatchResponse) - err := c.cc.Invoke(ctx, "/pb.NodeService/countAllEnabledNodesMatch", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *nodeServiceClient) ListEnabledNodesMatch(ctx context.Context, in *ListEnabledNodesMatchRequest, opts ...grpc.CallOption) (*ListEnabledNodesMatchResponse, error) { - out := new(ListEnabledNodesMatchResponse) - err := c.cc.Invoke(ctx, "/pb.NodeService/listEnabledNodesMatch", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *nodeServiceClient) DisableNode(ctx context.Context, in *DisableNodeRequest, opts ...grpc.CallOption) (*DisableNodeResponse, error) { - out := new(DisableNodeResponse) - err := c.cc.Invoke(ctx, "/pb.NodeService/disableNode", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *nodeServiceClient) UpdateNode(ctx context.Context, in *UpdateNodeRequest, opts ...grpc.CallOption) (*UpdateNodeResponse, error) { - out := new(UpdateNodeResponse) - err := c.cc.Invoke(ctx, "/pb.NodeService/updateNode", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *nodeServiceClient) FindEnabledNode(ctx context.Context, in *FindEnabledNodeRequest, opts ...grpc.CallOption) (*FindEnabledNodeResponse, error) { - out := new(FindEnabledNodeResponse) - err := c.cc.Invoke(ctx, "/pb.NodeService/findEnabledNode", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *nodeServiceClient) ComposeNodeConfig(ctx context.Context, in *ComposeNodeConfigRequest, opts ...grpc.CallOption) (*ComposeNodeConfigResponse, error) { - out := new(ComposeNodeConfigResponse) - err := c.cc.Invoke(ctx, "/pb.NodeService/composeNodeConfig", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *nodeServiceClient) NodeStream(ctx context.Context, opts ...grpc.CallOption) (NodeService_NodeStreamClient, error) { - stream, err := c.cc.NewStream(ctx, &_NodeService_serviceDesc.Streams[0], "/pb.NodeService/nodeStream", opts...) - if err != nil { - return nil, err - } - x := &nodeServiceNodeStreamClient{stream} - return x, nil -} - -type NodeService_NodeStreamClient interface { - Send(*NodeStreamRequest) error - Recv() (*NodeStreamResponse, error) - grpc.ClientStream -} - -type nodeServiceNodeStreamClient struct { - grpc.ClientStream -} - -func (x *nodeServiceNodeStreamClient) Send(m *NodeStreamRequest) error { - return x.ClientStream.SendMsg(m) -} - -func (x *nodeServiceNodeStreamClient) Recv() (*NodeStreamResponse, error) { - m := new(NodeStreamResponse) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func (c *nodeServiceClient) UpdateNodeStatus(ctx context.Context, in *UpdateNodeStatusRequest, opts ...grpc.CallOption) (*UpdateNodeStatusResponse, error) { - out := new(UpdateNodeStatusResponse) - err := c.cc.Invoke(ctx, "/pb.NodeService/updateNodeStatus", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *nodeServiceClient) SyncNodesVersionWithCluster(ctx context.Context, in *SyncNodesVersionWithClusterRequest, opts ...grpc.CallOption) (*SyncNodesVersionWithClusterResponse, error) { - out := new(SyncNodesVersionWithClusterResponse) - err := c.cc.Invoke(ctx, "/pb.NodeService/syncNodesVersionWithCluster", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *nodeServiceClient) UpdateNodeIsInstalled(ctx context.Context, in *UpdateNodeIsInstalledRequest, opts ...grpc.CallOption) (*UpdateNodeIsInstalledResponse, error) { - out := new(UpdateNodeIsInstalledResponse) - err := c.cc.Invoke(ctx, "/pb.NodeService/updateNodeIsInstalled", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// NodeServiceServer is the server API for NodeService service. -type NodeServiceServer interface { - // 创建节点 - CreateNode(context.Context, *CreateNodeRequest) (*CreateNodeResponse, error) - // 节点数量 - CountAllEnabledNodes(context.Context, *CountAllEnabledNodesRequest) (*CountAllEnabledNodesResponse, error) - // 计算匹配的节点数量 - CountAllEnabledNodesMatch(context.Context, *CountAllEnabledNodesMatchRequest) (*CountAllEnabledNodesMatchResponse, error) - // 列出单页节点 - ListEnabledNodesMatch(context.Context, *ListEnabledNodesMatchRequest) (*ListEnabledNodesMatchResponse, error) - // 禁用节点 - DisableNode(context.Context, *DisableNodeRequest) (*DisableNodeResponse, error) - // 修改节点 - UpdateNode(context.Context, *UpdateNodeRequest) (*UpdateNodeResponse, error) - // 查看单个节点 - FindEnabledNode(context.Context, *FindEnabledNodeRequest) (*FindEnabledNodeResponse, error) - // 组合单个节点配置 - ComposeNodeConfig(context.Context, *ComposeNodeConfigRequest) (*ComposeNodeConfigResponse, error) - // 节点stream - NodeStream(NodeService_NodeStreamServer) error - // 更新节点状态 - UpdateNodeStatus(context.Context, *UpdateNodeStatusRequest) (*UpdateNodeStatusResponse, error) - // 同步集群中的节点版本 - SyncNodesVersionWithCluster(context.Context, *SyncNodesVersionWithClusterRequest) (*SyncNodesVersionWithClusterResponse, error) - // 修改节点安装状态 - UpdateNodeIsInstalled(context.Context, *UpdateNodeIsInstalledRequest) (*UpdateNodeIsInstalledResponse, error) -} - -// UnimplementedNodeServiceServer can be embedded to have forward compatible implementations. -type UnimplementedNodeServiceServer struct { -} - -func (*UnimplementedNodeServiceServer) CreateNode(context.Context, *CreateNodeRequest) (*CreateNodeResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method CreateNode not implemented") -} -func (*UnimplementedNodeServiceServer) CountAllEnabledNodes(context.Context, *CountAllEnabledNodesRequest) (*CountAllEnabledNodesResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method CountAllEnabledNodes not implemented") -} -func (*UnimplementedNodeServiceServer) CountAllEnabledNodesMatch(context.Context, *CountAllEnabledNodesMatchRequest) (*CountAllEnabledNodesMatchResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method CountAllEnabledNodesMatch not implemented") -} -func (*UnimplementedNodeServiceServer) ListEnabledNodesMatch(context.Context, *ListEnabledNodesMatchRequest) (*ListEnabledNodesMatchResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ListEnabledNodesMatch not implemented") -} -func (*UnimplementedNodeServiceServer) DisableNode(context.Context, *DisableNodeRequest) (*DisableNodeResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method DisableNode not implemented") -} -func (*UnimplementedNodeServiceServer) UpdateNode(context.Context, *UpdateNodeRequest) (*UpdateNodeResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method UpdateNode not implemented") -} -func (*UnimplementedNodeServiceServer) FindEnabledNode(context.Context, *FindEnabledNodeRequest) (*FindEnabledNodeResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method FindEnabledNode not implemented") -} -func (*UnimplementedNodeServiceServer) ComposeNodeConfig(context.Context, *ComposeNodeConfigRequest) (*ComposeNodeConfigResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ComposeNodeConfig not implemented") -} -func (*UnimplementedNodeServiceServer) NodeStream(NodeService_NodeStreamServer) error { - return status.Errorf(codes.Unimplemented, "method NodeStream not implemented") -} -func (*UnimplementedNodeServiceServer) UpdateNodeStatus(context.Context, *UpdateNodeStatusRequest) (*UpdateNodeStatusResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method UpdateNodeStatus not implemented") -} -func (*UnimplementedNodeServiceServer) SyncNodesVersionWithCluster(context.Context, *SyncNodesVersionWithClusterRequest) (*SyncNodesVersionWithClusterResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method SyncNodesVersionWithCluster not implemented") -} -func (*UnimplementedNodeServiceServer) UpdateNodeIsInstalled(context.Context, *UpdateNodeIsInstalledRequest) (*UpdateNodeIsInstalledResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method UpdateNodeIsInstalled not implemented") -} - -func RegisterNodeServiceServer(s *grpc.Server, srv NodeServiceServer) { - s.RegisterService(&_NodeService_serviceDesc, srv) -} - -func _NodeService_CreateNode_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(CreateNodeRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(NodeServiceServer).CreateNode(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/pb.NodeService/CreateNode", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(NodeServiceServer).CreateNode(ctx, req.(*CreateNodeRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _NodeService_CountAllEnabledNodes_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(CountAllEnabledNodesRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(NodeServiceServer).CountAllEnabledNodes(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/pb.NodeService/CountAllEnabledNodes", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(NodeServiceServer).CountAllEnabledNodes(ctx, req.(*CountAllEnabledNodesRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _NodeService_CountAllEnabledNodesMatch_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(CountAllEnabledNodesMatchRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(NodeServiceServer).CountAllEnabledNodesMatch(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/pb.NodeService/CountAllEnabledNodesMatch", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(NodeServiceServer).CountAllEnabledNodesMatch(ctx, req.(*CountAllEnabledNodesMatchRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _NodeService_ListEnabledNodesMatch_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ListEnabledNodesMatchRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(NodeServiceServer).ListEnabledNodesMatch(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/pb.NodeService/ListEnabledNodesMatch", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(NodeServiceServer).ListEnabledNodesMatch(ctx, req.(*ListEnabledNodesMatchRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _NodeService_DisableNode_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DisableNodeRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(NodeServiceServer).DisableNode(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/pb.NodeService/DisableNode", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(NodeServiceServer).DisableNode(ctx, req.(*DisableNodeRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _NodeService_UpdateNode_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(UpdateNodeRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(NodeServiceServer).UpdateNode(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/pb.NodeService/UpdateNode", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(NodeServiceServer).UpdateNode(ctx, req.(*UpdateNodeRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _NodeService_FindEnabledNode_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(FindEnabledNodeRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(NodeServiceServer).FindEnabledNode(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/pb.NodeService/FindEnabledNode", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(NodeServiceServer).FindEnabledNode(ctx, req.(*FindEnabledNodeRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _NodeService_ComposeNodeConfig_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ComposeNodeConfigRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(NodeServiceServer).ComposeNodeConfig(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/pb.NodeService/ComposeNodeConfig", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(NodeServiceServer).ComposeNodeConfig(ctx, req.(*ComposeNodeConfigRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _NodeService_NodeStream_Handler(srv interface{}, stream grpc.ServerStream) error { - return srv.(NodeServiceServer).NodeStream(&nodeServiceNodeStreamServer{stream}) -} - -type NodeService_NodeStreamServer interface { - Send(*NodeStreamResponse) error - Recv() (*NodeStreamRequest, error) - grpc.ServerStream -} - -type nodeServiceNodeStreamServer struct { - grpc.ServerStream -} - -func (x *nodeServiceNodeStreamServer) Send(m *NodeStreamResponse) error { - return x.ServerStream.SendMsg(m) -} - -func (x *nodeServiceNodeStreamServer) Recv() (*NodeStreamRequest, error) { - m := new(NodeStreamRequest) - if err := x.ServerStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func _NodeService_UpdateNodeStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(UpdateNodeStatusRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(NodeServiceServer).UpdateNodeStatus(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/pb.NodeService/UpdateNodeStatus", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(NodeServiceServer).UpdateNodeStatus(ctx, req.(*UpdateNodeStatusRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _NodeService_SyncNodesVersionWithCluster_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(SyncNodesVersionWithClusterRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(NodeServiceServer).SyncNodesVersionWithCluster(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/pb.NodeService/SyncNodesVersionWithCluster", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(NodeServiceServer).SyncNodesVersionWithCluster(ctx, req.(*SyncNodesVersionWithClusterRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _NodeService_UpdateNodeIsInstalled_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(UpdateNodeIsInstalledRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(NodeServiceServer).UpdateNodeIsInstalled(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/pb.NodeService/UpdateNodeIsInstalled", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(NodeServiceServer).UpdateNodeIsInstalled(ctx, req.(*UpdateNodeIsInstalledRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _NodeService_serviceDesc = grpc.ServiceDesc{ - ServiceName: "pb.NodeService", - HandlerType: (*NodeServiceServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "createNode", - Handler: _NodeService_CreateNode_Handler, - }, - { - MethodName: "countAllEnabledNodes", - Handler: _NodeService_CountAllEnabledNodes_Handler, - }, - { - MethodName: "countAllEnabledNodesMatch", - Handler: _NodeService_CountAllEnabledNodesMatch_Handler, - }, - { - MethodName: "listEnabledNodesMatch", - Handler: _NodeService_ListEnabledNodesMatch_Handler, - }, - { - MethodName: "disableNode", - Handler: _NodeService_DisableNode_Handler, - }, - { - MethodName: "updateNode", - Handler: _NodeService_UpdateNode_Handler, - }, - { - MethodName: "findEnabledNode", - Handler: _NodeService_FindEnabledNode_Handler, - }, - { - MethodName: "composeNodeConfig", - Handler: _NodeService_ComposeNodeConfig_Handler, - }, - { - MethodName: "updateNodeStatus", - Handler: _NodeService_UpdateNodeStatus_Handler, - }, - { - MethodName: "syncNodesVersionWithCluster", - Handler: _NodeService_SyncNodesVersionWithCluster_Handler, - }, - { - MethodName: "updateNodeIsInstalled", - Handler: _NodeService_UpdateNodeIsInstalled_Handler, - }, - }, - Streams: []grpc.StreamDesc{ - { - StreamName: "nodeStream", - Handler: _NodeService_NodeStream_Handler, - ServerStreams: true, - ClientStreams: true, - }, - }, - Metadata: "service_node.proto", -} diff --git a/internal/rpc/pb/service_node_cluster.pb.go b/internal/rpc/pb/service_node_cluster.pb.go deleted file mode 100644 index 6bfca315..00000000 --- a/internal/rpc/pb/service_node_cluster.pb.go +++ /dev/null @@ -1,1547 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.25.0 -// protoc v3.12.3 -// source: service_node_cluster.proto - -package pb - -import ( - context "context" - proto "github.com/golang/protobuf/proto" - 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" - 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) -) - -// 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 FindAllEnabledNodeClustersRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *FindAllEnabledNodeClustersRequest) Reset() { - *x = FindAllEnabledNodeClustersRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_service_node_cluster_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *FindAllEnabledNodeClustersRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*FindAllEnabledNodeClustersRequest) ProtoMessage() {} - -func (x *FindAllEnabledNodeClustersRequest) ProtoReflect() protoreflect.Message { - mi := &file_service_node_cluster_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 FindAllEnabledNodeClustersRequest.ProtoReflect.Descriptor instead. -func (*FindAllEnabledNodeClustersRequest) Descriptor() ([]byte, []int) { - return file_service_node_cluster_proto_rawDescGZIP(), []int{0} -} - -type FindAllEnabledNodeClustersResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Clusters []*NodeCluster `protobuf:"bytes,1,rep,name=clusters,proto3" json:"clusters,omitempty"` -} - -func (x *FindAllEnabledNodeClustersResponse) Reset() { - *x = FindAllEnabledNodeClustersResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_service_node_cluster_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *FindAllEnabledNodeClustersResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*FindAllEnabledNodeClustersResponse) ProtoMessage() {} - -func (x *FindAllEnabledNodeClustersResponse) ProtoReflect() protoreflect.Message { - mi := &file_service_node_cluster_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) -} - -// Deprecated: Use FindAllEnabledNodeClustersResponse.ProtoReflect.Descriptor instead. -func (*FindAllEnabledNodeClustersResponse) Descriptor() ([]byte, []int) { - return file_service_node_cluster_proto_rawDescGZIP(), []int{1} -} - -func (x *FindAllEnabledNodeClustersResponse) GetClusters() []*NodeCluster { - if x != nil { - return x.Clusters - } - return nil -} - -// 获取变更的集群 -type FindAllChangedNodeClustersRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *FindAllChangedNodeClustersRequest) Reset() { - *x = FindAllChangedNodeClustersRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_service_node_cluster_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *FindAllChangedNodeClustersRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*FindAllChangedNodeClustersRequest) ProtoMessage() {} - -func (x *FindAllChangedNodeClustersRequest) ProtoReflect() protoreflect.Message { - mi := &file_service_node_cluster_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) -} - -// Deprecated: Use FindAllChangedNodeClustersRequest.ProtoReflect.Descriptor instead. -func (*FindAllChangedNodeClustersRequest) Descriptor() ([]byte, []int) { - return file_service_node_cluster_proto_rawDescGZIP(), []int{2} -} - -type FindAllChangedNodeClustersResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Clusters []*NodeCluster `protobuf:"bytes,1,rep,name=clusters,proto3" json:"clusters,omitempty"` -} - -func (x *FindAllChangedNodeClustersResponse) Reset() { - *x = FindAllChangedNodeClustersResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_service_node_cluster_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *FindAllChangedNodeClustersResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*FindAllChangedNodeClustersResponse) ProtoMessage() {} - -func (x *FindAllChangedNodeClustersResponse) ProtoReflect() protoreflect.Message { - mi := &file_service_node_cluster_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) -} - -// Deprecated: Use FindAllChangedNodeClustersResponse.ProtoReflect.Descriptor instead. -func (*FindAllChangedNodeClustersResponse) Descriptor() ([]byte, []int) { - return file_service_node_cluster_proto_rawDescGZIP(), []int{3} -} - -func (x *FindAllChangedNodeClustersResponse) GetClusters() []*NodeCluster { - if x != nil { - return x.Clusters - } - return nil -} - -// 创建集群 -type CreateNodeClusterRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - GrantId int64 `protobuf:"varint,2,opt,name=grantId,proto3" json:"grantId,omitempty"` - InstallDir string `protobuf:"bytes,3,opt,name=installDir,proto3" json:"installDir,omitempty"` -} - -func (x *CreateNodeClusterRequest) Reset() { - *x = CreateNodeClusterRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_service_node_cluster_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CreateNodeClusterRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CreateNodeClusterRequest) ProtoMessage() {} - -func (x *CreateNodeClusterRequest) ProtoReflect() protoreflect.Message { - mi := &file_service_node_cluster_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) -} - -// Deprecated: Use CreateNodeClusterRequest.ProtoReflect.Descriptor instead. -func (*CreateNodeClusterRequest) Descriptor() ([]byte, []int) { - return file_service_node_cluster_proto_rawDescGZIP(), []int{4} -} - -func (x *CreateNodeClusterRequest) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *CreateNodeClusterRequest) GetGrantId() int64 { - if x != nil { - return x.GrantId - } - return 0 -} - -func (x *CreateNodeClusterRequest) GetInstallDir() string { - if x != nil { - return x.InstallDir - } - return "" -} - -type CreateNodeClusterResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - ClusterId int64 `protobuf:"varint,1,opt,name=clusterId,proto3" json:"clusterId,omitempty"` -} - -func (x *CreateNodeClusterResponse) Reset() { - *x = CreateNodeClusterResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_service_node_cluster_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CreateNodeClusterResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CreateNodeClusterResponse) ProtoMessage() {} - -func (x *CreateNodeClusterResponse) ProtoReflect() protoreflect.Message { - mi := &file_service_node_cluster_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) -} - -// Deprecated: Use CreateNodeClusterResponse.ProtoReflect.Descriptor instead. -func (*CreateNodeClusterResponse) Descriptor() ([]byte, []int) { - return file_service_node_cluster_proto_rawDescGZIP(), []int{5} -} - -func (x *CreateNodeClusterResponse) GetClusterId() int64 { - if x != nil { - return x.ClusterId - } - return 0 -} - -// 修改集群 -type UpdateNodeClusterRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - ClusterId int64 `protobuf:"varint,1,opt,name=clusterId,proto3" json:"clusterId,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - GrantId int64 `protobuf:"varint,3,opt,name=grantId,proto3" json:"grantId,omitempty"` - InstallDir string `protobuf:"bytes,4,opt,name=installDir,proto3" json:"installDir,omitempty"` -} - -func (x *UpdateNodeClusterRequest) Reset() { - *x = UpdateNodeClusterRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_service_node_cluster_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *UpdateNodeClusterRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UpdateNodeClusterRequest) ProtoMessage() {} - -func (x *UpdateNodeClusterRequest) ProtoReflect() protoreflect.Message { - mi := &file_service_node_cluster_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) -} - -// Deprecated: Use UpdateNodeClusterRequest.ProtoReflect.Descriptor instead. -func (*UpdateNodeClusterRequest) Descriptor() ([]byte, []int) { - return file_service_node_cluster_proto_rawDescGZIP(), []int{6} -} - -func (x *UpdateNodeClusterRequest) GetClusterId() int64 { - if x != nil { - return x.ClusterId - } - return 0 -} - -func (x *UpdateNodeClusterRequest) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *UpdateNodeClusterRequest) GetGrantId() int64 { - if x != nil { - return x.GrantId - } - return 0 -} - -func (x *UpdateNodeClusterRequest) GetInstallDir() string { - if x != nil { - return x.InstallDir - } - return "" -} - -type UpdateNodeClusterResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *UpdateNodeClusterResponse) Reset() { - *x = UpdateNodeClusterResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_service_node_cluster_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *UpdateNodeClusterResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UpdateNodeClusterResponse) ProtoMessage() {} - -func (x *UpdateNodeClusterResponse) ProtoReflect() protoreflect.Message { - mi := &file_service_node_cluster_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) -} - -// Deprecated: Use UpdateNodeClusterResponse.ProtoReflect.Descriptor instead. -func (*UpdateNodeClusterResponse) Descriptor() ([]byte, []int) { - return file_service_node_cluster_proto_rawDescGZIP(), []int{7} -} - -// 禁用集群 -type DisableNodeClusterRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - ClusterId int64 `protobuf:"varint,1,opt,name=clusterId,proto3" json:"clusterId,omitempty"` -} - -func (x *DisableNodeClusterRequest) Reset() { - *x = DisableNodeClusterRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_service_node_cluster_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *DisableNodeClusterRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DisableNodeClusterRequest) ProtoMessage() {} - -func (x *DisableNodeClusterRequest) ProtoReflect() protoreflect.Message { - mi := &file_service_node_cluster_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) -} - -// Deprecated: Use DisableNodeClusterRequest.ProtoReflect.Descriptor instead. -func (*DisableNodeClusterRequest) Descriptor() ([]byte, []int) { - return file_service_node_cluster_proto_rawDescGZIP(), []int{8} -} - -func (x *DisableNodeClusterRequest) GetClusterId() int64 { - if x != nil { - return x.ClusterId - } - return 0 -} - -type DisableNodeClusterResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *DisableNodeClusterResponse) Reset() { - *x = DisableNodeClusterResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_service_node_cluster_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *DisableNodeClusterResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DisableNodeClusterResponse) ProtoMessage() {} - -func (x *DisableNodeClusterResponse) ProtoReflect() protoreflect.Message { - mi := &file_service_node_cluster_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) -} - -// Deprecated: Use DisableNodeClusterResponse.ProtoReflect.Descriptor instead. -func (*DisableNodeClusterResponse) Descriptor() ([]byte, []int) { - return file_service_node_cluster_proto_rawDescGZIP(), []int{9} -} - -// 查找单个集群信息 -type FindEnabledNodeClusterRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - ClusterId int64 `protobuf:"varint,1,opt,name=clusterId,proto3" json:"clusterId,omitempty"` -} - -func (x *FindEnabledNodeClusterRequest) Reset() { - *x = FindEnabledNodeClusterRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_service_node_cluster_proto_msgTypes[10] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *FindEnabledNodeClusterRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*FindEnabledNodeClusterRequest) ProtoMessage() {} - -func (x *FindEnabledNodeClusterRequest) ProtoReflect() protoreflect.Message { - mi := &file_service_node_cluster_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) -} - -// Deprecated: Use FindEnabledNodeClusterRequest.ProtoReflect.Descriptor instead. -func (*FindEnabledNodeClusterRequest) Descriptor() ([]byte, []int) { - return file_service_node_cluster_proto_rawDescGZIP(), []int{10} -} - -func (x *FindEnabledNodeClusterRequest) GetClusterId() int64 { - if x != nil { - return x.ClusterId - } - return 0 -} - -type FindEnabledNodeClusterResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Cluster *NodeCluster `protobuf:"bytes,1,opt,name=cluster,proto3" json:"cluster,omitempty"` -} - -func (x *FindEnabledNodeClusterResponse) Reset() { - *x = FindEnabledNodeClusterResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_service_node_cluster_proto_msgTypes[11] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *FindEnabledNodeClusterResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*FindEnabledNodeClusterResponse) ProtoMessage() {} - -func (x *FindEnabledNodeClusterResponse) ProtoReflect() protoreflect.Message { - mi := &file_service_node_cluster_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) -} - -// Deprecated: Use FindEnabledNodeClusterResponse.ProtoReflect.Descriptor instead. -func (*FindEnabledNodeClusterResponse) Descriptor() ([]byte, []int) { - return file_service_node_cluster_proto_rawDescGZIP(), []int{11} -} - -func (x *FindEnabledNodeClusterResponse) GetCluster() *NodeCluster { - if x != nil { - return x.Cluster - } - return nil -} - -// 计算所有集群数量 -type CountAllEnabledNodeClustersRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *CountAllEnabledNodeClustersRequest) Reset() { - *x = CountAllEnabledNodeClustersRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_service_node_cluster_proto_msgTypes[12] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CountAllEnabledNodeClustersRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CountAllEnabledNodeClustersRequest) ProtoMessage() {} - -func (x *CountAllEnabledNodeClustersRequest) ProtoReflect() protoreflect.Message { - mi := &file_service_node_cluster_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) -} - -// Deprecated: Use CountAllEnabledNodeClustersRequest.ProtoReflect.Descriptor instead. -func (*CountAllEnabledNodeClustersRequest) Descriptor() ([]byte, []int) { - return file_service_node_cluster_proto_rawDescGZIP(), []int{12} -} - -type CountAllEnabledNodeClustersResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Count int64 `protobuf:"varint,1,opt,name=count,proto3" json:"count,omitempty"` -} - -func (x *CountAllEnabledNodeClustersResponse) Reset() { - *x = CountAllEnabledNodeClustersResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_service_node_cluster_proto_msgTypes[13] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CountAllEnabledNodeClustersResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CountAllEnabledNodeClustersResponse) ProtoMessage() {} - -func (x *CountAllEnabledNodeClustersResponse) ProtoReflect() protoreflect.Message { - mi := &file_service_node_cluster_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) -} - -// Deprecated: Use CountAllEnabledNodeClustersResponse.ProtoReflect.Descriptor instead. -func (*CountAllEnabledNodeClustersResponse) Descriptor() ([]byte, []int) { - return file_service_node_cluster_proto_rawDescGZIP(), []int{13} -} - -func (x *CountAllEnabledNodeClustersResponse) GetCount() int64 { - if x != nil { - return x.Count - } - return 0 -} - -// 列出单页集群 -type ListEnabledNodeClustersRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Offset int64 `protobuf:"varint,1,opt,name=offset,proto3" json:"offset,omitempty"` - Size int64 `protobuf:"varint,2,opt,name=size,proto3" json:"size,omitempty"` -} - -func (x *ListEnabledNodeClustersRequest) Reset() { - *x = ListEnabledNodeClustersRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_service_node_cluster_proto_msgTypes[14] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListEnabledNodeClustersRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListEnabledNodeClustersRequest) ProtoMessage() {} - -func (x *ListEnabledNodeClustersRequest) ProtoReflect() protoreflect.Message { - mi := &file_service_node_cluster_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) -} - -// Deprecated: Use ListEnabledNodeClustersRequest.ProtoReflect.Descriptor instead. -func (*ListEnabledNodeClustersRequest) Descriptor() ([]byte, []int) { - return file_service_node_cluster_proto_rawDescGZIP(), []int{14} -} - -func (x *ListEnabledNodeClustersRequest) GetOffset() int64 { - if x != nil { - return x.Offset - } - return 0 -} - -func (x *ListEnabledNodeClustersRequest) GetSize() int64 { - if x != nil { - return x.Size - } - return 0 -} - -type ListEnabledNodeClustersResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Clusters []*NodeCluster `protobuf:"bytes,1,rep,name=clusters,proto3" json:"clusters,omitempty"` -} - -func (x *ListEnabledNodeClustersResponse) Reset() { - *x = ListEnabledNodeClustersResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_service_node_cluster_proto_msgTypes[15] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListEnabledNodeClustersResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListEnabledNodeClustersResponse) ProtoMessage() {} - -func (x *ListEnabledNodeClustersResponse) ProtoReflect() protoreflect.Message { - mi := &file_service_node_cluster_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) -} - -// Deprecated: Use ListEnabledNodeClustersResponse.ProtoReflect.Descriptor instead. -func (*ListEnabledNodeClustersResponse) Descriptor() ([]byte, []int) { - return file_service_node_cluster_proto_rawDescGZIP(), []int{15} -} - -func (x *ListEnabledNodeClustersResponse) GetClusters() []*NodeCluster { - if x != nil { - return x.Clusters - } - return nil -} - -var File_service_node_cluster_proto protoreflect.FileDescriptor - -var file_service_node_cluster_proto_rawDesc = []byte{ - 0x0a, 0x1a, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x63, - 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, 0x62, - 0x1a, 0x18, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5f, 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x63, 0x6c, 0x75, - 0x73, 0x74, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x23, 0x0a, 0x21, 0x46, 0x69, - 0x6e, 0x64, 0x41, 0x6c, 0x6c, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x4e, 0x6f, 0x64, 0x65, - 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, - 0x51, 0x0a, 0x22, 0x46, 0x69, 0x6e, 0x64, 0x41, 0x6c, 0x6c, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, - 0x64, 0x4e, 0x6f, 0x64, 0x65, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2b, 0x0a, 0x08, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, - 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x70, 0x62, 0x2e, 0x4e, 0x6f, 0x64, - 0x65, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x52, 0x08, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, - 0x72, 0x73, 0x22, 0x23, 0x0a, 0x21, 0x46, 0x69, 0x6e, 0x64, 0x41, 0x6c, 0x6c, 0x43, 0x68, 0x61, - 0x6e, 0x67, 0x65, 0x64, 0x4e, 0x6f, 0x64, 0x65, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x73, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x51, 0x0a, 0x22, 0x46, 0x69, 0x6e, 0x64, 0x41, - 0x6c, 0x6c, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x64, 0x4e, 0x6f, 0x64, 0x65, 0x43, 0x6c, 0x75, - 0x73, 0x74, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2b, 0x0a, - 0x08, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x0f, 0x2e, 0x70, 0x62, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, - 0x52, 0x08, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x73, 0x22, 0x68, 0x0a, 0x18, 0x43, 0x72, - 0x65, 0x61, 0x74, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x67, 0x72, - 0x61, 0x6e, 0x74, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x67, 0x72, 0x61, - 0x6e, 0x74, 0x49, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x44, - 0x69, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, - 0x6c, 0x44, 0x69, 0x72, 0x22, 0x39, 0x0a, 0x19, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4e, 0x6f, - 0x64, 0x65, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x64, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x64, 0x22, - 0x86, 0x01, 0x0a, 0x18, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x43, 0x6c, - 0x75, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1c, 0x0a, 0x09, - 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, - 0x09, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, - 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x18, - 0x0a, 0x07, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, - 0x07, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x69, 0x6e, 0x73, 0x74, - 0x61, 0x6c, 0x6c, 0x44, 0x69, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x69, 0x6e, - 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x44, 0x69, 0x72, 0x22, 0x1b, 0x0a, 0x19, 0x55, 0x70, 0x64, 0x61, - 0x74, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x39, 0x0a, 0x19, 0x44, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, - 0x4e, 0x6f, 0x64, 0x65, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x64, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x64, - 0x22, 0x1c, 0x0a, 0x1a, 0x44, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x43, - 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x3d, - 0x0a, 0x1d, 0x46, 0x69, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x4e, 0x6f, 0x64, - 0x65, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, - 0x1c, 0x0a, 0x09, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x03, 0x52, 0x09, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x64, 0x22, 0x4b, 0x0a, - 0x1e, 0x46, 0x69, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x4e, 0x6f, 0x64, 0x65, - 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, - 0x29, 0x0a, 0x07, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x0f, 0x2e, 0x70, 0x62, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, - 0x72, 0x52, 0x07, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x22, 0x24, 0x0a, 0x22, 0x43, 0x6f, - 0x75, 0x6e, 0x74, 0x41, 0x6c, 0x6c, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x4e, 0x6f, 0x64, - 0x65, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x22, 0x3b, 0x0a, 0x23, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x41, 0x6c, 0x6c, 0x45, 0x6e, 0x61, 0x62, - 0x6c, 0x65, 0x64, 0x4e, 0x6f, 0x64, 0x65, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x73, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x4c, 0x0a, - 0x1e, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x4e, 0x6f, 0x64, 0x65, - 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, - 0x16, 0x0a, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, - 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x22, 0x4e, 0x0a, 0x1f, 0x4c, - 0x69, 0x73, 0x74, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x4e, 0x6f, 0x64, 0x65, 0x43, 0x6c, - 0x75, 0x73, 0x74, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2b, - 0x0a, 0x08, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x0f, 0x2e, 0x70, 0x62, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, - 0x72, 0x52, 0x08, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x73, 0x32, 0x9c, 0x06, 0x0a, 0x12, - 0x4e, 0x6f, 0x64, 0x65, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, - 0x63, 0x65, 0x12, 0x50, 0x0a, 0x11, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4e, 0x6f, 0x64, 0x65, - 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x12, 0x1c, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x72, 0x65, - 0x61, 0x74, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, - 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x50, 0x0a, 0x11, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4e, 0x6f, - 0x64, 0x65, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x12, 0x1c, 0x2e, 0x70, 0x62, 0x2e, 0x55, - 0x70, 0x64, 0x61, 0x74, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, - 0x61, 0x74, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x53, 0x0a, 0x12, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, - 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x12, 0x1d, 0x2e, 0x70, - 0x62, 0x2e, 0x44, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x43, 0x6c, 0x75, - 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x70, 0x62, - 0x2e, 0x44, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x43, 0x6c, 0x75, 0x73, - 0x74, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x5f, 0x0a, 0x16, 0x66, - 0x69, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x4e, 0x6f, 0x64, 0x65, 0x43, 0x6c, - 0x75, 0x73, 0x74, 0x65, 0x72, 0x12, 0x21, 0x2e, 0x70, 0x62, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x45, - 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x4e, 0x6f, 0x64, 0x65, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, - 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x22, 0x2e, 0x70, 0x62, 0x2e, 0x46, 0x69, - 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x4e, 0x6f, 0x64, 0x65, 0x43, 0x6c, 0x75, - 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x6b, 0x0a, 0x1a, - 0x66, 0x69, 0x6e, 0x64, 0x41, 0x6c, 0x6c, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x4e, 0x6f, - 0x64, 0x65, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x73, 0x12, 0x25, 0x2e, 0x70, 0x62, 0x2e, - 0x46, 0x69, 0x6e, 0x64, 0x41, 0x6c, 0x6c, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x4e, 0x6f, - 0x64, 0x65, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x26, 0x2e, 0x70, 0x62, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x41, 0x6c, 0x6c, 0x45, 0x6e, - 0x61, 0x62, 0x6c, 0x65, 0x64, 0x4e, 0x6f, 0x64, 0x65, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, - 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x6b, 0x0a, 0x1a, 0x66, 0x69, 0x6e, - 0x64, 0x41, 0x6c, 0x6c, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x64, 0x4e, 0x6f, 0x64, 0x65, 0x43, - 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x73, 0x12, 0x25, 0x2e, 0x70, 0x62, 0x2e, 0x46, 0x69, 0x6e, - 0x64, 0x41, 0x6c, 0x6c, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x64, 0x4e, 0x6f, 0x64, 0x65, 0x43, - 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x26, - 0x2e, 0x70, 0x62, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x41, 0x6c, 0x6c, 0x43, 0x68, 0x61, 0x6e, 0x67, - 0x65, 0x64, 0x4e, 0x6f, 0x64, 0x65, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x73, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x6e, 0x0a, 0x1b, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x41, - 0x6c, 0x6c, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x4e, 0x6f, 0x64, 0x65, 0x43, 0x6c, 0x75, - 0x73, 0x74, 0x65, 0x72, 0x73, 0x12, 0x26, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x6f, 0x75, 0x6e, 0x74, - 0x41, 0x6c, 0x6c, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x4e, 0x6f, 0x64, 0x65, 0x43, 0x6c, - 0x75, 0x73, 0x74, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e, - 0x70, 0x62, 0x2e, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x41, 0x6c, 0x6c, 0x45, 0x6e, 0x61, 0x62, 0x6c, - 0x65, 0x64, 0x4e, 0x6f, 0x64, 0x65, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x73, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x62, 0x0a, 0x17, 0x6c, 0x69, 0x73, 0x74, 0x45, 0x6e, - 0x61, 0x62, 0x6c, 0x65, 0x64, 0x4e, 0x6f, 0x64, 0x65, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, - 0x73, 0x12, 0x22, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x6e, 0x61, 0x62, 0x6c, - 0x65, 0x64, 0x4e, 0x6f, 0x64, 0x65, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x73, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x45, - 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x4e, 0x6f, 0x64, 0x65, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, - 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, - 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_service_node_cluster_proto_rawDescOnce sync.Once - file_service_node_cluster_proto_rawDescData = file_service_node_cluster_proto_rawDesc -) - -func file_service_node_cluster_proto_rawDescGZIP() []byte { - file_service_node_cluster_proto_rawDescOnce.Do(func() { - file_service_node_cluster_proto_rawDescData = protoimpl.X.CompressGZIP(file_service_node_cluster_proto_rawDescData) - }) - return file_service_node_cluster_proto_rawDescData -} - -var file_service_node_cluster_proto_msgTypes = make([]protoimpl.MessageInfo, 16) -var file_service_node_cluster_proto_goTypes = []interface{}{ - (*FindAllEnabledNodeClustersRequest)(nil), // 0: pb.FindAllEnabledNodeClustersRequest - (*FindAllEnabledNodeClustersResponse)(nil), // 1: pb.FindAllEnabledNodeClustersResponse - (*FindAllChangedNodeClustersRequest)(nil), // 2: pb.FindAllChangedNodeClustersRequest - (*FindAllChangedNodeClustersResponse)(nil), // 3: pb.FindAllChangedNodeClustersResponse - (*CreateNodeClusterRequest)(nil), // 4: pb.CreateNodeClusterRequest - (*CreateNodeClusterResponse)(nil), // 5: pb.CreateNodeClusterResponse - (*UpdateNodeClusterRequest)(nil), // 6: pb.UpdateNodeClusterRequest - (*UpdateNodeClusterResponse)(nil), // 7: pb.UpdateNodeClusterResponse - (*DisableNodeClusterRequest)(nil), // 8: pb.DisableNodeClusterRequest - (*DisableNodeClusterResponse)(nil), // 9: pb.DisableNodeClusterResponse - (*FindEnabledNodeClusterRequest)(nil), // 10: pb.FindEnabledNodeClusterRequest - (*FindEnabledNodeClusterResponse)(nil), // 11: pb.FindEnabledNodeClusterResponse - (*CountAllEnabledNodeClustersRequest)(nil), // 12: pb.CountAllEnabledNodeClustersRequest - (*CountAllEnabledNodeClustersResponse)(nil), // 13: pb.CountAllEnabledNodeClustersResponse - (*ListEnabledNodeClustersRequest)(nil), // 14: pb.ListEnabledNodeClustersRequest - (*ListEnabledNodeClustersResponse)(nil), // 15: pb.ListEnabledNodeClustersResponse - (*NodeCluster)(nil), // 16: pb.NodeCluster -} -var file_service_node_cluster_proto_depIdxs = []int32{ - 16, // 0: pb.FindAllEnabledNodeClustersResponse.clusters:type_name -> pb.NodeCluster - 16, // 1: pb.FindAllChangedNodeClustersResponse.clusters:type_name -> pb.NodeCluster - 16, // 2: pb.FindEnabledNodeClusterResponse.cluster:type_name -> pb.NodeCluster - 16, // 3: pb.ListEnabledNodeClustersResponse.clusters:type_name -> pb.NodeCluster - 4, // 4: pb.NodeClusterService.createNodeCluster:input_type -> pb.CreateNodeClusterRequest - 6, // 5: pb.NodeClusterService.updateNodeCluster:input_type -> pb.UpdateNodeClusterRequest - 8, // 6: pb.NodeClusterService.disableNodeCluster:input_type -> pb.DisableNodeClusterRequest - 10, // 7: pb.NodeClusterService.findEnabledNodeCluster:input_type -> pb.FindEnabledNodeClusterRequest - 0, // 8: pb.NodeClusterService.findAllEnabledNodeClusters:input_type -> pb.FindAllEnabledNodeClustersRequest - 2, // 9: pb.NodeClusterService.findAllChangedNodeClusters:input_type -> pb.FindAllChangedNodeClustersRequest - 12, // 10: pb.NodeClusterService.countAllEnabledNodeClusters:input_type -> pb.CountAllEnabledNodeClustersRequest - 14, // 11: pb.NodeClusterService.listEnabledNodeClusters:input_type -> pb.ListEnabledNodeClustersRequest - 5, // 12: pb.NodeClusterService.createNodeCluster:output_type -> pb.CreateNodeClusterResponse - 7, // 13: pb.NodeClusterService.updateNodeCluster:output_type -> pb.UpdateNodeClusterResponse - 9, // 14: pb.NodeClusterService.disableNodeCluster:output_type -> pb.DisableNodeClusterResponse - 11, // 15: pb.NodeClusterService.findEnabledNodeCluster:output_type -> pb.FindEnabledNodeClusterResponse - 1, // 16: pb.NodeClusterService.findAllEnabledNodeClusters:output_type -> pb.FindAllEnabledNodeClustersResponse - 3, // 17: pb.NodeClusterService.findAllChangedNodeClusters:output_type -> pb.FindAllChangedNodeClustersResponse - 13, // 18: pb.NodeClusterService.countAllEnabledNodeClusters:output_type -> pb.CountAllEnabledNodeClustersResponse - 15, // 19: pb.NodeClusterService.listEnabledNodeClusters:output_type -> pb.ListEnabledNodeClustersResponse - 12, // [12:20] is the sub-list for method output_type - 4, // [4:12] is the sub-list for method input_type - 4, // [4:4] is the sub-list for extension type_name - 4, // [4:4] is the sub-list for extension extendee - 0, // [0:4] is the sub-list for field type_name -} - -func init() { file_service_node_cluster_proto_init() } -func file_service_node_cluster_proto_init() { - if File_service_node_cluster_proto != nil { - return - } - file_model_node_cluster_proto_init() - if !protoimpl.UnsafeEnabled { - file_service_node_cluster_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*FindAllEnabledNodeClustersRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_service_node_cluster_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*FindAllEnabledNodeClustersResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_service_node_cluster_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*FindAllChangedNodeClustersRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_service_node_cluster_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*FindAllChangedNodeClustersResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_service_node_cluster_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreateNodeClusterRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_service_node_cluster_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreateNodeClusterResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_service_node_cluster_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UpdateNodeClusterRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_service_node_cluster_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UpdateNodeClusterResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_service_node_cluster_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DisableNodeClusterRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_service_node_cluster_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DisableNodeClusterResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_service_node_cluster_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*FindEnabledNodeClusterRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_service_node_cluster_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*FindEnabledNodeClusterResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_service_node_cluster_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CountAllEnabledNodeClustersRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_service_node_cluster_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CountAllEnabledNodeClustersResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_service_node_cluster_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListEnabledNodeClustersRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_service_node_cluster_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListEnabledNodeClustersResponse); 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_service_node_cluster_proto_rawDesc, - NumEnums: 0, - NumMessages: 16, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_service_node_cluster_proto_goTypes, - DependencyIndexes: file_service_node_cluster_proto_depIdxs, - MessageInfos: file_service_node_cluster_proto_msgTypes, - }.Build() - File_service_node_cluster_proto = out.File - file_service_node_cluster_proto_rawDesc = nil - file_service_node_cluster_proto_goTypes = nil - file_service_node_cluster_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 - -// NodeClusterServiceClient is the client API for NodeClusterService service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type NodeClusterServiceClient interface { - // 创建集群 - CreateNodeCluster(ctx context.Context, in *CreateNodeClusterRequest, opts ...grpc.CallOption) (*CreateNodeClusterResponse, error) - // 修改集群 - UpdateNodeCluster(ctx context.Context, in *UpdateNodeClusterRequest, opts ...grpc.CallOption) (*UpdateNodeClusterResponse, error) - // 禁用集群 - DisableNodeCluster(ctx context.Context, in *DisableNodeClusterRequest, opts ...grpc.CallOption) (*DisableNodeClusterResponse, error) - // 查找单个集群信息 - FindEnabledNodeCluster(ctx context.Context, in *FindEnabledNodeClusterRequest, opts ...grpc.CallOption) (*FindEnabledNodeClusterResponse, error) - // 获取所有集群的信息 - FindAllEnabledNodeClusters(ctx context.Context, in *FindAllEnabledNodeClustersRequest, opts ...grpc.CallOption) (*FindAllEnabledNodeClustersResponse, error) - // 获取变更的集群 - FindAllChangedNodeClusters(ctx context.Context, in *FindAllChangedNodeClustersRequest, opts ...grpc.CallOption) (*FindAllChangedNodeClustersResponse, error) - // 计算所有集群数量 - CountAllEnabledNodeClusters(ctx context.Context, in *CountAllEnabledNodeClustersRequest, opts ...grpc.CallOption) (*CountAllEnabledNodeClustersResponse, error) - // 列出单页集群 - ListEnabledNodeClusters(ctx context.Context, in *ListEnabledNodeClustersRequest, opts ...grpc.CallOption) (*ListEnabledNodeClustersResponse, error) -} - -type nodeClusterServiceClient struct { - cc grpc.ClientConnInterface -} - -func NewNodeClusterServiceClient(cc grpc.ClientConnInterface) NodeClusterServiceClient { - return &nodeClusterServiceClient{cc} -} - -func (c *nodeClusterServiceClient) CreateNodeCluster(ctx context.Context, in *CreateNodeClusterRequest, opts ...grpc.CallOption) (*CreateNodeClusterResponse, error) { - out := new(CreateNodeClusterResponse) - err := c.cc.Invoke(ctx, "/pb.NodeClusterService/createNodeCluster", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *nodeClusterServiceClient) UpdateNodeCluster(ctx context.Context, in *UpdateNodeClusterRequest, opts ...grpc.CallOption) (*UpdateNodeClusterResponse, error) { - out := new(UpdateNodeClusterResponse) - err := c.cc.Invoke(ctx, "/pb.NodeClusterService/updateNodeCluster", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *nodeClusterServiceClient) DisableNodeCluster(ctx context.Context, in *DisableNodeClusterRequest, opts ...grpc.CallOption) (*DisableNodeClusterResponse, error) { - out := new(DisableNodeClusterResponse) - err := c.cc.Invoke(ctx, "/pb.NodeClusterService/disableNodeCluster", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *nodeClusterServiceClient) FindEnabledNodeCluster(ctx context.Context, in *FindEnabledNodeClusterRequest, opts ...grpc.CallOption) (*FindEnabledNodeClusterResponse, error) { - out := new(FindEnabledNodeClusterResponse) - err := c.cc.Invoke(ctx, "/pb.NodeClusterService/findEnabledNodeCluster", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *nodeClusterServiceClient) FindAllEnabledNodeClusters(ctx context.Context, in *FindAllEnabledNodeClustersRequest, opts ...grpc.CallOption) (*FindAllEnabledNodeClustersResponse, error) { - out := new(FindAllEnabledNodeClustersResponse) - err := c.cc.Invoke(ctx, "/pb.NodeClusterService/findAllEnabledNodeClusters", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *nodeClusterServiceClient) FindAllChangedNodeClusters(ctx context.Context, in *FindAllChangedNodeClustersRequest, opts ...grpc.CallOption) (*FindAllChangedNodeClustersResponse, error) { - out := new(FindAllChangedNodeClustersResponse) - err := c.cc.Invoke(ctx, "/pb.NodeClusterService/findAllChangedNodeClusters", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *nodeClusterServiceClient) CountAllEnabledNodeClusters(ctx context.Context, in *CountAllEnabledNodeClustersRequest, opts ...grpc.CallOption) (*CountAllEnabledNodeClustersResponse, error) { - out := new(CountAllEnabledNodeClustersResponse) - err := c.cc.Invoke(ctx, "/pb.NodeClusterService/countAllEnabledNodeClusters", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *nodeClusterServiceClient) ListEnabledNodeClusters(ctx context.Context, in *ListEnabledNodeClustersRequest, opts ...grpc.CallOption) (*ListEnabledNodeClustersResponse, error) { - out := new(ListEnabledNodeClustersResponse) - err := c.cc.Invoke(ctx, "/pb.NodeClusterService/listEnabledNodeClusters", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// NodeClusterServiceServer is the server API for NodeClusterService service. -type NodeClusterServiceServer interface { - // 创建集群 - CreateNodeCluster(context.Context, *CreateNodeClusterRequest) (*CreateNodeClusterResponse, error) - // 修改集群 - UpdateNodeCluster(context.Context, *UpdateNodeClusterRequest) (*UpdateNodeClusterResponse, error) - // 禁用集群 - DisableNodeCluster(context.Context, *DisableNodeClusterRequest) (*DisableNodeClusterResponse, error) - // 查找单个集群信息 - FindEnabledNodeCluster(context.Context, *FindEnabledNodeClusterRequest) (*FindEnabledNodeClusterResponse, error) - // 获取所有集群的信息 - FindAllEnabledNodeClusters(context.Context, *FindAllEnabledNodeClustersRequest) (*FindAllEnabledNodeClustersResponse, error) - // 获取变更的集群 - FindAllChangedNodeClusters(context.Context, *FindAllChangedNodeClustersRequest) (*FindAllChangedNodeClustersResponse, error) - // 计算所有集群数量 - CountAllEnabledNodeClusters(context.Context, *CountAllEnabledNodeClustersRequest) (*CountAllEnabledNodeClustersResponse, error) - // 列出单页集群 - ListEnabledNodeClusters(context.Context, *ListEnabledNodeClustersRequest) (*ListEnabledNodeClustersResponse, error) -} - -// UnimplementedNodeClusterServiceServer can be embedded to have forward compatible implementations. -type UnimplementedNodeClusterServiceServer struct { -} - -func (*UnimplementedNodeClusterServiceServer) CreateNodeCluster(context.Context, *CreateNodeClusterRequest) (*CreateNodeClusterResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method CreateNodeCluster not implemented") -} -func (*UnimplementedNodeClusterServiceServer) UpdateNodeCluster(context.Context, *UpdateNodeClusterRequest) (*UpdateNodeClusterResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method UpdateNodeCluster not implemented") -} -func (*UnimplementedNodeClusterServiceServer) DisableNodeCluster(context.Context, *DisableNodeClusterRequest) (*DisableNodeClusterResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method DisableNodeCluster not implemented") -} -func (*UnimplementedNodeClusterServiceServer) FindEnabledNodeCluster(context.Context, *FindEnabledNodeClusterRequest) (*FindEnabledNodeClusterResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method FindEnabledNodeCluster not implemented") -} -func (*UnimplementedNodeClusterServiceServer) FindAllEnabledNodeClusters(context.Context, *FindAllEnabledNodeClustersRequest) (*FindAllEnabledNodeClustersResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method FindAllEnabledNodeClusters not implemented") -} -func (*UnimplementedNodeClusterServiceServer) FindAllChangedNodeClusters(context.Context, *FindAllChangedNodeClustersRequest) (*FindAllChangedNodeClustersResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method FindAllChangedNodeClusters not implemented") -} -func (*UnimplementedNodeClusterServiceServer) CountAllEnabledNodeClusters(context.Context, *CountAllEnabledNodeClustersRequest) (*CountAllEnabledNodeClustersResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method CountAllEnabledNodeClusters not implemented") -} -func (*UnimplementedNodeClusterServiceServer) ListEnabledNodeClusters(context.Context, *ListEnabledNodeClustersRequest) (*ListEnabledNodeClustersResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ListEnabledNodeClusters not implemented") -} - -func RegisterNodeClusterServiceServer(s *grpc.Server, srv NodeClusterServiceServer) { - s.RegisterService(&_NodeClusterService_serviceDesc, srv) -} - -func _NodeClusterService_CreateNodeCluster_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(CreateNodeClusterRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(NodeClusterServiceServer).CreateNodeCluster(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/pb.NodeClusterService/CreateNodeCluster", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(NodeClusterServiceServer).CreateNodeCluster(ctx, req.(*CreateNodeClusterRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _NodeClusterService_UpdateNodeCluster_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(UpdateNodeClusterRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(NodeClusterServiceServer).UpdateNodeCluster(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/pb.NodeClusterService/UpdateNodeCluster", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(NodeClusterServiceServer).UpdateNodeCluster(ctx, req.(*UpdateNodeClusterRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _NodeClusterService_DisableNodeCluster_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DisableNodeClusterRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(NodeClusterServiceServer).DisableNodeCluster(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/pb.NodeClusterService/DisableNodeCluster", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(NodeClusterServiceServer).DisableNodeCluster(ctx, req.(*DisableNodeClusterRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _NodeClusterService_FindEnabledNodeCluster_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(FindEnabledNodeClusterRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(NodeClusterServiceServer).FindEnabledNodeCluster(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/pb.NodeClusterService/FindEnabledNodeCluster", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(NodeClusterServiceServer).FindEnabledNodeCluster(ctx, req.(*FindEnabledNodeClusterRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _NodeClusterService_FindAllEnabledNodeClusters_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(FindAllEnabledNodeClustersRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(NodeClusterServiceServer).FindAllEnabledNodeClusters(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/pb.NodeClusterService/FindAllEnabledNodeClusters", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(NodeClusterServiceServer).FindAllEnabledNodeClusters(ctx, req.(*FindAllEnabledNodeClustersRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _NodeClusterService_FindAllChangedNodeClusters_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(FindAllChangedNodeClustersRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(NodeClusterServiceServer).FindAllChangedNodeClusters(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/pb.NodeClusterService/FindAllChangedNodeClusters", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(NodeClusterServiceServer).FindAllChangedNodeClusters(ctx, req.(*FindAllChangedNodeClustersRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _NodeClusterService_CountAllEnabledNodeClusters_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(CountAllEnabledNodeClustersRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(NodeClusterServiceServer).CountAllEnabledNodeClusters(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/pb.NodeClusterService/CountAllEnabledNodeClusters", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(NodeClusterServiceServer).CountAllEnabledNodeClusters(ctx, req.(*CountAllEnabledNodeClustersRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _NodeClusterService_ListEnabledNodeClusters_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ListEnabledNodeClustersRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(NodeClusterServiceServer).ListEnabledNodeClusters(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/pb.NodeClusterService/ListEnabledNodeClusters", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(NodeClusterServiceServer).ListEnabledNodeClusters(ctx, req.(*ListEnabledNodeClustersRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _NodeClusterService_serviceDesc = grpc.ServiceDesc{ - ServiceName: "pb.NodeClusterService", - HandlerType: (*NodeClusterServiceServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "createNodeCluster", - Handler: _NodeClusterService_CreateNodeCluster_Handler, - }, - { - MethodName: "updateNodeCluster", - Handler: _NodeClusterService_UpdateNodeCluster_Handler, - }, - { - MethodName: "disableNodeCluster", - Handler: _NodeClusterService_DisableNodeCluster_Handler, - }, - { - MethodName: "findEnabledNodeCluster", - Handler: _NodeClusterService_FindEnabledNodeCluster_Handler, - }, - { - MethodName: "findAllEnabledNodeClusters", - Handler: _NodeClusterService_FindAllEnabledNodeClusters_Handler, - }, - { - MethodName: "findAllChangedNodeClusters", - Handler: _NodeClusterService_FindAllChangedNodeClusters_Handler, - }, - { - MethodName: "countAllEnabledNodeClusters", - Handler: _NodeClusterService_CountAllEnabledNodeClusters_Handler, - }, - { - MethodName: "listEnabledNodeClusters", - Handler: _NodeClusterService_ListEnabledNodeClusters_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "service_node_cluster.proto", -} diff --git a/internal/rpc/pb/service_node_grant.pb.go b/internal/rpc/pb/service_node_grant.pb.go deleted file mode 100644 index 69104def..00000000 --- a/internal/rpc/pb/service_node_grant.pb.go +++ /dev/null @@ -1,1450 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.25.0 -// protoc v3.12.3 -// source: service_node_grant.proto - -package pb - -import ( - context "context" - proto "github.com/golang/protobuf/proto" - 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" - 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) -) - -// 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 CreateNodeGrantRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - Method string `protobuf:"bytes,2,opt,name=method,proto3" json:"method,omitempty"` - Username string `protobuf:"bytes,3,opt,name=username,proto3" json:"username,omitempty"` - Password string `protobuf:"bytes,4,opt,name=password,proto3" json:"password,omitempty"` - PrivateKey string `protobuf:"bytes,5,opt,name=privateKey,proto3" json:"privateKey,omitempty"` - Description string `protobuf:"bytes,6,opt,name=description,proto3" json:"description,omitempty"` - NodeId int64 `protobuf:"varint,7,opt,name=nodeId,proto3" json:"nodeId,omitempty"` -} - -func (x *CreateNodeGrantRequest) Reset() { - *x = CreateNodeGrantRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_service_node_grant_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CreateNodeGrantRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CreateNodeGrantRequest) ProtoMessage() {} - -func (x *CreateNodeGrantRequest) ProtoReflect() protoreflect.Message { - mi := &file_service_node_grant_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 CreateNodeGrantRequest.ProtoReflect.Descriptor instead. -func (*CreateNodeGrantRequest) Descriptor() ([]byte, []int) { - return file_service_node_grant_proto_rawDescGZIP(), []int{0} -} - -func (x *CreateNodeGrantRequest) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *CreateNodeGrantRequest) GetMethod() string { - if x != nil { - return x.Method - } - return "" -} - -func (x *CreateNodeGrantRequest) GetUsername() string { - if x != nil { - return x.Username - } - return "" -} - -func (x *CreateNodeGrantRequest) GetPassword() string { - if x != nil { - return x.Password - } - return "" -} - -func (x *CreateNodeGrantRequest) GetPrivateKey() string { - if x != nil { - return x.PrivateKey - } - return "" -} - -func (x *CreateNodeGrantRequest) GetDescription() string { - if x != nil { - return x.Description - } - return "" -} - -func (x *CreateNodeGrantRequest) GetNodeId() int64 { - if x != nil { - return x.NodeId - } - return 0 -} - -type CreateNodeGrantResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - GrantId int64 `protobuf:"varint,1,opt,name=grantId,proto3" json:"grantId,omitempty"` -} - -func (x *CreateNodeGrantResponse) Reset() { - *x = CreateNodeGrantResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_service_node_grant_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CreateNodeGrantResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CreateNodeGrantResponse) ProtoMessage() {} - -func (x *CreateNodeGrantResponse) ProtoReflect() protoreflect.Message { - mi := &file_service_node_grant_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) -} - -// Deprecated: Use CreateNodeGrantResponse.ProtoReflect.Descriptor instead. -func (*CreateNodeGrantResponse) Descriptor() ([]byte, []int) { - return file_service_node_grant_proto_rawDescGZIP(), []int{1} -} - -func (x *CreateNodeGrantResponse) GetGrantId() int64 { - if x != nil { - return x.GrantId - } - return 0 -} - -// 修改节点认证 -type UpdateNodeGrantRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - GrantId int64 `protobuf:"varint,8,opt,name=grantId,proto3" json:"grantId,omitempty"` - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - Method string `protobuf:"bytes,2,opt,name=method,proto3" json:"method,omitempty"` - Username string `protobuf:"bytes,3,opt,name=username,proto3" json:"username,omitempty"` - Password string `protobuf:"bytes,4,opt,name=password,proto3" json:"password,omitempty"` - PrivateKey string `protobuf:"bytes,5,opt,name=privateKey,proto3" json:"privateKey,omitempty"` - Description string `protobuf:"bytes,6,opt,name=description,proto3" json:"description,omitempty"` - NodeId int64 `protobuf:"varint,7,opt,name=nodeId,proto3" json:"nodeId,omitempty"` -} - -func (x *UpdateNodeGrantRequest) Reset() { - *x = UpdateNodeGrantRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_service_node_grant_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *UpdateNodeGrantRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UpdateNodeGrantRequest) ProtoMessage() {} - -func (x *UpdateNodeGrantRequest) ProtoReflect() protoreflect.Message { - mi := &file_service_node_grant_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) -} - -// Deprecated: Use UpdateNodeGrantRequest.ProtoReflect.Descriptor instead. -func (*UpdateNodeGrantRequest) Descriptor() ([]byte, []int) { - return file_service_node_grant_proto_rawDescGZIP(), []int{2} -} - -func (x *UpdateNodeGrantRequest) GetGrantId() int64 { - if x != nil { - return x.GrantId - } - return 0 -} - -func (x *UpdateNodeGrantRequest) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *UpdateNodeGrantRequest) GetMethod() string { - if x != nil { - return x.Method - } - return "" -} - -func (x *UpdateNodeGrantRequest) GetUsername() string { - if x != nil { - return x.Username - } - return "" -} - -func (x *UpdateNodeGrantRequest) GetPassword() string { - if x != nil { - return x.Password - } - return "" -} - -func (x *UpdateNodeGrantRequest) GetPrivateKey() string { - if x != nil { - return x.PrivateKey - } - return "" -} - -func (x *UpdateNodeGrantRequest) GetDescription() string { - if x != nil { - return x.Description - } - return "" -} - -func (x *UpdateNodeGrantRequest) GetNodeId() int64 { - if x != nil { - return x.NodeId - } - return 0 -} - -type UpdateNodeGrantResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *UpdateNodeGrantResponse) Reset() { - *x = UpdateNodeGrantResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_service_node_grant_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *UpdateNodeGrantResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UpdateNodeGrantResponse) ProtoMessage() {} - -func (x *UpdateNodeGrantResponse) ProtoReflect() protoreflect.Message { - mi := &file_service_node_grant_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) -} - -// Deprecated: Use UpdateNodeGrantResponse.ProtoReflect.Descriptor instead. -func (*UpdateNodeGrantResponse) Descriptor() ([]byte, []int) { - return file_service_node_grant_proto_rawDescGZIP(), []int{3} -} - -// 禁用节点认证 -type DisableNodeGrantRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - GrantId int64 `protobuf:"varint,1,opt,name=grantId,proto3" json:"grantId,omitempty"` -} - -func (x *DisableNodeGrantRequest) Reset() { - *x = DisableNodeGrantRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_service_node_grant_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *DisableNodeGrantRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DisableNodeGrantRequest) ProtoMessage() {} - -func (x *DisableNodeGrantRequest) ProtoReflect() protoreflect.Message { - mi := &file_service_node_grant_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) -} - -// Deprecated: Use DisableNodeGrantRequest.ProtoReflect.Descriptor instead. -func (*DisableNodeGrantRequest) Descriptor() ([]byte, []int) { - return file_service_node_grant_proto_rawDescGZIP(), []int{4} -} - -func (x *DisableNodeGrantRequest) GetGrantId() int64 { - if x != nil { - return x.GrantId - } - return 0 -} - -type DisableNodeGrantResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *DisableNodeGrantResponse) Reset() { - *x = DisableNodeGrantResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_service_node_grant_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *DisableNodeGrantResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DisableNodeGrantResponse) ProtoMessage() {} - -func (x *DisableNodeGrantResponse) ProtoReflect() protoreflect.Message { - mi := &file_service_node_grant_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) -} - -// Deprecated: Use DisableNodeGrantResponse.ProtoReflect.Descriptor instead. -func (*DisableNodeGrantResponse) Descriptor() ([]byte, []int) { - return file_service_node_grant_proto_rawDescGZIP(), []int{5} -} - -// 计算节点认证数量 -type CountAllEnabledNodeGrantsRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *CountAllEnabledNodeGrantsRequest) Reset() { - *x = CountAllEnabledNodeGrantsRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_service_node_grant_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CountAllEnabledNodeGrantsRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CountAllEnabledNodeGrantsRequest) ProtoMessage() {} - -func (x *CountAllEnabledNodeGrantsRequest) ProtoReflect() protoreflect.Message { - mi := &file_service_node_grant_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) -} - -// Deprecated: Use CountAllEnabledNodeGrantsRequest.ProtoReflect.Descriptor instead. -func (*CountAllEnabledNodeGrantsRequest) Descriptor() ([]byte, []int) { - return file_service_node_grant_proto_rawDescGZIP(), []int{6} -} - -type CountAllEnabledNodeGrantsResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Count int64 `protobuf:"varint,1,opt,name=count,proto3" json:"count,omitempty"` -} - -func (x *CountAllEnabledNodeGrantsResponse) Reset() { - *x = CountAllEnabledNodeGrantsResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_service_node_grant_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CountAllEnabledNodeGrantsResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CountAllEnabledNodeGrantsResponse) ProtoMessage() {} - -func (x *CountAllEnabledNodeGrantsResponse) ProtoReflect() protoreflect.Message { - mi := &file_service_node_grant_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) -} - -// Deprecated: Use CountAllEnabledNodeGrantsResponse.ProtoReflect.Descriptor instead. -func (*CountAllEnabledNodeGrantsResponse) Descriptor() ([]byte, []int) { - return file_service_node_grant_proto_rawDescGZIP(), []int{7} -} - -func (x *CountAllEnabledNodeGrantsResponse) GetCount() int64 { - if x != nil { - return x.Count - } - return 0 -} - -// 列出单页认证 -type ListEnabledNodeGrantsRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Offset int64 `protobuf:"varint,1,opt,name=offset,proto3" json:"offset,omitempty"` - Size int64 `protobuf:"varint,2,opt,name=size,proto3" json:"size,omitempty"` -} - -func (x *ListEnabledNodeGrantsRequest) Reset() { - *x = ListEnabledNodeGrantsRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_service_node_grant_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListEnabledNodeGrantsRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListEnabledNodeGrantsRequest) ProtoMessage() {} - -func (x *ListEnabledNodeGrantsRequest) ProtoReflect() protoreflect.Message { - mi := &file_service_node_grant_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) -} - -// Deprecated: Use ListEnabledNodeGrantsRequest.ProtoReflect.Descriptor instead. -func (*ListEnabledNodeGrantsRequest) Descriptor() ([]byte, []int) { - return file_service_node_grant_proto_rawDescGZIP(), []int{8} -} - -func (x *ListEnabledNodeGrantsRequest) GetOffset() int64 { - if x != nil { - return x.Offset - } - return 0 -} - -func (x *ListEnabledNodeGrantsRequest) GetSize() int64 { - if x != nil { - return x.Size - } - return 0 -} - -type ListEnabledNodeGrantsResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Grants []*NodeGrant `protobuf:"bytes,1,rep,name=grants,proto3" json:"grants,omitempty"` -} - -func (x *ListEnabledNodeGrantsResponse) Reset() { - *x = ListEnabledNodeGrantsResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_service_node_grant_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListEnabledNodeGrantsResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListEnabledNodeGrantsResponse) ProtoMessage() {} - -func (x *ListEnabledNodeGrantsResponse) ProtoReflect() protoreflect.Message { - mi := &file_service_node_grant_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) -} - -// Deprecated: Use ListEnabledNodeGrantsResponse.ProtoReflect.Descriptor instead. -func (*ListEnabledNodeGrantsResponse) Descriptor() ([]byte, []int) { - return file_service_node_grant_proto_rawDescGZIP(), []int{9} -} - -func (x *ListEnabledNodeGrantsResponse) GetGrants() []*NodeGrant { - if x != nil { - return x.Grants - } - return nil -} - -// 获取所有认证信息 -type FindAllEnabledNodeGrantsRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *FindAllEnabledNodeGrantsRequest) Reset() { - *x = FindAllEnabledNodeGrantsRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_service_node_grant_proto_msgTypes[10] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *FindAllEnabledNodeGrantsRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*FindAllEnabledNodeGrantsRequest) ProtoMessage() {} - -func (x *FindAllEnabledNodeGrantsRequest) ProtoReflect() protoreflect.Message { - mi := &file_service_node_grant_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) -} - -// Deprecated: Use FindAllEnabledNodeGrantsRequest.ProtoReflect.Descriptor instead. -func (*FindAllEnabledNodeGrantsRequest) Descriptor() ([]byte, []int) { - return file_service_node_grant_proto_rawDescGZIP(), []int{10} -} - -type FindAllEnabledNodeGrantsResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Grants []*NodeGrant `protobuf:"bytes,1,rep,name=grants,proto3" json:"grants,omitempty"` -} - -func (x *FindAllEnabledNodeGrantsResponse) Reset() { - *x = FindAllEnabledNodeGrantsResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_service_node_grant_proto_msgTypes[11] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *FindAllEnabledNodeGrantsResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*FindAllEnabledNodeGrantsResponse) ProtoMessage() {} - -func (x *FindAllEnabledNodeGrantsResponse) ProtoReflect() protoreflect.Message { - mi := &file_service_node_grant_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) -} - -// Deprecated: Use FindAllEnabledNodeGrantsResponse.ProtoReflect.Descriptor instead. -func (*FindAllEnabledNodeGrantsResponse) Descriptor() ([]byte, []int) { - return file_service_node_grant_proto_rawDescGZIP(), []int{11} -} - -func (x *FindAllEnabledNodeGrantsResponse) GetGrants() []*NodeGrant { - if x != nil { - return x.Grants - } - return nil -} - -// 获取认证信息 -type FindEnabledGrantRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - GrantId int64 `protobuf:"varint,1,opt,name=grantId,proto3" json:"grantId,omitempty"` -} - -func (x *FindEnabledGrantRequest) Reset() { - *x = FindEnabledGrantRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_service_node_grant_proto_msgTypes[12] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *FindEnabledGrantRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*FindEnabledGrantRequest) ProtoMessage() {} - -func (x *FindEnabledGrantRequest) ProtoReflect() protoreflect.Message { - mi := &file_service_node_grant_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) -} - -// Deprecated: Use FindEnabledGrantRequest.ProtoReflect.Descriptor instead. -func (*FindEnabledGrantRequest) Descriptor() ([]byte, []int) { - return file_service_node_grant_proto_rawDescGZIP(), []int{12} -} - -func (x *FindEnabledGrantRequest) GetGrantId() int64 { - if x != nil { - return x.GrantId - } - return 0 -} - -type FindEnabledGrantResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Grant *NodeGrant `protobuf:"bytes,1,opt,name=grant,proto3" json:"grant,omitempty"` -} - -func (x *FindEnabledGrantResponse) Reset() { - *x = FindEnabledGrantResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_service_node_grant_proto_msgTypes[13] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *FindEnabledGrantResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*FindEnabledGrantResponse) ProtoMessage() {} - -func (x *FindEnabledGrantResponse) ProtoReflect() protoreflect.Message { - mi := &file_service_node_grant_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) -} - -// Deprecated: Use FindEnabledGrantResponse.ProtoReflect.Descriptor instead. -func (*FindEnabledGrantResponse) Descriptor() ([]byte, []int) { - return file_service_node_grant_proto_rawDescGZIP(), []int{13} -} - -func (x *FindEnabledGrantResponse) GetGrant() *NodeGrant { - if x != nil { - return x.Grant - } - return nil -} - -var File_service_node_grant_proto protoreflect.FileDescriptor - -var file_service_node_grant_proto_rawDesc = []byte{ - 0x0a, 0x18, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x67, - 0x72, 0x61, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, 0x62, 0x1a, 0x16, - 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5f, 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x67, 0x72, 0x61, 0x6e, 0x74, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xd6, 0x01, 0x0a, 0x16, 0x43, 0x72, 0x65, 0x61, 0x74, - 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x12, 0x1a, 0x0a, - 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x61, 0x73, - 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x61, 0x73, - 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, - 0x4b, 0x65, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x70, 0x72, 0x69, 0x76, 0x61, - 0x74, 0x65, 0x4b, 0x65, 0x79, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, - 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, - 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x6e, 0x6f, 0x64, 0x65, 0x49, - 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x6e, 0x6f, 0x64, 0x65, 0x49, 0x64, 0x22, - 0x33, 0x0a, 0x17, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x47, 0x72, 0x61, - 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x67, 0x72, - 0x61, 0x6e, 0x74, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x67, 0x72, 0x61, - 0x6e, 0x74, 0x49, 0x64, 0x22, 0xf0, 0x01, 0x0a, 0x16, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4e, - 0x6f, 0x64, 0x65, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, - 0x18, 0x0a, 0x07, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x49, 0x64, 0x18, 0x08, 0x20, 0x01, 0x28, 0x03, - 0x52, 0x07, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, - 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, - 0x06, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6d, - 0x65, 0x74, 0x68, 0x6f, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, - 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, - 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x04, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x1e, 0x0a, - 0x0a, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x4b, 0x65, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x0a, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x4b, 0x65, 0x79, 0x12, 0x20, 0x0a, - 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x06, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, - 0x16, 0x0a, 0x06, 0x6e, 0x6f, 0x64, 0x65, 0x49, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x52, - 0x06, 0x6e, 0x6f, 0x64, 0x65, 0x49, 0x64, 0x22, 0x19, 0x0a, 0x17, 0x55, 0x70, 0x64, 0x61, 0x74, - 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x22, 0x33, 0x0a, 0x17, 0x44, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x4e, 0x6f, 0x64, - 0x65, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x18, 0x0a, - 0x07, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, - 0x67, 0x72, 0x61, 0x6e, 0x74, 0x49, 0x64, 0x22, 0x1a, 0x0a, 0x18, 0x44, 0x69, 0x73, 0x61, 0x62, - 0x6c, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x22, 0x22, 0x0a, 0x20, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x41, 0x6c, 0x6c, 0x45, - 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x4e, 0x6f, 0x64, 0x65, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x73, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x39, 0x0a, 0x21, 0x43, 0x6f, 0x75, 0x6e, 0x74, - 0x41, 0x6c, 0x6c, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x4e, 0x6f, 0x64, 0x65, 0x47, 0x72, - 0x61, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, - 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x63, 0x6f, 0x75, - 0x6e, 0x74, 0x22, 0x4a, 0x0a, 0x1c, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, - 0x64, 0x4e, 0x6f, 0x64, 0x65, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x03, 0x52, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x69, - 0x7a, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x22, 0x46, - 0x0a, 0x1d, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x4e, 0x6f, 0x64, - 0x65, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, - 0x25, 0x0a, 0x06, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x0d, 0x2e, 0x70, 0x62, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x52, 0x06, - 0x67, 0x72, 0x61, 0x6e, 0x74, 0x73, 0x22, 0x21, 0x0a, 0x1f, 0x46, 0x69, 0x6e, 0x64, 0x41, 0x6c, - 0x6c, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x4e, 0x6f, 0x64, 0x65, 0x47, 0x72, 0x61, 0x6e, - 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x49, 0x0a, 0x20, 0x46, 0x69, 0x6e, - 0x64, 0x41, 0x6c, 0x6c, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x4e, 0x6f, 0x64, 0x65, 0x47, - 0x72, 0x61, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x25, 0x0a, - 0x06, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0d, 0x2e, - 0x70, 0x62, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x52, 0x06, 0x67, 0x72, - 0x61, 0x6e, 0x74, 0x73, 0x22, 0x33, 0x0a, 0x17, 0x46, 0x69, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, - 0x6c, 0x65, 0x64, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, - 0x18, 0x0a, 0x07, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, - 0x52, 0x07, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x49, 0x64, 0x22, 0x3f, 0x0a, 0x18, 0x46, 0x69, 0x6e, - 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x23, 0x0a, 0x05, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x70, 0x62, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x47, 0x72, - 0x61, 0x6e, 0x74, 0x52, 0x05, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x32, 0xf7, 0x04, 0x0a, 0x10, 0x4e, - 0x6f, 0x64, 0x65, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, - 0x4a, 0x0a, 0x0f, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x47, 0x72, 0x61, - 0x6e, 0x74, 0x12, 0x1a, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4e, 0x6f, - 0x64, 0x65, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, - 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x47, 0x72, - 0x61, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4a, 0x0a, 0x0f, 0x75, - 0x70, 0x64, 0x61, 0x74, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x12, 0x1a, - 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x47, 0x72, - 0x61, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x70, 0x62, 0x2e, - 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4d, 0x0a, 0x10, 0x64, 0x69, 0x73, 0x61, 0x62, - 0x6c, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x12, 0x1b, 0x2e, 0x70, 0x62, - 0x2e, 0x44, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x47, 0x72, 0x61, 0x6e, - 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x69, - 0x73, 0x61, 0x62, 0x6c, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x68, 0x0a, 0x19, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x41, - 0x6c, 0x6c, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x4e, 0x6f, 0x64, 0x65, 0x47, 0x72, 0x61, - 0x6e, 0x74, 0x73, 0x12, 0x24, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x41, 0x6c, - 0x6c, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x4e, 0x6f, 0x64, 0x65, 0x47, 0x72, 0x61, 0x6e, - 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x70, 0x62, 0x2e, 0x43, - 0x6f, 0x75, 0x6e, 0x74, 0x41, 0x6c, 0x6c, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x4e, 0x6f, - 0x64, 0x65, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x5c, 0x0a, 0x15, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x4e, - 0x6f, 0x64, 0x65, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x73, 0x12, 0x20, 0x2e, 0x70, 0x62, 0x2e, 0x4c, - 0x69, 0x73, 0x74, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x4e, 0x6f, 0x64, 0x65, 0x47, 0x72, - 0x61, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x70, 0x62, - 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x4e, 0x6f, 0x64, 0x65, - 0x47, 0x72, 0x61, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x65, - 0x0a, 0x18, 0x46, 0x69, 0x6e, 0x64, 0x41, 0x6c, 0x6c, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, - 0x4e, 0x6f, 0x64, 0x65, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x73, 0x12, 0x23, 0x2e, 0x70, 0x62, 0x2e, - 0x46, 0x69, 0x6e, 0x64, 0x41, 0x6c, 0x6c, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x4e, 0x6f, - 0x64, 0x65, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x24, 0x2e, 0x70, 0x62, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x41, 0x6c, 0x6c, 0x45, 0x6e, 0x61, 0x62, - 0x6c, 0x65, 0x64, 0x4e, 0x6f, 0x64, 0x65, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4d, 0x0a, 0x10, 0x46, 0x69, 0x6e, 0x64, 0x45, 0x6e, 0x61, - 0x62, 0x6c, 0x65, 0x64, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x12, 0x1b, 0x2e, 0x70, 0x62, 0x2e, 0x46, - 0x69, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x70, 0x62, 0x2e, 0x46, 0x69, 0x6e, 0x64, - 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_service_node_grant_proto_rawDescOnce sync.Once - file_service_node_grant_proto_rawDescData = file_service_node_grant_proto_rawDesc -) - -func file_service_node_grant_proto_rawDescGZIP() []byte { - file_service_node_grant_proto_rawDescOnce.Do(func() { - file_service_node_grant_proto_rawDescData = protoimpl.X.CompressGZIP(file_service_node_grant_proto_rawDescData) - }) - return file_service_node_grant_proto_rawDescData -} - -var file_service_node_grant_proto_msgTypes = make([]protoimpl.MessageInfo, 14) -var file_service_node_grant_proto_goTypes = []interface{}{ - (*CreateNodeGrantRequest)(nil), // 0: pb.CreateNodeGrantRequest - (*CreateNodeGrantResponse)(nil), // 1: pb.CreateNodeGrantResponse - (*UpdateNodeGrantRequest)(nil), // 2: pb.UpdateNodeGrantRequest - (*UpdateNodeGrantResponse)(nil), // 3: pb.UpdateNodeGrantResponse - (*DisableNodeGrantRequest)(nil), // 4: pb.DisableNodeGrantRequest - (*DisableNodeGrantResponse)(nil), // 5: pb.DisableNodeGrantResponse - (*CountAllEnabledNodeGrantsRequest)(nil), // 6: pb.CountAllEnabledNodeGrantsRequest - (*CountAllEnabledNodeGrantsResponse)(nil), // 7: pb.CountAllEnabledNodeGrantsResponse - (*ListEnabledNodeGrantsRequest)(nil), // 8: pb.ListEnabledNodeGrantsRequest - (*ListEnabledNodeGrantsResponse)(nil), // 9: pb.ListEnabledNodeGrantsResponse - (*FindAllEnabledNodeGrantsRequest)(nil), // 10: pb.FindAllEnabledNodeGrantsRequest - (*FindAllEnabledNodeGrantsResponse)(nil), // 11: pb.FindAllEnabledNodeGrantsResponse - (*FindEnabledGrantRequest)(nil), // 12: pb.FindEnabledGrantRequest - (*FindEnabledGrantResponse)(nil), // 13: pb.FindEnabledGrantResponse - (*NodeGrant)(nil), // 14: pb.NodeGrant -} -var file_service_node_grant_proto_depIdxs = []int32{ - 14, // 0: pb.ListEnabledNodeGrantsResponse.grants:type_name -> pb.NodeGrant - 14, // 1: pb.FindAllEnabledNodeGrantsResponse.grants:type_name -> pb.NodeGrant - 14, // 2: pb.FindEnabledGrantResponse.grant:type_name -> pb.NodeGrant - 0, // 3: pb.NodeGrantService.createNodeGrant:input_type -> pb.CreateNodeGrantRequest - 2, // 4: pb.NodeGrantService.updateNodeGrant:input_type -> pb.UpdateNodeGrantRequest - 4, // 5: pb.NodeGrantService.disableNodeGrant:input_type -> pb.DisableNodeGrantRequest - 6, // 6: pb.NodeGrantService.countAllEnabledNodeGrants:input_type -> pb.CountAllEnabledNodeGrantsRequest - 8, // 7: pb.NodeGrantService.ListEnabledNodeGrants:input_type -> pb.ListEnabledNodeGrantsRequest - 10, // 8: pb.NodeGrantService.FindAllEnabledNodeGrants:input_type -> pb.FindAllEnabledNodeGrantsRequest - 12, // 9: pb.NodeGrantService.FindEnabledGrant:input_type -> pb.FindEnabledGrantRequest - 1, // 10: pb.NodeGrantService.createNodeGrant:output_type -> pb.CreateNodeGrantResponse - 3, // 11: pb.NodeGrantService.updateNodeGrant:output_type -> pb.UpdateNodeGrantResponse - 5, // 12: pb.NodeGrantService.disableNodeGrant:output_type -> pb.DisableNodeGrantResponse - 7, // 13: pb.NodeGrantService.countAllEnabledNodeGrants:output_type -> pb.CountAllEnabledNodeGrantsResponse - 9, // 14: pb.NodeGrantService.ListEnabledNodeGrants:output_type -> pb.ListEnabledNodeGrantsResponse - 11, // 15: pb.NodeGrantService.FindAllEnabledNodeGrants:output_type -> pb.FindAllEnabledNodeGrantsResponse - 13, // 16: pb.NodeGrantService.FindEnabledGrant:output_type -> pb.FindEnabledGrantResponse - 10, // [10:17] is the sub-list for method output_type - 3, // [3:10] is the sub-list for method input_type - 3, // [3:3] is the sub-list for extension type_name - 3, // [3:3] is the sub-list for extension extendee - 0, // [0:3] is the sub-list for field type_name -} - -func init() { file_service_node_grant_proto_init() } -func file_service_node_grant_proto_init() { - if File_service_node_grant_proto != nil { - return - } - file_model_node_grant_proto_init() - if !protoimpl.UnsafeEnabled { - file_service_node_grant_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreateNodeGrantRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_service_node_grant_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreateNodeGrantResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_service_node_grant_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UpdateNodeGrantRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_service_node_grant_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UpdateNodeGrantResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_service_node_grant_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DisableNodeGrantRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_service_node_grant_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DisableNodeGrantResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_service_node_grant_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CountAllEnabledNodeGrantsRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_service_node_grant_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CountAllEnabledNodeGrantsResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_service_node_grant_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListEnabledNodeGrantsRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_service_node_grant_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListEnabledNodeGrantsResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_service_node_grant_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*FindAllEnabledNodeGrantsRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_service_node_grant_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*FindAllEnabledNodeGrantsResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_service_node_grant_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*FindEnabledGrantRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_service_node_grant_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*FindEnabledGrantResponse); 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_service_node_grant_proto_rawDesc, - NumEnums: 0, - NumMessages: 14, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_service_node_grant_proto_goTypes, - DependencyIndexes: file_service_node_grant_proto_depIdxs, - MessageInfos: file_service_node_grant_proto_msgTypes, - }.Build() - File_service_node_grant_proto = out.File - file_service_node_grant_proto_rawDesc = nil - file_service_node_grant_proto_goTypes = nil - file_service_node_grant_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 - -// NodeGrantServiceClient is the client API for NodeGrantService service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type NodeGrantServiceClient interface { - // 创建认证 - CreateNodeGrant(ctx context.Context, in *CreateNodeGrantRequest, opts ...grpc.CallOption) (*CreateNodeGrantResponse, error) - // 修改认证 - UpdateNodeGrant(ctx context.Context, in *UpdateNodeGrantRequest, opts ...grpc.CallOption) (*UpdateNodeGrantResponse, error) - // 禁用认证 - DisableNodeGrant(ctx context.Context, in *DisableNodeGrantRequest, opts ...grpc.CallOption) (*DisableNodeGrantResponse, error) - // 计算认证的数量 - CountAllEnabledNodeGrants(ctx context.Context, in *CountAllEnabledNodeGrantsRequest, opts ...grpc.CallOption) (*CountAllEnabledNodeGrantsResponse, error) - // 列出单页认证 - ListEnabledNodeGrants(ctx context.Context, in *ListEnabledNodeGrantsRequest, opts ...grpc.CallOption) (*ListEnabledNodeGrantsResponse, error) - // 列出所有认证 - FindAllEnabledNodeGrants(ctx context.Context, in *FindAllEnabledNodeGrantsRequest, opts ...grpc.CallOption) (*FindAllEnabledNodeGrantsResponse, error) - // 获取单个认证信息 - FindEnabledGrant(ctx context.Context, in *FindEnabledGrantRequest, opts ...grpc.CallOption) (*FindEnabledGrantResponse, error) -} - -type nodeGrantServiceClient struct { - cc grpc.ClientConnInterface -} - -func NewNodeGrantServiceClient(cc grpc.ClientConnInterface) NodeGrantServiceClient { - return &nodeGrantServiceClient{cc} -} - -func (c *nodeGrantServiceClient) CreateNodeGrant(ctx context.Context, in *CreateNodeGrantRequest, opts ...grpc.CallOption) (*CreateNodeGrantResponse, error) { - out := new(CreateNodeGrantResponse) - err := c.cc.Invoke(ctx, "/pb.NodeGrantService/createNodeGrant", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *nodeGrantServiceClient) UpdateNodeGrant(ctx context.Context, in *UpdateNodeGrantRequest, opts ...grpc.CallOption) (*UpdateNodeGrantResponse, error) { - out := new(UpdateNodeGrantResponse) - err := c.cc.Invoke(ctx, "/pb.NodeGrantService/updateNodeGrant", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *nodeGrantServiceClient) DisableNodeGrant(ctx context.Context, in *DisableNodeGrantRequest, opts ...grpc.CallOption) (*DisableNodeGrantResponse, error) { - out := new(DisableNodeGrantResponse) - err := c.cc.Invoke(ctx, "/pb.NodeGrantService/disableNodeGrant", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *nodeGrantServiceClient) CountAllEnabledNodeGrants(ctx context.Context, in *CountAllEnabledNodeGrantsRequest, opts ...grpc.CallOption) (*CountAllEnabledNodeGrantsResponse, error) { - out := new(CountAllEnabledNodeGrantsResponse) - err := c.cc.Invoke(ctx, "/pb.NodeGrantService/countAllEnabledNodeGrants", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *nodeGrantServiceClient) ListEnabledNodeGrants(ctx context.Context, in *ListEnabledNodeGrantsRequest, opts ...grpc.CallOption) (*ListEnabledNodeGrantsResponse, error) { - out := new(ListEnabledNodeGrantsResponse) - err := c.cc.Invoke(ctx, "/pb.NodeGrantService/ListEnabledNodeGrants", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *nodeGrantServiceClient) FindAllEnabledNodeGrants(ctx context.Context, in *FindAllEnabledNodeGrantsRequest, opts ...grpc.CallOption) (*FindAllEnabledNodeGrantsResponse, error) { - out := new(FindAllEnabledNodeGrantsResponse) - err := c.cc.Invoke(ctx, "/pb.NodeGrantService/FindAllEnabledNodeGrants", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *nodeGrantServiceClient) FindEnabledGrant(ctx context.Context, in *FindEnabledGrantRequest, opts ...grpc.CallOption) (*FindEnabledGrantResponse, error) { - out := new(FindEnabledGrantResponse) - err := c.cc.Invoke(ctx, "/pb.NodeGrantService/FindEnabledGrant", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// NodeGrantServiceServer is the server API for NodeGrantService service. -type NodeGrantServiceServer interface { - // 创建认证 - CreateNodeGrant(context.Context, *CreateNodeGrantRequest) (*CreateNodeGrantResponse, error) - // 修改认证 - UpdateNodeGrant(context.Context, *UpdateNodeGrantRequest) (*UpdateNodeGrantResponse, error) - // 禁用认证 - DisableNodeGrant(context.Context, *DisableNodeGrantRequest) (*DisableNodeGrantResponse, error) - // 计算认证的数量 - CountAllEnabledNodeGrants(context.Context, *CountAllEnabledNodeGrantsRequest) (*CountAllEnabledNodeGrantsResponse, error) - // 列出单页认证 - ListEnabledNodeGrants(context.Context, *ListEnabledNodeGrantsRequest) (*ListEnabledNodeGrantsResponse, error) - // 列出所有认证 - FindAllEnabledNodeGrants(context.Context, *FindAllEnabledNodeGrantsRequest) (*FindAllEnabledNodeGrantsResponse, error) - // 获取单个认证信息 - FindEnabledGrant(context.Context, *FindEnabledGrantRequest) (*FindEnabledGrantResponse, error) -} - -// UnimplementedNodeGrantServiceServer can be embedded to have forward compatible implementations. -type UnimplementedNodeGrantServiceServer struct { -} - -func (*UnimplementedNodeGrantServiceServer) CreateNodeGrant(context.Context, *CreateNodeGrantRequest) (*CreateNodeGrantResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method CreateNodeGrant not implemented") -} -func (*UnimplementedNodeGrantServiceServer) UpdateNodeGrant(context.Context, *UpdateNodeGrantRequest) (*UpdateNodeGrantResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method UpdateNodeGrant not implemented") -} -func (*UnimplementedNodeGrantServiceServer) DisableNodeGrant(context.Context, *DisableNodeGrantRequest) (*DisableNodeGrantResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method DisableNodeGrant not implemented") -} -func (*UnimplementedNodeGrantServiceServer) CountAllEnabledNodeGrants(context.Context, *CountAllEnabledNodeGrantsRequest) (*CountAllEnabledNodeGrantsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method CountAllEnabledNodeGrants not implemented") -} -func (*UnimplementedNodeGrantServiceServer) ListEnabledNodeGrants(context.Context, *ListEnabledNodeGrantsRequest) (*ListEnabledNodeGrantsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ListEnabledNodeGrants not implemented") -} -func (*UnimplementedNodeGrantServiceServer) FindAllEnabledNodeGrants(context.Context, *FindAllEnabledNodeGrantsRequest) (*FindAllEnabledNodeGrantsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method FindAllEnabledNodeGrants not implemented") -} -func (*UnimplementedNodeGrantServiceServer) FindEnabledGrant(context.Context, *FindEnabledGrantRequest) (*FindEnabledGrantResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method FindEnabledGrant not implemented") -} - -func RegisterNodeGrantServiceServer(s *grpc.Server, srv NodeGrantServiceServer) { - s.RegisterService(&_NodeGrantService_serviceDesc, srv) -} - -func _NodeGrantService_CreateNodeGrant_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(CreateNodeGrantRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(NodeGrantServiceServer).CreateNodeGrant(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/pb.NodeGrantService/CreateNodeGrant", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(NodeGrantServiceServer).CreateNodeGrant(ctx, req.(*CreateNodeGrantRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _NodeGrantService_UpdateNodeGrant_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(UpdateNodeGrantRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(NodeGrantServiceServer).UpdateNodeGrant(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/pb.NodeGrantService/UpdateNodeGrant", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(NodeGrantServiceServer).UpdateNodeGrant(ctx, req.(*UpdateNodeGrantRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _NodeGrantService_DisableNodeGrant_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DisableNodeGrantRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(NodeGrantServiceServer).DisableNodeGrant(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/pb.NodeGrantService/DisableNodeGrant", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(NodeGrantServiceServer).DisableNodeGrant(ctx, req.(*DisableNodeGrantRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _NodeGrantService_CountAllEnabledNodeGrants_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(CountAllEnabledNodeGrantsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(NodeGrantServiceServer).CountAllEnabledNodeGrants(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/pb.NodeGrantService/CountAllEnabledNodeGrants", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(NodeGrantServiceServer).CountAllEnabledNodeGrants(ctx, req.(*CountAllEnabledNodeGrantsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _NodeGrantService_ListEnabledNodeGrants_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ListEnabledNodeGrantsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(NodeGrantServiceServer).ListEnabledNodeGrants(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/pb.NodeGrantService/ListEnabledNodeGrants", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(NodeGrantServiceServer).ListEnabledNodeGrants(ctx, req.(*ListEnabledNodeGrantsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _NodeGrantService_FindAllEnabledNodeGrants_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(FindAllEnabledNodeGrantsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(NodeGrantServiceServer).FindAllEnabledNodeGrants(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/pb.NodeGrantService/FindAllEnabledNodeGrants", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(NodeGrantServiceServer).FindAllEnabledNodeGrants(ctx, req.(*FindAllEnabledNodeGrantsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _NodeGrantService_FindEnabledGrant_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(FindEnabledGrantRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(NodeGrantServiceServer).FindEnabledGrant(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/pb.NodeGrantService/FindEnabledGrant", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(NodeGrantServiceServer).FindEnabledGrant(ctx, req.(*FindEnabledGrantRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _NodeGrantService_serviceDesc = grpc.ServiceDesc{ - ServiceName: "pb.NodeGrantService", - HandlerType: (*NodeGrantServiceServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "createNodeGrant", - Handler: _NodeGrantService_CreateNodeGrant_Handler, - }, - { - MethodName: "updateNodeGrant", - Handler: _NodeGrantService_UpdateNodeGrant_Handler, - }, - { - MethodName: "disableNodeGrant", - Handler: _NodeGrantService_DisableNodeGrant_Handler, - }, - { - MethodName: "countAllEnabledNodeGrants", - Handler: _NodeGrantService_CountAllEnabledNodeGrants_Handler, - }, - { - MethodName: "ListEnabledNodeGrants", - Handler: _NodeGrantService_ListEnabledNodeGrants_Handler, - }, - { - MethodName: "FindAllEnabledNodeGrants", - Handler: _NodeGrantService_FindAllEnabledNodeGrants_Handler, - }, - { - MethodName: "FindEnabledGrant", - Handler: _NodeGrantService_FindEnabledGrant_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "service_node_grant.proto", -} diff --git a/internal/rpc/pb/service_node_group.pb.go b/internal/rpc/pb/service_node_group.pb.go deleted file mode 100644 index 82c627a2..00000000 --- a/internal/rpc/pb/service_node_group.pb.go +++ /dev/null @@ -1,66 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.25.0 -// protoc v3.12.3 -// source: service_node_group.proto - -package pb - -import ( - proto "github.com/golang/protobuf/proto" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" -) - -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 - -var File_service_node_group_proto protoreflect.FileDescriptor - -var file_service_node_group_proto_rawDesc = []byte{ - 0x0a, 0x18, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x67, - 0x72, 0x6f, 0x75, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, 0x62, 0x42, 0x06, - 0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var file_service_node_group_proto_goTypes = []interface{}{} -var file_service_node_group_proto_depIdxs = []int32{ - 0, // [0:0] is the sub-list for method output_type - 0, // [0:0] 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_service_node_group_proto_init() } -func file_service_node_group_proto_init() { - if File_service_node_group_proto != nil { - return - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_service_node_group_proto_rawDesc, - NumEnums: 0, - NumMessages: 0, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_service_node_group_proto_goTypes, - DependencyIndexes: file_service_node_group_proto_depIdxs, - }.Build() - File_service_node_group_proto = out.File - file_service_node_group_proto_rawDesc = nil - file_service_node_group_proto_goTypes = nil - file_service_node_group_proto_depIdxs = nil -} diff --git a/internal/rpc/pb/service_node_ip_address.pb.go b/internal/rpc/pb/service_node_ip_address.pb.go deleted file mode 100644 index 635c5f26..00000000 --- a/internal/rpc/pb/service_node_ip_address.pb.go +++ /dev/null @@ -1,1375 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.25.0 -// protoc v3.12.3 -// source: service_node_ip_address.proto - -package pb - -import ( - context "context" - proto "github.com/golang/protobuf/proto" - 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" - 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) -) - -// This is a compile-time assertion that a sufficiently up-to-date version -// of the legacy proto package is being used. -const _ = proto.ProtoPackageIsVersion4 - -// 创建IP地址 -type CreateNodeIPAddressRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - NodeId int64 `protobuf:"varint,1,opt,name=nodeId,proto3" json:"nodeId,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - Ip string `protobuf:"bytes,3,opt,name=ip,proto3" json:"ip,omitempty"` -} - -func (x *CreateNodeIPAddressRequest) Reset() { - *x = CreateNodeIPAddressRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_service_node_ip_address_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CreateNodeIPAddressRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CreateNodeIPAddressRequest) ProtoMessage() {} - -func (x *CreateNodeIPAddressRequest) ProtoReflect() protoreflect.Message { - mi := &file_service_node_ip_address_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 CreateNodeIPAddressRequest.ProtoReflect.Descriptor instead. -func (*CreateNodeIPAddressRequest) Descriptor() ([]byte, []int) { - return file_service_node_ip_address_proto_rawDescGZIP(), []int{0} -} - -func (x *CreateNodeIPAddressRequest) GetNodeId() int64 { - if x != nil { - return x.NodeId - } - return 0 -} - -func (x *CreateNodeIPAddressRequest) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *CreateNodeIPAddressRequest) GetIp() string { - if x != nil { - return x.Ip - } - return "" -} - -type CreateNodeIPAddressResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - AddressId int64 `protobuf:"varint,1,opt,name=addressId,proto3" json:"addressId,omitempty"` -} - -func (x *CreateNodeIPAddressResponse) Reset() { - *x = CreateNodeIPAddressResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_service_node_ip_address_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CreateNodeIPAddressResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CreateNodeIPAddressResponse) ProtoMessage() {} - -func (x *CreateNodeIPAddressResponse) ProtoReflect() protoreflect.Message { - mi := &file_service_node_ip_address_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) -} - -// Deprecated: Use CreateNodeIPAddressResponse.ProtoReflect.Descriptor instead. -func (*CreateNodeIPAddressResponse) Descriptor() ([]byte, []int) { - return file_service_node_ip_address_proto_rawDescGZIP(), []int{1} -} - -func (x *CreateNodeIPAddressResponse) GetAddressId() int64 { - if x != nil { - return x.AddressId - } - return 0 -} - -// 修改IP地址 -type UpdateNodeIPAddressRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - AddressId int64 `protobuf:"varint,1,opt,name=addressId,proto3" json:"addressId,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - Ip string `protobuf:"bytes,3,opt,name=ip,proto3" json:"ip,omitempty"` -} - -func (x *UpdateNodeIPAddressRequest) Reset() { - *x = UpdateNodeIPAddressRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_service_node_ip_address_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *UpdateNodeIPAddressRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UpdateNodeIPAddressRequest) ProtoMessage() {} - -func (x *UpdateNodeIPAddressRequest) ProtoReflect() protoreflect.Message { - mi := &file_service_node_ip_address_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) -} - -// Deprecated: Use UpdateNodeIPAddressRequest.ProtoReflect.Descriptor instead. -func (*UpdateNodeIPAddressRequest) Descriptor() ([]byte, []int) { - return file_service_node_ip_address_proto_rawDescGZIP(), []int{2} -} - -func (x *UpdateNodeIPAddressRequest) GetAddressId() int64 { - if x != nil { - return x.AddressId - } - return 0 -} - -func (x *UpdateNodeIPAddressRequest) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *UpdateNodeIPAddressRequest) GetIp() string { - if x != nil { - return x.Ip - } - return "" -} - -type UpdateNodeIPAddressResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *UpdateNodeIPAddressResponse) Reset() { - *x = UpdateNodeIPAddressResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_service_node_ip_address_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *UpdateNodeIPAddressResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UpdateNodeIPAddressResponse) ProtoMessage() {} - -func (x *UpdateNodeIPAddressResponse) ProtoReflect() protoreflect.Message { - mi := &file_service_node_ip_address_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) -} - -// Deprecated: Use UpdateNodeIPAddressResponse.ProtoReflect.Descriptor instead. -func (*UpdateNodeIPAddressResponse) Descriptor() ([]byte, []int) { - return file_service_node_ip_address_proto_rawDescGZIP(), []int{3} -} - -// 修改IP地址所属节点 -type UpdateNodeIPAddressNodeIdRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - AddressId int64 `protobuf:"varint,1,opt,name=addressId,proto3" json:"addressId,omitempty"` - NodeId int64 `protobuf:"varint,2,opt,name=nodeId,proto3" json:"nodeId,omitempty"` -} - -func (x *UpdateNodeIPAddressNodeIdRequest) Reset() { - *x = UpdateNodeIPAddressNodeIdRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_service_node_ip_address_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *UpdateNodeIPAddressNodeIdRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UpdateNodeIPAddressNodeIdRequest) ProtoMessage() {} - -func (x *UpdateNodeIPAddressNodeIdRequest) ProtoReflect() protoreflect.Message { - mi := &file_service_node_ip_address_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) -} - -// Deprecated: Use UpdateNodeIPAddressNodeIdRequest.ProtoReflect.Descriptor instead. -func (*UpdateNodeIPAddressNodeIdRequest) Descriptor() ([]byte, []int) { - return file_service_node_ip_address_proto_rawDescGZIP(), []int{4} -} - -func (x *UpdateNodeIPAddressNodeIdRequest) GetAddressId() int64 { - if x != nil { - return x.AddressId - } - return 0 -} - -func (x *UpdateNodeIPAddressNodeIdRequest) GetNodeId() int64 { - if x != nil { - return x.NodeId - } - return 0 -} - -type UpdateNodeIPAddressNodeIdResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *UpdateNodeIPAddressNodeIdResponse) Reset() { - *x = UpdateNodeIPAddressNodeIdResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_service_node_ip_address_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *UpdateNodeIPAddressNodeIdResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UpdateNodeIPAddressNodeIdResponse) ProtoMessage() {} - -func (x *UpdateNodeIPAddressNodeIdResponse) ProtoReflect() protoreflect.Message { - mi := &file_service_node_ip_address_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) -} - -// Deprecated: Use UpdateNodeIPAddressNodeIdResponse.ProtoReflect.Descriptor instead. -func (*UpdateNodeIPAddressNodeIdResponse) Descriptor() ([]byte, []int) { - return file_service_node_ip_address_proto_rawDescGZIP(), []int{5} -} - -// 禁用单个IP地址 -type DisableNodeIPAddressRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - AddressId int64 `protobuf:"varint,1,opt,name=addressId,proto3" json:"addressId,omitempty"` -} - -func (x *DisableNodeIPAddressRequest) Reset() { - *x = DisableNodeIPAddressRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_service_node_ip_address_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *DisableNodeIPAddressRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DisableNodeIPAddressRequest) ProtoMessage() {} - -func (x *DisableNodeIPAddressRequest) ProtoReflect() protoreflect.Message { - mi := &file_service_node_ip_address_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) -} - -// Deprecated: Use DisableNodeIPAddressRequest.ProtoReflect.Descriptor instead. -func (*DisableNodeIPAddressRequest) Descriptor() ([]byte, []int) { - return file_service_node_ip_address_proto_rawDescGZIP(), []int{6} -} - -func (x *DisableNodeIPAddressRequest) GetAddressId() int64 { - if x != nil { - return x.AddressId - } - return 0 -} - -type DisableNodeIPAddressResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *DisableNodeIPAddressResponse) Reset() { - *x = DisableNodeIPAddressResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_service_node_ip_address_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *DisableNodeIPAddressResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DisableNodeIPAddressResponse) ProtoMessage() {} - -func (x *DisableNodeIPAddressResponse) ProtoReflect() protoreflect.Message { - mi := &file_service_node_ip_address_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) -} - -// Deprecated: Use DisableNodeIPAddressResponse.ProtoReflect.Descriptor instead. -func (*DisableNodeIPAddressResponse) Descriptor() ([]byte, []int) { - return file_service_node_ip_address_proto_rawDescGZIP(), []int{7} -} - -// 禁用节点的所有IP地址 -type DisableAllIPAddressesWithNodeIdRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - NodeId int64 `protobuf:"varint,1,opt,name=nodeId,proto3" json:"nodeId,omitempty"` -} - -func (x *DisableAllIPAddressesWithNodeIdRequest) Reset() { - *x = DisableAllIPAddressesWithNodeIdRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_service_node_ip_address_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *DisableAllIPAddressesWithNodeIdRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DisableAllIPAddressesWithNodeIdRequest) ProtoMessage() {} - -func (x *DisableAllIPAddressesWithNodeIdRequest) ProtoReflect() protoreflect.Message { - mi := &file_service_node_ip_address_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) -} - -// Deprecated: Use DisableAllIPAddressesWithNodeIdRequest.ProtoReflect.Descriptor instead. -func (*DisableAllIPAddressesWithNodeIdRequest) Descriptor() ([]byte, []int) { - return file_service_node_ip_address_proto_rawDescGZIP(), []int{8} -} - -func (x *DisableAllIPAddressesWithNodeIdRequest) GetNodeId() int64 { - if x != nil { - return x.NodeId - } - return 0 -} - -type DisableAllIPAddressesWithNodeIdResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *DisableAllIPAddressesWithNodeIdResponse) Reset() { - *x = DisableAllIPAddressesWithNodeIdResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_service_node_ip_address_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *DisableAllIPAddressesWithNodeIdResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DisableAllIPAddressesWithNodeIdResponse) ProtoMessage() {} - -func (x *DisableAllIPAddressesWithNodeIdResponse) ProtoReflect() protoreflect.Message { - mi := &file_service_node_ip_address_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) -} - -// Deprecated: Use DisableAllIPAddressesWithNodeIdResponse.ProtoReflect.Descriptor instead. -func (*DisableAllIPAddressesWithNodeIdResponse) Descriptor() ([]byte, []int) { - return file_service_node_ip_address_proto_rawDescGZIP(), []int{9} -} - -// 查找单个IP地址 -type FindEnabledNodeIPAddressRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - AddressId int64 `protobuf:"varint,1,opt,name=addressId,proto3" json:"addressId,omitempty"` -} - -func (x *FindEnabledNodeIPAddressRequest) Reset() { - *x = FindEnabledNodeIPAddressRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_service_node_ip_address_proto_msgTypes[10] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *FindEnabledNodeIPAddressRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*FindEnabledNodeIPAddressRequest) ProtoMessage() {} - -func (x *FindEnabledNodeIPAddressRequest) ProtoReflect() protoreflect.Message { - mi := &file_service_node_ip_address_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) -} - -// Deprecated: Use FindEnabledNodeIPAddressRequest.ProtoReflect.Descriptor instead. -func (*FindEnabledNodeIPAddressRequest) Descriptor() ([]byte, []int) { - return file_service_node_ip_address_proto_rawDescGZIP(), []int{10} -} - -func (x *FindEnabledNodeIPAddressRequest) GetAddressId() int64 { - if x != nil { - return x.AddressId - } - return 0 -} - -type FindEnabledNodeIPAddressResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - IpAddress *NodeIPAddress `protobuf:"bytes,1,opt,name=ipAddress,proto3" json:"ipAddress,omitempty"` -} - -func (x *FindEnabledNodeIPAddressResponse) Reset() { - *x = FindEnabledNodeIPAddressResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_service_node_ip_address_proto_msgTypes[11] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *FindEnabledNodeIPAddressResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*FindEnabledNodeIPAddressResponse) ProtoMessage() {} - -func (x *FindEnabledNodeIPAddressResponse) ProtoReflect() protoreflect.Message { - mi := &file_service_node_ip_address_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) -} - -// Deprecated: Use FindEnabledNodeIPAddressResponse.ProtoReflect.Descriptor instead. -func (*FindEnabledNodeIPAddressResponse) Descriptor() ([]byte, []int) { - return file_service_node_ip_address_proto_rawDescGZIP(), []int{11} -} - -func (x *FindEnabledNodeIPAddressResponse) GetIpAddress() *NodeIPAddress { - if x != nil { - return x.IpAddress - } - return nil -} - -// 查找节点的所有地址 -type FindAllEnabledIPAddressesWithNodeIdRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - NodeId int64 `protobuf:"varint,1,opt,name=nodeId,proto3" json:"nodeId,omitempty"` -} - -func (x *FindAllEnabledIPAddressesWithNodeIdRequest) Reset() { - *x = FindAllEnabledIPAddressesWithNodeIdRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_service_node_ip_address_proto_msgTypes[12] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *FindAllEnabledIPAddressesWithNodeIdRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*FindAllEnabledIPAddressesWithNodeIdRequest) ProtoMessage() {} - -func (x *FindAllEnabledIPAddressesWithNodeIdRequest) ProtoReflect() protoreflect.Message { - mi := &file_service_node_ip_address_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) -} - -// Deprecated: Use FindAllEnabledIPAddressesWithNodeIdRequest.ProtoReflect.Descriptor instead. -func (*FindAllEnabledIPAddressesWithNodeIdRequest) Descriptor() ([]byte, []int) { - return file_service_node_ip_address_proto_rawDescGZIP(), []int{12} -} - -func (x *FindAllEnabledIPAddressesWithNodeIdRequest) GetNodeId() int64 { - if x != nil { - return x.NodeId - } - return 0 -} - -type FindAllEnabledIPAddressesWithNodeIdResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Addresses []*NodeIPAddress `protobuf:"bytes,1,rep,name=addresses,proto3" json:"addresses,omitempty"` -} - -func (x *FindAllEnabledIPAddressesWithNodeIdResponse) Reset() { - *x = FindAllEnabledIPAddressesWithNodeIdResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_service_node_ip_address_proto_msgTypes[13] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *FindAllEnabledIPAddressesWithNodeIdResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*FindAllEnabledIPAddressesWithNodeIdResponse) ProtoMessage() {} - -func (x *FindAllEnabledIPAddressesWithNodeIdResponse) ProtoReflect() protoreflect.Message { - mi := &file_service_node_ip_address_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) -} - -// Deprecated: Use FindAllEnabledIPAddressesWithNodeIdResponse.ProtoReflect.Descriptor instead. -func (*FindAllEnabledIPAddressesWithNodeIdResponse) Descriptor() ([]byte, []int) { - return file_service_node_ip_address_proto_rawDescGZIP(), []int{13} -} - -func (x *FindAllEnabledIPAddressesWithNodeIdResponse) GetAddresses() []*NodeIPAddress { - if x != nil { - return x.Addresses - } - return nil -} - -var File_service_node_ip_address_proto protoreflect.FileDescriptor - -var file_service_node_ip_address_proto_rawDesc = []byte{ - 0x0a, 0x1d, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x69, - 0x70, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, - 0x02, 0x70, 0x62, 0x1a, 0x1b, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5f, 0x6e, 0x6f, 0x64, 0x65, 0x5f, - 0x69, 0x70, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x22, 0x58, 0x0a, 0x1a, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x50, - 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, - 0x0a, 0x06, 0x6e, 0x6f, 0x64, 0x65, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, - 0x6e, 0x6f, 0x64, 0x65, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x70, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x70, 0x22, 0x3b, 0x0a, 0x1b, 0x43, 0x72, - 0x65, 0x61, 0x74, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x50, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, - 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x61, 0x64, 0x64, - 0x72, 0x65, 0x73, 0x73, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x61, 0x64, - 0x64, 0x72, 0x65, 0x73, 0x73, 0x49, 0x64, 0x22, 0x5e, 0x0a, 0x1a, 0x55, 0x70, 0x64, 0x61, 0x74, - 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x50, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, - 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, - 0x73, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x70, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x70, 0x22, 0x1d, 0x0a, 0x1b, 0x55, 0x70, 0x64, 0x61, 0x74, - 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x50, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x58, 0x0a, 0x20, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, - 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x50, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x4e, 0x6f, 0x64, - 0x65, 0x49, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x61, 0x64, - 0x64, 0x72, 0x65, 0x73, 0x73, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x61, - 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x6e, 0x6f, 0x64, 0x65, - 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x6e, 0x6f, 0x64, 0x65, 0x49, 0x64, - 0x22, 0x23, 0x0a, 0x21, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x50, - 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x64, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x3b, 0x0a, 0x1b, 0x44, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, - 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x50, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x49, - 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, - 0x49, 0x64, 0x22, 0x1e, 0x0a, 0x1c, 0x44, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x4e, 0x6f, 0x64, - 0x65, 0x49, 0x50, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x22, 0x40, 0x0a, 0x26, 0x44, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x41, 0x6c, 0x6c, - 0x49, 0x50, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, 0x57, 0x69, 0x74, 0x68, 0x4e, - 0x6f, 0x64, 0x65, 0x49, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, - 0x6e, 0x6f, 0x64, 0x65, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x6e, 0x6f, - 0x64, 0x65, 0x49, 0x64, 0x22, 0x29, 0x0a, 0x27, 0x44, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x41, - 0x6c, 0x6c, 0x49, 0x50, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, 0x57, 0x69, 0x74, - 0x68, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, - 0x3f, 0x0a, 0x1f, 0x46, 0x69, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x4e, 0x6f, - 0x64, 0x65, 0x49, 0x50, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x49, 0x64, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x49, 0x64, - 0x22, 0x53, 0x0a, 0x20, 0x46, 0x69, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x4e, - 0x6f, 0x64, 0x65, 0x49, 0x50, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2f, 0x0a, 0x09, 0x69, 0x70, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, - 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x70, 0x62, 0x2e, 0x4e, 0x6f, 0x64, - 0x65, 0x49, 0x50, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x09, 0x69, 0x70, 0x41, 0x64, - 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0x44, 0x0a, 0x2a, 0x46, 0x69, 0x6e, 0x64, 0x41, 0x6c, 0x6c, - 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x49, 0x50, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, - 0x65, 0x73, 0x57, 0x69, 0x74, 0x68, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x64, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x6e, 0x6f, 0x64, 0x65, 0x49, 0x64, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x03, 0x52, 0x06, 0x6e, 0x6f, 0x64, 0x65, 0x49, 0x64, 0x22, 0x5e, 0x0a, 0x2b, 0x46, - 0x69, 0x6e, 0x64, 0x41, 0x6c, 0x6c, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x49, 0x50, 0x41, - 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, 0x57, 0x69, 0x74, 0x68, 0x4e, 0x6f, 0x64, 0x65, - 0x49, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2f, 0x0a, 0x09, 0x61, 0x64, - 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x11, 0x2e, - 0x70, 0x62, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x50, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, - 0x52, 0x09, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, 0x32, 0xf7, 0x05, 0x0a, 0x14, - 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x50, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x65, 0x72, - 0x76, 0x69, 0x63, 0x65, 0x12, 0x56, 0x0a, 0x13, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4e, 0x6f, - 0x64, 0x65, 0x49, 0x50, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x1e, 0x2e, 0x70, 0x62, - 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x50, 0x41, 0x64, 0x64, - 0x72, 0x65, 0x73, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x70, 0x62, - 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x50, 0x41, 0x64, 0x64, - 0x72, 0x65, 0x73, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x56, 0x0a, 0x13, - 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x50, 0x41, 0x64, 0x64, 0x72, - 0x65, 0x73, 0x73, 0x12, 0x1e, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4e, - 0x6f, 0x64, 0x65, 0x49, 0x50, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4e, - 0x6f, 0x64, 0x65, 0x49, 0x50, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x68, 0x0a, 0x19, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4e, 0x6f, - 0x64, 0x65, 0x49, 0x50, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x4e, 0x6f, 0x64, 0x65, 0x49, - 0x64, 0x12, 0x24, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4e, 0x6f, 0x64, - 0x65, 0x49, 0x50, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x64, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, - 0x61, 0x74, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x50, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, - 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x59, - 0x0a, 0x14, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x50, 0x41, - 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x1f, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x69, 0x73, 0x61, - 0x62, 0x6c, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x50, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x69, 0x73, - 0x61, 0x62, 0x6c, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x50, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, - 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x7a, 0x0a, 0x1f, 0x64, 0x69, 0x73, - 0x61, 0x62, 0x6c, 0x65, 0x41, 0x6c, 0x6c, 0x49, 0x50, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, - 0x65, 0x73, 0x57, 0x69, 0x74, 0x68, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x64, 0x12, 0x2a, 0x2e, 0x70, - 0x62, 0x2e, 0x44, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x41, 0x6c, 0x6c, 0x49, 0x50, 0x41, 0x64, - 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, 0x57, 0x69, 0x74, 0x68, 0x4e, 0x6f, 0x64, 0x65, 0x49, - 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x69, - 0x73, 0x61, 0x62, 0x6c, 0x65, 0x41, 0x6c, 0x6c, 0x49, 0x50, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, - 0x73, 0x65, 0x73, 0x57, 0x69, 0x74, 0x68, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x64, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x65, 0x0a, 0x18, 0x66, 0x69, 0x6e, 0x64, 0x45, 0x6e, 0x61, - 0x62, 0x6c, 0x65, 0x64, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x50, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, - 0x73, 0x12, 0x23, 0x2e, 0x70, 0x62, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, - 0x65, 0x64, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x50, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x70, 0x62, 0x2e, 0x46, 0x69, 0x6e, 0x64, - 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x50, 0x41, 0x64, 0x64, - 0x72, 0x65, 0x73, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x86, 0x01, 0x0a, - 0x23, 0x66, 0x69, 0x6e, 0x64, 0x41, 0x6c, 0x6c, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x49, - 0x50, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, 0x57, 0x69, 0x74, 0x68, 0x4e, 0x6f, - 0x64, 0x65, 0x49, 0x64, 0x12, 0x2e, 0x2e, 0x70, 0x62, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x41, 0x6c, - 0x6c, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x49, 0x50, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, - 0x73, 0x65, 0x73, 0x57, 0x69, 0x74, 0x68, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x64, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2f, 0x2e, 0x70, 0x62, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x41, 0x6c, - 0x6c, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x49, 0x50, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, - 0x73, 0x65, 0x73, 0x57, 0x69, 0x74, 0x68, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x64, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_service_node_ip_address_proto_rawDescOnce sync.Once - file_service_node_ip_address_proto_rawDescData = file_service_node_ip_address_proto_rawDesc -) - -func file_service_node_ip_address_proto_rawDescGZIP() []byte { - file_service_node_ip_address_proto_rawDescOnce.Do(func() { - file_service_node_ip_address_proto_rawDescData = protoimpl.X.CompressGZIP(file_service_node_ip_address_proto_rawDescData) - }) - return file_service_node_ip_address_proto_rawDescData -} - -var file_service_node_ip_address_proto_msgTypes = make([]protoimpl.MessageInfo, 14) -var file_service_node_ip_address_proto_goTypes = []interface{}{ - (*CreateNodeIPAddressRequest)(nil), // 0: pb.CreateNodeIPAddressRequest - (*CreateNodeIPAddressResponse)(nil), // 1: pb.CreateNodeIPAddressResponse - (*UpdateNodeIPAddressRequest)(nil), // 2: pb.UpdateNodeIPAddressRequest - (*UpdateNodeIPAddressResponse)(nil), // 3: pb.UpdateNodeIPAddressResponse - (*UpdateNodeIPAddressNodeIdRequest)(nil), // 4: pb.UpdateNodeIPAddressNodeIdRequest - (*UpdateNodeIPAddressNodeIdResponse)(nil), // 5: pb.UpdateNodeIPAddressNodeIdResponse - (*DisableNodeIPAddressRequest)(nil), // 6: pb.DisableNodeIPAddressRequest - (*DisableNodeIPAddressResponse)(nil), // 7: pb.DisableNodeIPAddressResponse - (*DisableAllIPAddressesWithNodeIdRequest)(nil), // 8: pb.DisableAllIPAddressesWithNodeIdRequest - (*DisableAllIPAddressesWithNodeIdResponse)(nil), // 9: pb.DisableAllIPAddressesWithNodeIdResponse - (*FindEnabledNodeIPAddressRequest)(nil), // 10: pb.FindEnabledNodeIPAddressRequest - (*FindEnabledNodeIPAddressResponse)(nil), // 11: pb.FindEnabledNodeIPAddressResponse - (*FindAllEnabledIPAddressesWithNodeIdRequest)(nil), // 12: pb.FindAllEnabledIPAddressesWithNodeIdRequest - (*FindAllEnabledIPAddressesWithNodeIdResponse)(nil), // 13: pb.FindAllEnabledIPAddressesWithNodeIdResponse - (*NodeIPAddress)(nil), // 14: pb.NodeIPAddress -} -var file_service_node_ip_address_proto_depIdxs = []int32{ - 14, // 0: pb.FindEnabledNodeIPAddressResponse.ipAddress:type_name -> pb.NodeIPAddress - 14, // 1: pb.FindAllEnabledIPAddressesWithNodeIdResponse.addresses:type_name -> pb.NodeIPAddress - 0, // 2: pb.NodeIPAddressService.createNodeIPAddress:input_type -> pb.CreateNodeIPAddressRequest - 2, // 3: pb.NodeIPAddressService.updateNodeIPAddress:input_type -> pb.UpdateNodeIPAddressRequest - 4, // 4: pb.NodeIPAddressService.updateNodeIPAddressNodeId:input_type -> pb.UpdateNodeIPAddressNodeIdRequest - 6, // 5: pb.NodeIPAddressService.disableNodeIPAddress:input_type -> pb.DisableNodeIPAddressRequest - 8, // 6: pb.NodeIPAddressService.disableAllIPAddressesWithNodeId:input_type -> pb.DisableAllIPAddressesWithNodeIdRequest - 10, // 7: pb.NodeIPAddressService.findEnabledNodeIPAddress:input_type -> pb.FindEnabledNodeIPAddressRequest - 12, // 8: pb.NodeIPAddressService.findAllEnabledIPAddressesWithNodeId:input_type -> pb.FindAllEnabledIPAddressesWithNodeIdRequest - 1, // 9: pb.NodeIPAddressService.createNodeIPAddress:output_type -> pb.CreateNodeIPAddressResponse - 3, // 10: pb.NodeIPAddressService.updateNodeIPAddress:output_type -> pb.UpdateNodeIPAddressResponse - 5, // 11: pb.NodeIPAddressService.updateNodeIPAddressNodeId:output_type -> pb.UpdateNodeIPAddressNodeIdResponse - 7, // 12: pb.NodeIPAddressService.disableNodeIPAddress:output_type -> pb.DisableNodeIPAddressResponse - 9, // 13: pb.NodeIPAddressService.disableAllIPAddressesWithNodeId:output_type -> pb.DisableAllIPAddressesWithNodeIdResponse - 11, // 14: pb.NodeIPAddressService.findEnabledNodeIPAddress:output_type -> pb.FindEnabledNodeIPAddressResponse - 13, // 15: pb.NodeIPAddressService.findAllEnabledIPAddressesWithNodeId:output_type -> pb.FindAllEnabledIPAddressesWithNodeIdResponse - 9, // [9:16] is the sub-list for method output_type - 2, // [2:9] is the sub-list for method input_type - 2, // [2:2] is the sub-list for extension type_name - 2, // [2:2] is the sub-list for extension extendee - 0, // [0:2] is the sub-list for field type_name -} - -func init() { file_service_node_ip_address_proto_init() } -func file_service_node_ip_address_proto_init() { - if File_service_node_ip_address_proto != nil { - return - } - file_model_node_ip_address_proto_init() - if !protoimpl.UnsafeEnabled { - file_service_node_ip_address_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreateNodeIPAddressRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_service_node_ip_address_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreateNodeIPAddressResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_service_node_ip_address_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UpdateNodeIPAddressRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_service_node_ip_address_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UpdateNodeIPAddressResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_service_node_ip_address_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UpdateNodeIPAddressNodeIdRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_service_node_ip_address_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UpdateNodeIPAddressNodeIdResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_service_node_ip_address_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DisableNodeIPAddressRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_service_node_ip_address_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DisableNodeIPAddressResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_service_node_ip_address_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DisableAllIPAddressesWithNodeIdRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_service_node_ip_address_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DisableAllIPAddressesWithNodeIdResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_service_node_ip_address_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*FindEnabledNodeIPAddressRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_service_node_ip_address_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*FindEnabledNodeIPAddressResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_service_node_ip_address_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*FindAllEnabledIPAddressesWithNodeIdRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_service_node_ip_address_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*FindAllEnabledIPAddressesWithNodeIdResponse); 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_service_node_ip_address_proto_rawDesc, - NumEnums: 0, - NumMessages: 14, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_service_node_ip_address_proto_goTypes, - DependencyIndexes: file_service_node_ip_address_proto_depIdxs, - MessageInfos: file_service_node_ip_address_proto_msgTypes, - }.Build() - File_service_node_ip_address_proto = out.File - file_service_node_ip_address_proto_rawDesc = nil - file_service_node_ip_address_proto_goTypes = nil - file_service_node_ip_address_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 - -// NodeIPAddressServiceClient is the client API for NodeIPAddressService service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type NodeIPAddressServiceClient interface { - // 创建IP地址 - CreateNodeIPAddress(ctx context.Context, in *CreateNodeIPAddressRequest, opts ...grpc.CallOption) (*CreateNodeIPAddressResponse, error) - // 修改IP地址 - UpdateNodeIPAddress(ctx context.Context, in *UpdateNodeIPAddressRequest, opts ...grpc.CallOption) (*UpdateNodeIPAddressResponse, error) - // 修改IP地址所属节点 - UpdateNodeIPAddressNodeId(ctx context.Context, in *UpdateNodeIPAddressNodeIdRequest, opts ...grpc.CallOption) (*UpdateNodeIPAddressNodeIdResponse, error) - // 禁用单个IP地址 - DisableNodeIPAddress(ctx context.Context, in *DisableNodeIPAddressRequest, opts ...grpc.CallOption) (*DisableNodeIPAddressResponse, error) - // 禁用节点的所有IP地址 - DisableAllIPAddressesWithNodeId(ctx context.Context, in *DisableAllIPAddressesWithNodeIdRequest, opts ...grpc.CallOption) (*DisableAllIPAddressesWithNodeIdResponse, error) - // 查找单个IP地址 - FindEnabledNodeIPAddress(ctx context.Context, in *FindEnabledNodeIPAddressRequest, opts ...grpc.CallOption) (*FindEnabledNodeIPAddressResponse, error) - // 查找节点的所有地址 - FindAllEnabledIPAddressesWithNodeId(ctx context.Context, in *FindAllEnabledIPAddressesWithNodeIdRequest, opts ...grpc.CallOption) (*FindAllEnabledIPAddressesWithNodeIdResponse, error) -} - -type nodeIPAddressServiceClient struct { - cc grpc.ClientConnInterface -} - -func NewNodeIPAddressServiceClient(cc grpc.ClientConnInterface) NodeIPAddressServiceClient { - return &nodeIPAddressServiceClient{cc} -} - -func (c *nodeIPAddressServiceClient) CreateNodeIPAddress(ctx context.Context, in *CreateNodeIPAddressRequest, opts ...grpc.CallOption) (*CreateNodeIPAddressResponse, error) { - out := new(CreateNodeIPAddressResponse) - err := c.cc.Invoke(ctx, "/pb.NodeIPAddressService/createNodeIPAddress", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *nodeIPAddressServiceClient) UpdateNodeIPAddress(ctx context.Context, in *UpdateNodeIPAddressRequest, opts ...grpc.CallOption) (*UpdateNodeIPAddressResponse, error) { - out := new(UpdateNodeIPAddressResponse) - err := c.cc.Invoke(ctx, "/pb.NodeIPAddressService/updateNodeIPAddress", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *nodeIPAddressServiceClient) UpdateNodeIPAddressNodeId(ctx context.Context, in *UpdateNodeIPAddressNodeIdRequest, opts ...grpc.CallOption) (*UpdateNodeIPAddressNodeIdResponse, error) { - out := new(UpdateNodeIPAddressNodeIdResponse) - err := c.cc.Invoke(ctx, "/pb.NodeIPAddressService/updateNodeIPAddressNodeId", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *nodeIPAddressServiceClient) DisableNodeIPAddress(ctx context.Context, in *DisableNodeIPAddressRequest, opts ...grpc.CallOption) (*DisableNodeIPAddressResponse, error) { - out := new(DisableNodeIPAddressResponse) - err := c.cc.Invoke(ctx, "/pb.NodeIPAddressService/disableNodeIPAddress", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *nodeIPAddressServiceClient) DisableAllIPAddressesWithNodeId(ctx context.Context, in *DisableAllIPAddressesWithNodeIdRequest, opts ...grpc.CallOption) (*DisableAllIPAddressesWithNodeIdResponse, error) { - out := new(DisableAllIPAddressesWithNodeIdResponse) - err := c.cc.Invoke(ctx, "/pb.NodeIPAddressService/disableAllIPAddressesWithNodeId", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *nodeIPAddressServiceClient) FindEnabledNodeIPAddress(ctx context.Context, in *FindEnabledNodeIPAddressRequest, opts ...grpc.CallOption) (*FindEnabledNodeIPAddressResponse, error) { - out := new(FindEnabledNodeIPAddressResponse) - err := c.cc.Invoke(ctx, "/pb.NodeIPAddressService/findEnabledNodeIPAddress", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *nodeIPAddressServiceClient) FindAllEnabledIPAddressesWithNodeId(ctx context.Context, in *FindAllEnabledIPAddressesWithNodeIdRequest, opts ...grpc.CallOption) (*FindAllEnabledIPAddressesWithNodeIdResponse, error) { - out := new(FindAllEnabledIPAddressesWithNodeIdResponse) - err := c.cc.Invoke(ctx, "/pb.NodeIPAddressService/findAllEnabledIPAddressesWithNodeId", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// NodeIPAddressServiceServer is the server API for NodeIPAddressService service. -type NodeIPAddressServiceServer interface { - // 创建IP地址 - CreateNodeIPAddress(context.Context, *CreateNodeIPAddressRequest) (*CreateNodeIPAddressResponse, error) - // 修改IP地址 - UpdateNodeIPAddress(context.Context, *UpdateNodeIPAddressRequest) (*UpdateNodeIPAddressResponse, error) - // 修改IP地址所属节点 - UpdateNodeIPAddressNodeId(context.Context, *UpdateNodeIPAddressNodeIdRequest) (*UpdateNodeIPAddressNodeIdResponse, error) - // 禁用单个IP地址 - DisableNodeIPAddress(context.Context, *DisableNodeIPAddressRequest) (*DisableNodeIPAddressResponse, error) - // 禁用节点的所有IP地址 - DisableAllIPAddressesWithNodeId(context.Context, *DisableAllIPAddressesWithNodeIdRequest) (*DisableAllIPAddressesWithNodeIdResponse, error) - // 查找单个IP地址 - FindEnabledNodeIPAddress(context.Context, *FindEnabledNodeIPAddressRequest) (*FindEnabledNodeIPAddressResponse, error) - // 查找节点的所有地址 - FindAllEnabledIPAddressesWithNodeId(context.Context, *FindAllEnabledIPAddressesWithNodeIdRequest) (*FindAllEnabledIPAddressesWithNodeIdResponse, error) -} - -// UnimplementedNodeIPAddressServiceServer can be embedded to have forward compatible implementations. -type UnimplementedNodeIPAddressServiceServer struct { -} - -func (*UnimplementedNodeIPAddressServiceServer) CreateNodeIPAddress(context.Context, *CreateNodeIPAddressRequest) (*CreateNodeIPAddressResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method CreateNodeIPAddress not implemented") -} -func (*UnimplementedNodeIPAddressServiceServer) UpdateNodeIPAddress(context.Context, *UpdateNodeIPAddressRequest) (*UpdateNodeIPAddressResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method UpdateNodeIPAddress not implemented") -} -func (*UnimplementedNodeIPAddressServiceServer) UpdateNodeIPAddressNodeId(context.Context, *UpdateNodeIPAddressNodeIdRequest) (*UpdateNodeIPAddressNodeIdResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method UpdateNodeIPAddressNodeId not implemented") -} -func (*UnimplementedNodeIPAddressServiceServer) DisableNodeIPAddress(context.Context, *DisableNodeIPAddressRequest) (*DisableNodeIPAddressResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method DisableNodeIPAddress not implemented") -} -func (*UnimplementedNodeIPAddressServiceServer) DisableAllIPAddressesWithNodeId(context.Context, *DisableAllIPAddressesWithNodeIdRequest) (*DisableAllIPAddressesWithNodeIdResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method DisableAllIPAddressesWithNodeId not implemented") -} -func (*UnimplementedNodeIPAddressServiceServer) FindEnabledNodeIPAddress(context.Context, *FindEnabledNodeIPAddressRequest) (*FindEnabledNodeIPAddressResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method FindEnabledNodeIPAddress not implemented") -} -func (*UnimplementedNodeIPAddressServiceServer) FindAllEnabledIPAddressesWithNodeId(context.Context, *FindAllEnabledIPAddressesWithNodeIdRequest) (*FindAllEnabledIPAddressesWithNodeIdResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method FindAllEnabledIPAddressesWithNodeId not implemented") -} - -func RegisterNodeIPAddressServiceServer(s *grpc.Server, srv NodeIPAddressServiceServer) { - s.RegisterService(&_NodeIPAddressService_serviceDesc, srv) -} - -func _NodeIPAddressService_CreateNodeIPAddress_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(CreateNodeIPAddressRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(NodeIPAddressServiceServer).CreateNodeIPAddress(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/pb.NodeIPAddressService/CreateNodeIPAddress", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(NodeIPAddressServiceServer).CreateNodeIPAddress(ctx, req.(*CreateNodeIPAddressRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _NodeIPAddressService_UpdateNodeIPAddress_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(UpdateNodeIPAddressRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(NodeIPAddressServiceServer).UpdateNodeIPAddress(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/pb.NodeIPAddressService/UpdateNodeIPAddress", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(NodeIPAddressServiceServer).UpdateNodeIPAddress(ctx, req.(*UpdateNodeIPAddressRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _NodeIPAddressService_UpdateNodeIPAddressNodeId_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(UpdateNodeIPAddressNodeIdRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(NodeIPAddressServiceServer).UpdateNodeIPAddressNodeId(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/pb.NodeIPAddressService/UpdateNodeIPAddressNodeId", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(NodeIPAddressServiceServer).UpdateNodeIPAddressNodeId(ctx, req.(*UpdateNodeIPAddressNodeIdRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _NodeIPAddressService_DisableNodeIPAddress_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DisableNodeIPAddressRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(NodeIPAddressServiceServer).DisableNodeIPAddress(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/pb.NodeIPAddressService/DisableNodeIPAddress", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(NodeIPAddressServiceServer).DisableNodeIPAddress(ctx, req.(*DisableNodeIPAddressRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _NodeIPAddressService_DisableAllIPAddressesWithNodeId_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DisableAllIPAddressesWithNodeIdRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(NodeIPAddressServiceServer).DisableAllIPAddressesWithNodeId(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/pb.NodeIPAddressService/DisableAllIPAddressesWithNodeId", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(NodeIPAddressServiceServer).DisableAllIPAddressesWithNodeId(ctx, req.(*DisableAllIPAddressesWithNodeIdRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _NodeIPAddressService_FindEnabledNodeIPAddress_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(FindEnabledNodeIPAddressRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(NodeIPAddressServiceServer).FindEnabledNodeIPAddress(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/pb.NodeIPAddressService/FindEnabledNodeIPAddress", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(NodeIPAddressServiceServer).FindEnabledNodeIPAddress(ctx, req.(*FindEnabledNodeIPAddressRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _NodeIPAddressService_FindAllEnabledIPAddressesWithNodeId_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(FindAllEnabledIPAddressesWithNodeIdRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(NodeIPAddressServiceServer).FindAllEnabledIPAddressesWithNodeId(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/pb.NodeIPAddressService/FindAllEnabledIPAddressesWithNodeId", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(NodeIPAddressServiceServer).FindAllEnabledIPAddressesWithNodeId(ctx, req.(*FindAllEnabledIPAddressesWithNodeIdRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _NodeIPAddressService_serviceDesc = grpc.ServiceDesc{ - ServiceName: "pb.NodeIPAddressService", - HandlerType: (*NodeIPAddressServiceServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "createNodeIPAddress", - Handler: _NodeIPAddressService_CreateNodeIPAddress_Handler, - }, - { - MethodName: "updateNodeIPAddress", - Handler: _NodeIPAddressService_UpdateNodeIPAddress_Handler, - }, - { - MethodName: "updateNodeIPAddressNodeId", - Handler: _NodeIPAddressService_UpdateNodeIPAddressNodeId_Handler, - }, - { - MethodName: "disableNodeIPAddress", - Handler: _NodeIPAddressService_DisableNodeIPAddress_Handler, - }, - { - MethodName: "disableAllIPAddressesWithNodeId", - Handler: _NodeIPAddressService_DisableAllIPAddressesWithNodeId_Handler, - }, - { - MethodName: "findEnabledNodeIPAddress", - Handler: _NodeIPAddressService_FindEnabledNodeIPAddress_Handler, - }, - { - MethodName: "findAllEnabledIPAddressesWithNodeId", - Handler: _NodeIPAddressService_FindAllEnabledIPAddressesWithNodeId_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "service_node_ip_address.proto", -} diff --git a/internal/rpc/pb/service_node_region.pb.go b/internal/rpc/pb/service_node_region.pb.go deleted file mode 100644 index 2ced8732..00000000 --- a/internal/rpc/pb/service_node_region.pb.go +++ /dev/null @@ -1,66 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.25.0 -// protoc v3.12.3 -// source: service_node_region.proto - -package pb - -import ( - proto "github.com/golang/protobuf/proto" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" -) - -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 - -var File_service_node_region_proto protoreflect.FileDescriptor - -var file_service_node_region_proto_rawDesc = []byte{ - 0x0a, 0x19, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x72, - 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, 0x62, 0x42, - 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var file_service_node_region_proto_goTypes = []interface{}{} -var file_service_node_region_proto_depIdxs = []int32{ - 0, // [0:0] is the sub-list for method output_type - 0, // [0:0] 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_service_node_region_proto_init() } -func file_service_node_region_proto_init() { - if File_service_node_region_proto != nil { - return - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_service_node_region_proto_rawDesc, - NumEnums: 0, - NumMessages: 0, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_service_node_region_proto_goTypes, - DependencyIndexes: file_service_node_region_proto_depIdxs, - }.Build() - File_service_node_region_proto = out.File - file_service_node_region_proto_rawDesc = nil - file_service_node_region_proto_goTypes = nil - file_service_node_region_proto_depIdxs = nil -} diff --git a/internal/rpc/pb/service_server.pb.go b/internal/rpc/pb/service_server.pb.go deleted file mode 100644 index 5f973082..00000000 --- a/internal/rpc/pb/service_server.pb.go +++ /dev/null @@ -1,1263 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.25.0 -// protoc v3.12.3 -// source: service_server.proto - -package pb - -import ( - context "context" - proto "github.com/golang/protobuf/proto" - 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" - 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) -) - -// 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 CreateServerRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - UserId int64 `protobuf:"varint,1,opt,name=userId,proto3" json:"userId,omitempty"` - AdminId int64 `protobuf:"varint,2,opt,name=adminId,proto3" json:"adminId,omitempty"` - ClusterId int64 `protobuf:"varint,6,opt,name=clusterId,proto3" json:"clusterId,omitempty"` - Config []byte `protobuf:"bytes,3,opt,name=config,proto3" json:"config,omitempty"` - IncludeNodesJSON []byte `protobuf:"bytes,4,opt,name=includeNodesJSON,proto3" json:"includeNodesJSON,omitempty"` - ExcludeNodesJSON []byte `protobuf:"bytes,5,opt,name=excludeNodesJSON,proto3" json:"excludeNodesJSON,omitempty"` -} - -func (x *CreateServerRequest) Reset() { - *x = CreateServerRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_service_server_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CreateServerRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CreateServerRequest) ProtoMessage() {} - -func (x *CreateServerRequest) ProtoReflect() protoreflect.Message { - mi := &file_service_server_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 CreateServerRequest.ProtoReflect.Descriptor instead. -func (*CreateServerRequest) Descriptor() ([]byte, []int) { - return file_service_server_proto_rawDescGZIP(), []int{0} -} - -func (x *CreateServerRequest) GetUserId() int64 { - if x != nil { - return x.UserId - } - return 0 -} - -func (x *CreateServerRequest) GetAdminId() int64 { - if x != nil { - return x.AdminId - } - return 0 -} - -func (x *CreateServerRequest) GetClusterId() int64 { - if x != nil { - return x.ClusterId - } - return 0 -} - -func (x *CreateServerRequest) GetConfig() []byte { - if x != nil { - return x.Config - } - return nil -} - -func (x *CreateServerRequest) GetIncludeNodesJSON() []byte { - if x != nil { - return x.IncludeNodesJSON - } - return nil -} - -func (x *CreateServerRequest) GetExcludeNodesJSON() []byte { - if x != nil { - return x.ExcludeNodesJSON - } - return nil -} - -type CreateServerResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - ServerId int64 `protobuf:"varint,1,opt,name=serverId,proto3" json:"serverId,omitempty"` -} - -func (x *CreateServerResponse) Reset() { - *x = CreateServerResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_service_server_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CreateServerResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CreateServerResponse) ProtoMessage() {} - -func (x *CreateServerResponse) ProtoReflect() protoreflect.Message { - mi := &file_service_server_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) -} - -// Deprecated: Use CreateServerResponse.ProtoReflect.Descriptor instead. -func (*CreateServerResponse) Descriptor() ([]byte, []int) { - return file_service_server_proto_rawDescGZIP(), []int{1} -} - -func (x *CreateServerResponse) GetServerId() int64 { - if x != nil { - return x.ServerId - } - return 0 -} - -// 修改服务 -type UpdateServerRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - ServerId int64 `protobuf:"varint,1,opt,name=serverId,proto3" json:"serverId,omitempty"` - UserId int64 `protobuf:"varint,2,opt,name=userId,proto3" json:"userId,omitempty"` - AdminId int64 `protobuf:"varint,3,opt,name=adminId,proto3" json:"adminId,omitempty"` - ClusterId int64 `protobuf:"varint,4,opt,name=clusterId,proto3" json:"clusterId,omitempty"` - Config []byte `protobuf:"bytes,5,opt,name=config,proto3" json:"config,omitempty"` - IncludeNodesJSON []byte `protobuf:"bytes,6,opt,name=includeNodesJSON,proto3" json:"includeNodesJSON,omitempty"` - ExcludeNodesJSON []byte `protobuf:"bytes,7,opt,name=excludeNodesJSON,proto3" json:"excludeNodesJSON,omitempty"` -} - -func (x *UpdateServerRequest) Reset() { - *x = UpdateServerRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_service_server_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *UpdateServerRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UpdateServerRequest) ProtoMessage() {} - -func (x *UpdateServerRequest) ProtoReflect() protoreflect.Message { - mi := &file_service_server_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) -} - -// Deprecated: Use UpdateServerRequest.ProtoReflect.Descriptor instead. -func (*UpdateServerRequest) Descriptor() ([]byte, []int) { - return file_service_server_proto_rawDescGZIP(), []int{2} -} - -func (x *UpdateServerRequest) GetServerId() int64 { - if x != nil { - return x.ServerId - } - return 0 -} - -func (x *UpdateServerRequest) GetUserId() int64 { - if x != nil { - return x.UserId - } - return 0 -} - -func (x *UpdateServerRequest) GetAdminId() int64 { - if x != nil { - return x.AdminId - } - return 0 -} - -func (x *UpdateServerRequest) GetClusterId() int64 { - if x != nil { - return x.ClusterId - } - return 0 -} - -func (x *UpdateServerRequest) GetConfig() []byte { - if x != nil { - return x.Config - } - return nil -} - -func (x *UpdateServerRequest) GetIncludeNodesJSON() []byte { - if x != nil { - return x.IncludeNodesJSON - } - return nil -} - -func (x *UpdateServerRequest) GetExcludeNodesJSON() []byte { - if x != nil { - return x.ExcludeNodesJSON - } - return nil -} - -type UpdateServerResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *UpdateServerResponse) Reset() { - *x = UpdateServerResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_service_server_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *UpdateServerResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UpdateServerResponse) ProtoMessage() {} - -func (x *UpdateServerResponse) ProtoReflect() protoreflect.Message { - mi := &file_service_server_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) -} - -// Deprecated: Use UpdateServerResponse.ProtoReflect.Descriptor instead. -func (*UpdateServerResponse) Descriptor() ([]byte, []int) { - return file_service_server_proto_rawDescGZIP(), []int{3} -} - -// 计算服务数量 -type CountAllEnabledServersRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *CountAllEnabledServersRequest) Reset() { - *x = CountAllEnabledServersRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_service_server_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CountAllEnabledServersRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CountAllEnabledServersRequest) ProtoMessage() {} - -func (x *CountAllEnabledServersRequest) ProtoReflect() protoreflect.Message { - mi := &file_service_server_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) -} - -// Deprecated: Use CountAllEnabledServersRequest.ProtoReflect.Descriptor instead. -func (*CountAllEnabledServersRequest) Descriptor() ([]byte, []int) { - return file_service_server_proto_rawDescGZIP(), []int{4} -} - -type CountAllEnabledServersResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Count int64 `protobuf:"varint,1,opt,name=count,proto3" json:"count,omitempty"` -} - -func (x *CountAllEnabledServersResponse) Reset() { - *x = CountAllEnabledServersResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_service_server_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CountAllEnabledServersResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CountAllEnabledServersResponse) ProtoMessage() {} - -func (x *CountAllEnabledServersResponse) ProtoReflect() protoreflect.Message { - mi := &file_service_server_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) -} - -// Deprecated: Use CountAllEnabledServersResponse.ProtoReflect.Descriptor instead. -func (*CountAllEnabledServersResponse) Descriptor() ([]byte, []int) { - return file_service_server_proto_rawDescGZIP(), []int{5} -} - -func (x *CountAllEnabledServersResponse) GetCount() int64 { - if x != nil { - return x.Count - } - return 0 -} - -// 列出单页服务 -type ListEnabledServersRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Offset int64 `protobuf:"varint,1,opt,name=offset,proto3" json:"offset,omitempty"` - Size int64 `protobuf:"varint,2,opt,name=size,proto3" json:"size,omitempty"` -} - -func (x *ListEnabledServersRequest) Reset() { - *x = ListEnabledServersRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_service_server_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListEnabledServersRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListEnabledServersRequest) ProtoMessage() {} - -func (x *ListEnabledServersRequest) ProtoReflect() protoreflect.Message { - mi := &file_service_server_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) -} - -// Deprecated: Use ListEnabledServersRequest.ProtoReflect.Descriptor instead. -func (*ListEnabledServersRequest) Descriptor() ([]byte, []int) { - return file_service_server_proto_rawDescGZIP(), []int{6} -} - -func (x *ListEnabledServersRequest) GetOffset() int64 { - if x != nil { - return x.Offset - } - return 0 -} - -func (x *ListEnabledServersRequest) GetSize() int64 { - if x != nil { - return x.Size - } - return 0 -} - -type ListEnabledServersResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Servers []*Server `protobuf:"bytes,1,rep,name=servers,proto3" json:"servers,omitempty"` -} - -func (x *ListEnabledServersResponse) Reset() { - *x = ListEnabledServersResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_service_server_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListEnabledServersResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListEnabledServersResponse) ProtoMessage() {} - -func (x *ListEnabledServersResponse) ProtoReflect() protoreflect.Message { - mi := &file_service_server_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) -} - -// Deprecated: Use ListEnabledServersResponse.ProtoReflect.Descriptor instead. -func (*ListEnabledServersResponse) Descriptor() ([]byte, []int) { - return file_service_server_proto_rawDescGZIP(), []int{7} -} - -func (x *ListEnabledServersResponse) GetServers() []*Server { - if x != nil { - return x.Servers - } - return nil -} - -// 禁用服务 -type DisableServerRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - ServerId int64 `protobuf:"varint,1,opt,name=serverId,proto3" json:"serverId,omitempty"` -} - -func (x *DisableServerRequest) Reset() { - *x = DisableServerRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_service_server_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *DisableServerRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DisableServerRequest) ProtoMessage() {} - -func (x *DisableServerRequest) ProtoReflect() protoreflect.Message { - mi := &file_service_server_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) -} - -// Deprecated: Use DisableServerRequest.ProtoReflect.Descriptor instead. -func (*DisableServerRequest) Descriptor() ([]byte, []int) { - return file_service_server_proto_rawDescGZIP(), []int{8} -} - -func (x *DisableServerRequest) GetServerId() int64 { - if x != nil { - return x.ServerId - } - return 0 -} - -type DisableServerResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *DisableServerResponse) Reset() { - *x = DisableServerResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_service_server_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *DisableServerResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DisableServerResponse) ProtoMessage() {} - -func (x *DisableServerResponse) ProtoReflect() protoreflect.Message { - mi := &file_service_server_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) -} - -// Deprecated: Use DisableServerResponse.ProtoReflect.Descriptor instead. -func (*DisableServerResponse) Descriptor() ([]byte, []int) { - return file_service_server_proto_rawDescGZIP(), []int{9} -} - -// 查找单个服务 -type FindEnabledServerRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - ServerId int64 `protobuf:"varint,1,opt,name=serverId,proto3" json:"serverId,omitempty"` -} - -func (x *FindEnabledServerRequest) Reset() { - *x = FindEnabledServerRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_service_server_proto_msgTypes[10] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *FindEnabledServerRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*FindEnabledServerRequest) ProtoMessage() {} - -func (x *FindEnabledServerRequest) ProtoReflect() protoreflect.Message { - mi := &file_service_server_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) -} - -// Deprecated: Use FindEnabledServerRequest.ProtoReflect.Descriptor instead. -func (*FindEnabledServerRequest) Descriptor() ([]byte, []int) { - return file_service_server_proto_rawDescGZIP(), []int{10} -} - -func (x *FindEnabledServerRequest) GetServerId() int64 { - if x != nil { - return x.ServerId - } - return 0 -} - -type FindEnabledServerResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Server *Server `protobuf:"bytes,1,opt,name=server,proto3" json:"server,omitempty"` -} - -func (x *FindEnabledServerResponse) Reset() { - *x = FindEnabledServerResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_service_server_proto_msgTypes[11] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *FindEnabledServerResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*FindEnabledServerResponse) ProtoMessage() {} - -func (x *FindEnabledServerResponse) ProtoReflect() protoreflect.Message { - mi := &file_service_server_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) -} - -// Deprecated: Use FindEnabledServerResponse.ProtoReflect.Descriptor instead. -func (*FindEnabledServerResponse) Descriptor() ([]byte, []int) { - return file_service_server_proto_rawDescGZIP(), []int{11} -} - -func (x *FindEnabledServerResponse) GetServer() *Server { - if x != nil { - return x.Server - } - return nil -} - -var File_service_server_proto protoreflect.FileDescriptor - -var file_service_server_proto_rawDesc = []byte{ - 0x0a, 0x14, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, 0x62, 0x1a, 0x12, 0x6d, 0x6f, 0x64, 0x65, - 0x6c, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xd5, - 0x01, 0x0a, 0x13, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x18, - 0x0a, 0x07, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, - 0x07, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x49, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x6c, 0x75, 0x73, - 0x74, 0x65, 0x72, 0x49, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x63, 0x6c, 0x75, - 0x73, 0x74, 0x65, 0x72, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x2a, - 0x0a, 0x10, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x4a, 0x53, - 0x4f, 0x4e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x10, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, - 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x4a, 0x53, 0x4f, 0x4e, 0x12, 0x2a, 0x0a, 0x10, 0x65, 0x78, - 0x63, 0x6c, 0x75, 0x64, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x4a, 0x53, 0x4f, 0x4e, 0x18, 0x05, - 0x20, 0x01, 0x28, 0x0c, 0x52, 0x10, 0x65, 0x78, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x4e, 0x6f, 0x64, - 0x65, 0x73, 0x4a, 0x53, 0x4f, 0x4e, 0x22, 0x32, 0x0a, 0x14, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, - 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1a, - 0x0a, 0x08, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, - 0x52, 0x08, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x49, 0x64, 0x22, 0xf1, 0x01, 0x0a, 0x13, 0x55, - 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x49, 0x64, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x49, 0x64, 0x12, 0x16, - 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, - 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x49, - 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x49, 0x64, - 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x64, 0x18, 0x04, 0x20, - 0x01, 0x28, 0x03, 0x52, 0x09, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x64, 0x12, 0x16, - 0x0a, 0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, - 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x2a, 0x0a, 0x10, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, - 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x4a, 0x53, 0x4f, 0x4e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0c, - 0x52, 0x10, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x4a, 0x53, - 0x4f, 0x4e, 0x12, 0x2a, 0x0a, 0x10, 0x65, 0x78, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x4e, 0x6f, 0x64, - 0x65, 0x73, 0x4a, 0x53, 0x4f, 0x4e, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x10, 0x65, 0x78, - 0x63, 0x6c, 0x75, 0x64, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x4a, 0x53, 0x4f, 0x4e, 0x22, 0x16, - 0x0a, 0x14, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1f, 0x0a, 0x1d, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x41, - 0x6c, 0x6c, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x73, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x36, 0x0a, 0x1e, 0x43, 0x6f, 0x75, 0x6e, 0x74, - 0x41, 0x6c, 0x6c, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, - 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, - 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x22, - 0x47, 0x0a, 0x19, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x53, 0x65, - 0x72, 0x76, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, - 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x6f, 0x66, - 0x66, 0x73, 0x65, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x03, 0x52, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x22, 0x42, 0x0a, 0x1a, 0x4c, 0x69, 0x73, 0x74, - 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x73, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x24, 0x0a, 0x07, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, - 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x70, 0x62, 0x2e, 0x53, 0x65, 0x72, - 0x76, 0x65, 0x72, 0x52, 0x07, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x73, 0x22, 0x32, 0x0a, 0x14, - 0x44, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x49, 0x64, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x49, 0x64, - 0x22, 0x17, 0x0a, 0x15, 0x44, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x53, 0x65, 0x72, 0x76, 0x65, - 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x36, 0x0a, 0x18, 0x46, 0x69, 0x6e, - 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x49, - 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x49, - 0x64, 0x22, 0x3f, 0x0a, 0x19, 0x46, 0x69, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, - 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x22, - 0x0a, 0x06, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0a, - 0x2e, 0x70, 0x62, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x52, 0x06, 0x73, 0x65, 0x72, 0x76, - 0x65, 0x72, 0x32, 0xe3, 0x03, 0x0a, 0x0d, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x53, 0x65, 0x72, - 0x76, 0x69, 0x63, 0x65, 0x12, 0x41, 0x0a, 0x0c, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x65, - 0x72, 0x76, 0x65, 0x72, 0x12, 0x17, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, - 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, - 0x70, 0x62, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x41, 0x0a, 0x0c, 0x75, 0x70, 0x64, 0x61, 0x74, - 0x65, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x12, 0x17, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, - 0x61, 0x74, 0x65, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x18, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x65, 0x72, 0x76, - 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x5f, 0x0a, 0x16, 0x63, 0x6f, - 0x75, 0x6e, 0x74, 0x41, 0x6c, 0x6c, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x53, 0x65, 0x72, - 0x76, 0x65, 0x72, 0x73, 0x12, 0x21, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x41, - 0x6c, 0x6c, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x73, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x22, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x6f, 0x75, - 0x6e, 0x74, 0x41, 0x6c, 0x6c, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x53, 0x65, 0x72, 0x76, - 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x53, 0x0a, 0x12, 0x6c, - 0x69, 0x73, 0x74, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, - 0x73, 0x12, 0x1d, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x6e, 0x61, 0x62, 0x6c, - 0x65, 0x64, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x1e, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, - 0x64, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x44, 0x0a, 0x0d, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x53, 0x65, 0x72, 0x76, 0x65, - 0x72, 0x12, 0x18, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x53, 0x65, - 0x72, 0x76, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x70, 0x62, - 0x2e, 0x44, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x50, 0x0a, 0x11, 0x66, 0x69, 0x6e, 0x64, 0x45, 0x6e, - 0x61, 0x62, 0x6c, 0x65, 0x64, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x12, 0x1c, 0x2e, 0x70, 0x62, - 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x53, 0x65, 0x72, 0x76, - 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x70, 0x62, 0x2e, 0x46, - 0x69, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62, - 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_service_server_proto_rawDescOnce sync.Once - file_service_server_proto_rawDescData = file_service_server_proto_rawDesc -) - -func file_service_server_proto_rawDescGZIP() []byte { - file_service_server_proto_rawDescOnce.Do(func() { - file_service_server_proto_rawDescData = protoimpl.X.CompressGZIP(file_service_server_proto_rawDescData) - }) - return file_service_server_proto_rawDescData -} - -var file_service_server_proto_msgTypes = make([]protoimpl.MessageInfo, 12) -var file_service_server_proto_goTypes = []interface{}{ - (*CreateServerRequest)(nil), // 0: pb.CreateServerRequest - (*CreateServerResponse)(nil), // 1: pb.CreateServerResponse - (*UpdateServerRequest)(nil), // 2: pb.UpdateServerRequest - (*UpdateServerResponse)(nil), // 3: pb.UpdateServerResponse - (*CountAllEnabledServersRequest)(nil), // 4: pb.CountAllEnabledServersRequest - (*CountAllEnabledServersResponse)(nil), // 5: pb.CountAllEnabledServersResponse - (*ListEnabledServersRequest)(nil), // 6: pb.ListEnabledServersRequest - (*ListEnabledServersResponse)(nil), // 7: pb.ListEnabledServersResponse - (*DisableServerRequest)(nil), // 8: pb.DisableServerRequest - (*DisableServerResponse)(nil), // 9: pb.DisableServerResponse - (*FindEnabledServerRequest)(nil), // 10: pb.FindEnabledServerRequest - (*FindEnabledServerResponse)(nil), // 11: pb.FindEnabledServerResponse - (*Server)(nil), // 12: pb.Server -} -var file_service_server_proto_depIdxs = []int32{ - 12, // 0: pb.ListEnabledServersResponse.servers:type_name -> pb.Server - 12, // 1: pb.FindEnabledServerResponse.server:type_name -> pb.Server - 0, // 2: pb.ServerService.createServer:input_type -> pb.CreateServerRequest - 2, // 3: pb.ServerService.updateServer:input_type -> pb.UpdateServerRequest - 4, // 4: pb.ServerService.countAllEnabledServers:input_type -> pb.CountAllEnabledServersRequest - 6, // 5: pb.ServerService.listEnabledServers:input_type -> pb.ListEnabledServersRequest - 8, // 6: pb.ServerService.disableServer:input_type -> pb.DisableServerRequest - 10, // 7: pb.ServerService.findEnabledServer:input_type -> pb.FindEnabledServerRequest - 1, // 8: pb.ServerService.createServer:output_type -> pb.CreateServerResponse - 3, // 9: pb.ServerService.updateServer:output_type -> pb.UpdateServerResponse - 5, // 10: pb.ServerService.countAllEnabledServers:output_type -> pb.CountAllEnabledServersResponse - 7, // 11: pb.ServerService.listEnabledServers:output_type -> pb.ListEnabledServersResponse - 9, // 12: pb.ServerService.disableServer:output_type -> pb.DisableServerResponse - 11, // 13: pb.ServerService.findEnabledServer:output_type -> pb.FindEnabledServerResponse - 8, // [8:14] is the sub-list for method output_type - 2, // [2:8] is the sub-list for method input_type - 2, // [2:2] is the sub-list for extension type_name - 2, // [2:2] is the sub-list for extension extendee - 0, // [0:2] is the sub-list for field type_name -} - -func init() { file_service_server_proto_init() } -func file_service_server_proto_init() { - if File_service_server_proto != nil { - return - } - file_model_server_proto_init() - if !protoimpl.UnsafeEnabled { - file_service_server_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreateServerRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_service_server_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreateServerResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_service_server_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UpdateServerRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_service_server_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UpdateServerResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_service_server_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CountAllEnabledServersRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_service_server_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CountAllEnabledServersResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_service_server_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListEnabledServersRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_service_server_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListEnabledServersResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_service_server_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DisableServerRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_service_server_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DisableServerResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_service_server_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*FindEnabledServerRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_service_server_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*FindEnabledServerResponse); 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_service_server_proto_rawDesc, - NumEnums: 0, - NumMessages: 12, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_service_server_proto_goTypes, - DependencyIndexes: file_service_server_proto_depIdxs, - MessageInfos: file_service_server_proto_msgTypes, - }.Build() - File_service_server_proto = out.File - file_service_server_proto_rawDesc = nil - file_service_server_proto_goTypes = nil - file_service_server_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 - -// ServerServiceClient is the client API for ServerService service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type ServerServiceClient interface { - // 创建服务 - CreateServer(ctx context.Context, in *CreateServerRequest, opts ...grpc.CallOption) (*CreateServerResponse, error) - // 修改服务 - UpdateServer(ctx context.Context, in *UpdateServerRequest, opts ...grpc.CallOption) (*UpdateServerResponse, error) - // 计算服务数量 - CountAllEnabledServers(ctx context.Context, in *CountAllEnabledServersRequest, opts ...grpc.CallOption) (*CountAllEnabledServersResponse, error) - // 列出单页服务 - ListEnabledServers(ctx context.Context, in *ListEnabledServersRequest, opts ...grpc.CallOption) (*ListEnabledServersResponse, error) - // 禁用某服务 - DisableServer(ctx context.Context, in *DisableServerRequest, opts ...grpc.CallOption) (*DisableServerResponse, error) - // 查找单个服务 - FindEnabledServer(ctx context.Context, in *FindEnabledServerRequest, opts ...grpc.CallOption) (*FindEnabledServerResponse, error) -} - -type serverServiceClient struct { - cc grpc.ClientConnInterface -} - -func NewServerServiceClient(cc grpc.ClientConnInterface) ServerServiceClient { - return &serverServiceClient{cc} -} - -func (c *serverServiceClient) CreateServer(ctx context.Context, in *CreateServerRequest, opts ...grpc.CallOption) (*CreateServerResponse, error) { - out := new(CreateServerResponse) - err := c.cc.Invoke(ctx, "/pb.ServerService/createServer", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *serverServiceClient) UpdateServer(ctx context.Context, in *UpdateServerRequest, opts ...grpc.CallOption) (*UpdateServerResponse, error) { - out := new(UpdateServerResponse) - err := c.cc.Invoke(ctx, "/pb.ServerService/updateServer", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *serverServiceClient) CountAllEnabledServers(ctx context.Context, in *CountAllEnabledServersRequest, opts ...grpc.CallOption) (*CountAllEnabledServersResponse, error) { - out := new(CountAllEnabledServersResponse) - err := c.cc.Invoke(ctx, "/pb.ServerService/countAllEnabledServers", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *serverServiceClient) ListEnabledServers(ctx context.Context, in *ListEnabledServersRequest, opts ...grpc.CallOption) (*ListEnabledServersResponse, error) { - out := new(ListEnabledServersResponse) - err := c.cc.Invoke(ctx, "/pb.ServerService/listEnabledServers", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *serverServiceClient) DisableServer(ctx context.Context, in *DisableServerRequest, opts ...grpc.CallOption) (*DisableServerResponse, error) { - out := new(DisableServerResponse) - err := c.cc.Invoke(ctx, "/pb.ServerService/disableServer", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *serverServiceClient) FindEnabledServer(ctx context.Context, in *FindEnabledServerRequest, opts ...grpc.CallOption) (*FindEnabledServerResponse, error) { - out := new(FindEnabledServerResponse) - err := c.cc.Invoke(ctx, "/pb.ServerService/findEnabledServer", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// ServerServiceServer is the server API for ServerService service. -type ServerServiceServer interface { - // 创建服务 - CreateServer(context.Context, *CreateServerRequest) (*CreateServerResponse, error) - // 修改服务 - UpdateServer(context.Context, *UpdateServerRequest) (*UpdateServerResponse, error) - // 计算服务数量 - CountAllEnabledServers(context.Context, *CountAllEnabledServersRequest) (*CountAllEnabledServersResponse, error) - // 列出单页服务 - ListEnabledServers(context.Context, *ListEnabledServersRequest) (*ListEnabledServersResponse, error) - // 禁用某服务 - DisableServer(context.Context, *DisableServerRequest) (*DisableServerResponse, error) - // 查找单个服务 - FindEnabledServer(context.Context, *FindEnabledServerRequest) (*FindEnabledServerResponse, error) -} - -// UnimplementedServerServiceServer can be embedded to have forward compatible implementations. -type UnimplementedServerServiceServer struct { -} - -func (*UnimplementedServerServiceServer) CreateServer(context.Context, *CreateServerRequest) (*CreateServerResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method CreateServer not implemented") -} -func (*UnimplementedServerServiceServer) UpdateServer(context.Context, *UpdateServerRequest) (*UpdateServerResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method UpdateServer not implemented") -} -func (*UnimplementedServerServiceServer) CountAllEnabledServers(context.Context, *CountAllEnabledServersRequest) (*CountAllEnabledServersResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method CountAllEnabledServers not implemented") -} -func (*UnimplementedServerServiceServer) ListEnabledServers(context.Context, *ListEnabledServersRequest) (*ListEnabledServersResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ListEnabledServers not implemented") -} -func (*UnimplementedServerServiceServer) DisableServer(context.Context, *DisableServerRequest) (*DisableServerResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method DisableServer not implemented") -} -func (*UnimplementedServerServiceServer) FindEnabledServer(context.Context, *FindEnabledServerRequest) (*FindEnabledServerResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method FindEnabledServer not implemented") -} - -func RegisterServerServiceServer(s *grpc.Server, srv ServerServiceServer) { - s.RegisterService(&_ServerService_serviceDesc, srv) -} - -func _ServerService_CreateServer_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(CreateServerRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ServerServiceServer).CreateServer(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/pb.ServerService/CreateServer", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ServerServiceServer).CreateServer(ctx, req.(*CreateServerRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _ServerService_UpdateServer_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(UpdateServerRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ServerServiceServer).UpdateServer(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/pb.ServerService/UpdateServer", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ServerServiceServer).UpdateServer(ctx, req.(*UpdateServerRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _ServerService_CountAllEnabledServers_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(CountAllEnabledServersRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ServerServiceServer).CountAllEnabledServers(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/pb.ServerService/CountAllEnabledServers", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ServerServiceServer).CountAllEnabledServers(ctx, req.(*CountAllEnabledServersRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _ServerService_ListEnabledServers_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ListEnabledServersRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ServerServiceServer).ListEnabledServers(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/pb.ServerService/ListEnabledServers", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ServerServiceServer).ListEnabledServers(ctx, req.(*ListEnabledServersRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _ServerService_DisableServer_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DisableServerRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ServerServiceServer).DisableServer(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/pb.ServerService/DisableServer", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ServerServiceServer).DisableServer(ctx, req.(*DisableServerRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _ServerService_FindEnabledServer_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(FindEnabledServerRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ServerServiceServer).FindEnabledServer(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/pb.ServerService/FindEnabledServer", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ServerServiceServer).FindEnabledServer(ctx, req.(*FindEnabledServerRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _ServerService_serviceDesc = grpc.ServiceDesc{ - ServiceName: "pb.ServerService", - HandlerType: (*ServerServiceServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "createServer", - Handler: _ServerService_CreateServer_Handler, - }, - { - MethodName: "updateServer", - Handler: _ServerService_UpdateServer_Handler, - }, - { - MethodName: "countAllEnabledServers", - Handler: _ServerService_CountAllEnabledServers_Handler, - }, - { - MethodName: "listEnabledServers", - Handler: _ServerService_ListEnabledServers_Handler, - }, - { - MethodName: "disableServer", - Handler: _ServerService_DisableServer_Handler, - }, - { - MethodName: "findEnabledServer", - Handler: _ServerService_FindEnabledServer_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "service_server.proto", -} diff --git a/internal/rpc/pb/service_server_group.pb.go b/internal/rpc/pb/service_server_group.pb.go deleted file mode 100644 index fbf350d7..00000000 --- a/internal/rpc/pb/service_server_group.pb.go +++ /dev/null @@ -1,66 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.25.0 -// protoc v3.12.3 -// source: service_server_group.proto - -package pb - -import ( - proto "github.com/golang/protobuf/proto" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" -) - -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 - -var File_service_server_group_proto protoreflect.FileDescriptor - -var file_service_server_group_proto_rawDesc = []byte{ - 0x0a, 0x1a, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, - 0x5f, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, 0x62, - 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var file_service_server_group_proto_goTypes = []interface{}{} -var file_service_server_group_proto_depIdxs = []int32{ - 0, // [0:0] is the sub-list for method output_type - 0, // [0:0] 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_service_server_group_proto_init() } -func file_service_server_group_proto_init() { - if File_service_server_group_proto != nil { - return - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_service_server_group_proto_rawDesc, - NumEnums: 0, - NumMessages: 0, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_service_server_group_proto_goTypes, - DependencyIndexes: file_service_server_group_proto_depIdxs, - }.Build() - File_service_server_group_proto = out.File - file_service_server_group_proto_rawDesc = nil - file_service_server_group_proto_goTypes = nil - file_service_server_group_proto_depIdxs = nil -} diff --git a/internal/rpc/pb/service_user.pb.go b/internal/rpc/pb/service_user.pb.go deleted file mode 100644 index 85aec58a..00000000 --- a/internal/rpc/pb/service_user.pb.go +++ /dev/null @@ -1,66 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.25.0 -// protoc v3.12.3 -// source: service_user.proto - -package pb - -import ( - proto "github.com/golang/protobuf/proto" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" -) - -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 - -var File_service_user_proto protoreflect.FileDescriptor - -var file_service_user_proto_rawDesc = []byte{ - 0x0a, 0x12, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, 0x62, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62, - 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var file_service_user_proto_goTypes = []interface{}{} -var file_service_user_proto_depIdxs = []int32{ - 0, // [0:0] is the sub-list for method output_type - 0, // [0:0] 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_service_user_proto_init() } -func file_service_user_proto_init() { - if File_service_user_proto != nil { - return - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_service_user_proto_rawDesc, - NumEnums: 0, - NumMessages: 0, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_service_user_proto_goTypes, - DependencyIndexes: file_service_user_proto_depIdxs, - }.Build() - File_service_user_proto = out.File - file_service_user_proto_rawDesc = nil - file_service_user_proto_goTypes = nil - file_service_user_proto_depIdxs = nil -} diff --git a/internal/rpc/protos/model_api_node.proto b/internal/rpc/protos/model_api_node.proto deleted file mode 100644 index eca5d36e..00000000 --- a/internal/rpc/protos/model_api_node.proto +++ /dev/null @@ -1,16 +0,0 @@ -syntax = "proto3"; -option go_package = "./pb"; - -package pb; - -message APINode { - int64 id = 1; - bool isOn = 2; - int64 clusterId = 3; - string uniqueId = 4; - string secret = 5; - string name = 6; - string description = 7; - string host = 8; - int32 port = 9; -} \ No newline at end of file diff --git a/internal/rpc/protos/model_node.proto b/internal/rpc/protos/model_node.proto deleted file mode 100644 index 15c75e10..00000000 --- a/internal/rpc/protos/model_node.proto +++ /dev/null @@ -1,21 +0,0 @@ -syntax = "proto3"; -option go_package = "./pb"; - -package pb; - -import "model_node_cluster.proto"; -import "model_node_login.proto"; - -message Node { - int64 id = 1; - string name = 2; - string status = 3; - string installDir = 4; - bool isInstalled = 5; - string code = 6; - string uniqueId = 7; - string secret = 8; - - NodeCluster cluster = 32; - NodeLogin login = 33; -} \ No newline at end of file diff --git a/internal/rpc/protos/model_node_cluster.proto b/internal/rpc/protos/model_node_cluster.proto deleted file mode 100644 index 810aec84..00000000 --- a/internal/rpc/protos/model_node_cluster.proto +++ /dev/null @@ -1,12 +0,0 @@ -syntax = "proto3"; -option go_package = "./pb"; - -package pb; - -message NodeCluster { - int64 id = 1; - string name = 2; - int64 createdAt = 3; - int64 grantId = 4; - string installDir = 5; -} \ No newline at end of file diff --git a/internal/rpc/protos/model_node_grant.proto b/internal/rpc/protos/model_node_grant.proto deleted file mode 100644 index 6bddffca..00000000 --- a/internal/rpc/protos/model_node_grant.proto +++ /dev/null @@ -1,16 +0,0 @@ -syntax = "proto3"; -option go_package = "./pb"; - -package pb; - -message NodeGrant { - int64 id = 1; - string name = 2; - string method = 3; - string username = 4; - string password = 5; - bool su = 6; - string privateKey = 7; - string description = 8; - int64 nodeId = 9; -} \ No newline at end of file diff --git a/internal/rpc/protos/model_node_ip_address.proto b/internal/rpc/protos/model_node_ip_address.proto deleted file mode 100644 index 512b5aa0..00000000 --- a/internal/rpc/protos/model_node_ip_address.proto +++ /dev/null @@ -1,14 +0,0 @@ -syntax = "proto3"; -option go_package = "./pb"; - -package pb; - -message NodeIPAddress { - int64 id = 1; - int64 nodeId = 2; - string name = 3; - string ip = 4; - string description = 5; - int64 state = 6; - int64 order = 7; -} \ No newline at end of file diff --git a/internal/rpc/protos/model_node_login.proto b/internal/rpc/protos/model_node_login.proto deleted file mode 100644 index 3ad28698..00000000 --- a/internal/rpc/protos/model_node_login.proto +++ /dev/null @@ -1,11 +0,0 @@ -syntax = "proto3"; -option go_package = "./pb"; - -package pb; - -message NodeLogin { - int64 id = 1; - string name = 2; - string type = 3; - bytes params = 4; -} \ No newline at end of file diff --git a/internal/rpc/protos/model_server.proto b/internal/rpc/protos/model_server.proto deleted file mode 100644 index ac4f26be..00000000 --- a/internal/rpc/protos/model_server.proto +++ /dev/null @@ -1,16 +0,0 @@ -syntax = "proto3"; -option go_package = "./pb"; - -package pb; - -import "model_node_cluster.proto"; - -message Server { - int64 id = 1; - bytes config = 2; - bytes includeNodes = 3; - bytes excludeNodes = 4; - int64 createdAt = 5; - - NodeCluster cluster = 6; -} diff --git a/internal/rpc/protos/service_admin.proto b/internal/rpc/protos/service_admin.proto deleted file mode 100644 index e351d924..00000000 --- a/internal/rpc/protos/service_admin.proto +++ /dev/null @@ -1,65 +0,0 @@ -syntax = "proto3"; -option go_package = "./pb"; - -package pb; - - -service AdminService { - // 登录 - rpc loginAdmin (LoginAdminRequest) returns (LoginAdminResponse) { - } - - // 创建操作日志 - rpc createAdminLog (CreateAdminLogRequest) returns (CreateAdminLogResponse) { - } - - // 检查管理员是否存在 - rpc checkAdminExists (CheckAdminExistsRequest) returns (CheckAdminExistsResponse) { - } - - // 获取管理员名称 - rpc findAdminFullname (FindAdminNameRequest) returns (FindAdminNameResponse) { - } - -} - -message LoginAdminRequest { - string username = 1; - string password = 2; -} - -message LoginAdminResponse { - int64 adminId = 1; - bool isOk = 2; - string message = 3; -} - -message CreateAdminLogRequest { - string level = 1; - string description = 2; - string action = 3; - string ip = 4; -} - -message CreateAdminLogResponse { - bool isOk = 1; -} - -message CheckAdminExistsRequest { - int64 adminId = 1; -} - -message CheckAdminExistsResponse { - bool isOk = 1; - string message = 2; -} - - -message FindAdminNameRequest { - int64 adminId = 1; -} - -message FindAdminNameResponse { - string fullname = 1; -} - diff --git a/internal/rpc/protos/service_api_node.proto b/internal/rpc/protos/service_api_node.proto deleted file mode 100644 index 2140bd76..00000000 --- a/internal/rpc/protos/service_api_node.proto +++ /dev/null @@ -1,99 +0,0 @@ -syntax = "proto3"; -option go_package = "./pb"; - -package pb; -import "model_api_node.proto"; - -service APINodeService { - // 创建API节点 - rpc createAPINode (CreateAPINodeRequest) returns (CreateAPINodeResponse); - - // 修改API节点 - rpc updateAPINode (UpdateAPINodeRequest) returns (UpdateAPINodeResponse); - - // 删除API节点 - rpc deleteAPINode (DeleteAPINodeRequest) returns (DeleteAPINodeResponse); - - // 列出所有可用API节点 - rpc findAllEnabledAPINodes (FindAllEnabledAPINodesRequest) returns (FindAllEnabledAPINodesResponse); - - // 计算API节点数量 - rpc countAllEnabledAPINodes (CountAllEnabledAPINodesRequest) returns (CountAllEnabledAPINodesResponse); - - // 列出单页的API节点 - rpc listEnabledAPINodes (ListEnabledAPINodesRequest) returns (ListEnabledAPINodesResponse); - - // 根据ID查找节点 - rpc findEnabledAPINode (FindEnabledAPINodeRequest) returns (FindEnabledAPINodeResponse); -} - -// 创建API节点 -message CreateAPINodeRequest { - string name = 1; - string description = 2; - string host = 3; - int32 port = 4; -} - -message CreateAPINodeResponse { - int64 nodeId = 1; -} - -// 修改API节点 -message UpdateAPINodeRequest { - int64 nodeId = 1; - string name = 2; - string description = 3; - string host = 4; - int32 port = 5; -} - -message UpdateAPINodeResponse { - -} - -// 删除API节点 -message DeleteAPINodeRequest { - int64 nodeId = 1; -} - -message DeleteAPINodeResponse { - -} - -// 列出所有可用API节点 -message FindAllEnabledAPINodesRequest { - -} - -message FindAllEnabledAPINodesResponse { - repeated APINode nodes = 1; -} - -// 计算API节点数量 -message CountAllEnabledAPINodesRequest { - -} - -message CountAllEnabledAPINodesResponse { - int64 count = 1; -} - -// 列出单页的API节点 -message ListEnabledAPINodesRequest { - int64 offset = 1; - int64 size = 2; -} - -message ListEnabledAPINodesResponse { - repeated APINode nodes = 1; -} - -// 根据ID查找节点 -message FindEnabledAPINodeRequest { - int64 nodeId = 1; -} - -message FindEnabledAPINodeResponse { - APINode node = 1; -} \ No newline at end of file diff --git a/internal/rpc/protos/service_log.proto b/internal/rpc/protos/service_log.proto deleted file mode 100644 index b1699911..00000000 --- a/internal/rpc/protos/service_log.proto +++ /dev/null @@ -1,5 +0,0 @@ -syntax = "proto3"; -option go_package = "./pb"; - -package pb; - diff --git a/internal/rpc/protos/service_node.proto b/internal/rpc/protos/service_node.proto deleted file mode 100644 index b4662ffa..00000000 --- a/internal/rpc/protos/service_node.proto +++ /dev/null @@ -1,160 +0,0 @@ -syntax = "proto3"; -option go_package = "./pb"; - -package pb; -import "model_node.proto"; -import "model_node_login.proto"; - -service NodeService { - // 创建节点 - rpc createNode (CreateNodeRequest) returns (CreateNodeResponse); - - // 节点数量 - rpc countAllEnabledNodes (CountAllEnabledNodesRequest) returns (CountAllEnabledNodesResponse); - - // 计算匹配的节点数量 - rpc countAllEnabledNodesMatch (CountAllEnabledNodesMatchRequest) returns (CountAllEnabledNodesMatchResponse); - - // 列出单页节点 - rpc listEnabledNodesMatch (ListEnabledNodesMatchRequest) returns (ListEnabledNodesMatchResponse); - - // 禁用节点 - rpc disableNode (DisableNodeRequest) returns (DisableNodeResponse); - - // 修改节点 - rpc updateNode (UpdateNodeRequest) returns (UpdateNodeResponse); - - // 查看单个节点 - rpc findEnabledNode (FindEnabledNodeRequest) returns (FindEnabledNodeResponse); - - // 组合单个节点配置 - rpc composeNodeConfig (ComposeNodeConfigRequest) returns (ComposeNodeConfigResponse); - - // 节点stream - rpc nodeStream (stream NodeStreamRequest) returns (stream NodeStreamResponse); - - // 更新节点状态 - rpc updateNodeStatus (UpdateNodeStatusRequest) returns (UpdateNodeStatusResponse); - - // 同步集群中的节点版本 - rpc syncNodesVersionWithCluster (SyncNodesVersionWithClusterRequest) returns (SyncNodesVersionWithClusterResponse); - - // 修改节点安装状态 - rpc updateNodeIsInstalled (UpdateNodeIsInstalledRequest) returns (UpdateNodeIsInstalledResponse); -} - -// 创建节点 -message CreateNodeRequest { - string name = 1; - int64 clusterId = 2; - NodeLogin Login = 3; -} - -message CreateNodeResponse { - int64 nodeId = 1; -} - -// 节点数量 -message CountAllEnabledNodesRequest { - -} - -message CountAllEnabledNodesResponse { - int64 count = 1; -} - -// 列出单页节点 -message ListEnabledNodesMatchRequest { - int64 offset = 1; - int64 size = 2; - int64 clusterId = 3; -} - -message ListEnabledNodesMatchResponse { - repeated Node nodes = 1; -} - -// 禁用节点 -message DisableNodeRequest { - int64 nodeId = 1; -} - -message DisableNodeResponse { - -} - -// 修改节点 -message UpdateNodeRequest { - int64 nodeId = 1; - string name = 2; - int64 clusterId = 3; - NodeLogin Login = 4; -} - -message UpdateNodeResponse { - -} - -// 查找节点 -message FindEnabledNodeRequest { - int64 nodeId = 1; -} - -message FindEnabledNodeResponse { - Node node = 1; -} - -// 组合单个节点配置 -message ComposeNodeConfigRequest { - -} - -message ComposeNodeConfigResponse { - bytes configJSON = 1; -} - -// 节点stream -message NodeStreamRequest { - -} - -message NodeStreamResponse { - -} - -// 更新节点状态 -message UpdateNodeStatusRequest { - int64 nodeId = 1; - bytes statusJSON = 2; -} - -message UpdateNodeStatusResponse { - -} - -// 同步集群中的节点版本 -message SyncNodesVersionWithClusterRequest { - int64 clusterId = 1; -} - -message SyncNodesVersionWithClusterResponse { -} - -// 计算匹配的节点数量 -message CountAllEnabledNodesMatchRequest { - int64 clusterId = 1; -} - -message CountAllEnabledNodesMatchResponse { - int64 count = 1; -} - -// 修改节点安装状态 -message UpdateNodeIsInstalledRequest { - int64 nodeId = 1; - bool isInstalled = 2; -} - -message UpdateNodeIsInstalledResponse { - -} \ No newline at end of file diff --git a/internal/rpc/protos/service_node_cluster.proto b/internal/rpc/protos/service_node_cluster.proto deleted file mode 100644 index 0cb0e974..00000000 --- a/internal/rpc/protos/service_node_cluster.proto +++ /dev/null @@ -1,109 +0,0 @@ -syntax = "proto3"; -option go_package = "./pb"; - -package pb; -import "model_node_cluster.proto"; - -service NodeClusterService { - // 创建集群 - rpc createNodeCluster (CreateNodeClusterRequest) returns (CreateNodeClusterResponse); - - // 修改集群 - rpc updateNodeCluster (UpdateNodeClusterRequest) returns (UpdateNodeClusterResponse); - - // 禁用集群 - rpc disableNodeCluster (DisableNodeClusterRequest) returns (DisableNodeClusterResponse); - - // 查找单个集群信息 - rpc findEnabledNodeCluster (FindEnabledNodeClusterRequest) returns (FindEnabledNodeClusterResponse); - - // 获取所有集群的信息 - rpc findAllEnabledNodeClusters (FindAllEnabledNodeClustersRequest) returns (FindAllEnabledNodeClustersResponse); - - // 获取变更的集群 - rpc findAllChangedNodeClusters (FindAllChangedNodeClustersRequest) returns (FindAllChangedNodeClustersResponse); - - // 计算所有集群数量 - rpc countAllEnabledNodeClusters (CountAllEnabledNodeClustersRequest) returns (CountAllEnabledNodeClustersResponse); - - // 列出单页集群 - rpc listEnabledNodeClusters (ListEnabledNodeClustersRequest) returns (ListEnabledNodeClustersResponse); -} - -// 获取所有集群的信息 -message FindAllEnabledNodeClustersRequest { - -} - -message FindAllEnabledNodeClustersResponse { - repeated NodeCluster clusters = 1; -} - -// 获取变更的集群 -message FindAllChangedNodeClustersRequest { - -} - -message FindAllChangedNodeClustersResponse { - repeated NodeCluster clusters = 1; -} - -// 创建集群 -message CreateNodeClusterRequest { - string name = 1; - int64 grantId = 2; - string installDir = 3; -} - -message CreateNodeClusterResponse { - int64 clusterId = 1; -} - -// 修改集群 -message UpdateNodeClusterRequest { - int64 clusterId = 1; - string name = 2; - int64 grantId = 3; - string installDir = 4; -} - -message UpdateNodeClusterResponse { - -} - -// 禁用集群 -message DisableNodeClusterRequest { - int64 clusterId = 1; -} - -message DisableNodeClusterResponse { - -} - -// 查找单个集群信息 -message FindEnabledNodeClusterRequest { - int64 clusterId = 1; -} - -message FindEnabledNodeClusterResponse { - NodeCluster cluster = 1; -} - -// 计算所有集群数量 -message CountAllEnabledNodeClustersRequest { - -} - -message CountAllEnabledNodeClustersResponse { - int64 count = 1; -} - -// 列出单页集群 -message ListEnabledNodeClustersRequest { - int64 offset = 1; - int64 size = 2; -} - -message ListEnabledNodeClustersResponse { - repeated NodeCluster clusters = 1; -} \ No newline at end of file diff --git a/internal/rpc/protos/service_node_grant.proto b/internal/rpc/protos/service_node_grant.proto deleted file mode 100644 index 6a2d3c27..00000000 --- a/internal/rpc/protos/service_node_grant.proto +++ /dev/null @@ -1,105 +0,0 @@ -syntax = "proto3"; -option go_package = "./pb"; - -package pb; -import "model_node_grant.proto"; - -service NodeGrantService { - // 创建认证 - rpc createNodeGrant (CreateNodeGrantRequest) returns (CreateNodeGrantResponse); - - // 修改认证 - rpc updateNodeGrant (UpdateNodeGrantRequest) returns (UpdateNodeGrantResponse); - - // 禁用认证 - rpc disableNodeGrant (DisableNodeGrantRequest) returns (DisableNodeGrantResponse); - - // 计算认证的数量 - rpc countAllEnabledNodeGrants (CountAllEnabledNodeGrantsRequest) returns (CountAllEnabledNodeGrantsResponse); - - // 列出单页认证 - rpc ListEnabledNodeGrants (ListEnabledNodeGrantsRequest) returns (ListEnabledNodeGrantsResponse); - - // 列出所有认证 - rpc FindAllEnabledNodeGrants(FindAllEnabledNodeGrantsRequest) returns (FindAllEnabledNodeGrantsResponse); - - // 获取单个认证信息 - rpc FindEnabledGrant(FindEnabledGrantRequest) returns (FindEnabledGrantResponse); -} - -// 创建节点认证 -message CreateNodeGrantRequest { - string name = 1; - string method = 2; - string username = 3; - string password = 4; - string privateKey = 5; - string description = 6; - int64 nodeId = 7; -} - -message CreateNodeGrantResponse { - int64 grantId = 1; -} - -// 修改节点认证 -message UpdateNodeGrantRequest { - int64 grantId = 8; - string name = 1; - string method = 2; - string username = 3; - string password = 4; - string privateKey = 5; - string description = 6; - int64 nodeId = 7; -} - -message UpdateNodeGrantResponse { - -} - -// 禁用节点认证 -message DisableNodeGrantRequest { - int64 grantId = 1; -} - -message DisableNodeGrantResponse { - -} - -// 计算节点认证数量 -message CountAllEnabledNodeGrantsRequest { - -} - -message CountAllEnabledNodeGrantsResponse { - int64 count = 1; -} - -// 列出单页认证 -message ListEnabledNodeGrantsRequest { - int64 offset = 1; - int64 size = 2; -} - -message ListEnabledNodeGrantsResponse { - repeated NodeGrant grants = 1; -} - -// 获取所有认证信息 -message FindAllEnabledNodeGrantsRequest { - -} - -message FindAllEnabledNodeGrantsResponse { - repeated NodeGrant grants = 1; -} - -// 获取认证信息 -message FindEnabledGrantRequest { - int64 grantId = 1; -} - -message FindEnabledGrantResponse { - NodeGrant grant = 1; -} \ No newline at end of file diff --git a/internal/rpc/protos/service_node_group.proto b/internal/rpc/protos/service_node_group.proto deleted file mode 100644 index b1699911..00000000 --- a/internal/rpc/protos/service_node_group.proto +++ /dev/null @@ -1,5 +0,0 @@ -syntax = "proto3"; -option go_package = "./pb"; - -package pb; - diff --git a/internal/rpc/protos/service_node_ip_address.proto b/internal/rpc/protos/service_node_ip_address.proto deleted file mode 100644 index dabdcd11..00000000 --- a/internal/rpc/protos/service_node_ip_address.proto +++ /dev/null @@ -1,97 +0,0 @@ -syntax = "proto3"; -option go_package = "./pb"; - -package pb; - -import "model_node_ip_address.proto"; - -service NodeIPAddressService { - // 创建IP地址 - rpc createNodeIPAddress (CreateNodeIPAddressRequest) returns (CreateNodeIPAddressResponse); - - // 修改IP地址 - rpc updateNodeIPAddress (UpdateNodeIPAddressRequest) returns (UpdateNodeIPAddressResponse); - - // 修改IP地址所属节点 - rpc updateNodeIPAddressNodeId (UpdateNodeIPAddressNodeIdRequest) returns (UpdateNodeIPAddressNodeIdResponse); - - // 禁用单个IP地址 - rpc disableNodeIPAddress (DisableNodeIPAddressRequest) returns (DisableNodeIPAddressResponse); - - // 禁用节点的所有IP地址 - rpc disableAllIPAddressesWithNodeId (DisableAllIPAddressesWithNodeIdRequest) returns (DisableAllIPAddressesWithNodeIdResponse); - - // 查找单个IP地址 - rpc findEnabledNodeIPAddress (FindEnabledNodeIPAddressRequest) returns (FindEnabledNodeIPAddressResponse); - - // 查找节点的所有地址 - rpc findAllEnabledIPAddressesWithNodeId (FindAllEnabledIPAddressesWithNodeIdRequest) returns (FindAllEnabledIPAddressesWithNodeIdResponse); -} - -// 创建IP地址 -message CreateNodeIPAddressRequest { - int64 nodeId = 1; - string name = 2; - string ip = 3; -} - -message CreateNodeIPAddressResponse { - int64 addressId = 1; -} - -// 修改IP地址 -message UpdateNodeIPAddressRequest { - int64 addressId = 1; - string name = 2; - string ip = 3; -} - -message UpdateNodeIPAddressResponse { - -} - -// 修改IP地址所属节点 -message UpdateNodeIPAddressNodeIdRequest { - int64 addressId = 1; - int64 nodeId = 2; -} - -message UpdateNodeIPAddressNodeIdResponse { - -} - -// 禁用单个IP地址 -message DisableNodeIPAddressRequest { - int64 addressId = 1; -} - -message DisableNodeIPAddressResponse { - -} - -// 禁用节点的所有IP地址 -message DisableAllIPAddressesWithNodeIdRequest { - int64 nodeId = 1; -} - -message DisableAllIPAddressesWithNodeIdResponse { - -} - -// 查找单个IP地址 -message FindEnabledNodeIPAddressRequest { - int64 addressId = 1; -} - -message FindEnabledNodeIPAddressResponse { - NodeIPAddress ipAddress = 1; -} - -// 查找节点的所有地址 -message FindAllEnabledIPAddressesWithNodeIdRequest { - int64 nodeId = 1; -} - -message FindAllEnabledIPAddressesWithNodeIdResponse { - repeated NodeIPAddress addresses = 1; -} \ No newline at end of file diff --git a/internal/rpc/protos/service_node_region.proto b/internal/rpc/protos/service_node_region.proto deleted file mode 100644 index b1699911..00000000 --- a/internal/rpc/protos/service_node_region.proto +++ /dev/null @@ -1,5 +0,0 @@ -syntax = "proto3"; -option go_package = "./pb"; - -package pb; - diff --git a/internal/rpc/protos/service_server.proto b/internal/rpc/protos/service_server.proto deleted file mode 100644 index c504e164..00000000 --- a/internal/rpc/protos/service_server.proto +++ /dev/null @@ -1,91 +0,0 @@ -syntax = "proto3"; -option go_package = "./pb"; - -package pb; -import "model_server.proto"; - -service ServerService { - // 创建服务 - rpc createServer (CreateServerRequest) returns (CreateServerResponse); - - // 修改服务 - rpc updateServer (UpdateServerRequest) returns (UpdateServerResponse); - - // 计算服务数量 - rpc countAllEnabledServers (CountAllEnabledServersRequest) returns (CountAllEnabledServersResponse); - - // 列出单页服务 - rpc listEnabledServers (ListEnabledServersRequest) returns (ListEnabledServersResponse); - - // 禁用某服务 - rpc disableServer (DisableServerRequest) returns (DisableServerResponse); - - // 查找单个服务 - rpc findEnabledServer (FindEnabledServerRequest) returns (FindEnabledServerResponse); -} - -// 创建服务 -message CreateServerRequest { - int64 userId = 1; - int64 adminId = 2; - int64 clusterId = 6; - bytes config = 3; - bytes includeNodesJSON = 4; - bytes excludeNodesJSON = 5; -} - -message CreateServerResponse { - int64 serverId = 1; -} - -// 修改服务 -message UpdateServerRequest { - int64 serverId = 1; - int64 userId = 2; - int64 adminId = 3; - int64 clusterId = 4; - bytes config = 5; - bytes includeNodesJSON = 6; - bytes excludeNodesJSON = 7; -} - -message UpdateServerResponse { - -} - -// 计算服务数量 -message CountAllEnabledServersRequest { - -} - -message CountAllEnabledServersResponse { - int64 count = 1; -} - -// 列出单页服务 -message ListEnabledServersRequest { - int64 offset = 1; - int64 size = 2; -} - -message ListEnabledServersResponse { - repeated Server servers = 1; -} - -// 禁用服务 -message DisableServerRequest { - int64 serverId = 1; -} - -message DisableServerResponse { - -} - -// 查找单个服务 -message FindEnabledServerRequest { - int64 serverId = 1; -} - -message FindEnabledServerResponse { - Server server = 1; -} \ No newline at end of file diff --git a/internal/rpc/protos/service_server_group.proto b/internal/rpc/protos/service_server_group.proto deleted file mode 100644 index b1699911..00000000 --- a/internal/rpc/protos/service_server_group.proto +++ /dev/null @@ -1,5 +0,0 @@ -syntax = "proto3"; -option go_package = "./pb"; - -package pb; - diff --git a/internal/rpc/protos/service_user.proto b/internal/rpc/protos/service_user.proto deleted file mode 100644 index b1699911..00000000 --- a/internal/rpc/protos/service_user.proto +++ /dev/null @@ -1,5 +0,0 @@ -syntax = "proto3"; -option go_package = "./pb"; - -package pb; - diff --git a/internal/rpc/services/service_admin.go b/internal/rpc/services/service_admin.go index 990c0222..5933a2ec 100644 --- a/internal/rpc/services/service_admin.go +++ b/internal/rpc/services/service_admin.go @@ -3,9 +3,9 @@ package services import ( "context" "github.com/TeaOSLab/EdgeAPI/internal/db/models" - "github.com/TeaOSLab/EdgeAPI/internal/rpc/pb" rpcutils "github.com/TeaOSLab/EdgeAPI/internal/rpc/utils" "github.com/TeaOSLab/EdgeAPI/internal/utils" + "github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb" ) type AdminService struct { @@ -79,7 +79,7 @@ func (this *AdminService) CheckAdminExists(ctx context.Context, req *pb.CheckAdm }, nil } -func (this *AdminService) FindAdminFullname(ctx context.Context, req *pb.FindAdminNameRequest) (*pb.FindAdminNameResponse, error) { +func (this *AdminService) FindAdminFullname(ctx context.Context, req *pb.FindAdminFullnameRequest) (*pb.FindAdminFullnameResponse, error) { _, _, err := rpcutils.ValidateRequest(ctx) if err != nil { return nil, err @@ -91,7 +91,7 @@ func (this *AdminService) FindAdminFullname(ctx context.Context, req *pb.FindAdm return nil, err } - return &pb.FindAdminNameResponse{ + return &pb.FindAdminFullnameResponse{ Fullname: fullname, }, nil -} \ No newline at end of file +} diff --git a/internal/rpc/services/service_admin_test.go b/internal/rpc/services/service_admin_test.go index 0d74272d..9c1f490f 100644 --- a/internal/rpc/services/service_admin_test.go +++ b/internal/rpc/services/service_admin_test.go @@ -5,7 +5,7 @@ import ( "encoding/base64" teaconst "github.com/TeaOSLab/EdgeAPI/internal/const" "github.com/TeaOSLab/EdgeAPI/internal/encrypt" - "github.com/TeaOSLab/EdgeAPI/internal/rpc/pb" + "github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb" "github.com/iwind/TeaGo/assert" "github.com/iwind/TeaGo/maps" stringutil "github.com/iwind/TeaGo/utils/string" @@ -19,7 +19,7 @@ func TestAdminService_Login(t *testing.T) { service := &AdminService{ debug: true, } - resp, err := service.Login(testCtx(t), &pb.AdminLoginRequest{ + resp, err := service.LoginAdmin(testCtx(t), &pb.LoginAdminRequest{ Username: "admin", Password: stringutil.Md5("123456"), }) @@ -32,7 +32,7 @@ func TestAdminService_Login(t *testing.T) { func TestAdminService_CreateLog(t *testing.T) { service := &AdminService{debug: true} - resp, err := service.CreateLog(testCtx(t), &pb.AdminCreateLogRequest{ + resp, err := service.CreateAdminLog(testCtx(t), &pb.CreateAdminLogRequest{ Level: "info", Description: "这是一个测试日志", Action: "/login", @@ -44,11 +44,11 @@ func TestAdminService_CreateLog(t *testing.T) { t.Log(resp) } -func TestAdminService_FindAllEnabledClusters(t *testing.T) { +func TestAdminService_FindAdminFullname(t *testing.T) { service := &AdminService{ debug: true, } - resp, err := service.FindAllEnabledClusters(testCtx(t), &pb.AdminFindAllEnabledClustersRequest{}) + resp, err := service.FindAdminFullname(testCtx(t), &pb.FindAdminFullnameRequest{AdminId: 1}) if err != nil { t.Fatal(err) } diff --git a/internal/rpc/services/service_api_node.go b/internal/rpc/services/service_api_node.go index 6bf77ac9..857df924 100644 --- a/internal/rpc/services/service_api_node.go +++ b/internal/rpc/services/service_api_node.go @@ -3,8 +3,8 @@ package services import ( "context" "github.com/TeaOSLab/EdgeAPI/internal/db/models" - "github.com/TeaOSLab/EdgeAPI/internal/rpc/pb" rpcutils "github.com/TeaOSLab/EdgeAPI/internal/rpc/utils" + "github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb" ) type APINodeService struct { @@ -79,6 +79,7 @@ func (this *APINodeService) FindAllEnabledAPINodes(ctx context.Context, req *pb. Description: node.Description, Host: node.Host, Port: int32(node.Port), + Address: node.Address(), }) } @@ -124,6 +125,7 @@ func (this *APINodeService) ListEnabledAPINodes(ctx context.Context, req *pb.Lis Description: node.Description, Host: node.Host, Port: int32(node.Port), + Address: node.Address(), }) } @@ -156,6 +158,7 @@ func (this *APINodeService) FindEnabledAPINode(ctx context.Context, req *pb.Find Description: node.Description, Host: node.Host, Port: int32(node.Port), + Address: node.Address(), } return &pb.FindEnabledAPINodeResponse{Node: result}, nil } diff --git a/internal/rpc/services/service_node.go b/internal/rpc/services/service_node.go index 8c683853..7cae84d6 100644 --- a/internal/rpc/services/service_node.go +++ b/internal/rpc/services/service_node.go @@ -5,15 +5,18 @@ import ( "encoding/json" "errors" "github.com/TeaOSLab/EdgeAPI/internal/db/models" - "github.com/TeaOSLab/EdgeAPI/internal/rpc/pb" + "github.com/TeaOSLab/EdgeAPI/internal/installers" rpcutils "github.com/TeaOSLab/EdgeAPI/internal/rpc/utils" + "github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb" "github.com/iwind/TeaGo/logs" "github.com/iwind/TeaGo/maps" + "github.com/iwind/TeaGo/types" ) type NodeService struct { } +// 创建节点 func (this *NodeService) CreateNode(ctx context.Context, req *pb.CreateNodeRequest) (*pb.CreateNodeResponse, error) { _, _, err := rpcutils.ValidateRequest(ctx, rpcutils.UserTypeAdmin) if err != nil { @@ -38,6 +41,7 @@ func (this *NodeService) CreateNode(ctx context.Context, req *pb.CreateNodeReque }, nil } +// 计算节点数量 func (this *NodeService) CountAllEnabledNodes(ctx context.Context, req *pb.CountAllEnabledNodesRequest) (*pb.CountAllEnabledNodesResponse, error) { _ = req _, _, err := rpcutils.ValidateRequest(ctx, rpcutils.UserTypeAdmin) @@ -58,19 +62,20 @@ func (this *NodeService) CountAllEnabledNodesMatch(ctx context.Context, req *pb. if err != nil { return nil, err } - count, err := models.SharedNodeDAO.CountAllEnabledNodesMatch(req.ClusterId) + count, err := models.SharedNodeDAO.CountAllEnabledNodesMatch(req.ClusterId, types.Int8(req.InstallState)) if err != nil { return nil, err } return &pb.CountAllEnabledNodesMatchResponse{Count: count}, nil } +// 列出单页的节点 func (this *NodeService) ListEnabledNodesMatch(ctx context.Context, req *pb.ListEnabledNodesMatchRequest) (*pb.ListEnabledNodesMatchResponse, error) { _, _, err := rpcutils.ValidateRequest(ctx, rpcutils.UserTypeAdmin) if err != nil { return nil, err } - nodes, err := models.SharedNodeDAO.ListEnabledNodesMatch(req.Offset, req.Size, req.ClusterId) + nodes, err := models.SharedNodeDAO.ListEnabledNodesMatch(req.Offset, req.Size, req.ClusterId, types.Int8(req.InstallState)) if err != nil { return nil, err } @@ -82,14 +87,32 @@ func (this *NodeService) ListEnabledNodesMatch(ctx context.Context, req *pb.List return nil, err } + // 安装信息 + installStatus, err := node.DecodeInstallStatus() + if err != nil { + return nil, err + } + installStatusResult := &pb.NodeInstallStatus{} + if installStatus != nil { + installStatusResult = &pb.NodeInstallStatus{ + IsRunning: installStatus.IsRunning, + IsFinished: installStatus.IsFinished, + IsOk: installStatus.IsOk, + Error: installStatus.Error, + UpdatedAt: installStatus.UpdatedAt, + } + } + result = append(result, &pb.Node{ - Id: int64(node.Id), - Name: node.Name, - Status: node.Status, + Id: int64(node.Id), + Name: node.Name, + IsInstalled: node.IsInstalled == 1, + Status: node.Status, Cluster: &pb.NodeCluster{ Id: int64(node.ClusterId), Name: clusterName, }, + InstallStatus: installStatusResult, }) } @@ -183,6 +206,22 @@ func (this *NodeService) FindEnabledNode(ctx context.Context, req *pb.FindEnable } } + // 安装信息 + installStatus, err := node.DecodeInstallStatus() + if err != nil { + return nil, err + } + installStatusResult := &pb.NodeInstallStatus{} + if installStatus != nil { + installStatusResult = &pb.NodeInstallStatus{ + IsRunning: installStatus.IsRunning, + IsFinished: installStatus.IsFinished, + IsOk: installStatus.IsOk, + Error: installStatus.Error, + UpdatedAt: installStatus.UpdatedAt, + } + } + return &pb.FindEnabledNodeResponse{Node: &pb.Node{ Id: int64(node.Id), Name: node.Name, @@ -195,7 +234,8 @@ func (this *NodeService) FindEnabledNode(ctx context.Context, req *pb.FindEnable Id: int64(node.ClusterId), Name: clusterName, }, - Login: respLogin, + Login: respLogin, + InstallStatus: installStatusResult, }}, nil } @@ -323,3 +363,20 @@ func (this *NodeService) UpdateNodeIsInstalled(ctx context.Context, req *pb.Upda return &pb.UpdateNodeIsInstalledResponse{}, nil } + +// 安装节点 +func (this *NodeService) InstallNode(ctx context.Context, req *pb.InstallNodeRequest) (*pb.InstallNodeResponse, error) { + _, _, err := rpcutils.ValidateRequest(ctx, rpcutils.UserTypeAdmin) + if err != nil { + return nil, err + } + + go func() { + err = installers.SharedQueue().InstallNodeProcess(req.NodeId) + if err != nil { + logs.Println("[RPC]install node:" + err.Error()) + } + }() + + return &pb.InstallNodeResponse{}, nil +} diff --git a/internal/rpc/services/service_node_cluster.go b/internal/rpc/services/service_node_cluster.go index 58295c1d..3552d644 100644 --- a/internal/rpc/services/service_node_cluster.go +++ b/internal/rpc/services/service_node_cluster.go @@ -3,8 +3,8 @@ package services import ( "context" "github.com/TeaOSLab/EdgeAPI/internal/db/models" - "github.com/TeaOSLab/EdgeAPI/internal/rpc/pb" rpcutils "github.com/TeaOSLab/EdgeAPI/internal/rpc/utils" + "github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb" ) type NodeClusterService struct { diff --git a/internal/rpc/services/service_node_grant.go b/internal/rpc/services/service_node_grant.go index e1d7748b..6337c40f 100644 --- a/internal/rpc/services/service_node_grant.go +++ b/internal/rpc/services/service_node_grant.go @@ -4,8 +4,8 @@ import ( "context" "errors" "github.com/TeaOSLab/EdgeAPI/internal/db/models" - "github.com/TeaOSLab/EdgeAPI/internal/rpc/pb" rpcutils "github.com/TeaOSLab/EdgeAPI/internal/rpc/utils" + "github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb" ) type NodeGrantService struct { diff --git a/internal/rpc/services/service_node_ip_address.go b/internal/rpc/services/service_node_ip_address.go index d2d10aef..127de2c9 100644 --- a/internal/rpc/services/service_node_ip_address.go +++ b/internal/rpc/services/service_node_ip_address.go @@ -3,8 +3,8 @@ package services import ( "context" "github.com/TeaOSLab/EdgeAPI/internal/db/models" - "github.com/TeaOSLab/EdgeAPI/internal/rpc/pb" rpcutils "github.com/TeaOSLab/EdgeAPI/internal/rpc/utils" + "github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb" ) type NodeIPAddressService struct { diff --git a/internal/rpc/services/service_origin_server.go b/internal/rpc/services/service_origin_server.go new file mode 100644 index 00000000..880cbad3 --- /dev/null +++ b/internal/rpc/services/service_origin_server.go @@ -0,0 +1,95 @@ +package services + +import ( + "context" + "errors" + "github.com/TeaOSLab/EdgeAPI/internal/db/models" + rpcutils "github.com/TeaOSLab/EdgeAPI/internal/rpc/utils" + "github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb" + "github.com/iwind/TeaGo/maps" +) + +// 源站相关管理 +type OriginServerService struct { +} + +// 创建源站 +func (this *OriginServerService) CreateOriginServer(ctx context.Context, req *pb.CreateOriginServerRequest) (*pb.CreateOriginServerResponse, error) { + _, _, err := rpcutils.ValidateRequest(ctx, rpcutils.UserTypeAdmin) + if err != nil { + return nil, err + } + + if req.Addr == nil { + return nil, errors.New("'addr' can not be nil") + } + addrMap := maps.Map{ + "protocol": req.Addr.Protocol, + "portRange": req.Addr.PortRange, + "host": req.Addr.Host, + } + originId, err := models.SharedOriginServerDAO.CreateOriginServer(req.Name, string(addrMap.AsJSON()), req.Description) + if err != nil { + return nil, err + } + + return &pb.CreateOriginServerResponse{OriginId: originId}, nil +} + +// 修改源站 +func (this *OriginServerService) UpdateOriginServer(ctx context.Context, req *pb.UpdateOriginServerRequest) (*pb.UpdateOriginServerResponse, error) { + _, _, err := rpcutils.ValidateRequest(ctx, rpcutils.UserTypeAdmin) + if err != nil { + return nil, err + } + + if req.Addr == nil { + return nil, errors.New("'addr' can not be nil") + } + addrMap := maps.Map{ + "protocol": req.Addr.Protocol, + "portRange": req.Addr.PortRange, + "host": req.Addr.Host, + } + err = models.SharedOriginServerDAO.UpdateOriginServer(req.OriginId, req.Name, string(addrMap.AsJSON()), req.Description) + if err != nil { + return nil, err + } + + return &pb.UpdateOriginServerResponse{}, nil +} + +// 查找单个源站信息 +func (this *OriginServerService) FindEnabledOriginServer(ctx context.Context, req *pb.FindEnabledOriginServerRequest) (*pb.FindEnabledOriginServerResponse, error) { + _, _, err := rpcutils.ValidateRequest(ctx, rpcutils.UserTypeAdmin) + if err != nil { + return nil, err + } + + origin, err := models.SharedOriginServerDAO.FindEnabledOriginServer(req.OriginId) + if err != nil { + return nil, err + } + + if origin == nil { + return &pb.FindEnabledOriginServerResponse{Origin: nil}, nil + } + + addr, err := origin.DecodeAddr() + if err != nil { + return nil, err + } + + result := &pb.OriginServer{ + Id: int64(origin.Id), + IsOn: origin.IsOn == 1, + Name: origin.Name, + Addr: &pb.NetworkAddress{ + Protocol: addr.Protocol, + Host: addr.Host, + PortRange: addr.PortRange, + }, + Description: origin.Description, + } + return &pb.FindEnabledOriginServerResponse{Origin: result}, nil +} diff --git a/internal/rpc/services/service_server.go b/internal/rpc/services/service_server.go index 5059e8fc..18e8926c 100644 --- a/internal/rpc/services/service_server.go +++ b/internal/rpc/services/service_server.go @@ -4,8 +4,8 @@ import ( "context" "errors" "github.com/TeaOSLab/EdgeAPI/internal/db/models" - "github.com/TeaOSLab/EdgeAPI/internal/rpc/pb" rpcutils "github.com/TeaOSLab/EdgeAPI/internal/rpc/utils" + "github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb" ) type ServerService struct { @@ -17,7 +17,7 @@ func (this *ServerService) CreateServer(ctx context.Context, req *pb.CreateServe if err != nil { return nil, err } - serverId, err := models.SharedServerDAO.CreateServer(req.AdminId, req.UserId, req.ClusterId, string(req.Config), string(req.IncludeNodesJSON), string(req.ExcludeNodesJSON)) + serverId, err := models.SharedServerDAO.CreateServer(req.AdminId, req.UserId, req.Type, req.Name, req.Description, req.ClusterId, string(req.Config), string(req.IncludeNodesJSON), string(req.ExcludeNodesJSON)) if err != nil { return nil, err } @@ -32,7 +32,7 @@ func (this *ServerService) CreateServer(ctx context.Context, req *pb.CreateServe } // 修改服务 -func (this *ServerService) UpdateServer(ctx context.Context, req *pb.UpdateServerRequest) (*pb.UpdateServerResponse, error) { +func (this *ServerService) UpdateServerBasic(ctx context.Context, req *pb.UpdateServerBasicRequest) (*pb.UpdateServerBasicResponse, error) { _, _, err := rpcutils.ValidateRequest(ctx, rpcutils.UserTypeAdmin) if err != nil { return nil, err @@ -51,7 +51,7 @@ func (this *ServerService) UpdateServer(ctx context.Context, req *pb.UpdateServe return nil, errors.New("can not find server") } - err = models.SharedServerDAO.UpdateServer(req.ServerId, req.ClusterId, string(req.Config), string(req.IncludeNodesJSON), string(req.ExcludeNodesJSON)) + err = models.SharedServerDAO.UpdateServerBasic(req.ServerId, req.Name, req.Description, req.ClusterId) if err != nil { return nil, err } @@ -70,7 +70,42 @@ func (this *ServerService) UpdateServer(ctx context.Context, req *pb.UpdateServe return nil, err } - return &pb.UpdateServerResponse{}, nil + return &pb.UpdateServerBasicResponse{}, nil +} + +// 修改服务配置 +func (this *ServerService) UpdateServerConfig(ctx context.Context, req *pb.UpdateServerConfigRequest) (*pb.UpdateServerConfigResponse, error) { + _, _, err := rpcutils.ValidateRequest(ctx, rpcutils.UserTypeAdmin) + if err != nil { + return nil, err + } + + if req.ServerId <= 0 { + return nil, errors.New("invalid serverId") + } + + // 查找Server + server, err := models.SharedServerDAO.FindEnabledServer(req.ServerId) + if err != nil { + return nil, err + } + if server == nil { + return &pb.UpdateServerConfigResponse{}, nil + } + + // 修改 + err = models.SharedServerDAO.UpdateServerConfig(req.ServerId, req.Config) + if err != nil { + return nil, err + } + + // 更新新的节点版本 + err = models.SharedNodeDAO.UpdateAllNodesLatestVersionMatch(int64(server.ClusterId)) + if err != nil { + return nil, err + } + + return &pb.UpdateServerConfigResponse{}, nil } // 计算服务数量 @@ -106,6 +141,9 @@ func (this *ServerService) ListEnabledServers(ctx context.Context, req *pb.ListE } result = append(result, &pb.Server{ Id: int64(server.Id), + Type: server.Type, + Name: server.Name, + Description: server.Description, Config: []byte(server.Config), IncludeNodes: []byte(server.IncludeNodes), ExcludeNodes: []byte(server.ExcludeNodes), @@ -174,6 +212,9 @@ func (this *ServerService) FindEnabledServer(ctx context.Context, req *pb.FindEn return &pb.FindEnabledServerResponse{Server: &pb.Server{ Id: int64(server.Id), + Type: server.Type, + Name: server.Name, + Description: server.Description, Config: []byte(server.Config), IncludeNodes: []byte(server.IncludeNodes), ExcludeNodes: []byte(server.ExcludeNodes), diff --git a/internal/tests/grpc_test.go b/internal/tests/grpc_test.go index 92843e81..e0eb68c0 100644 --- a/internal/tests/grpc_test.go +++ b/internal/tests/grpc_test.go @@ -3,9 +3,9 @@ package tests import ( "context" "encoding/json" - pb2 "github.com/TeaOSLab/EdgeAPI/internal/rpc/pb" "github.com/TeaOSLab/EdgeAPI/internal/rpc/services" pb "github.com/TeaOSLab/EdgeAPI/internal/tests/helloworld" + pb2 "github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb" "google.golang.org/grpc" "google.golang.org/grpc/credentials" "google.golang.org/grpc/metadata" @@ -75,30 +75,6 @@ func TestTCPClient(t *testing.T) { t.Log(time.Since(before).Seconds()*1000, "ms") } -func TestTCPClient_Node(t *testing.T) { - conn, err := grpc.Dial("127.0.0.1:8001", grpc.WithInsecure()) - if err != nil { - t.Fatal(err) - } - defer func() { - _ = conn.Close() - }() - - c := pb2.NewNodeServiceClient(conn) - - before := time.Now() - - ctx := context.Background() - ctx = metadata.AppendToOutgoingContext(ctx, "name", "liu", "age", "20") - reply, err := c.Config(ctx, &pb2.ConfigRequest{ - }) - if err != nil { - t.Fatal(err) - } - t.Log(reply) - t.Log(time.Since(before).Seconds()*1000, "ms") -} - func TestTLSServer(t *testing.T) { listener, err := net.Listen("tcp", ":8001") if err != nil { diff --git a/internal/utils/ticker.go b/internal/utils/ticker.go new file mode 100644 index 00000000..b4e8792a --- /dev/null +++ b/internal/utils/ticker.go @@ -0,0 +1,34 @@ +package utils + +import "time" + +type Ticker struct { + raw *time.Ticker + isDone bool + done chan bool +} + +func NewTicker(duration time.Duration) *Ticker { + return &Ticker{ + raw: time.NewTicker(duration), + done: make(chan bool), + } +} + +func (this *Ticker) Wait() bool { + select { + case <-this.raw.C: + return true + case <-this.done: + this.isDone = true + return false + } +} + +func (this *Ticker) Stop() { + if this.isDone { + return + } + this.done <- true + this.raw.Stop() +}