diff --git a/go.mod b/go.mod index e165d6b..5b185ce 100644 --- a/go.mod +++ b/go.mod @@ -4,8 +4,8 @@ go 1.13 require ( github.com/dgrijalva/jwt-go v3.2.0+incompatible - github.com/golang/protobuf v1.3.5 github.com/rs/zerolog v1.19.0 - google.golang.org/grpc v1.28.0 + google.golang.org/grpc v1.43.0 + google.golang.org/protobuf v1.29.0 gopkg.in/yaml.v2 v2.3.0 ) diff --git a/go.sum b/go.sum index 24480db..a80eb1c 100644 --- a/go.sum +++ b/go.sum @@ -1,46 +1,88 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= 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/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= +github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI= +github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/dgrijalva/jwt-go v3.2.0+incompatible h1:7qlOGliEKZXTDg6OTjfoBKDXWrumCAMpl/TFQ4/5kLM= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= 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/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= +github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= +github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= -github.com/golang/protobuf v1.3.5 h1:F768QJ1E9tib+q5Sc8MkdJi1RxLTbRcTf8LJV56aRls= -github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk= -github.com/google/go-cmp v0.2.0 h1:+dTQ8DZQJz0Mb/HjFlkptS1FeQ4cWSnN941F8aEG4SQ= +github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= +github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= +github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= +github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= +github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= +github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= +github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/protobuf v1.5.0 h1:LUVKkCeviFUMKqHa4tXIIij/lbhnMbP7Fn5wKdKkRh4= +github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= +github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU= +github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rs/xid v1.2.1/go.mod h1:+uKXf+4Djp6Md1KODXJxgGQPKngRmWyn10oCKFzNHOQ= github.com/rs/zerolog v1.19.0 h1:hYz4ZVdUgjXTBUmrkrw55j1nHx68LfOKIQk5IYtyScg= github.com/rs/zerolog v1.19.0/go.mod h1:IzD0RJ65iWH0w97OQQebJEvTZYvsCUm9WVLWBQrJRjo= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= +github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= 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/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-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190620200207-3b0461eec859 h1:R/3boaszxrf1GEUWTVDzSKVwLmSJpwZ1yqXm8j0v2QI= +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-20200822124328-c89045814202 h1:VvcQYSHwXgi7W+TpUR6A9g6Up98WAHf3f/ulnJ62IyA= +golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-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-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd h1:xhmwyvizuTgC2qz7ZlMluP20uW+C3Rm0FD/WLDX8884= +golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -49,19 +91,42 @@ golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3 golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190828213141-aed303cbaa74/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/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-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +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= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= -google.golang.org/grpc v1.28.0 h1:bO/TA4OxCOummhSf10siHuG7vJOiwh7SpRpFZDkOgl4= -google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= +google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= +google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= +google.golang.org/grpc v1.43.0 h1:Eeu7bZtDZ2DpRCsLhUlcrLnvYaMK1Gz86a+hMVvELmM= +google.golang.org/grpc v1.43.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU= +google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= +google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= +google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= +google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= +google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= +google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= +google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= +google.golang.org/protobuf v1.29.0 h1:44S3JjaKmLEE4YIkjzexaP+NzZsudE3Zin5Njn/pYX0= +google.golang.org/protobuf v1.29.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.3/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/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/proto/compile-proto.sh b/proto/compile-proto.sh new file mode 100755 index 0000000..5773300 --- /dev/null +++ b/proto/compile-proto.sh @@ -0,0 +1 @@ +protoc --go_out=. --go_opt=paths=source_relative --go-grpc_out=. --go-grpc_opt=paths=source_relative wg.proto \ No newline at end of file diff --git a/proto/wg.pb.go b/proto/wg.pb.go index c300244..d3ea254 100644 --- a/proto/wg.pb.go +++ b/proto/wg.pb.go @@ -1,1333 +1,1378 @@ // Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.28.1 +// protoc v3.6.1 // source: wg.proto -package wg +package proto import ( - context "context" - fmt "fmt" - proto "github.com/golang/protobuf/proto" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" - math "math" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" ) -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) type PeerStatusReq struct { - NicName string `protobuf:"bytes,1,opt,name=nicName,proto3" json:"nicName,omitempty"` - PublicKey string `protobuf:"bytes,2,opt,name=publicKey,proto3" json:"publicKey,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (m *PeerStatusReq) Reset() { *m = PeerStatusReq{} } -func (m *PeerStatusReq) String() string { return proto.CompactTextString(m) } -func (*PeerStatusReq) ProtoMessage() {} -func (*PeerStatusReq) Descriptor() ([]byte, []int) { - return fileDescriptor_44e0f2c0b3aafb52, []int{0} + NicName string `protobuf:"bytes,1,opt,name=nicName,proto3" json:"nicName,omitempty"` + PublicKey string `protobuf:"bytes,2,opt,name=publicKey,proto3" json:"publicKey,omitempty"` } -func (m *PeerStatusReq) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_PeerStatusReq.Unmarshal(m, b) -} -func (m *PeerStatusReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_PeerStatusReq.Marshal(b, m, deterministic) -} -func (m *PeerStatusReq) XXX_Merge(src proto.Message) { - xxx_messageInfo_PeerStatusReq.Merge(m, src) +func (x *PeerStatusReq) Reset() { + *x = PeerStatusReq{} + if protoimpl.UnsafeEnabled { + mi := &file_wg_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *PeerStatusReq) XXX_Size() int { - return xxx_messageInfo_PeerStatusReq.Size(m) + +func (x *PeerStatusReq) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *PeerStatusReq) XXX_DiscardUnknown() { - xxx_messageInfo_PeerStatusReq.DiscardUnknown(m) + +func (*PeerStatusReq) ProtoMessage() {} + +func (x *PeerStatusReq) ProtoReflect() protoreflect.Message { + mi := &file_wg_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) } -var xxx_messageInfo_PeerStatusReq proto.InternalMessageInfo +// Deprecated: Use PeerStatusReq.ProtoReflect.Descriptor instead. +func (*PeerStatusReq) Descriptor() ([]byte, []int) { + return file_wg_proto_rawDescGZIP(), []int{0} +} -func (m *PeerStatusReq) GetNicName() string { - if m != nil { - return m.NicName +func (x *PeerStatusReq) GetNicName() string { + if x != nil { + return x.NicName } return "" } -func (m *PeerStatusReq) GetPublicKey() string { - if m != nil { - return m.PublicKey +func (x *PeerStatusReq) GetPublicKey() string { + if x != nil { + return x.PublicKey } return "" } type PeerStatusResp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + // connected or not connected - Status bool `protobuf:"varint,1,opt,name=status,proto3" json:"status,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + Status bool `protobuf:"varint,1,opt,name=status,proto3" json:"status,omitempty"` } -func (m *PeerStatusResp) Reset() { *m = PeerStatusResp{} } -func (m *PeerStatusResp) String() string { return proto.CompactTextString(m) } -func (*PeerStatusResp) ProtoMessage() {} -func (*PeerStatusResp) Descriptor() ([]byte, []int) { - return fileDescriptor_44e0f2c0b3aafb52, []int{1} +func (x *PeerStatusResp) Reset() { + *x = PeerStatusResp{} + if protoimpl.UnsafeEnabled { + mi := &file_wg_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *PeerStatusResp) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_PeerStatusResp.Unmarshal(m, b) -} -func (m *PeerStatusResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_PeerStatusResp.Marshal(b, m, deterministic) -} -func (m *PeerStatusResp) XXX_Merge(src proto.Message) { - xxx_messageInfo_PeerStatusResp.Merge(m, src) +func (x *PeerStatusResp) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *PeerStatusResp) XXX_Size() int { - return xxx_messageInfo_PeerStatusResp.Size(m) -} -func (m *PeerStatusResp) XXX_DiscardUnknown() { - xxx_messageInfo_PeerStatusResp.DiscardUnknown(m) + +func (*PeerStatusResp) ProtoMessage() {} + +func (x *PeerStatusResp) ProtoReflect() protoreflect.Message { + mi := &file_wg_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_PeerStatusResp proto.InternalMessageInfo +// Deprecated: Use PeerStatusResp.ProtoReflect.Descriptor instead. +func (*PeerStatusResp) Descriptor() ([]byte, []int) { + return file_wg_proto_rawDescGZIP(), []int{1} +} -func (m *PeerStatusResp) GetStatus() bool { - if m != nil { - return m.Status +func (x *PeerStatusResp) GetStatus() bool { + if x != nil { + return x.Status } return false } type AddPReq struct { - Nic string `protobuf:"bytes,1,opt,name=nic,proto3" json:"nic,omitempty"` - AllowedIPs string `protobuf:"bytes,2,opt,name=allowedIPs,proto3" json:"allowedIPs,omitempty"` - PublicKey string `protobuf:"bytes,3,opt,name=publicKey,proto3" json:"publicKey,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (m *AddPReq) Reset() { *m = AddPReq{} } -func (m *AddPReq) String() string { return proto.CompactTextString(m) } -func (*AddPReq) ProtoMessage() {} -func (*AddPReq) Descriptor() ([]byte, []int) { - return fileDescriptor_44e0f2c0b3aafb52, []int{2} + Nic string `protobuf:"bytes,1,opt,name=nic,proto3" json:"nic,omitempty"` + AllowedIPs string `protobuf:"bytes,2,opt,name=allowedIPs,proto3" json:"allowedIPs,omitempty"` + PublicKey string `protobuf:"bytes,3,opt,name=publicKey,proto3" json:"publicKey,omitempty"` } -func (m *AddPReq) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_AddPReq.Unmarshal(m, b) -} -func (m *AddPReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_AddPReq.Marshal(b, m, deterministic) -} -func (m *AddPReq) XXX_Merge(src proto.Message) { - xxx_messageInfo_AddPReq.Merge(m, src) +func (x *AddPReq) Reset() { + *x = AddPReq{} + if protoimpl.UnsafeEnabled { + mi := &file_wg_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *AddPReq) XXX_Size() int { - return xxx_messageInfo_AddPReq.Size(m) + +func (x *AddPReq) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *AddPReq) XXX_DiscardUnknown() { - xxx_messageInfo_AddPReq.DiscardUnknown(m) + +func (*AddPReq) ProtoMessage() {} + +func (x *AddPReq) ProtoReflect() protoreflect.Message { + mi := &file_wg_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_AddPReq proto.InternalMessageInfo +// Deprecated: Use AddPReq.ProtoReflect.Descriptor instead. +func (*AddPReq) Descriptor() ([]byte, []int) { + return file_wg_proto_rawDescGZIP(), []int{2} +} -func (m *AddPReq) GetNic() string { - if m != nil { - return m.Nic +func (x *AddPReq) GetNic() string { + if x != nil { + return x.Nic } return "" } -func (m *AddPReq) GetAllowedIPs() string { - if m != nil { - return m.AllowedIPs +func (x *AddPReq) GetAllowedIPs() string { + if x != nil { + return x.AllowedIPs } return "" } -func (m *AddPReq) GetPublicKey() string { - if m != nil { - return m.PublicKey +func (x *AddPReq) GetPublicKey() string { + if x != nil { + return x.PublicKey } return "" } type AddPResp struct { - Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (m *AddPResp) Reset() { *m = AddPResp{} } -func (m *AddPResp) String() string { return proto.CompactTextString(m) } -func (*AddPResp) ProtoMessage() {} -func (*AddPResp) Descriptor() ([]byte, []int) { - return fileDescriptor_44e0f2c0b3aafb52, []int{3} + Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` } -func (m *AddPResp) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_AddPResp.Unmarshal(m, b) -} -func (m *AddPResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_AddPResp.Marshal(b, m, deterministic) -} -func (m *AddPResp) XXX_Merge(src proto.Message) { - xxx_messageInfo_AddPResp.Merge(m, src) +func (x *AddPResp) Reset() { + *x = AddPResp{} + if protoimpl.UnsafeEnabled { + mi := &file_wg_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *AddPResp) XXX_Size() int { - return xxx_messageInfo_AddPResp.Size(m) + +func (x *AddPResp) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *AddPResp) XXX_DiscardUnknown() { - xxx_messageInfo_AddPResp.DiscardUnknown(m) + +func (*AddPResp) ProtoMessage() {} + +func (x *AddPResp) ProtoReflect() protoreflect.Message { + mi := &file_wg_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_AddPResp proto.InternalMessageInfo +// Deprecated: Use AddPResp.ProtoReflect.Descriptor instead. +func (*AddPResp) Descriptor() ([]byte, []int) { + return file_wg_proto_rawDescGZIP(), []int{3} +} -func (m *AddPResp) GetMessage() string { - if m != nil { - return m.Message +func (x *AddPResp) GetMessage() string { + if x != nil { + return x.Message } return "" } type ListPeersReq struct { - Nicname string `protobuf:"bytes,1,opt,name=nicname,proto3" json:"nicname,omitempty"` - Error string `protobuf:"bytes,2,opt,name=error,proto3" json:"error,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (m *ListPeersReq) Reset() { *m = ListPeersReq{} } -func (m *ListPeersReq) String() string { return proto.CompactTextString(m) } -func (*ListPeersReq) ProtoMessage() {} -func (*ListPeersReq) Descriptor() ([]byte, []int) { - return fileDescriptor_44e0f2c0b3aafb52, []int{4} + Nicname string `protobuf:"bytes,1,opt,name=nicname,proto3" json:"nicname,omitempty"` + Error string `protobuf:"bytes,2,opt,name=error,proto3" json:"error,omitempty"` } -func (m *ListPeersReq) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ListPeersReq.Unmarshal(m, b) -} -func (m *ListPeersReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ListPeersReq.Marshal(b, m, deterministic) -} -func (m *ListPeersReq) XXX_Merge(src proto.Message) { - xxx_messageInfo_ListPeersReq.Merge(m, src) +func (x *ListPeersReq) Reset() { + *x = ListPeersReq{} + if protoimpl.UnsafeEnabled { + mi := &file_wg_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *ListPeersReq) XXX_Size() int { - return xxx_messageInfo_ListPeersReq.Size(m) + +func (x *ListPeersReq) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *ListPeersReq) XXX_DiscardUnknown() { - xxx_messageInfo_ListPeersReq.DiscardUnknown(m) + +func (*ListPeersReq) ProtoMessage() {} + +func (x *ListPeersReq) ProtoReflect() protoreflect.Message { + mi := &file_wg_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_ListPeersReq proto.InternalMessageInfo +// Deprecated: Use ListPeersReq.ProtoReflect.Descriptor instead. +func (*ListPeersReq) Descriptor() ([]byte, []int) { + return file_wg_proto_rawDescGZIP(), []int{4} +} -func (m *ListPeersReq) GetNicname() string { - if m != nil { - return m.Nicname +func (x *ListPeersReq) GetNicname() string { + if x != nil { + return x.Nicname } return "" } -func (m *ListPeersReq) GetError() string { - if m != nil { - return m.Error +func (x *ListPeersReq) GetError() string { + if x != nil { + return x.Error } return "" } type ListPeersResp struct { - Response string `protobuf:"bytes,1,opt,name=response,proto3" json:"response,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (m *ListPeersResp) Reset() { *m = ListPeersResp{} } -func (m *ListPeersResp) String() string { return proto.CompactTextString(m) } -func (*ListPeersResp) ProtoMessage() {} -func (*ListPeersResp) Descriptor() ([]byte, []int) { - return fileDescriptor_44e0f2c0b3aafb52, []int{5} + Response string `protobuf:"bytes,1,opt,name=response,proto3" json:"response,omitempty"` } -func (m *ListPeersResp) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ListPeersResp.Unmarshal(m, b) -} -func (m *ListPeersResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ListPeersResp.Marshal(b, m, deterministic) -} -func (m *ListPeersResp) XXX_Merge(src proto.Message) { - xxx_messageInfo_ListPeersResp.Merge(m, src) +func (x *ListPeersResp) Reset() { + *x = ListPeersResp{} + if protoimpl.UnsafeEnabled { + mi := &file_wg_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *ListPeersResp) XXX_Size() int { - return xxx_messageInfo_ListPeersResp.Size(m) + +func (x *ListPeersResp) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *ListPeersResp) XXX_DiscardUnknown() { - xxx_messageInfo_ListPeersResp.DiscardUnknown(m) + +func (*ListPeersResp) ProtoMessage() {} + +func (x *ListPeersResp) ProtoReflect() protoreflect.Message { + mi := &file_wg_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_ListPeersResp proto.InternalMessageInfo +// Deprecated: Use ListPeersResp.ProtoReflect.Descriptor instead. +func (*ListPeersResp) Descriptor() ([]byte, []int) { + return file_wg_proto_rawDescGZIP(), []int{5} +} -func (m *ListPeersResp) GetResponse() string { - if m != nil { - return m.Response +func (x *ListPeersResp) GetResponse() string { + if x != nil { + return x.Response } return "" } type IReq struct { - Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` - ListenPort uint32 `protobuf:"varint,2,opt,name=listenPort,proto3" json:"listenPort,omitempty"` - SaveConfig bool `protobuf:"varint,3,opt,name=saveConfig,proto3" json:"saveConfig,omitempty"` - PrivateKey string `protobuf:"bytes,4,opt,name=privateKey,proto3" json:"privateKey,omitempty"` - Eth string `protobuf:"bytes,5,opt,name=eth,proto3" json:"eth,omitempty"` - IName string `protobuf:"bytes,6,opt,name=iName,proto3" json:"iName,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *IReq) Reset() { *m = IReq{} } -func (m *IReq) String() string { return proto.CompactTextString(m) } -func (*IReq) ProtoMessage() {} -func (*IReq) Descriptor() ([]byte, []int) { - return fileDescriptor_44e0f2c0b3aafb52, []int{6} -} + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (m *IReq) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_IReq.Unmarshal(m, b) -} -func (m *IReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_IReq.Marshal(b, m, deterministic) + Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` + ListenPort uint32 `protobuf:"varint,2,opt,name=listenPort,proto3" json:"listenPort,omitempty"` + SaveConfig bool `protobuf:"varint,3,opt,name=saveConfig,proto3" json:"saveConfig,omitempty"` + PrivateKey string `protobuf:"bytes,4,opt,name=privateKey,proto3" json:"privateKey,omitempty"` + Eth string `protobuf:"bytes,5,opt,name=eth,proto3" json:"eth,omitempty"` + IName string `protobuf:"bytes,6,opt,name=iName,proto3" json:"iName,omitempty"` } -func (m *IReq) XXX_Merge(src proto.Message) { - xxx_messageInfo_IReq.Merge(m, src) + +func (x *IReq) Reset() { + *x = IReq{} + if protoimpl.UnsafeEnabled { + mi := &file_wg_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *IReq) XXX_Size() int { - return xxx_messageInfo_IReq.Size(m) + +func (x *IReq) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *IReq) XXX_DiscardUnknown() { - xxx_messageInfo_IReq.DiscardUnknown(m) + +func (*IReq) ProtoMessage() {} + +func (x *IReq) ProtoReflect() protoreflect.Message { + mi := &file_wg_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_IReq proto.InternalMessageInfo +// Deprecated: Use IReq.ProtoReflect.Descriptor instead. +func (*IReq) Descriptor() ([]byte, []int) { + return file_wg_proto_rawDescGZIP(), []int{6} +} -func (m *IReq) GetAddress() string { - if m != nil { - return m.Address +func (x *IReq) GetAddress() string { + if x != nil { + return x.Address } return "" } -func (m *IReq) GetListenPort() uint32 { - if m != nil { - return m.ListenPort +func (x *IReq) GetListenPort() uint32 { + if x != nil { + return x.ListenPort } return 0 } -func (m *IReq) GetSaveConfig() bool { - if m != nil { - return m.SaveConfig +func (x *IReq) GetSaveConfig() bool { + if x != nil { + return x.SaveConfig } return false } -func (m *IReq) GetPrivateKey() string { - if m != nil { - return m.PrivateKey +func (x *IReq) GetPrivateKey() string { + if x != nil { + return x.PrivateKey } return "" } -func (m *IReq) GetEth() string { - if m != nil { - return m.Eth +func (x *IReq) GetEth() string { + if x != nil { + return x.Eth } return "" } -func (m *IReq) GetIName() string { - if m != nil { - return m.IName +func (x *IReq) GetIName() string { + if x != nil { + return x.IName } return "" } type IResp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + // message could be error or ordinary result depend on function result. - Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` } -func (m *IResp) Reset() { *m = IResp{} } -func (m *IResp) String() string { return proto.CompactTextString(m) } -func (*IResp) ProtoMessage() {} -func (*IResp) Descriptor() ([]byte, []int) { - return fileDescriptor_44e0f2c0b3aafb52, []int{7} +func (x *IResp) Reset() { + *x = IResp{} + if protoimpl.UnsafeEnabled { + mi := &file_wg_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *IResp) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_IResp.Unmarshal(m, b) -} -func (m *IResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_IResp.Marshal(b, m, deterministic) -} -func (m *IResp) XXX_Merge(src proto.Message) { - xxx_messageInfo_IResp.Merge(m, src) -} -func (m *IResp) XXX_Size() int { - return xxx_messageInfo_IResp.Size(m) +func (x *IResp) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *IResp) XXX_DiscardUnknown() { - xxx_messageInfo_IResp.DiscardUnknown(m) + +func (*IResp) ProtoMessage() {} + +func (x *IResp) ProtoReflect() protoreflect.Message { + mi := &file_wg_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) } -var xxx_messageInfo_IResp proto.InternalMessageInfo +// Deprecated: Use IResp.ProtoReflect.Descriptor instead. +func (*IResp) Descriptor() ([]byte, []int) { + return file_wg_proto_rawDescGZIP(), []int{7} +} -func (m *IResp) GetMessage() string { - if m != nil { - return m.Message +func (x *IResp) GetMessage() string { + if x != nil { + return x.Message } return "" } type DelPReq struct { - PeerPublicKey string `protobuf:"bytes,1,opt,name=peerPublicKey,proto3" json:"peerPublicKey,omitempty"` - IpAddress string `protobuf:"bytes,2,opt,name=ipAddress,proto3" json:"ipAddress,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (m *DelPReq) Reset() { *m = DelPReq{} } -func (m *DelPReq) String() string { return proto.CompactTextString(m) } -func (*DelPReq) ProtoMessage() {} -func (*DelPReq) Descriptor() ([]byte, []int) { - return fileDescriptor_44e0f2c0b3aafb52, []int{8} + PeerPublicKey string `protobuf:"bytes,1,opt,name=peerPublicKey,proto3" json:"peerPublicKey,omitempty"` + Nic string `protobuf:"bytes,2,opt,name=nic,proto3" json:"nic,omitempty"` } -func (m *DelPReq) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_DelPReq.Unmarshal(m, b) -} -func (m *DelPReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_DelPReq.Marshal(b, m, deterministic) -} -func (m *DelPReq) XXX_Merge(src proto.Message) { - xxx_messageInfo_DelPReq.Merge(m, src) +func (x *DelPReq) Reset() { + *x = DelPReq{} + if protoimpl.UnsafeEnabled { + mi := &file_wg_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *DelPReq) XXX_Size() int { - return xxx_messageInfo_DelPReq.Size(m) + +func (x *DelPReq) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *DelPReq) XXX_DiscardUnknown() { - xxx_messageInfo_DelPReq.DiscardUnknown(m) + +func (*DelPReq) ProtoMessage() {} + +func (x *DelPReq) ProtoReflect() protoreflect.Message { + mi := &file_wg_proto_msgTypes[8] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_DelPReq proto.InternalMessageInfo +// Deprecated: Use DelPReq.ProtoReflect.Descriptor instead. +func (*DelPReq) Descriptor() ([]byte, []int) { + return file_wg_proto_rawDescGZIP(), []int{8} +} -func (m *DelPReq) GetPeerPublicKey() string { - if m != nil { - return m.PeerPublicKey +func (x *DelPReq) GetPeerPublicKey() string { + if x != nil { + return x.PeerPublicKey } return "" } -func (m *DelPReq) GetIpAddress() string { - if m != nil { - return m.IpAddress +func (x *DelPReq) GetNic() string { + if x != nil { + return x.Nic } return "" } type DelPResp struct { - Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (m *DelPResp) Reset() { *m = DelPResp{} } -func (m *DelPResp) String() string { return proto.CompactTextString(m) } -func (*DelPResp) ProtoMessage() {} -func (*DelPResp) Descriptor() ([]byte, []int) { - return fileDescriptor_44e0f2c0b3aafb52, []int{9} + Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` } -func (m *DelPResp) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_DelPResp.Unmarshal(m, b) -} -func (m *DelPResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_DelPResp.Marshal(b, m, deterministic) -} -func (m *DelPResp) XXX_Merge(src proto.Message) { - xxx_messageInfo_DelPResp.Merge(m, src) +func (x *DelPResp) Reset() { + *x = DelPResp{} + if protoimpl.UnsafeEnabled { + mi := &file_wg_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *DelPResp) XXX_Size() int { - return xxx_messageInfo_DelPResp.Size(m) + +func (x *DelPResp) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *DelPResp) XXX_DiscardUnknown() { - xxx_messageInfo_DelPResp.DiscardUnknown(m) + +func (*DelPResp) ProtoMessage() {} + +func (x *DelPResp) ProtoReflect() protoreflect.Message { + mi := &file_wg_proto_msgTypes[9] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_DelPResp proto.InternalMessageInfo +// Deprecated: Use DelPResp.ProtoReflect.Descriptor instead. +func (*DelPResp) Descriptor() ([]byte, []int) { + return file_wg_proto_rawDescGZIP(), []int{9} +} -func (m *DelPResp) GetMessage() string { - if m != nil { - return m.Message +func (x *DelPResp) GetMessage() string { + if x != nil { + return x.Message } return "" } type ManageNICReq struct { - // manage NIC is responsible to up and down given interface - Nic string `protobuf:"bytes,1,opt,name=nic,proto3" json:"nic,omitempty"` - Cmd string `protobuf:"bytes,2,opt,name=cmd,proto3" json:"cmd,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (m *ManageNICReq) Reset() { *m = ManageNICReq{} } -func (m *ManageNICReq) String() string { return proto.CompactTextString(m) } -func (*ManageNICReq) ProtoMessage() {} -func (*ManageNICReq) Descriptor() ([]byte, []int) { - return fileDescriptor_44e0f2c0b3aafb52, []int{10} + // manage NIC is responsible to up and down given interface + Nic string `protobuf:"bytes,1,opt,name=nic,proto3" json:"nic,omitempty"` + Cmd string `protobuf:"bytes,2,opt,name=cmd,proto3" json:"cmd,omitempty"` // up or down } -func (m *ManageNICReq) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ManageNICReq.Unmarshal(m, b) -} -func (m *ManageNICReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ManageNICReq.Marshal(b, m, deterministic) -} -func (m *ManageNICReq) XXX_Merge(src proto.Message) { - xxx_messageInfo_ManageNICReq.Merge(m, src) +func (x *ManageNICReq) Reset() { + *x = ManageNICReq{} + if protoimpl.UnsafeEnabled { + mi := &file_wg_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *ManageNICReq) XXX_Size() int { - return xxx_messageInfo_ManageNICReq.Size(m) + +func (x *ManageNICReq) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *ManageNICReq) XXX_DiscardUnknown() { - xxx_messageInfo_ManageNICReq.DiscardUnknown(m) + +func (*ManageNICReq) ProtoMessage() {} + +func (x *ManageNICReq) ProtoReflect() protoreflect.Message { + mi := &file_wg_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) } -var xxx_messageInfo_ManageNICReq proto.InternalMessageInfo +// Deprecated: Use ManageNICReq.ProtoReflect.Descriptor instead. +func (*ManageNICReq) Descriptor() ([]byte, []int) { + return file_wg_proto_rawDescGZIP(), []int{10} +} -func (m *ManageNICReq) GetNic() string { - if m != nil { - return m.Nic +func (x *ManageNICReq) GetNic() string { + if x != nil { + return x.Nic } return "" } -func (m *ManageNICReq) GetCmd() string { - if m != nil { - return m.Cmd +func (x *ManageNICReq) GetCmd() string { + if x != nil { + return x.Cmd } return "" } type ManageNICResp struct { - Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (m *ManageNICResp) Reset() { *m = ManageNICResp{} } -func (m *ManageNICResp) String() string { return proto.CompactTextString(m) } -func (*ManageNICResp) ProtoMessage() {} -func (*ManageNICResp) Descriptor() ([]byte, []int) { - return fileDescriptor_44e0f2c0b3aafb52, []int{11} + Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` } -func (m *ManageNICResp) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ManageNICResp.Unmarshal(m, b) -} -func (m *ManageNICResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ManageNICResp.Marshal(b, m, deterministic) -} -func (m *ManageNICResp) XXX_Merge(src proto.Message) { - xxx_messageInfo_ManageNICResp.Merge(m, src) -} -func (m *ManageNICResp) XXX_Size() int { - return xxx_messageInfo_ManageNICResp.Size(m) -} -func (m *ManageNICResp) XXX_DiscardUnknown() { - xxx_messageInfo_ManageNICResp.DiscardUnknown(m) -} - -var xxx_messageInfo_ManageNICResp proto.InternalMessageInfo - -func (m *ManageNICResp) GetMessage() string { - if m != nil { - return m.Message +func (x *ManageNICResp) Reset() { + *x = ManageNICResp{} + if protoimpl.UnsafeEnabled { + mi := &file_wg_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } - return "" } -type NICInfoReq struct { - Interface string `protobuf:"bytes,1,opt,name=interface,proto3" json:"interface,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` +func (x *ManageNICResp) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *NICInfoReq) Reset() { *m = NICInfoReq{} } -func (m *NICInfoReq) String() string { return proto.CompactTextString(m) } -func (*NICInfoReq) ProtoMessage() {} -func (*NICInfoReq) Descriptor() ([]byte, []int) { - return fileDescriptor_44e0f2c0b3aafb52, []int{12} -} +func (*ManageNICResp) ProtoMessage() {} -func (m *NICInfoReq) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_NICInfoReq.Unmarshal(m, b) -} -func (m *NICInfoReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_NICInfoReq.Marshal(b, m, deterministic) -} -func (m *NICInfoReq) XXX_Merge(src proto.Message) { - xxx_messageInfo_NICInfoReq.Merge(m, src) -} -func (m *NICInfoReq) XXX_Size() int { - return xxx_messageInfo_NICInfoReq.Size(m) -} -func (m *NICInfoReq) XXX_DiscardUnknown() { - xxx_messageInfo_NICInfoReq.DiscardUnknown(m) +func (x *ManageNICResp) ProtoReflect() protoreflect.Message { + mi := &file_wg_proto_msgTypes[11] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_NICInfoReq proto.InternalMessageInfo +// Deprecated: Use ManageNICResp.ProtoReflect.Descriptor instead. +func (*ManageNICResp) Descriptor() ([]byte, []int) { + return file_wg_proto_rawDescGZIP(), []int{11} +} -func (m *NICInfoReq) GetInterface() string { - if m != nil { - return m.Interface +func (x *ManageNICResp) GetMessage() string { + if x != nil { + return x.Message } return "" } -type NICInfoResp struct { - Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} +type NICInfoReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (m *NICInfoResp) Reset() { *m = NICInfoResp{} } -func (m *NICInfoResp) String() string { return proto.CompactTextString(m) } -func (*NICInfoResp) ProtoMessage() {} -func (*NICInfoResp) Descriptor() ([]byte, []int) { - return fileDescriptor_44e0f2c0b3aafb52, []int{13} + Interface string `protobuf:"bytes,1,opt,name=interface,proto3" json:"interface,omitempty"` } -func (m *NICInfoResp) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_NICInfoResp.Unmarshal(m, b) -} -func (m *NICInfoResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_NICInfoResp.Marshal(b, m, deterministic) -} -func (m *NICInfoResp) XXX_Merge(src proto.Message) { - xxx_messageInfo_NICInfoResp.Merge(m, src) -} -func (m *NICInfoResp) XXX_Size() int { - return xxx_messageInfo_NICInfoResp.Size(m) +func (x *NICInfoReq) Reset() { + *x = NICInfoReq{} + if protoimpl.UnsafeEnabled { + mi := &file_wg_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *NICInfoResp) XXX_DiscardUnknown() { - xxx_messageInfo_NICInfoResp.DiscardUnknown(m) + +func (x *NICInfoReq) String() string { + return protoimpl.X.MessageStringOf(x) } -var xxx_messageInfo_NICInfoResp proto.InternalMessageInfo +func (*NICInfoReq) ProtoMessage() {} -func (m *NICInfoResp) GetMessage() string { - if m != nil { - return m.Message +func (x *NICInfoReq) ProtoReflect() protoreflect.Message { + mi := &file_wg_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 "" + return mi.MessageOf(x) } -type PubKeyReq struct { - PubKeyName string `protobuf:"bytes,1,opt,name=pubKeyName,proto3" json:"pubKeyName,omitempty"` - PrivKeyName string `protobuf:"bytes,2,opt,name=privKeyName,proto3" json:"privKeyName,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *PubKeyReq) Reset() { *m = PubKeyReq{} } -func (m *PubKeyReq) String() string { return proto.CompactTextString(m) } -func (*PubKeyReq) ProtoMessage() {} -func (*PubKeyReq) Descriptor() ([]byte, []int) { - return fileDescriptor_44e0f2c0b3aafb52, []int{14} +// Deprecated: Use NICInfoReq.ProtoReflect.Descriptor instead. +func (*NICInfoReq) Descriptor() ([]byte, []int) { + return file_wg_proto_rawDescGZIP(), []int{12} } -func (m *PubKeyReq) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_PubKeyReq.Unmarshal(m, b) -} -func (m *PubKeyReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_PubKeyReq.Marshal(b, m, deterministic) -} -func (m *PubKeyReq) XXX_Merge(src proto.Message) { - xxx_messageInfo_PubKeyReq.Merge(m, src) -} -func (m *PubKeyReq) XXX_Size() int { - return xxx_messageInfo_PubKeyReq.Size(m) -} -func (m *PubKeyReq) XXX_DiscardUnknown() { - xxx_messageInfo_PubKeyReq.DiscardUnknown(m) +func (x *NICInfoReq) GetInterface() string { + if x != nil { + return x.Interface + } + return "" } -var xxx_messageInfo_PubKeyReq proto.InternalMessageInfo +type NICInfoResp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (m *PubKeyReq) GetPubKeyName() string { - if m != nil { - return m.PubKeyName - } - return "" + Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` } -func (m *PubKeyReq) GetPrivKeyName() string { - if m != nil { - return m.PrivKeyName +func (x *NICInfoResp) Reset() { + *x = NICInfoResp{} + if protoimpl.UnsafeEnabled { + mi := &file_wg_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } - return "" } -type PubKeyResp struct { - Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` +func (x *NICInfoResp) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *PubKeyResp) Reset() { *m = PubKeyResp{} } -func (m *PubKeyResp) String() string { return proto.CompactTextString(m) } -func (*PubKeyResp) ProtoMessage() {} -func (*PubKeyResp) Descriptor() ([]byte, []int) { - return fileDescriptor_44e0f2c0b3aafb52, []int{15} -} +func (*NICInfoResp) ProtoMessage() {} -func (m *PubKeyResp) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_PubKeyResp.Unmarshal(m, b) -} -func (m *PubKeyResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_PubKeyResp.Marshal(b, m, deterministic) -} -func (m *PubKeyResp) XXX_Merge(src proto.Message) { - xxx_messageInfo_PubKeyResp.Merge(m, src) -} -func (m *PubKeyResp) XXX_Size() int { - return xxx_messageInfo_PubKeyResp.Size(m) -} -func (m *PubKeyResp) XXX_DiscardUnknown() { - xxx_messageInfo_PubKeyResp.DiscardUnknown(m) +func (x *NICInfoResp) ProtoReflect() protoreflect.Message { + mi := &file_wg_proto_msgTypes[13] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_PubKeyResp proto.InternalMessageInfo +// Deprecated: Use NICInfoResp.ProtoReflect.Descriptor instead. +func (*NICInfoResp) Descriptor() ([]byte, []int) { + return file_wg_proto_rawDescGZIP(), []int{13} +} -func (m *PubKeyResp) GetMessage() string { - if m != nil { - return m.Message +func (x *NICInfoResp) GetMessage() string { + if x != nil { + return x.Message } return "" } -type PrivKeyReq struct { - PrivateKeyName string `protobuf:"bytes,1,opt,name=privateKeyName,proto3" json:"privateKeyName,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} +type PubKeyReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (m *PrivKeyReq) Reset() { *m = PrivKeyReq{} } -func (m *PrivKeyReq) String() string { return proto.CompactTextString(m) } -func (*PrivKeyReq) ProtoMessage() {} -func (*PrivKeyReq) Descriptor() ([]byte, []int) { - return fileDescriptor_44e0f2c0b3aafb52, []int{16} + PubKeyName string `protobuf:"bytes,1,opt,name=pubKeyName,proto3" json:"pubKeyName,omitempty"` // name of wireguard interface + PrivKeyName string `protobuf:"bytes,2,opt,name=privKeyName,proto3" json:"privKeyName,omitempty"` } -func (m *PrivKeyReq) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_PrivKeyReq.Unmarshal(m, b) -} -func (m *PrivKeyReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_PrivKeyReq.Marshal(b, m, deterministic) -} -func (m *PrivKeyReq) XXX_Merge(src proto.Message) { - xxx_messageInfo_PrivKeyReq.Merge(m, src) -} -func (m *PrivKeyReq) XXX_Size() int { - return xxx_messageInfo_PrivKeyReq.Size(m) +func (x *PubKeyReq) Reset() { + *x = PubKeyReq{} + if protoimpl.UnsafeEnabled { + mi := &file_wg_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *PrivKeyReq) XXX_DiscardUnknown() { - xxx_messageInfo_PrivKeyReq.DiscardUnknown(m) + +func (x *PubKeyReq) String() string { + return protoimpl.X.MessageStringOf(x) } -var xxx_messageInfo_PrivKeyReq proto.InternalMessageInfo +func (*PubKeyReq) ProtoMessage() {} -func (m *PrivKeyReq) GetPrivateKeyName() string { - if m != nil { - return m.PrivateKeyName +func (x *PubKeyReq) ProtoReflect() protoreflect.Message { + mi := &file_wg_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 "" -} - -type PrivKeyResp struct { - Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + return mi.MessageOf(x) } -func (m *PrivKeyResp) Reset() { *m = PrivKeyResp{} } -func (m *PrivKeyResp) String() string { return proto.CompactTextString(m) } -func (*PrivKeyResp) ProtoMessage() {} -func (*PrivKeyResp) Descriptor() ([]byte, []int) { - return fileDescriptor_44e0f2c0b3aafb52, []int{17} +// Deprecated: Use PubKeyReq.ProtoReflect.Descriptor instead. +func (*PubKeyReq) Descriptor() ([]byte, []int) { + return file_wg_proto_rawDescGZIP(), []int{14} } -func (m *PrivKeyResp) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_PrivKeyResp.Unmarshal(m, b) -} -func (m *PrivKeyResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_PrivKeyResp.Marshal(b, m, deterministic) -} -func (m *PrivKeyResp) XXX_Merge(src proto.Message) { - xxx_messageInfo_PrivKeyResp.Merge(m, src) -} -func (m *PrivKeyResp) XXX_Size() int { - return xxx_messageInfo_PrivKeyResp.Size(m) -} -func (m *PrivKeyResp) XXX_DiscardUnknown() { - xxx_messageInfo_PrivKeyResp.DiscardUnknown(m) +func (x *PubKeyReq) GetPubKeyName() string { + if x != nil { + return x.PubKeyName + } + return "" } -var xxx_messageInfo_PrivKeyResp proto.InternalMessageInfo - -func (m *PrivKeyResp) GetMessage() string { - if m != nil { - return m.Message +func (x *PubKeyReq) GetPrivKeyName() string { + if x != nil { + return x.PrivKeyName } return "" } -func init() { - proto.RegisterType((*PeerStatusReq)(nil), "PeerStatusReq") - proto.RegisterType((*PeerStatusResp)(nil), "PeerStatusResp") - proto.RegisterType((*AddPReq)(nil), "AddPReq") - proto.RegisterType((*AddPResp)(nil), "AddPResp") - proto.RegisterType((*ListPeersReq)(nil), "ListPeersReq") - proto.RegisterType((*ListPeersResp)(nil), "ListPeersResp") - proto.RegisterType((*IReq)(nil), "IReq") - proto.RegisterType((*IResp)(nil), "IResp") - proto.RegisterType((*DelPReq)(nil), "DelPReq") - proto.RegisterType((*DelPResp)(nil), "DelPResp") - proto.RegisterType((*ManageNICReq)(nil), "ManageNICReq") - proto.RegisterType((*ManageNICResp)(nil), "ManageNICResp") - proto.RegisterType((*NICInfoReq)(nil), "NICInfoReq") - proto.RegisterType((*NICInfoResp)(nil), "NICInfoResp") - proto.RegisterType((*PubKeyReq)(nil), "PubKeyReq") - proto.RegisterType((*PubKeyResp)(nil), "PubKeyResp") - proto.RegisterType((*PrivKeyReq)(nil), "PrivKeyReq") - proto.RegisterType((*PrivKeyResp)(nil), "PrivKeyResp") -} - -func init() { proto.RegisterFile("wg.proto", fileDescriptor_44e0f2c0b3aafb52) } - -var fileDescriptor_44e0f2c0b3aafb52 = []byte{ - // 636 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x55, 0x5f, 0x6b, 0xdb, 0x30, - 0x10, 0x4f, 0x97, 0x26, 0x8d, 0x2f, 0x71, 0x56, 0xc4, 0x18, 0xc1, 0x8c, 0xd2, 0x89, 0xd2, 0xb5, - 0xdb, 0xd0, 0x43, 0xb7, 0xe7, 0x41, 0xe9, 0x20, 0x98, 0xae, 0xc5, 0x64, 0x0f, 0x63, 0x8f, 0x6e, - 0x7c, 0x4d, 0x05, 0xae, 0xed, 0x49, 0x4a, 0x4b, 0xf7, 0x89, 0xf6, 0xa1, 0xf6, 0x61, 0x86, 0xfe, - 0xd8, 0x96, 0xcb, 0x48, 0xfb, 0xe6, 0x3b, 0x9d, 0xee, 0xee, 0x77, 0xbf, 0xdf, 0xc9, 0x30, 0xba, - 0x5f, 0xb1, 0x4a, 0x94, 0xaa, 0xa4, 0x73, 0x08, 0x13, 0x44, 0xf1, 0x5d, 0xa5, 0x6a, 0x2d, 0x17, - 0xf8, 0x8b, 0xcc, 0x60, 0xa7, 0xe0, 0xcb, 0xcb, 0xf4, 0x16, 0x67, 0x5b, 0xfb, 0x5b, 0x47, 0xc1, - 0xa2, 0x36, 0xc9, 0x1b, 0x08, 0xaa, 0xf5, 0x55, 0xce, 0x97, 0xe7, 0xf8, 0x30, 0x7b, 0x61, 0xce, - 0x5a, 0x07, 0x3d, 0x82, 0xa9, 0x9f, 0x48, 0x56, 0xe4, 0x35, 0x0c, 0xa5, 0xb1, 0x4c, 0xa2, 0xd1, - 0xc2, 0x59, 0xf4, 0x27, 0xec, 0x9c, 0x66, 0x59, 0xa2, 0x8b, 0xed, 0x42, 0xbf, 0xe0, 0x4b, 0x57, - 0x48, 0x7f, 0x92, 0x3d, 0x80, 0x34, 0xcf, 0xcb, 0x7b, 0xcc, 0xe2, 0x44, 0xba, 0x2a, 0x9e, 0xa7, - 0xdb, 0x44, 0xff, 0x71, 0x13, 0x07, 0x30, 0xb2, 0xa9, 0x65, 0xa5, 0x81, 0xdc, 0xa2, 0x94, 0xe9, - 0xaa, 0x01, 0xe2, 0x4c, 0xfa, 0x05, 0x26, 0xdf, 0xb8, 0x54, 0xba, 0x5d, 0x0f, 0x72, 0xd1, 0x85, - 0xac, 0x4d, 0xf2, 0x0a, 0x06, 0x28, 0x44, 0x29, 0x5c, 0x23, 0xd6, 0xa0, 0x1f, 0x20, 0xf4, 0xee, - 0xcb, 0x8a, 0x44, 0x30, 0x12, 0x28, 0xab, 0xb2, 0x90, 0x75, 0x86, 0xc6, 0xa6, 0x7f, 0xb6, 0x60, - 0x3b, 0x76, 0x55, 0xd2, 0x2c, 0x13, 0x28, 0x65, 0x5d, 0xc5, 0x99, 0x1a, 0x73, 0xce, 0xa5, 0xc2, - 0x22, 0x29, 0x85, 0x32, 0xa5, 0xc2, 0x85, 0xe7, 0xd1, 0xe7, 0x32, 0xbd, 0xc3, 0xb3, 0xb2, 0xb8, - 0xe6, 0x2b, 0x03, 0x7a, 0xb4, 0xf0, 0x3c, 0xfa, 0xbc, 0x12, 0xfc, 0x2e, 0x55, 0xa8, 0x87, 0xb2, - 0x6d, 0x67, 0xd6, 0x7a, 0xf4, 0x94, 0x51, 0xdd, 0xcc, 0x06, 0x76, 0xca, 0xa8, 0x6e, 0x34, 0x2e, - 0x6e, 0x28, 0x1e, 0x5a, 0x5c, 0xc6, 0xa0, 0x6f, 0x61, 0x10, 0x3f, 0x31, 0xba, 0x0b, 0xd8, 0xf9, - 0x8a, 0xb9, 0xe1, 0xee, 0x00, 0xc2, 0x0a, 0x51, 0x24, 0x0d, 0x1b, 0x36, 0xb4, 0xeb, 0xd4, 0x7c, - 0xf1, 0xea, 0xd4, 0xe1, 0x76, 0xa2, 0x69, 0x1c, 0x9a, 0x2f, 0x9b, 0x6e, 0x63, 0xd1, 0x13, 0x98, - 0x5c, 0xa4, 0x45, 0xba, 0xc2, 0xcb, 0xf8, 0xec, 0xff, 0xaa, 0xd9, 0x85, 0xfe, 0xf2, 0x36, 0x73, - 0xf9, 0xf5, 0x27, 0x3d, 0x86, 0xd0, 0xbb, 0xb3, 0x31, 0xfd, 0x7b, 0x80, 0xcb, 0xf8, 0x2c, 0x2e, - 0xae, 0x4b, 0x9d, 0x5c, 0x37, 0x5c, 0x28, 0x14, 0xd7, 0xe9, 0xb2, 0x8e, 0x6c, 0x1d, 0xf4, 0x1d, - 0x8c, 0x9b, 0xd8, 0x27, 0x06, 0x15, 0x24, 0xeb, 0xab, 0x73, 0x7c, 0xd0, 0x39, 0x35, 0x41, 0xc6, - 0xf0, 0xd6, 0xca, 0xf3, 0x90, 0x7d, 0x18, 0x6b, 0xba, 0xea, 0x00, 0x0b, 0xc3, 0x77, 0xd1, 0x43, - 0x80, 0x3a, 0xdd, 0xc6, 0xb2, 0x9f, 0x01, 0x12, 0x7b, 0x4d, 0xd7, 0x3d, 0x84, 0x69, 0x2b, 0x03, - 0xaf, 0xf6, 0x23, 0xaf, 0x46, 0xd5, 0xdc, 0xda, 0x94, 0xfe, 0xe4, 0x6f, 0x1f, 0x82, 0x1f, 0x5c, - 0xe0, 0x6a, 0x9d, 0x8a, 0x8c, 0xec, 0xc1, 0x38, 0x2e, 0xb8, 0xe2, 0x69, 0xce, 0x7f, 0x63, 0x4c, - 0x06, 0x4c, 0xeb, 0x3c, 0x1a, 0x32, 0x23, 0x22, 0xda, 0x23, 0xfb, 0x76, 0xd1, 0x11, 0x05, 0x19, - 0x31, 0xb7, 0xf2, 0x51, 0xc0, 0xea, 0x0d, 0xb5, 0x11, 0x9a, 0x7f, 0x1b, 0xe1, 0x84, 0x15, 0x05, - 0xac, 0xd6, 0x04, 0xed, 0x91, 0x8f, 0x10, 0x34, 0xbb, 0x46, 0x42, 0xe6, 0xef, 0x6d, 0x34, 0x65, - 0x9d, 0x35, 0xb4, 0xd1, 0x0d, 0xeb, 0x24, 0x64, 0xbe, 0x6a, 0xa2, 0x29, 0xeb, 0x08, 0x82, 0xf6, - 0xc8, 0x09, 0x84, 0x73, 0x54, 0xed, 0xab, 0x45, 0xa6, 0xac, 0xf3, 0x16, 0x46, 0x2f, 0x59, 0xf7, - 0x49, 0xa3, 0x3d, 0x72, 0x0c, 0x30, 0x47, 0xe5, 0x34, 0x40, 0xc6, 0xac, 0x55, 0x4e, 0x34, 0x61, - 0x9e, 0x34, 0x4c, 0xe8, 0x64, 0x8e, 0x45, 0xbb, 0x0a, 0xc0, 0x1a, 0x45, 0x44, 0x63, 0xd6, 0xd2, - 0x69, 0xfa, 0x0e, 0x75, 0x68, 0xbb, 0xb2, 0x63, 0xd6, 0xd2, 0x18, 0x4d, 0x98, 0xc7, 0x4e, 0x1d, - 0xad, 0x9e, 0x1b, 0x6d, 0xda, 0x50, 0xcf, 0x69, 0xe3, 0x6a, 0x68, 0xfe, 0x09, 0x9f, 0xfe, 0x05, - 0x00, 0x00, 0xff, 0xff, 0xf5, 0xe1, 0xfd, 0x66, 0x1f, 0x06, 0x00, 0x00, -} - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConn - -// 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.SupportPackageIsVersion4 - -// WireguardClient is the client API for Wireguard service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type WireguardClient interface { - InitializeI(ctx context.Context, in *IReq, opts ...grpc.CallOption) (*IResp, error) - AddPeer(ctx context.Context, in *AddPReq, opts ...grpc.CallOption) (*AddPResp, error) - DelPeer(ctx context.Context, in *DelPReq, opts ...grpc.CallOption) (*DelPResp, error) - ListPeers(ctx context.Context, in *ListPeersReq, opts ...grpc.CallOption) (*ListPeersResp, error) - ManageNIC(ctx context.Context, in *ManageNICReq, opts ...grpc.CallOption) (*ManageNICResp, error) - GetPeerStatus(ctx context.Context, in *PeerStatusReq, opts ...grpc.CallOption) (*PeerStatusResp, error) - GetNICInfo(ctx context.Context, in *NICInfoReq, opts ...grpc.CallOption) (*NICInfoResp, error) - GenPublicKey(ctx context.Context, in *PubKeyReq, opts ...grpc.CallOption) (*PubKeyResp, error) - GenPrivateKey(ctx context.Context, in *PrivKeyReq, opts ...grpc.CallOption) (*PrivKeyResp, error) - GetPrivateKey(ctx context.Context, in *PrivKeyReq, opts ...grpc.CallOption) (*PrivKeyResp, error) - GetPublicKey(ctx context.Context, in *PubKeyReq, opts ...grpc.CallOption) (*PubKeyResp, error) -} - -type wireguardClient struct { - cc *grpc.ClientConn -} - -func NewWireguardClient(cc *grpc.ClientConn) WireguardClient { - return &wireguardClient{cc} -} - -func (c *wireguardClient) InitializeI(ctx context.Context, in *IReq, opts ...grpc.CallOption) (*IResp, error) { - out := new(IResp) - err := c.cc.Invoke(ctx, "/Wireguard/InitializeI", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *wireguardClient) AddPeer(ctx context.Context, in *AddPReq, opts ...grpc.CallOption) (*AddPResp, error) { - out := new(AddPResp) - err := c.cc.Invoke(ctx, "/Wireguard/AddPeer", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *wireguardClient) DelPeer(ctx context.Context, in *DelPReq, opts ...grpc.CallOption) (*DelPResp, error) { - out := new(DelPResp) - err := c.cc.Invoke(ctx, "/Wireguard/DelPeer", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} +type PubKeyResp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (c *wireguardClient) ListPeers(ctx context.Context, in *ListPeersReq, opts ...grpc.CallOption) (*ListPeersResp, error) { - out := new(ListPeersResp) - err := c.cc.Invoke(ctx, "/Wireguard/ListPeers", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil + Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` } -func (c *wireguardClient) ManageNIC(ctx context.Context, in *ManageNICReq, opts ...grpc.CallOption) (*ManageNICResp, error) { - out := new(ManageNICResp) - err := c.cc.Invoke(ctx, "/Wireguard/ManageNIC", in, out, opts...) - if err != nil { - return nil, err +func (x *PubKeyResp) Reset() { + *x = PubKeyResp{} + if protoimpl.UnsafeEnabled { + mi := &file_wg_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } - return out, nil } -func (c *wireguardClient) GetPeerStatus(ctx context.Context, in *PeerStatusReq, opts ...grpc.CallOption) (*PeerStatusResp, error) { - out := new(PeerStatusResp) - err := c.cc.Invoke(ctx, "/Wireguard/GetPeerStatus", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil +func (x *PubKeyResp) String() string { + return protoimpl.X.MessageStringOf(x) } -func (c *wireguardClient) GetNICInfo(ctx context.Context, in *NICInfoReq, opts ...grpc.CallOption) (*NICInfoResp, error) { - out := new(NICInfoResp) - err := c.cc.Invoke(ctx, "/Wireguard/GetNICInfo", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} +func (*PubKeyResp) ProtoMessage() {} -func (c *wireguardClient) GenPublicKey(ctx context.Context, in *PubKeyReq, opts ...grpc.CallOption) (*PubKeyResp, error) { - out := new(PubKeyResp) - err := c.cc.Invoke(ctx, "/Wireguard/GenPublicKey", in, out, opts...) - if err != nil { - return nil, err +func (x *PubKeyResp) ProtoReflect() protoreflect.Message { + mi := &file_wg_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 out, nil + return mi.MessageOf(x) } -func (c *wireguardClient) GenPrivateKey(ctx context.Context, in *PrivKeyReq, opts ...grpc.CallOption) (*PrivKeyResp, error) { - out := new(PrivKeyResp) - err := c.cc.Invoke(ctx, "/Wireguard/GenPrivateKey", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil +// Deprecated: Use PubKeyResp.ProtoReflect.Descriptor instead. +func (*PubKeyResp) Descriptor() ([]byte, []int) { + return file_wg_proto_rawDescGZIP(), []int{15} } -func (c *wireguardClient) GetPrivateKey(ctx context.Context, in *PrivKeyReq, opts ...grpc.CallOption) (*PrivKeyResp, error) { - out := new(PrivKeyResp) - err := c.cc.Invoke(ctx, "/Wireguard/GetPrivateKey", in, out, opts...) - if err != nil { - return nil, err +func (x *PubKeyResp) GetMessage() string { + if x != nil { + return x.Message } - return out, nil + return "" } -func (c *wireguardClient) GetPublicKey(ctx context.Context, in *PubKeyReq, opts ...grpc.CallOption) (*PubKeyResp, error) { - out := new(PubKeyResp) - err := c.cc.Invoke(ctx, "/Wireguard/GetPublicKey", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} +type PrivKeyReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -// WireguardServer is the server API for Wireguard service. -type WireguardServer interface { - InitializeI(context.Context, *IReq) (*IResp, error) - AddPeer(context.Context, *AddPReq) (*AddPResp, error) - DelPeer(context.Context, *DelPReq) (*DelPResp, error) - ListPeers(context.Context, *ListPeersReq) (*ListPeersResp, error) - ManageNIC(context.Context, *ManageNICReq) (*ManageNICResp, error) - GetPeerStatus(context.Context, *PeerStatusReq) (*PeerStatusResp, error) - GetNICInfo(context.Context, *NICInfoReq) (*NICInfoResp, error) - GenPublicKey(context.Context, *PubKeyReq) (*PubKeyResp, error) - GenPrivateKey(context.Context, *PrivKeyReq) (*PrivKeyResp, error) - GetPrivateKey(context.Context, *PrivKeyReq) (*PrivKeyResp, error) - GetPublicKey(context.Context, *PubKeyReq) (*PubKeyResp, error) + PrivateKeyName string `protobuf:"bytes,1,opt,name=privateKeyName,proto3" json:"privateKeyName,omitempty"` } -// UnimplementedWireguardServer can be embedded to have forward compatible implementations. -type UnimplementedWireguardServer struct { +func (x *PrivKeyReq) Reset() { + *x = PrivKeyReq{} + if protoimpl.UnsafeEnabled { + mi := &file_wg_proto_msgTypes[16] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (*UnimplementedWireguardServer) InitializeI(ctx context.Context, req *IReq) (*IResp, error) { - return nil, status.Errorf(codes.Unimplemented, "method InitializeI not implemented") -} -func (*UnimplementedWireguardServer) AddPeer(ctx context.Context, req *AddPReq) (*AddPResp, error) { - return nil, status.Errorf(codes.Unimplemented, "method AddPeer not implemented") -} -func (*UnimplementedWireguardServer) DelPeer(ctx context.Context, req *DelPReq) (*DelPResp, error) { - return nil, status.Errorf(codes.Unimplemented, "method DelPeer not implemented") -} -func (*UnimplementedWireguardServer) ListPeers(ctx context.Context, req *ListPeersReq) (*ListPeersResp, error) { - return nil, status.Errorf(codes.Unimplemented, "method ListPeers not implemented") -} -func (*UnimplementedWireguardServer) ManageNIC(ctx context.Context, req *ManageNICReq) (*ManageNICResp, error) { - return nil, status.Errorf(codes.Unimplemented, "method ManageNIC not implemented") -} -func (*UnimplementedWireguardServer) GetPeerStatus(ctx context.Context, req *PeerStatusReq) (*PeerStatusResp, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetPeerStatus not implemented") -} -func (*UnimplementedWireguardServer) GetNICInfo(ctx context.Context, req *NICInfoReq) (*NICInfoResp, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetNICInfo not implemented") -} -func (*UnimplementedWireguardServer) GenPublicKey(ctx context.Context, req *PubKeyReq) (*PubKeyResp, error) { - return nil, status.Errorf(codes.Unimplemented, "method GenPublicKey not implemented") -} -func (*UnimplementedWireguardServer) GenPrivateKey(ctx context.Context, req *PrivKeyReq) (*PrivKeyResp, error) { - return nil, status.Errorf(codes.Unimplemented, "method GenPrivateKey not implemented") -} -func (*UnimplementedWireguardServer) GetPrivateKey(ctx context.Context, req *PrivKeyReq) (*PrivKeyResp, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetPrivateKey not implemented") -} -func (*UnimplementedWireguardServer) GetPublicKey(ctx context.Context, req *PubKeyReq) (*PubKeyResp, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetPublicKey not implemented") +func (x *PrivKeyReq) String() string { + return protoimpl.X.MessageStringOf(x) } -func RegisterWireguardServer(s *grpc.Server, srv WireguardServer) { - s.RegisterService(&_Wireguard_serviceDesc, srv) -} +func (*PrivKeyReq) ProtoMessage() {} -func _Wireguard_InitializeI_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(IReq) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(WireguardServer).InitializeI(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/Wireguard/InitializeI", +func (x *PrivKeyReq) ProtoReflect() protoreflect.Message { + mi := &file_wg_proto_msgTypes[16] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(WireguardServer).InitializeI(ctx, req.(*IReq)) - } - return interceptor(ctx, in, info, handler) + return mi.MessageOf(x) } -func _Wireguard_AddPeer_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(AddPReq) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(WireguardServer).AddPeer(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/Wireguard/AddPeer", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(WireguardServer).AddPeer(ctx, req.(*AddPReq)) - } - return interceptor(ctx, in, info, handler) +// Deprecated: Use PrivKeyReq.ProtoReflect.Descriptor instead. +func (*PrivKeyReq) Descriptor() ([]byte, []int) { + return file_wg_proto_rawDescGZIP(), []int{16} } -func _Wireguard_DelPeer_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DelPReq) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(WireguardServer).DelPeer(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/Wireguard/DelPeer", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(WireguardServer).DelPeer(ctx, req.(*DelPReq)) +func (x *PrivKeyReq) GetPrivateKeyName() string { + if x != nil { + return x.PrivateKeyName } - return interceptor(ctx, in, info, handler) + return "" } -func _Wireguard_ListPeers_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ListPeersReq) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(WireguardServer).ListPeers(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/Wireguard/ListPeers", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(WireguardServer).ListPeers(ctx, req.(*ListPeersReq)) - } - return interceptor(ctx, in, info, handler) -} +type PrivKeyResp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func _Wireguard_ManageNIC_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ManageNICReq) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(WireguardServer).ManageNIC(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/Wireguard/ManageNIC", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(WireguardServer).ManageNIC(ctx, req.(*ManageNICReq)) - } - return interceptor(ctx, in, info, handler) + Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` } -func _Wireguard_GetPeerStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(PeerStatusReq) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(WireguardServer).GetPeerStatus(ctx, in) +func (x *PrivKeyResp) Reset() { + *x = PrivKeyResp{} + if protoimpl.UnsafeEnabled { + mi := &file_wg_proto_msgTypes[17] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/Wireguard/GetPeerStatus", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(WireguardServer).GetPeerStatus(ctx, req.(*PeerStatusReq)) - } - return interceptor(ctx, in, info, handler) } -func _Wireguard_GetNICInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(NICInfoReq) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(WireguardServer).GetNICInfo(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/Wireguard/GetNICInfo", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(WireguardServer).GetNICInfo(ctx, req.(*NICInfoReq)) - } - return interceptor(ctx, in, info, handler) +func (x *PrivKeyResp) String() string { + return protoimpl.X.MessageStringOf(x) } -func _Wireguard_GenPublicKey_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(PubKeyReq) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(WireguardServer).GenPublicKey(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/Wireguard/GenPublicKey", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(WireguardServer).GenPublicKey(ctx, req.(*PubKeyReq)) - } - return interceptor(ctx, in, info, handler) -} +func (*PrivKeyResp) ProtoMessage() {} -func _Wireguard_GenPrivateKey_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(PrivKeyReq) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(WireguardServer).GenPrivateKey(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/Wireguard/GenPrivateKey", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(WireguardServer).GenPrivateKey(ctx, req.(*PrivKeyReq)) +func (x *PrivKeyResp) ProtoReflect() protoreflect.Message { + mi := &file_wg_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 interceptor(ctx, in, info, handler) + return mi.MessageOf(x) } -func _Wireguard_GetPrivateKey_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(PrivKeyReq) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(WireguardServer).GetPrivateKey(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/Wireguard/GetPrivateKey", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(WireguardServer).GetPrivateKey(ctx, req.(*PrivKeyReq)) - } - return interceptor(ctx, in, info, handler) +// Deprecated: Use PrivKeyResp.ProtoReflect.Descriptor instead. +func (*PrivKeyResp) Descriptor() ([]byte, []int) { + return file_wg_proto_rawDescGZIP(), []int{17} } -func _Wireguard_GetPublicKey_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(PubKeyReq) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(WireguardServer).GetPublicKey(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/Wireguard/GetPublicKey", +func (x *PrivKeyResp) GetMessage() string { + if x != nil { + return x.Message } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(WireguardServer).GetPublicKey(ctx, req.(*PubKeyReq)) - } - return interceptor(ctx, in, info, handler) + return "" } -var _Wireguard_serviceDesc = grpc.ServiceDesc{ - ServiceName: "Wireguard", - HandlerType: (*WireguardServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "InitializeI", - Handler: _Wireguard_InitializeI_Handler, - }, - { - MethodName: "AddPeer", - Handler: _Wireguard_AddPeer_Handler, - }, - { - MethodName: "DelPeer", - Handler: _Wireguard_DelPeer_Handler, - }, - { - MethodName: "ListPeers", - Handler: _Wireguard_ListPeers_Handler, - }, - { - MethodName: "ManageNIC", - Handler: _Wireguard_ManageNIC_Handler, - }, - { - MethodName: "GetPeerStatus", - Handler: _Wireguard_GetPeerStatus_Handler, - }, - { - MethodName: "GetNICInfo", - Handler: _Wireguard_GetNICInfo_Handler, - }, - { - MethodName: "GenPublicKey", - Handler: _Wireguard_GenPublicKey_Handler, - }, - { - MethodName: "GenPrivateKey", - Handler: _Wireguard_GenPrivateKey_Handler, - }, - { - MethodName: "GetPrivateKey", - Handler: _Wireguard_GetPrivateKey_Handler, - }, - { - MethodName: "GetPublicKey", - Handler: _Wireguard_GetPublicKey_Handler, +var File_wg_proto protoreflect.FileDescriptor + +var file_wg_proto_rawDesc = []byte{ + 0x0a, 0x08, 0x77, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x47, 0x0a, 0x0d, 0x50, 0x65, + 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x12, 0x18, 0x0a, 0x07, 0x6e, + 0x69, 0x63, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6e, 0x69, + 0x63, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, + 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, + 0x4b, 0x65, 0x79, 0x22, 0x28, 0x0a, 0x0e, 0x50, 0x65, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x75, + 0x73, 0x52, 0x65, 0x73, 0x70, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x59, 0x0a, + 0x07, 0x41, 0x64, 0x64, 0x50, 0x52, 0x65, 0x71, 0x12, 0x10, 0x0a, 0x03, 0x6e, 0x69, 0x63, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6e, 0x69, 0x63, 0x12, 0x1e, 0x0a, 0x0a, 0x61, 0x6c, + 0x6c, 0x6f, 0x77, 0x65, 0x64, 0x49, 0x50, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, + 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64, 0x49, 0x50, 0x73, 0x12, 0x1c, 0x0a, 0x09, 0x70, 0x75, + 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, + 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x22, 0x24, 0x0a, 0x08, 0x41, 0x64, 0x64, 0x50, + 0x52, 0x65, 0x73, 0x70, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x3e, + 0x0a, 0x0c, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x65, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x12, 0x18, + 0x0a, 0x07, 0x6e, 0x69, 0x63, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x07, 0x6e, 0x69, 0x63, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, + 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x22, 0x2b, + 0x0a, 0x0d, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x65, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x12, + 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xa8, 0x01, 0x0a, 0x04, + 0x49, 0x52, 0x65, 0x71, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x1e, + 0x0a, 0x0a, 0x6c, 0x69, 0x73, 0x74, 0x65, 0x6e, 0x50, 0x6f, 0x72, 0x74, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0d, 0x52, 0x0a, 0x6c, 0x69, 0x73, 0x74, 0x65, 0x6e, 0x50, 0x6f, 0x72, 0x74, 0x12, 0x1e, + 0x0a, 0x0a, 0x73, 0x61, 0x76, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x08, 0x52, 0x0a, 0x73, 0x61, 0x76, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x1e, + 0x0a, 0x0a, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x4b, 0x65, 0x79, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0a, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x4b, 0x65, 0x79, 0x12, 0x10, + 0x0a, 0x03, 0x65, 0x74, 0x68, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x65, 0x74, 0x68, + 0x12, 0x14, 0x0a, 0x05, 0x69, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x05, 0x69, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x21, 0x0a, 0x05, 0x49, 0x52, 0x65, 0x73, 0x70, 0x12, + 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x41, 0x0a, 0x07, 0x44, 0x65, 0x6c, + 0x50, 0x52, 0x65, 0x71, 0x12, 0x24, 0x0a, 0x0d, 0x70, 0x65, 0x65, 0x72, 0x50, 0x75, 0x62, 0x6c, + 0x69, 0x63, 0x4b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x70, 0x65, 0x65, + 0x72, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6e, 0x69, + 0x63, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6e, 0x69, 0x63, 0x22, 0x24, 0x0a, 0x08, + 0x44, 0x65, 0x6c, 0x50, 0x52, 0x65, 0x73, 0x70, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, + 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, + 0x67, 0x65, 0x22, 0x32, 0x0a, 0x0c, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x4e, 0x49, 0x43, 0x52, + 0x65, 0x71, 0x12, 0x10, 0x0a, 0x03, 0x6e, 0x69, 0x63, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x03, 0x6e, 0x69, 0x63, 0x12, 0x10, 0x0a, 0x03, 0x63, 0x6d, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x03, 0x63, 0x6d, 0x64, 0x22, 0x29, 0x0a, 0x0d, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, + 0x4e, 0x49, 0x43, 0x52, 0x65, 0x73, 0x70, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, + 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, + 0x65, 0x22, 0x2a, 0x0a, 0x0a, 0x4e, 0x49, 0x43, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x12, + 0x1c, 0x0a, 0x09, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x66, 0x61, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x09, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x66, 0x61, 0x63, 0x65, 0x22, 0x27, 0x0a, + 0x0b, 0x4e, 0x49, 0x43, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x12, 0x18, 0x0a, 0x07, + 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, + 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x4d, 0x0a, 0x09, 0x50, 0x75, 0x62, 0x4b, 0x65, 0x79, + 0x52, 0x65, 0x71, 0x12, 0x1e, 0x0a, 0x0a, 0x70, 0x75, 0x62, 0x4b, 0x65, 0x79, 0x4e, 0x61, 0x6d, + 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x70, 0x75, 0x62, 0x4b, 0x65, 0x79, 0x4e, + 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x70, 0x72, 0x69, 0x76, 0x4b, 0x65, 0x79, 0x4e, 0x61, + 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x70, 0x72, 0x69, 0x76, 0x4b, 0x65, + 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x26, 0x0a, 0x0a, 0x50, 0x75, 0x62, 0x4b, 0x65, 0x79, 0x52, + 0x65, 0x73, 0x70, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x34, 0x0a, + 0x0a, 0x50, 0x72, 0x69, 0x76, 0x4b, 0x65, 0x79, 0x52, 0x65, 0x71, 0x12, 0x26, 0x0a, 0x0e, 0x70, + 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x4b, 0x65, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x0e, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x4b, 0x65, 0x79, 0x4e, + 0x61, 0x6d, 0x65, 0x22, 0x27, 0x0a, 0x0b, 0x50, 0x72, 0x69, 0x76, 0x4b, 0x65, 0x79, 0x52, 0x65, + 0x73, 0x70, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x32, 0xdc, 0x03, 0x0a, + 0x09, 0x57, 0x69, 0x72, 0x65, 0x67, 0x75, 0x61, 0x72, 0x64, 0x12, 0x1e, 0x0a, 0x0b, 0x49, 0x6e, + 0x69, 0x74, 0x69, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x49, 0x12, 0x05, 0x2e, 0x49, 0x52, 0x65, 0x71, + 0x1a, 0x06, 0x2e, 0x49, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x20, 0x0a, 0x07, 0x41, 0x64, + 0x64, 0x50, 0x65, 0x65, 0x72, 0x12, 0x08, 0x2e, 0x41, 0x64, 0x64, 0x50, 0x52, 0x65, 0x71, 0x1a, + 0x09, 0x2e, 0x41, 0x64, 0x64, 0x50, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x20, 0x0a, 0x07, + 0x44, 0x65, 0x6c, 0x50, 0x65, 0x65, 0x72, 0x12, 0x08, 0x2e, 0x44, 0x65, 0x6c, 0x50, 0x52, 0x65, + 0x71, 0x1a, 0x09, 0x2e, 0x44, 0x65, 0x6c, 0x50, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x2c, + 0x0a, 0x09, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x65, 0x65, 0x72, 0x73, 0x12, 0x0d, 0x2e, 0x4c, 0x69, + 0x73, 0x74, 0x50, 0x65, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x0e, 0x2e, 0x4c, 0x69, 0x73, + 0x74, 0x50, 0x65, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x2c, 0x0a, 0x09, + 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x4e, 0x49, 0x43, 0x12, 0x0d, 0x2e, 0x4d, 0x61, 0x6e, 0x61, + 0x67, 0x65, 0x4e, 0x49, 0x43, 0x52, 0x65, 0x71, 0x1a, 0x0e, 0x2e, 0x4d, 0x61, 0x6e, 0x61, 0x67, + 0x65, 0x4e, 0x49, 0x43, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x32, 0x0a, 0x0d, 0x47, 0x65, + 0x74, 0x50, 0x65, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x0e, 0x2e, 0x50, 0x65, + 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x0f, 0x2e, 0x50, 0x65, + 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x29, + 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x4e, 0x49, 0x43, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x0b, 0x2e, 0x4e, + 0x49, 0x43, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x1a, 0x0c, 0x2e, 0x4e, 0x49, 0x43, 0x49, + 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x29, 0x0a, 0x0c, 0x47, 0x65, 0x6e, + 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x12, 0x0a, 0x2e, 0x50, 0x75, 0x62, 0x4b, + 0x65, 0x79, 0x52, 0x65, 0x71, 0x1a, 0x0b, 0x2e, 0x50, 0x75, 0x62, 0x4b, 0x65, 0x79, 0x52, 0x65, + 0x73, 0x70, 0x22, 0x00, 0x12, 0x2c, 0x0a, 0x0d, 0x47, 0x65, 0x6e, 0x50, 0x72, 0x69, 0x76, 0x61, + 0x74, 0x65, 0x4b, 0x65, 0x79, 0x12, 0x0b, 0x2e, 0x50, 0x72, 0x69, 0x76, 0x4b, 0x65, 0x79, 0x52, + 0x65, 0x71, 0x1a, 0x0c, 0x2e, 0x50, 0x72, 0x69, 0x76, 0x4b, 0x65, 0x79, 0x52, 0x65, 0x73, 0x70, + 0x22, 0x00, 0x12, 0x2c, 0x0a, 0x0d, 0x47, 0x65, 0x74, 0x50, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, + 0x4b, 0x65, 0x79, 0x12, 0x0b, 0x2e, 0x50, 0x72, 0x69, 0x76, 0x4b, 0x65, 0x79, 0x52, 0x65, 0x71, + 0x1a, 0x0c, 0x2e, 0x50, 0x72, 0x69, 0x76, 0x4b, 0x65, 0x79, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, + 0x12, 0x29, 0x0a, 0x0c, 0x47, 0x65, 0x74, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, + 0x12, 0x0a, 0x2e, 0x50, 0x75, 0x62, 0x4b, 0x65, 0x79, 0x52, 0x65, 0x71, 0x1a, 0x0b, 0x2e, 0x50, + 0x75, 0x62, 0x4b, 0x65, 0x79, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x42, 0x32, 0x5a, 0x30, 0x67, + 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x61, 0x61, 0x75, 0x2d, 0x6e, 0x65, + 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2d, 0x73, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x2f, 0x67, + 0x77, 0x69, 0x72, 0x65, 0x67, 0x75, 0x61, 0x72, 0x64, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_wg_proto_rawDescOnce sync.Once + file_wg_proto_rawDescData = file_wg_proto_rawDesc +) + +func file_wg_proto_rawDescGZIP() []byte { + file_wg_proto_rawDescOnce.Do(func() { + file_wg_proto_rawDescData = protoimpl.X.CompressGZIP(file_wg_proto_rawDescData) + }) + return file_wg_proto_rawDescData +} + +var file_wg_proto_msgTypes = make([]protoimpl.MessageInfo, 18) +var file_wg_proto_goTypes = []interface{}{ + (*PeerStatusReq)(nil), // 0: PeerStatusReq + (*PeerStatusResp)(nil), // 1: PeerStatusResp + (*AddPReq)(nil), // 2: AddPReq + (*AddPResp)(nil), // 3: AddPResp + (*ListPeersReq)(nil), // 4: ListPeersReq + (*ListPeersResp)(nil), // 5: ListPeersResp + (*IReq)(nil), // 6: IReq + (*IResp)(nil), // 7: IResp + (*DelPReq)(nil), // 8: DelPReq + (*DelPResp)(nil), // 9: DelPResp + (*ManageNICReq)(nil), // 10: ManageNICReq + (*ManageNICResp)(nil), // 11: ManageNICResp + (*NICInfoReq)(nil), // 12: NICInfoReq + (*NICInfoResp)(nil), // 13: NICInfoResp + (*PubKeyReq)(nil), // 14: PubKeyReq + (*PubKeyResp)(nil), // 15: PubKeyResp + (*PrivKeyReq)(nil), // 16: PrivKeyReq + (*PrivKeyResp)(nil), // 17: PrivKeyResp +} +var file_wg_proto_depIdxs = []int32{ + 6, // 0: Wireguard.InitializeI:input_type -> IReq + 2, // 1: Wireguard.AddPeer:input_type -> AddPReq + 8, // 2: Wireguard.DelPeer:input_type -> DelPReq + 4, // 3: Wireguard.ListPeers:input_type -> ListPeersReq + 10, // 4: Wireguard.ManageNIC:input_type -> ManageNICReq + 0, // 5: Wireguard.GetPeerStatus:input_type -> PeerStatusReq + 12, // 6: Wireguard.GetNICInfo:input_type -> NICInfoReq + 14, // 7: Wireguard.GenPublicKey:input_type -> PubKeyReq + 16, // 8: Wireguard.GenPrivateKey:input_type -> PrivKeyReq + 16, // 9: Wireguard.GetPrivateKey:input_type -> PrivKeyReq + 14, // 10: Wireguard.GetPublicKey:input_type -> PubKeyReq + 7, // 11: Wireguard.InitializeI:output_type -> IResp + 3, // 12: Wireguard.AddPeer:output_type -> AddPResp + 9, // 13: Wireguard.DelPeer:output_type -> DelPResp + 5, // 14: Wireguard.ListPeers:output_type -> ListPeersResp + 11, // 15: Wireguard.ManageNIC:output_type -> ManageNICResp + 1, // 16: Wireguard.GetPeerStatus:output_type -> PeerStatusResp + 13, // 17: Wireguard.GetNICInfo:output_type -> NICInfoResp + 15, // 18: Wireguard.GenPublicKey:output_type -> PubKeyResp + 17, // 19: Wireguard.GenPrivateKey:output_type -> PrivKeyResp + 17, // 20: Wireguard.GetPrivateKey:output_type -> PrivKeyResp + 15, // 21: Wireguard.GetPublicKey:output_type -> PubKeyResp + 11, // [11:22] is the sub-list for method output_type + 0, // [0:11] 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_wg_proto_init() } +func file_wg_proto_init() { + if File_wg_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_wg_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PeerStatusReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_wg_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PeerStatusResp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_wg_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AddPReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_wg_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AddPResp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_wg_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListPeersReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_wg_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListPeersResp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_wg_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*IReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_wg_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*IResp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_wg_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DelPReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_wg_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DelPResp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_wg_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ManageNICReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_wg_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ManageNICResp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_wg_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*NICInfoReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_wg_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*NICInfoResp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_wg_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PubKeyReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_wg_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PubKeyResp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_wg_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PrivKeyReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_wg_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PrivKeyResp); 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_wg_proto_rawDesc, + NumEnums: 0, + NumMessages: 18, + NumExtensions: 0, + NumServices: 1, }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "wg.proto", + GoTypes: file_wg_proto_goTypes, + DependencyIndexes: file_wg_proto_depIdxs, + MessageInfos: file_wg_proto_msgTypes, + }.Build() + File_wg_proto = out.File + file_wg_proto_rawDesc = nil + file_wg_proto_goTypes = nil + file_wg_proto_depIdxs = nil } diff --git a/proto/wg.proto b/proto/wg.proto index 4aa1016..6fd267b 100644 --- a/proto/wg.proto +++ b/proto/wg.proto @@ -1,5 +1,5 @@ syntax="proto3"; - +option go_package = "github.com/aau-network-security/gwireguard/proto"; // todo: GenInterface service Wireguard { @@ -66,7 +66,7 @@ message IResp { message DelPReq { string peerPublicKey = 1; - string ipAddress = 2; + string nic = 2; } message DelPResp { diff --git a/proto/wg_grpc.pb.go b/proto/wg_grpc.pb.go new file mode 100644 index 0000000..62b7c80 --- /dev/null +++ b/proto/wg_grpc.pb.go @@ -0,0 +1,465 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.2.0 +// - protoc v3.6.1 +// source: wg.proto + +package proto + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +// WireguardClient is the client API for Wireguard service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type WireguardClient interface { + InitializeI(ctx context.Context, in *IReq, opts ...grpc.CallOption) (*IResp, error) + AddPeer(ctx context.Context, in *AddPReq, opts ...grpc.CallOption) (*AddPResp, error) + DelPeer(ctx context.Context, in *DelPReq, opts ...grpc.CallOption) (*DelPResp, error) + ListPeers(ctx context.Context, in *ListPeersReq, opts ...grpc.CallOption) (*ListPeersResp, error) + ManageNIC(ctx context.Context, in *ManageNICReq, opts ...grpc.CallOption) (*ManageNICResp, error) + GetPeerStatus(ctx context.Context, in *PeerStatusReq, opts ...grpc.CallOption) (*PeerStatusResp, error) + GetNICInfo(ctx context.Context, in *NICInfoReq, opts ...grpc.CallOption) (*NICInfoResp, error) + GenPublicKey(ctx context.Context, in *PubKeyReq, opts ...grpc.CallOption) (*PubKeyResp, error) + GenPrivateKey(ctx context.Context, in *PrivKeyReq, opts ...grpc.CallOption) (*PrivKeyResp, error) + GetPrivateKey(ctx context.Context, in *PrivKeyReq, opts ...grpc.CallOption) (*PrivKeyResp, error) + GetPublicKey(ctx context.Context, in *PubKeyReq, opts ...grpc.CallOption) (*PubKeyResp, error) +} + +type wireguardClient struct { + cc grpc.ClientConnInterface +} + +func NewWireguardClient(cc grpc.ClientConnInterface) WireguardClient { + return &wireguardClient{cc} +} + +func (c *wireguardClient) InitializeI(ctx context.Context, in *IReq, opts ...grpc.CallOption) (*IResp, error) { + out := new(IResp) + err := c.cc.Invoke(ctx, "/Wireguard/InitializeI", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wireguardClient) AddPeer(ctx context.Context, in *AddPReq, opts ...grpc.CallOption) (*AddPResp, error) { + out := new(AddPResp) + err := c.cc.Invoke(ctx, "/Wireguard/AddPeer", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wireguardClient) DelPeer(ctx context.Context, in *DelPReq, opts ...grpc.CallOption) (*DelPResp, error) { + out := new(DelPResp) + err := c.cc.Invoke(ctx, "/Wireguard/DelPeer", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wireguardClient) ListPeers(ctx context.Context, in *ListPeersReq, opts ...grpc.CallOption) (*ListPeersResp, error) { + out := new(ListPeersResp) + err := c.cc.Invoke(ctx, "/Wireguard/ListPeers", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wireguardClient) ManageNIC(ctx context.Context, in *ManageNICReq, opts ...grpc.CallOption) (*ManageNICResp, error) { + out := new(ManageNICResp) + err := c.cc.Invoke(ctx, "/Wireguard/ManageNIC", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wireguardClient) GetPeerStatus(ctx context.Context, in *PeerStatusReq, opts ...grpc.CallOption) (*PeerStatusResp, error) { + out := new(PeerStatusResp) + err := c.cc.Invoke(ctx, "/Wireguard/GetPeerStatus", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wireguardClient) GetNICInfo(ctx context.Context, in *NICInfoReq, opts ...grpc.CallOption) (*NICInfoResp, error) { + out := new(NICInfoResp) + err := c.cc.Invoke(ctx, "/Wireguard/GetNICInfo", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wireguardClient) GenPublicKey(ctx context.Context, in *PubKeyReq, opts ...grpc.CallOption) (*PubKeyResp, error) { + out := new(PubKeyResp) + err := c.cc.Invoke(ctx, "/Wireguard/GenPublicKey", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wireguardClient) GenPrivateKey(ctx context.Context, in *PrivKeyReq, opts ...grpc.CallOption) (*PrivKeyResp, error) { + out := new(PrivKeyResp) + err := c.cc.Invoke(ctx, "/Wireguard/GenPrivateKey", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wireguardClient) GetPrivateKey(ctx context.Context, in *PrivKeyReq, opts ...grpc.CallOption) (*PrivKeyResp, error) { + out := new(PrivKeyResp) + err := c.cc.Invoke(ctx, "/Wireguard/GetPrivateKey", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wireguardClient) GetPublicKey(ctx context.Context, in *PubKeyReq, opts ...grpc.CallOption) (*PubKeyResp, error) { + out := new(PubKeyResp) + err := c.cc.Invoke(ctx, "/Wireguard/GetPublicKey", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// WireguardServer is the server API for Wireguard service. +// All implementations must embed UnimplementedWireguardServer +// for forward compatibility +type WireguardServer interface { + InitializeI(context.Context, *IReq) (*IResp, error) + AddPeer(context.Context, *AddPReq) (*AddPResp, error) + DelPeer(context.Context, *DelPReq) (*DelPResp, error) + ListPeers(context.Context, *ListPeersReq) (*ListPeersResp, error) + ManageNIC(context.Context, *ManageNICReq) (*ManageNICResp, error) + GetPeerStatus(context.Context, *PeerStatusReq) (*PeerStatusResp, error) + GetNICInfo(context.Context, *NICInfoReq) (*NICInfoResp, error) + GenPublicKey(context.Context, *PubKeyReq) (*PubKeyResp, error) + GenPrivateKey(context.Context, *PrivKeyReq) (*PrivKeyResp, error) + GetPrivateKey(context.Context, *PrivKeyReq) (*PrivKeyResp, error) + GetPublicKey(context.Context, *PubKeyReq) (*PubKeyResp, error) + mustEmbedUnimplementedWireguardServer() +} + +// UnimplementedWireguardServer must be embedded to have forward compatible implementations. +type UnimplementedWireguardServer struct { +} + +func (UnimplementedWireguardServer) InitializeI(context.Context, *IReq) (*IResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method InitializeI not implemented") +} +func (UnimplementedWireguardServer) AddPeer(context.Context, *AddPReq) (*AddPResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method AddPeer not implemented") +} +func (UnimplementedWireguardServer) DelPeer(context.Context, *DelPReq) (*DelPResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method DelPeer not implemented") +} +func (UnimplementedWireguardServer) ListPeers(context.Context, *ListPeersReq) (*ListPeersResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListPeers not implemented") +} +func (UnimplementedWireguardServer) ManageNIC(context.Context, *ManageNICReq) (*ManageNICResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method ManageNIC not implemented") +} +func (UnimplementedWireguardServer) GetPeerStatus(context.Context, *PeerStatusReq) (*PeerStatusResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetPeerStatus not implemented") +} +func (UnimplementedWireguardServer) GetNICInfo(context.Context, *NICInfoReq) (*NICInfoResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetNICInfo not implemented") +} +func (UnimplementedWireguardServer) GenPublicKey(context.Context, *PubKeyReq) (*PubKeyResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method GenPublicKey not implemented") +} +func (UnimplementedWireguardServer) GenPrivateKey(context.Context, *PrivKeyReq) (*PrivKeyResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method GenPrivateKey not implemented") +} +func (UnimplementedWireguardServer) GetPrivateKey(context.Context, *PrivKeyReq) (*PrivKeyResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetPrivateKey not implemented") +} +func (UnimplementedWireguardServer) GetPublicKey(context.Context, *PubKeyReq) (*PubKeyResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetPublicKey not implemented") +} +func (UnimplementedWireguardServer) mustEmbedUnimplementedWireguardServer() {} + +// UnsafeWireguardServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to WireguardServer will +// result in compilation errors. +type UnsafeWireguardServer interface { + mustEmbedUnimplementedWireguardServer() +} + +func RegisterWireguardServer(s grpc.ServiceRegistrar, srv WireguardServer) { + s.RegisterService(&Wireguard_ServiceDesc, srv) +} + +func _Wireguard_InitializeI_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(IReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(WireguardServer).InitializeI(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/Wireguard/InitializeI", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(WireguardServer).InitializeI(ctx, req.(*IReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _Wireguard_AddPeer_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(AddPReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(WireguardServer).AddPeer(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/Wireguard/AddPeer", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(WireguardServer).AddPeer(ctx, req.(*AddPReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _Wireguard_DelPeer_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DelPReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(WireguardServer).DelPeer(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/Wireguard/DelPeer", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(WireguardServer).DelPeer(ctx, req.(*DelPReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _Wireguard_ListPeers_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListPeersReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(WireguardServer).ListPeers(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/Wireguard/ListPeers", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(WireguardServer).ListPeers(ctx, req.(*ListPeersReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _Wireguard_ManageNIC_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ManageNICReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(WireguardServer).ManageNIC(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/Wireguard/ManageNIC", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(WireguardServer).ManageNIC(ctx, req.(*ManageNICReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _Wireguard_GetPeerStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(PeerStatusReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(WireguardServer).GetPeerStatus(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/Wireguard/GetPeerStatus", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(WireguardServer).GetPeerStatus(ctx, req.(*PeerStatusReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _Wireguard_GetNICInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(NICInfoReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(WireguardServer).GetNICInfo(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/Wireguard/GetNICInfo", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(WireguardServer).GetNICInfo(ctx, req.(*NICInfoReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _Wireguard_GenPublicKey_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(PubKeyReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(WireguardServer).GenPublicKey(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/Wireguard/GenPublicKey", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(WireguardServer).GenPublicKey(ctx, req.(*PubKeyReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _Wireguard_GenPrivateKey_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(PrivKeyReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(WireguardServer).GenPrivateKey(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/Wireguard/GenPrivateKey", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(WireguardServer).GenPrivateKey(ctx, req.(*PrivKeyReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _Wireguard_GetPrivateKey_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(PrivKeyReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(WireguardServer).GetPrivateKey(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/Wireguard/GetPrivateKey", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(WireguardServer).GetPrivateKey(ctx, req.(*PrivKeyReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _Wireguard_GetPublicKey_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(PubKeyReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(WireguardServer).GetPublicKey(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/Wireguard/GetPublicKey", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(WireguardServer).GetPublicKey(ctx, req.(*PubKeyReq)) + } + return interceptor(ctx, in, info, handler) +} + +// Wireguard_ServiceDesc is the grpc.ServiceDesc for Wireguard service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var Wireguard_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "Wireguard", + HandlerType: (*WireguardServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "InitializeI", + Handler: _Wireguard_InitializeI_Handler, + }, + { + MethodName: "AddPeer", + Handler: _Wireguard_AddPeer_Handler, + }, + { + MethodName: "DelPeer", + Handler: _Wireguard_DelPeer_Handler, + }, + { + MethodName: "ListPeers", + Handler: _Wireguard_ListPeers_Handler, + }, + { + MethodName: "ManageNIC", + Handler: _Wireguard_ManageNIC_Handler, + }, + { + MethodName: "GetPeerStatus", + Handler: _Wireguard_GetPeerStatus_Handler, + }, + { + MethodName: "GetNICInfo", + Handler: _Wireguard_GetNICInfo_Handler, + }, + { + MethodName: "GenPublicKey", + Handler: _Wireguard_GenPublicKey_Handler, + }, + { + MethodName: "GenPrivateKey", + Handler: _Wireguard_GenPrivateKey_Handler, + }, + { + MethodName: "GetPrivateKey", + Handler: _Wireguard_GetPrivateKey_Handler, + }, + { + MethodName: "GetPublicKey", + Handler: _Wireguard_GetPublicKey_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "wg.proto", +} diff --git a/vpn/backend.go b/vpn/backend.go index 97bbce9..215cfc8 100644 --- a/vpn/backend.go +++ b/vpn/backend.go @@ -24,6 +24,7 @@ import ( type wireguard struct { auth Authenticator config *config.Config + pb.UnimplementedWireguardServer } // InitializeI creates interface configuration and make it UP. @@ -80,11 +81,11 @@ func (w *wireguard) AddPeer(ctx context.Context, r *pb.AddPReq) (*pb.AddPResp, e // DelPeer deletes peer from given wireguard interface func (w *wireguard) DelPeer(ctx context.Context, r *pb.DelPReq) (*pb.DelPResp, error) { - out, err := removePeer(r.PeerPublicKey, r.IpAddress) + out, err := removePeer(r.PeerPublicKey, r.Nic) if err != nil { return &pb.DelPResp{Message: out}, err } - log.Info().Msgf("Peer with public key: { %s } is deleted from ip-address: { %s }", r.PeerPublicKey, r.IpAddress) + log.Info().Msgf("Peer with public key: { %s } is deleted from ip-address: { %s }", r.PeerPublicKey, r.Nic) return &pb.DelPResp{Message: out}, nil } diff --git a/vpn/vpn.go b/vpn/vpn.go index 2222dc7..93c7bc3 100644 --- a/vpn/vpn.go +++ b/vpn/vpn.go @@ -64,9 +64,9 @@ func addPeer(nic, publicKey, allowedIPs string) (string, error) { // removePeer will remove peer from VPN server // wg rm allowed-ips 192.168.0.2/32 -func removePeer(peerPublicKey, ipAddress string) (string, error) { - log.Debug().Msgf("Peer with publickey { %s } is removing from %s", peerPublicKey, ipAddress) - cmd := wgManageBin + " rm " + peerPublicKey + " allowed-ips " + ipAddress +func removePeer(peerPublicKey, nic string) (string, error) { + log.Debug().Msgf("Peer with publickey { %s } is being removed", peerPublicKey) + cmd := wgManageBin + " set " + nic + " peer " + peerPublicKey + " remove" //_, err := WireGuardCmd(context.Background(), wgManageBin, "rm", peerPublicKey, "allowed-ips", ipAddress) _, err := WireGuardCmd(cmd) if err != nil {