From dc4e210bec0e40eed368f4f951067bb211f45a4c Mon Sep 17 00:00:00 2001 From: Lysak Vladislav Date: Fri, 31 Jul 2020 12:26:58 +0300 Subject: [PATCH] chore(grpc): support Priority tag fix: #492 close: https://github.com/appleboy/gorush/pull/537 --- go.mod | 4 +- go.sum | 21 + gorush/notification_fcm.go | 4 +- rpc/example/go/send/main.go | 1 + rpc/example/node/gorush_pb.js | 555 ++++++++++++++------- rpc/proto/gorush.pb.go | 909 ++++++++++++++++++++++------------ rpc/proto/gorush.proto | 5 + rpc/server.go | 2 + 8 files changed, 992 insertions(+), 509 deletions(-) diff --git a/go.mod b/go.mod index ff6a43e..665ca08 100644 --- a/go.mod +++ b/go.mod @@ -17,7 +17,7 @@ require ( github.com/gin-contrib/logger v0.0.2 github.com/gin-gonic/gin v1.6.3 github.com/go-redis/redis/v7 v7.2.0 - github.com/golang/protobuf v1.3.5 + github.com/golang/protobuf v1.4.1 github.com/konsorten/go-windows-terminal-sequences v1.0.2 // indirect github.com/mattn/go-isatty v0.0.12 github.com/mitchellh/mapstructure v1.1.2 @@ -43,6 +43,6 @@ require ( golang.org/x/net v0.0.0-20200301022130-244492dfa37a golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527 // indirect - google.golang.org/genproto v0.0.0-20200313141609-30c55424f95d // indirect google.golang.org/grpc v1.28.0 + google.golang.org/protobuf v1.25.0 ) diff --git a/go.sum b/go.sum index 8cc13cf..76f0b29 100644 --- a/go.sum +++ b/go.sum @@ -119,6 +119,13 @@ github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5y 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/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 h1:ZFgWrT+bLgsYPirOnRfKLYJLvssAegOj/hgyMFdJZe0= +github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db h1:woRePGFeVFfLKN/pOkfl+p/TAqKOfFu+7KPlMVpok/w= github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.1 h1:Qgr9rKW7uDUkrbSmQeiDsGa8SjGyCOGtuasMWwvp2P4= @@ -128,6 +135,8 @@ github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5a github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1 h1:Xye71clBPdm5HgqGwUkwhbynsUJZhDbS20FvLhQ2izg= 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/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= @@ -389,6 +398,7 @@ 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= google.golang.org/appengine v1.1.0 h1:igQkv0AAhEIvTEpD5LIpAfav2eeVO9HBTjvKHVJPRSs= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0 h1:/wp5JvzpHIxhs/dumFmF7BXTf3Z+dd4uXta4kVyO508= @@ -400,6 +410,8 @@ google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoA google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20200313141609-30c55424f95d h1:pyQjO6BnPvrPMldYxgDlXq9PLahtc0EKnUTYX1pWwXU= google.golang.org/genproto v0.0.0-20200313141609-30c55424f95d/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.21.0/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= @@ -408,6 +420,15 @@ google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQ google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.28.0 h1:bO/TA4OxCOummhSf10siHuG7vJOiwh7SpRpFZDkOgl4= google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= +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.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.25.0 h1:Ejskq+SyPohKW+1uil0JJMtmHCgJPJ/qWTxr8qp+R4c= +google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= diff --git a/gorush/notification_fcm.go b/gorush/notification_fcm.go index 77fc6eb..ca28e05 100644 --- a/gorush/notification_fcm.go +++ b/gorush/notification_fcm.go @@ -48,8 +48,8 @@ func GetAndroidNotification(req PushNotification) *fcm.Message { notification.RegistrationIDs = req.Tokens } - if len(req.Priority) > 0 && req.Priority == "high" { - notification.Priority = "high" + if req.Priority == "high" || req.Priority == "normal" { + notification.Priority = req.Priority } // Add another field diff --git a/rpc/example/go/send/main.go b/rpc/example/go/send/main.go index 6b9bbdf..9ead8ed 100644 --- a/rpc/example/go/send/main.go +++ b/rpc/example/go/send/main.go @@ -30,6 +30,7 @@ func main() { Badge: 1, Category: "test", Sound: "test", + Priority: proto.Priority_High, Alert: &proto.Alert{ Title: "Test Title", Body: "Test Alert Body", diff --git a/rpc/example/node/gorush_pb.js b/rpc/example/node/gorush_pb.js index 9721a5d..32aa1b7 100644 --- a/rpc/example/node/gorush_pb.js +++ b/rpc/example/node/gorush_pb.js @@ -1,3 +1,4 @@ +// source: gorush.proto /** * @fileoverview * @enhanceable @@ -12,13 +13,14 @@ var goog = jspb; var global = Function('return this')(); var google_protobuf_struct_pb = require('google-protobuf/google/protobuf/struct_pb.js'); +goog.object.extend(proto, google_protobuf_struct_pb); goog.exportSymbol('proto.proto.Alert', null, global); goog.exportSymbol('proto.proto.HealthCheckRequest', null, global); goog.exportSymbol('proto.proto.HealthCheckResponse', null, global); goog.exportSymbol('proto.proto.HealthCheckResponse.ServingStatus', null, global); goog.exportSymbol('proto.proto.NotificationReply', null, global); goog.exportSymbol('proto.proto.NotificationRequest', null, global); - +goog.exportSymbol('proto.proto.Priority', null, global); /** * Generated by JsPbCodeGenerator. * @param {Array=} opt_data Optional initial data array, typically from a @@ -34,8 +36,97 @@ proto.proto.Alert = function(opt_data) { }; goog.inherits(proto.proto.Alert, jspb.Message); if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ proto.proto.Alert.displayName = 'proto.proto.Alert'; } +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.proto.NotificationRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.proto.NotificationRequest.repeatedFields_, null); +}; +goog.inherits(proto.proto.NotificationRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.proto.NotificationRequest.displayName = 'proto.proto.NotificationRequest'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.proto.NotificationReply = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.proto.NotificationReply, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.proto.NotificationReply.displayName = 'proto.proto.NotificationReply'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.proto.HealthCheckRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.proto.HealthCheckRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.proto.HealthCheckRequest.displayName = 'proto.proto.HealthCheckRequest'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.proto.HealthCheckResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.proto.HealthCheckResponse, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.proto.HealthCheckResponse.displayName = 'proto.proto.HealthCheckResponse'; +} + /** * List of repeated fields within this message type. * @private {!Array} @@ -47,13 +138,15 @@ proto.proto.Alert.repeatedFields_ = [9,10]; if (jspb.Message.GENERATE_TO_OBJECT) { /** - * Creates an object representation of this proto suitable for use in Soy templates. + * Creates an object representation of this proto. * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. * To access a reserved field use, foo.pb_, eg, foo.pb_default. * For the list of reserved names please see: - * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. - * @param {boolean=} opt_includeInstance Whether to include the JSPB instance - * for transitional soy proto support: http://goto/soy-param-migration + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration * @return {!Object} */ proto.proto.Alert.prototype.toObject = function(opt_includeInstance) { @@ -63,8 +156,8 @@ proto.proto.Alert.prototype.toObject = function(opt_includeInstance) { /** * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Whether to include the JSPB - * instance for transitional soy proto support: + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @param {!proto.proto.Alert} msg The msg instance to transform. * @return {!Object} @@ -80,8 +173,8 @@ proto.proto.Alert.toObject = function(includeInstance, msg) { launchimage: jspb.Message.getFieldWithDefault(msg, 6, ""), lockey: jspb.Message.getFieldWithDefault(msg, 7, ""), titlelockey: jspb.Message.getFieldWithDefault(msg, 8, ""), - locargsList: jspb.Message.getRepeatedField(msg, 9), - titlelocargsList: jspb.Message.getRepeatedField(msg, 10) + locargsList: (f = jspb.Message.getRepeatedField(msg, 9)) == null ? undefined : f, + titlelocargsList: (f = jspb.Message.getRepeatedField(msg, 10)) == null ? undefined : f }; if (includeInstance) { @@ -269,9 +362,12 @@ proto.proto.Alert.prototype.getTitle = function() { }; -/** @param {string} value */ +/** + * @param {string} value + * @return {!proto.proto.Alert} returns this + */ proto.proto.Alert.prototype.setTitle = function(value) { - jspb.Message.setProto3StringField(this, 1, value); + return jspb.Message.setProto3StringField(this, 1, value); }; @@ -284,9 +380,12 @@ proto.proto.Alert.prototype.getBody = function() { }; -/** @param {string} value */ +/** + * @param {string} value + * @return {!proto.proto.Alert} returns this + */ proto.proto.Alert.prototype.setBody = function(value) { - jspb.Message.setProto3StringField(this, 2, value); + return jspb.Message.setProto3StringField(this, 2, value); }; @@ -299,9 +398,12 @@ proto.proto.Alert.prototype.getSubtitle = function() { }; -/** @param {string} value */ +/** + * @param {string} value + * @return {!proto.proto.Alert} returns this + */ proto.proto.Alert.prototype.setSubtitle = function(value) { - jspb.Message.setProto3StringField(this, 3, value); + return jspb.Message.setProto3StringField(this, 3, value); }; @@ -314,9 +416,12 @@ proto.proto.Alert.prototype.getAction = function() { }; -/** @param {string} value */ +/** + * @param {string} value + * @return {!proto.proto.Alert} returns this + */ proto.proto.Alert.prototype.setAction = function(value) { - jspb.Message.setProto3StringField(this, 4, value); + return jspb.Message.setProto3StringField(this, 4, value); }; @@ -329,9 +434,12 @@ proto.proto.Alert.prototype.getActionlockey = function() { }; -/** @param {string} value */ +/** + * @param {string} value + * @return {!proto.proto.Alert} returns this + */ proto.proto.Alert.prototype.setActionlockey = function(value) { - jspb.Message.setProto3StringField(this, 5, value); + return jspb.Message.setProto3StringField(this, 5, value); }; @@ -344,9 +452,12 @@ proto.proto.Alert.prototype.getLaunchimage = function() { }; -/** @param {string} value */ +/** + * @param {string} value + * @return {!proto.proto.Alert} returns this + */ proto.proto.Alert.prototype.setLaunchimage = function(value) { - jspb.Message.setProto3StringField(this, 6, value); + return jspb.Message.setProto3StringField(this, 6, value); }; @@ -359,9 +470,12 @@ proto.proto.Alert.prototype.getLockey = function() { }; -/** @param {string} value */ +/** + * @param {string} value + * @return {!proto.proto.Alert} returns this + */ proto.proto.Alert.prototype.setLockey = function(value) { - jspb.Message.setProto3StringField(this, 7, value); + return jspb.Message.setProto3StringField(this, 7, value); }; @@ -374,9 +488,12 @@ proto.proto.Alert.prototype.getTitlelockey = function() { }; -/** @param {string} value */ +/** + * @param {string} value + * @return {!proto.proto.Alert} returns this + */ proto.proto.Alert.prototype.setTitlelockey = function(value) { - jspb.Message.setProto3StringField(this, 8, value); + return jspb.Message.setProto3StringField(this, 8, value); }; @@ -389,23 +506,31 @@ proto.proto.Alert.prototype.getLocargsList = function() { }; -/** @param {!Array} value */ +/** + * @param {!Array} value + * @return {!proto.proto.Alert} returns this + */ proto.proto.Alert.prototype.setLocargsList = function(value) { - jspb.Message.setField(this, 9, value || []); + return jspb.Message.setField(this, 9, value || []); }; /** - * @param {!string} value + * @param {string} value * @param {number=} opt_index + * @return {!proto.proto.Alert} returns this */ proto.proto.Alert.prototype.addLocargs = function(value, opt_index) { - jspb.Message.addToRepeatedField(this, 9, value, opt_index); + return jspb.Message.addToRepeatedField(this, 9, value, opt_index); }; +/** + * Clears the list making it empty but non-null. + * @return {!proto.proto.Alert} returns this + */ proto.proto.Alert.prototype.clearLocargsList = function() { - this.setLocargsList([]); + return this.setLocargsList([]); }; @@ -418,44 +543,35 @@ proto.proto.Alert.prototype.getTitlelocargsList = function() { }; -/** @param {!Array} value */ +/** + * @param {!Array} value + * @return {!proto.proto.Alert} returns this + */ proto.proto.Alert.prototype.setTitlelocargsList = function(value) { - jspb.Message.setField(this, 10, value || []); + return jspb.Message.setField(this, 10, value || []); }; /** - * @param {!string} value + * @param {string} value * @param {number=} opt_index + * @return {!proto.proto.Alert} returns this */ proto.proto.Alert.prototype.addTitlelocargs = function(value, opt_index) { - jspb.Message.addToRepeatedField(this, 10, value, opt_index); + return jspb.Message.addToRepeatedField(this, 10, value, opt_index); }; -proto.proto.Alert.prototype.clearTitlelocargsList = function() { - this.setTitlelocargsList([]); -}; - - - /** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor + * Clears the list making it empty but non-null. + * @return {!proto.proto.Alert} returns this */ -proto.proto.NotificationRequest = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, proto.proto.NotificationRequest.repeatedFields_, null); +proto.proto.Alert.prototype.clearTitlelocargsList = function() { + return this.setTitlelocargsList([]); }; -goog.inherits(proto.proto.NotificationRequest, jspb.Message); -if (goog.DEBUG && !COMPILED) { - proto.proto.NotificationRequest.displayName = 'proto.proto.NotificationRequest'; -} + + + /** * List of repeated fields within this message type. * @private {!Array} @@ -467,13 +583,15 @@ proto.proto.NotificationRequest.repeatedFields_ = [1]; if (jspb.Message.GENERATE_TO_OBJECT) { /** - * Creates an object representation of this proto suitable for use in Soy templates. + * Creates an object representation of this proto. * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. * To access a reserved field use, foo.pb_, eg, foo.pb_default. * For the list of reserved names please see: - * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. - * @param {boolean=} opt_includeInstance Whether to include the JSPB instance - * for transitional soy proto support: http://goto/soy-param-migration + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration * @return {!Object} */ proto.proto.NotificationRequest.prototype.toObject = function(opt_includeInstance) { @@ -483,8 +601,8 @@ proto.proto.NotificationRequest.prototype.toObject = function(opt_includeInstanc /** * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Whether to include the JSPB - * instance for transitional soy proto support: + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @param {!proto.proto.NotificationRequest} msg The msg instance to transform. * @return {!Object} @@ -492,7 +610,7 @@ proto.proto.NotificationRequest.prototype.toObject = function(opt_includeInstanc */ proto.proto.NotificationRequest.toObject = function(includeInstance, msg) { var f, obj = { - tokensList: jspb.Message.getRepeatedField(msg, 1), + tokensList: (f = jspb.Message.getRepeatedField(msg, 1)) == null ? undefined : f, platform: jspb.Message.getFieldWithDefault(msg, 2, 0), message: jspb.Message.getFieldWithDefault(msg, 3, ""), title: jspb.Message.getFieldWithDefault(msg, 4, ""), @@ -502,11 +620,12 @@ proto.proto.NotificationRequest.toObject = function(includeInstance, msg) { category: jspb.Message.getFieldWithDefault(msg, 8, ""), alert: (f = msg.getAlert()) && proto.proto.Alert.toObject(includeInstance, f), sound: jspb.Message.getFieldWithDefault(msg, 10, ""), - contentavailable: jspb.Message.getFieldWithDefault(msg, 11, false), + contentavailable: jspb.Message.getBooleanFieldWithDefault(msg, 11, false), threadid: jspb.Message.getFieldWithDefault(msg, 12, ""), - mutablecontent: jspb.Message.getFieldWithDefault(msg, 13, false), + mutablecontent: jspb.Message.getBooleanFieldWithDefault(msg, 13, false), data: (f = msg.getData()) && google_protobuf_struct_pb.Struct.toObject(includeInstance, f), - image: jspb.Message.getFieldWithDefault(msg, 15, "") + image: jspb.Message.getFieldWithDefault(msg, 15, ""), + priority: jspb.Message.getFieldWithDefault(msg, 16, 0) }; if (includeInstance) { @@ -605,6 +724,10 @@ proto.proto.NotificationRequest.deserializeBinaryFromReader = function(msg, read var value = /** @type {string} */ (reader.readString()); msg.setImage(value); break; + case 16: + var value = /** @type {!proto.proto.Priority} */ (reader.readEnum()); + msg.setPriority(value); + break; default: reader.skipField(); break; @@ -741,6 +864,13 @@ proto.proto.NotificationRequest.serializeBinaryToWriter = function(message, writ f ); } + f = message.getPriority(); + if (f !== 0.0) { + writer.writeEnum( + 16, + f + ); + } }; @@ -753,23 +883,31 @@ proto.proto.NotificationRequest.prototype.getTokensList = function() { }; -/** @param {!Array} value */ +/** + * @param {!Array} value + * @return {!proto.proto.NotificationRequest} returns this + */ proto.proto.NotificationRequest.prototype.setTokensList = function(value) { - jspb.Message.setField(this, 1, value || []); + return jspb.Message.setField(this, 1, value || []); }; /** - * @param {!string} value + * @param {string} value * @param {number=} opt_index + * @return {!proto.proto.NotificationRequest} returns this */ proto.proto.NotificationRequest.prototype.addTokens = function(value, opt_index) { - jspb.Message.addToRepeatedField(this, 1, value, opt_index); + return jspb.Message.addToRepeatedField(this, 1, value, opt_index); }; +/** + * Clears the list making it empty but non-null. + * @return {!proto.proto.NotificationRequest} returns this + */ proto.proto.NotificationRequest.prototype.clearTokensList = function() { - this.setTokensList([]); + return this.setTokensList([]); }; @@ -782,9 +920,12 @@ proto.proto.NotificationRequest.prototype.getPlatform = function() { }; -/** @param {number} value */ +/** + * @param {number} value + * @return {!proto.proto.NotificationRequest} returns this + */ proto.proto.NotificationRequest.prototype.setPlatform = function(value) { - jspb.Message.setProto3IntField(this, 2, value); + return jspb.Message.setProto3IntField(this, 2, value); }; @@ -797,9 +938,12 @@ proto.proto.NotificationRequest.prototype.getMessage = function() { }; -/** @param {string} value */ +/** + * @param {string} value + * @return {!proto.proto.NotificationRequest} returns this + */ proto.proto.NotificationRequest.prototype.setMessage = function(value) { - jspb.Message.setProto3StringField(this, 3, value); + return jspb.Message.setProto3StringField(this, 3, value); }; @@ -812,9 +956,12 @@ proto.proto.NotificationRequest.prototype.getTitle = function() { }; -/** @param {string} value */ +/** + * @param {string} value + * @return {!proto.proto.NotificationRequest} returns this + */ proto.proto.NotificationRequest.prototype.setTitle = function(value) { - jspb.Message.setProto3StringField(this, 4, value); + return jspb.Message.setProto3StringField(this, 4, value); }; @@ -827,9 +974,12 @@ proto.proto.NotificationRequest.prototype.getTopic = function() { }; -/** @param {string} value */ +/** + * @param {string} value + * @return {!proto.proto.NotificationRequest} returns this + */ proto.proto.NotificationRequest.prototype.setTopic = function(value) { - jspb.Message.setProto3StringField(this, 5, value); + return jspb.Message.setProto3StringField(this, 5, value); }; @@ -842,9 +992,12 @@ proto.proto.NotificationRequest.prototype.getKey = function() { }; -/** @param {string} value */ +/** + * @param {string} value + * @return {!proto.proto.NotificationRequest} returns this + */ proto.proto.NotificationRequest.prototype.setKey = function(value) { - jspb.Message.setProto3StringField(this, 6, value); + return jspb.Message.setProto3StringField(this, 6, value); }; @@ -857,9 +1010,12 @@ proto.proto.NotificationRequest.prototype.getBadge = function() { }; -/** @param {number} value */ +/** + * @param {number} value + * @return {!proto.proto.NotificationRequest} returns this + */ proto.proto.NotificationRequest.prototype.setBadge = function(value) { - jspb.Message.setProto3IntField(this, 7, value); + return jspb.Message.setProto3IntField(this, 7, value); }; @@ -872,9 +1028,12 @@ proto.proto.NotificationRequest.prototype.getCategory = function() { }; -/** @param {string} value */ +/** + * @param {string} value + * @return {!proto.proto.NotificationRequest} returns this + */ proto.proto.NotificationRequest.prototype.setCategory = function(value) { - jspb.Message.setProto3StringField(this, 8, value); + return jspb.Message.setProto3StringField(this, 8, value); }; @@ -888,20 +1047,27 @@ proto.proto.NotificationRequest.prototype.getAlert = function() { }; -/** @param {?proto.proto.Alert|undefined} value */ +/** + * @param {?proto.proto.Alert|undefined} value + * @return {!proto.proto.NotificationRequest} returns this +*/ proto.proto.NotificationRequest.prototype.setAlert = function(value) { - jspb.Message.setWrapperField(this, 9, value); + return jspb.Message.setWrapperField(this, 9, value); }; +/** + * Clears the message field making it undefined. + * @return {!proto.proto.NotificationRequest} returns this + */ proto.proto.NotificationRequest.prototype.clearAlert = function() { - this.setAlert(undefined); + return this.setAlert(undefined); }; /** * Returns whether this field is set. - * @return {!boolean} + * @return {boolean} */ proto.proto.NotificationRequest.prototype.hasAlert = function() { return jspb.Message.getField(this, 9) != null; @@ -917,26 +1083,30 @@ proto.proto.NotificationRequest.prototype.getSound = function() { }; -/** @param {string} value */ +/** + * @param {string} value + * @return {!proto.proto.NotificationRequest} returns this + */ proto.proto.NotificationRequest.prototype.setSound = function(value) { - jspb.Message.setProto3StringField(this, 10, value); + return jspb.Message.setProto3StringField(this, 10, value); }; /** * optional bool contentAvailable = 11; - * Note that Boolean fields may be set to 0/1 when serialized from a Java server. - * You should avoid comparisons like {@code val === true/false} in those cases. * @return {boolean} */ proto.proto.NotificationRequest.prototype.getContentavailable = function() { - return /** @type {boolean} */ (jspb.Message.getFieldWithDefault(this, 11, false)); + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 11, false)); }; -/** @param {boolean} value */ +/** + * @param {boolean} value + * @return {!proto.proto.NotificationRequest} returns this + */ proto.proto.NotificationRequest.prototype.setContentavailable = function(value) { - jspb.Message.setProto3BooleanField(this, 11, value); + return jspb.Message.setProto3BooleanField(this, 11, value); }; @@ -949,26 +1119,30 @@ proto.proto.NotificationRequest.prototype.getThreadid = function() { }; -/** @param {string} value */ +/** + * @param {string} value + * @return {!proto.proto.NotificationRequest} returns this + */ proto.proto.NotificationRequest.prototype.setThreadid = function(value) { - jspb.Message.setProto3StringField(this, 12, value); + return jspb.Message.setProto3StringField(this, 12, value); }; /** * optional bool mutableContent = 13; - * Note that Boolean fields may be set to 0/1 when serialized from a Java server. - * You should avoid comparisons like {@code val === true/false} in those cases. * @return {boolean} */ proto.proto.NotificationRequest.prototype.getMutablecontent = function() { - return /** @type {boolean} */ (jspb.Message.getFieldWithDefault(this, 13, false)); + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 13, false)); }; -/** @param {boolean} value */ +/** + * @param {boolean} value + * @return {!proto.proto.NotificationRequest} returns this + */ proto.proto.NotificationRequest.prototype.setMutablecontent = function(value) { - jspb.Message.setProto3BooleanField(this, 13, value); + return jspb.Message.setProto3BooleanField(this, 13, value); }; @@ -982,20 +1156,27 @@ proto.proto.NotificationRequest.prototype.getData = function() { }; -/** @param {?proto.google.protobuf.Struct|undefined} value */ +/** + * @param {?proto.google.protobuf.Struct|undefined} value + * @return {!proto.proto.NotificationRequest} returns this +*/ proto.proto.NotificationRequest.prototype.setData = function(value) { - jspb.Message.setWrapperField(this, 14, value); + return jspb.Message.setWrapperField(this, 14, value); }; +/** + * Clears the message field making it undefined. + * @return {!proto.proto.NotificationRequest} returns this + */ proto.proto.NotificationRequest.prototype.clearData = function() { - this.setData(undefined); + return this.setData(undefined); }; /** * Returns whether this field is set. - * @return {!boolean} + * @return {boolean} */ proto.proto.NotificationRequest.prototype.hasData = function() { return jspb.Message.getField(this, 14) != null; @@ -1011,41 +1192,47 @@ proto.proto.NotificationRequest.prototype.getImage = function() { }; -/** @param {string} value */ +/** + * @param {string} value + * @return {!proto.proto.NotificationRequest} returns this + */ proto.proto.NotificationRequest.prototype.setImage = function(value) { - jspb.Message.setProto3StringField(this, 15, value); + return jspb.Message.setProto3StringField(this, 15, value); }; - /** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor + * optional Priority Priority = 16; + * @return {!proto.proto.Priority} */ -proto.proto.NotificationReply = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); +proto.proto.NotificationRequest.prototype.getPriority = function() { + return /** @type {!proto.proto.Priority} */ (jspb.Message.getFieldWithDefault(this, 16, 0)); }; -goog.inherits(proto.proto.NotificationReply, jspb.Message); -if (goog.DEBUG && !COMPILED) { - proto.proto.NotificationReply.displayName = 'proto.proto.NotificationReply'; -} + + +/** + * @param {!proto.proto.Priority} value + * @return {!proto.proto.NotificationRequest} returns this + */ +proto.proto.NotificationRequest.prototype.setPriority = function(value) { + return jspb.Message.setProto3EnumField(this, 16, value); +}; + + + if (jspb.Message.GENERATE_TO_OBJECT) { /** - * Creates an object representation of this proto suitable for use in Soy templates. + * Creates an object representation of this proto. * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. * To access a reserved field use, foo.pb_, eg, foo.pb_default. * For the list of reserved names please see: - * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. - * @param {boolean=} opt_includeInstance Whether to include the JSPB instance - * for transitional soy proto support: http://goto/soy-param-migration + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration * @return {!Object} */ proto.proto.NotificationReply.prototype.toObject = function(opt_includeInstance) { @@ -1055,8 +1242,8 @@ proto.proto.NotificationReply.prototype.toObject = function(opt_includeInstance) /** * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Whether to include the JSPB - * instance for transitional soy proto support: + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @param {!proto.proto.NotificationReply} msg The msg instance to transform. * @return {!Object} @@ -1064,7 +1251,7 @@ proto.proto.NotificationReply.prototype.toObject = function(opt_includeInstance) */ proto.proto.NotificationReply.toObject = function(includeInstance, msg) { var f, obj = { - success: jspb.Message.getFieldWithDefault(msg, 1, false), + success: jspb.Message.getBooleanFieldWithDefault(msg, 1, false), counts: jspb.Message.getFieldWithDefault(msg, 2, 0) }; @@ -1158,18 +1345,19 @@ proto.proto.NotificationReply.serializeBinaryToWriter = function(message, writer /** * optional bool success = 1; - * Note that Boolean fields may be set to 0/1 when serialized from a Java server. - * You should avoid comparisons like {@code val === true/false} in those cases. * @return {boolean} */ proto.proto.NotificationReply.prototype.getSuccess = function() { - return /** @type {boolean} */ (jspb.Message.getFieldWithDefault(this, 1, false)); + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 1, false)); }; -/** @param {boolean} value */ +/** + * @param {boolean} value + * @return {!proto.proto.NotificationReply} returns this + */ proto.proto.NotificationReply.prototype.setSuccess = function(value) { - jspb.Message.setProto3BooleanField(this, 1, value); + return jspb.Message.setProto3BooleanField(this, 1, value); }; @@ -1182,41 +1370,29 @@ proto.proto.NotificationReply.prototype.getCounts = function() { }; -/** @param {number} value */ -proto.proto.NotificationReply.prototype.setCounts = function(value) { - jspb.Message.setProto3IntField(this, 2, value); -}; - - - /** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor + * @param {number} value + * @return {!proto.proto.NotificationReply} returns this */ -proto.proto.HealthCheckRequest = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); +proto.proto.NotificationReply.prototype.setCounts = function(value) { + return jspb.Message.setProto3IntField(this, 2, value); }; -goog.inherits(proto.proto.HealthCheckRequest, jspb.Message); -if (goog.DEBUG && !COMPILED) { - proto.proto.HealthCheckRequest.displayName = 'proto.proto.HealthCheckRequest'; -} + + + if (jspb.Message.GENERATE_TO_OBJECT) { /** - * Creates an object representation of this proto suitable for use in Soy templates. + * Creates an object representation of this proto. * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. * To access a reserved field use, foo.pb_, eg, foo.pb_default. * For the list of reserved names please see: - * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. - * @param {boolean=} opt_includeInstance Whether to include the JSPB instance - * for transitional soy proto support: http://goto/soy-param-migration + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration * @return {!Object} */ proto.proto.HealthCheckRequest.prototype.toObject = function(opt_includeInstance) { @@ -1226,8 +1402,8 @@ proto.proto.HealthCheckRequest.prototype.toObject = function(opt_includeInstance /** * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Whether to include the JSPB - * instance for transitional soy proto support: + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @param {!proto.proto.HealthCheckRequest} msg The msg instance to transform. * @return {!Object} @@ -1324,41 +1500,29 @@ proto.proto.HealthCheckRequest.prototype.getService = function() { }; -/** @param {string} value */ -proto.proto.HealthCheckRequest.prototype.setService = function(value) { - jspb.Message.setProto3StringField(this, 1, value); -}; - - - /** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor + * @param {string} value + * @return {!proto.proto.HealthCheckRequest} returns this */ -proto.proto.HealthCheckResponse = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); +proto.proto.HealthCheckRequest.prototype.setService = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); }; -goog.inherits(proto.proto.HealthCheckResponse, jspb.Message); -if (goog.DEBUG && !COMPILED) { - proto.proto.HealthCheckResponse.displayName = 'proto.proto.HealthCheckResponse'; -} + + + if (jspb.Message.GENERATE_TO_OBJECT) { /** - * Creates an object representation of this proto suitable for use in Soy templates. + * Creates an object representation of this proto. * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. * To access a reserved field use, foo.pb_, eg, foo.pb_default. * For the list of reserved names please see: - * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. - * @param {boolean=} opt_includeInstance Whether to include the JSPB instance - * for transitional soy proto support: http://goto/soy-param-migration + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration * @return {!Object} */ proto.proto.HealthCheckResponse.prototype.toObject = function(opt_includeInstance) { @@ -1368,8 +1532,8 @@ proto.proto.HealthCheckResponse.prototype.toObject = function(opt_includeInstanc /** * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Whether to include the JSPB - * instance for transitional soy proto support: + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @param {!proto.proto.HealthCheckResponse} msg The msg instance to transform. * @return {!Object} @@ -1475,10 +1639,21 @@ proto.proto.HealthCheckResponse.prototype.getStatus = function() { }; -/** @param {!proto.proto.HealthCheckResponse.ServingStatus} value */ +/** + * @param {!proto.proto.HealthCheckResponse.ServingStatus} value + * @return {!proto.proto.HealthCheckResponse} returns this + */ proto.proto.HealthCheckResponse.prototype.setStatus = function(value) { - jspb.Message.setProto3EnumField(this, 1, value); + return jspb.Message.setProto3EnumField(this, 1, value); }; +/** + * @enum {number} + */ +proto.proto.Priority = { + NORMAL: 0, + HIGH: 1 +}; + goog.object.extend(exports, proto.proto); diff --git a/rpc/proto/gorush.pb.go b/rpc/proto/gorush.pb.go index 08e30ab..6b402b4 100644 --- a/rpc/proto/gorush.pb.go +++ b/rpc/proto/gorush.pb.go @@ -1,29 +1,80 @@ // Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.24.0 +// protoc v3.12.3 // source: gorush.proto package proto import ( context "context" - fmt "fmt" proto "github.com/golang/protobuf/proto" _struct "github.com/golang/protobuf/ptypes/struct" 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 +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) -// This is a compile-time assertion 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 +// This is a compile-time assertion that a sufficiently up-to-date version +// of the legacy proto package is being used. +const _ = proto.ProtoPackageIsVersion4 + +type Priority int32 + +const ( + Priority_Normal Priority = 0 + Priority_High Priority = 1 +) + +// Enum value maps for Priority. +var ( + Priority_name = map[int32]string{ + 0: "Normal", + 1: "High", + } + Priority_value = map[string]int32{ + "Normal": 0, + "High": 1, + } +) + +func (x Priority) Enum() *Priority { + p := new(Priority) + *p = x + return p +} + +func (x Priority) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (Priority) Descriptor() protoreflect.EnumDescriptor { + return file_gorush_proto_enumTypes[0].Descriptor() +} + +func (Priority) Type() protoreflect.EnumType { + return &file_gorush_proto_enumTypes[0] +} + +func (x Priority) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use Priority.Descriptor instead. +func (Priority) EnumDescriptor() ([]byte, []int) { + return file_gorush_proto_rawDescGZIP(), []int{0} +} type HealthCheckResponse_ServingStatus int32 @@ -33,467 +84,695 @@ const ( HealthCheckResponse_NOT_SERVING HealthCheckResponse_ServingStatus = 2 ) -var HealthCheckResponse_ServingStatus_name = map[int32]string{ - 0: "UNKNOWN", - 1: "SERVING", - 2: "NOT_SERVING", -} +// Enum value maps for HealthCheckResponse_ServingStatus. +var ( + HealthCheckResponse_ServingStatus_name = map[int32]string{ + 0: "UNKNOWN", + 1: "SERVING", + 2: "NOT_SERVING", + } + HealthCheckResponse_ServingStatus_value = map[string]int32{ + "UNKNOWN": 0, + "SERVING": 1, + "NOT_SERVING": 2, + } +) -var HealthCheckResponse_ServingStatus_value = map[string]int32{ - "UNKNOWN": 0, - "SERVING": 1, - "NOT_SERVING": 2, +func (x HealthCheckResponse_ServingStatus) Enum() *HealthCheckResponse_ServingStatus { + p := new(HealthCheckResponse_ServingStatus) + *p = x + return p } func (x HealthCheckResponse_ServingStatus) String() string { - return proto.EnumName(HealthCheckResponse_ServingStatus_name, int32(x)) + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) } +func (HealthCheckResponse_ServingStatus) Descriptor() protoreflect.EnumDescriptor { + return file_gorush_proto_enumTypes[1].Descriptor() +} + +func (HealthCheckResponse_ServingStatus) Type() protoreflect.EnumType { + return &file_gorush_proto_enumTypes[1] +} + +func (x HealthCheckResponse_ServingStatus) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use HealthCheckResponse_ServingStatus.Descriptor instead. func (HealthCheckResponse_ServingStatus) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_40935fa25e258221, []int{4, 0} + return file_gorush_proto_rawDescGZIP(), []int{4, 0} } type Alert struct { - Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"` - Body string `protobuf:"bytes,2,opt,name=body,proto3" json:"body,omitempty"` - Subtitle string `protobuf:"bytes,3,opt,name=subtitle,proto3" json:"subtitle,omitempty"` - Action string `protobuf:"bytes,4,opt,name=action,proto3" json:"action,omitempty"` - ActionLocKey string `protobuf:"bytes,5,opt,name=actionLocKey,proto3" json:"actionLocKey,omitempty"` - LaunchImage string `protobuf:"bytes,6,opt,name=launchImage,proto3" json:"launchImage,omitempty"` - LocKey string `protobuf:"bytes,7,opt,name=locKey,proto3" json:"locKey,omitempty"` - TitleLocKey string `protobuf:"bytes,8,opt,name=titleLocKey,proto3" json:"titleLocKey,omitempty"` - LocArgs []string `protobuf:"bytes,9,rep,name=locArgs,proto3" json:"locArgs,omitempty"` - TitleLocArgs []string `protobuf:"bytes,10,rep,name=titleLocArgs,proto3" json:"titleLocArgs,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"` + Body string `protobuf:"bytes,2,opt,name=body,proto3" json:"body,omitempty"` + Subtitle string `protobuf:"bytes,3,opt,name=subtitle,proto3" json:"subtitle,omitempty"` + Action string `protobuf:"bytes,4,opt,name=action,proto3" json:"action,omitempty"` + ActionLocKey string `protobuf:"bytes,5,opt,name=actionLocKey,proto3" json:"actionLocKey,omitempty"` + LaunchImage string `protobuf:"bytes,6,opt,name=launchImage,proto3" json:"launchImage,omitempty"` + LocKey string `protobuf:"bytes,7,opt,name=locKey,proto3" json:"locKey,omitempty"` + TitleLocKey string `protobuf:"bytes,8,opt,name=titleLocKey,proto3" json:"titleLocKey,omitempty"` + LocArgs []string `protobuf:"bytes,9,rep,name=locArgs,proto3" json:"locArgs,omitempty"` + TitleLocArgs []string `protobuf:"bytes,10,rep,name=titleLocArgs,proto3" json:"titleLocArgs,omitempty"` } -func (m *Alert) Reset() { *m = Alert{} } -func (m *Alert) String() string { return proto.CompactTextString(m) } -func (*Alert) ProtoMessage() {} +func (x *Alert) Reset() { + *x = Alert{} + if protoimpl.UnsafeEnabled { + mi := &file_gorush_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Alert) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Alert) ProtoMessage() {} + +func (x *Alert) ProtoReflect() protoreflect.Message { + mi := &file_gorush_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Alert.ProtoReflect.Descriptor instead. func (*Alert) Descriptor() ([]byte, []int) { - return fileDescriptor_40935fa25e258221, []int{0} + return file_gorush_proto_rawDescGZIP(), []int{0} } -func (m *Alert) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Alert.Unmarshal(m, b) -} -func (m *Alert) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Alert.Marshal(b, m, deterministic) -} -func (m *Alert) XXX_Merge(src proto.Message) { - xxx_messageInfo_Alert.Merge(m, src) -} -func (m *Alert) XXX_Size() int { - return xxx_messageInfo_Alert.Size(m) -} -func (m *Alert) XXX_DiscardUnknown() { - xxx_messageInfo_Alert.DiscardUnknown(m) -} - -var xxx_messageInfo_Alert proto.InternalMessageInfo - -func (m *Alert) GetTitle() string { - if m != nil { - return m.Title +func (x *Alert) GetTitle() string { + if x != nil { + return x.Title } return "" } -func (m *Alert) GetBody() string { - if m != nil { - return m.Body +func (x *Alert) GetBody() string { + if x != nil { + return x.Body } return "" } -func (m *Alert) GetSubtitle() string { - if m != nil { - return m.Subtitle +func (x *Alert) GetSubtitle() string { + if x != nil { + return x.Subtitle } return "" } -func (m *Alert) GetAction() string { - if m != nil { - return m.Action +func (x *Alert) GetAction() string { + if x != nil { + return x.Action } return "" } -func (m *Alert) GetActionLocKey() string { - if m != nil { - return m.ActionLocKey +func (x *Alert) GetActionLocKey() string { + if x != nil { + return x.ActionLocKey } return "" } -func (m *Alert) GetLaunchImage() string { - if m != nil { - return m.LaunchImage +func (x *Alert) GetLaunchImage() string { + if x != nil { + return x.LaunchImage } return "" } -func (m *Alert) GetLocKey() string { - if m != nil { - return m.LocKey +func (x *Alert) GetLocKey() string { + if x != nil { + return x.LocKey } return "" } -func (m *Alert) GetTitleLocKey() string { - if m != nil { - return m.TitleLocKey +func (x *Alert) GetTitleLocKey() string { + if x != nil { + return x.TitleLocKey } return "" } -func (m *Alert) GetLocArgs() []string { - if m != nil { - return m.LocArgs +func (x *Alert) GetLocArgs() []string { + if x != nil { + return x.LocArgs } return nil } -func (m *Alert) GetTitleLocArgs() []string { - if m != nil { - return m.TitleLocArgs +func (x *Alert) GetTitleLocArgs() []string { + if x != nil { + return x.TitleLocArgs } return nil } type NotificationRequest struct { - Tokens []string `protobuf:"bytes,1,rep,name=tokens,proto3" json:"tokens,omitempty"` - Platform int32 `protobuf:"varint,2,opt,name=platform,proto3" json:"platform,omitempty"` - Message string `protobuf:"bytes,3,opt,name=message,proto3" json:"message,omitempty"` - Title string `protobuf:"bytes,4,opt,name=title,proto3" json:"title,omitempty"` - Topic string `protobuf:"bytes,5,opt,name=topic,proto3" json:"topic,omitempty"` - Key string `protobuf:"bytes,6,opt,name=key,proto3" json:"key,omitempty"` - Badge int32 `protobuf:"varint,7,opt,name=badge,proto3" json:"badge,omitempty"` - Category string `protobuf:"bytes,8,opt,name=category,proto3" json:"category,omitempty"` - Alert *Alert `protobuf:"bytes,9,opt,name=alert,proto3" json:"alert,omitempty"` - Sound string `protobuf:"bytes,10,opt,name=sound,proto3" json:"sound,omitempty"` - ContentAvailable bool `protobuf:"varint,11,opt,name=contentAvailable,proto3" json:"contentAvailable,omitempty"` - ThreadID string `protobuf:"bytes,12,opt,name=threadID,proto3" json:"threadID,omitempty"` - MutableContent bool `protobuf:"varint,13,opt,name=mutableContent,proto3" json:"mutableContent,omitempty"` - Data *_struct.Struct `protobuf:"bytes,14,opt,name=data,proto3" json:"data,omitempty"` - Image string `protobuf:"bytes,15,opt,name=image,proto3" json:"image,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Tokens []string `protobuf:"bytes,1,rep,name=tokens,proto3" json:"tokens,omitempty"` + Platform int32 `protobuf:"varint,2,opt,name=platform,proto3" json:"platform,omitempty"` + Message string `protobuf:"bytes,3,opt,name=message,proto3" json:"message,omitempty"` + Title string `protobuf:"bytes,4,opt,name=title,proto3" json:"title,omitempty"` + Topic string `protobuf:"bytes,5,opt,name=topic,proto3" json:"topic,omitempty"` + Key string `protobuf:"bytes,6,opt,name=key,proto3" json:"key,omitempty"` + Badge int32 `protobuf:"varint,7,opt,name=badge,proto3" json:"badge,omitempty"` + Category string `protobuf:"bytes,8,opt,name=category,proto3" json:"category,omitempty"` + Alert *Alert `protobuf:"bytes,9,opt,name=alert,proto3" json:"alert,omitempty"` + Sound string `protobuf:"bytes,10,opt,name=sound,proto3" json:"sound,omitempty"` + ContentAvailable bool `protobuf:"varint,11,opt,name=contentAvailable,proto3" json:"contentAvailable,omitempty"` + ThreadID string `protobuf:"bytes,12,opt,name=threadID,proto3" json:"threadID,omitempty"` + MutableContent bool `protobuf:"varint,13,opt,name=mutableContent,proto3" json:"mutableContent,omitempty"` + Data *_struct.Struct `protobuf:"bytes,14,opt,name=data,proto3" json:"data,omitempty"` + Image string `protobuf:"bytes,15,opt,name=image,proto3" json:"image,omitempty"` + Priority Priority `protobuf:"varint,16,opt,name=Priority,proto3,enum=proto.Priority" json:"Priority,omitempty"` } -func (m *NotificationRequest) Reset() { *m = NotificationRequest{} } -func (m *NotificationRequest) String() string { return proto.CompactTextString(m) } -func (*NotificationRequest) ProtoMessage() {} +func (x *NotificationRequest) Reset() { + *x = NotificationRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_gorush_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *NotificationRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*NotificationRequest) ProtoMessage() {} + +func (x *NotificationRequest) ProtoReflect() protoreflect.Message { + mi := &file_gorush_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use NotificationRequest.ProtoReflect.Descriptor instead. func (*NotificationRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_40935fa25e258221, []int{1} + return file_gorush_proto_rawDescGZIP(), []int{1} } -func (m *NotificationRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_NotificationRequest.Unmarshal(m, b) -} -func (m *NotificationRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_NotificationRequest.Marshal(b, m, deterministic) -} -func (m *NotificationRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_NotificationRequest.Merge(m, src) -} -func (m *NotificationRequest) XXX_Size() int { - return xxx_messageInfo_NotificationRequest.Size(m) -} -func (m *NotificationRequest) XXX_DiscardUnknown() { - xxx_messageInfo_NotificationRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_NotificationRequest proto.InternalMessageInfo - -func (m *NotificationRequest) GetTokens() []string { - if m != nil { - return m.Tokens +func (x *NotificationRequest) GetTokens() []string { + if x != nil { + return x.Tokens } return nil } -func (m *NotificationRequest) GetPlatform() int32 { - if m != nil { - return m.Platform +func (x *NotificationRequest) GetPlatform() int32 { + if x != nil { + return x.Platform } return 0 } -func (m *NotificationRequest) GetMessage() string { - if m != nil { - return m.Message +func (x *NotificationRequest) GetMessage() string { + if x != nil { + return x.Message } return "" } -func (m *NotificationRequest) GetTitle() string { - if m != nil { - return m.Title +func (x *NotificationRequest) GetTitle() string { + if x != nil { + return x.Title } return "" } -func (m *NotificationRequest) GetTopic() string { - if m != nil { - return m.Topic +func (x *NotificationRequest) GetTopic() string { + if x != nil { + return x.Topic } return "" } -func (m *NotificationRequest) GetKey() string { - if m != nil { - return m.Key +func (x *NotificationRequest) GetKey() string { + if x != nil { + return x.Key } return "" } -func (m *NotificationRequest) GetBadge() int32 { - if m != nil { - return m.Badge +func (x *NotificationRequest) GetBadge() int32 { + if x != nil { + return x.Badge } return 0 } -func (m *NotificationRequest) GetCategory() string { - if m != nil { - return m.Category +func (x *NotificationRequest) GetCategory() string { + if x != nil { + return x.Category } return "" } -func (m *NotificationRequest) GetAlert() *Alert { - if m != nil { - return m.Alert +func (x *NotificationRequest) GetAlert() *Alert { + if x != nil { + return x.Alert } return nil } -func (m *NotificationRequest) GetSound() string { - if m != nil { - return m.Sound +func (x *NotificationRequest) GetSound() string { + if x != nil { + return x.Sound } return "" } -func (m *NotificationRequest) GetContentAvailable() bool { - if m != nil { - return m.ContentAvailable +func (x *NotificationRequest) GetContentAvailable() bool { + if x != nil { + return x.ContentAvailable } return false } -func (m *NotificationRequest) GetThreadID() string { - if m != nil { - return m.ThreadID +func (x *NotificationRequest) GetThreadID() string { + if x != nil { + return x.ThreadID } return "" } -func (m *NotificationRequest) GetMutableContent() bool { - if m != nil { - return m.MutableContent +func (x *NotificationRequest) GetMutableContent() bool { + if x != nil { + return x.MutableContent } return false } -func (m *NotificationRequest) GetData() *_struct.Struct { - if m != nil { - return m.Data +func (x *NotificationRequest) GetData() *_struct.Struct { + if x != nil { + return x.Data } return nil } -func (m *NotificationRequest) GetImage() string { - if m != nil { - return m.Image +func (x *NotificationRequest) GetImage() string { + if x != nil { + return x.Image } return "" } +func (x *NotificationRequest) GetPriority() Priority { + if x != nil { + return x.Priority + } + return Priority_Normal +} + type NotificationReply struct { - Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` - Counts int32 `protobuf:"varint,2,opt,name=counts,proto3" json:"counts,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` + Counts int32 `protobuf:"varint,2,opt,name=counts,proto3" json:"counts,omitempty"` } -func (m *NotificationReply) Reset() { *m = NotificationReply{} } -func (m *NotificationReply) String() string { return proto.CompactTextString(m) } -func (*NotificationReply) ProtoMessage() {} +func (x *NotificationReply) Reset() { + *x = NotificationReply{} + if protoimpl.UnsafeEnabled { + mi := &file_gorush_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *NotificationReply) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*NotificationReply) ProtoMessage() {} + +func (x *NotificationReply) ProtoReflect() protoreflect.Message { + mi := &file_gorush_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use NotificationReply.ProtoReflect.Descriptor instead. func (*NotificationReply) Descriptor() ([]byte, []int) { - return fileDescriptor_40935fa25e258221, []int{2} + return file_gorush_proto_rawDescGZIP(), []int{2} } -func (m *NotificationReply) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_NotificationReply.Unmarshal(m, b) -} -func (m *NotificationReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_NotificationReply.Marshal(b, m, deterministic) -} -func (m *NotificationReply) XXX_Merge(src proto.Message) { - xxx_messageInfo_NotificationReply.Merge(m, src) -} -func (m *NotificationReply) XXX_Size() int { - return xxx_messageInfo_NotificationReply.Size(m) -} -func (m *NotificationReply) XXX_DiscardUnknown() { - xxx_messageInfo_NotificationReply.DiscardUnknown(m) -} - -var xxx_messageInfo_NotificationReply proto.InternalMessageInfo - -func (m *NotificationReply) GetSuccess() bool { - if m != nil { - return m.Success +func (x *NotificationReply) GetSuccess() bool { + if x != nil { + return x.Success } return false } -func (m *NotificationReply) GetCounts() int32 { - if m != nil { - return m.Counts +func (x *NotificationReply) GetCounts() int32 { + if x != nil { + return x.Counts } return 0 } type HealthCheckRequest struct { - Service string `protobuf:"bytes,1,opt,name=service,proto3" json:"service,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Service string `protobuf:"bytes,1,opt,name=service,proto3" json:"service,omitempty"` } -func (m *HealthCheckRequest) Reset() { *m = HealthCheckRequest{} } -func (m *HealthCheckRequest) String() string { return proto.CompactTextString(m) } -func (*HealthCheckRequest) ProtoMessage() {} +func (x *HealthCheckRequest) Reset() { + *x = HealthCheckRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_gorush_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *HealthCheckRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*HealthCheckRequest) ProtoMessage() {} + +func (x *HealthCheckRequest) ProtoReflect() protoreflect.Message { + mi := &file_gorush_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use HealthCheckRequest.ProtoReflect.Descriptor instead. func (*HealthCheckRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_40935fa25e258221, []int{3} + return file_gorush_proto_rawDescGZIP(), []int{3} } -func (m *HealthCheckRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_HealthCheckRequest.Unmarshal(m, b) -} -func (m *HealthCheckRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_HealthCheckRequest.Marshal(b, m, deterministic) -} -func (m *HealthCheckRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_HealthCheckRequest.Merge(m, src) -} -func (m *HealthCheckRequest) XXX_Size() int { - return xxx_messageInfo_HealthCheckRequest.Size(m) -} -func (m *HealthCheckRequest) XXX_DiscardUnknown() { - xxx_messageInfo_HealthCheckRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_HealthCheckRequest proto.InternalMessageInfo - -func (m *HealthCheckRequest) GetService() string { - if m != nil { - return m.Service +func (x *HealthCheckRequest) GetService() string { + if x != nil { + return x.Service } return "" } type HealthCheckResponse struct { - Status HealthCheckResponse_ServingStatus `protobuf:"varint,1,opt,name=status,proto3,enum=proto.HealthCheckResponse_ServingStatus" json:"status,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Status HealthCheckResponse_ServingStatus `protobuf:"varint,1,opt,name=status,proto3,enum=proto.HealthCheckResponse_ServingStatus" json:"status,omitempty"` } -func (m *HealthCheckResponse) Reset() { *m = HealthCheckResponse{} } -func (m *HealthCheckResponse) String() string { return proto.CompactTextString(m) } -func (*HealthCheckResponse) ProtoMessage() {} +func (x *HealthCheckResponse) Reset() { + *x = HealthCheckResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_gorush_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *HealthCheckResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*HealthCheckResponse) ProtoMessage() {} + +func (x *HealthCheckResponse) ProtoReflect() protoreflect.Message { + mi := &file_gorush_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use HealthCheckResponse.ProtoReflect.Descriptor instead. func (*HealthCheckResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_40935fa25e258221, []int{4} + return file_gorush_proto_rawDescGZIP(), []int{4} } -func (m *HealthCheckResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_HealthCheckResponse.Unmarshal(m, b) -} -func (m *HealthCheckResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_HealthCheckResponse.Marshal(b, m, deterministic) -} -func (m *HealthCheckResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_HealthCheckResponse.Merge(m, src) -} -func (m *HealthCheckResponse) XXX_Size() int { - return xxx_messageInfo_HealthCheckResponse.Size(m) -} -func (m *HealthCheckResponse) XXX_DiscardUnknown() { - xxx_messageInfo_HealthCheckResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_HealthCheckResponse proto.InternalMessageInfo - -func (m *HealthCheckResponse) GetStatus() HealthCheckResponse_ServingStatus { - if m != nil { - return m.Status +func (x *HealthCheckResponse) GetStatus() HealthCheckResponse_ServingStatus { + if x != nil { + return x.Status } return HealthCheckResponse_UNKNOWN } -func init() { - proto.RegisterEnum("proto.HealthCheckResponse_ServingStatus", HealthCheckResponse_ServingStatus_name, HealthCheckResponse_ServingStatus_value) - proto.RegisterType((*Alert)(nil), "proto.Alert") - proto.RegisterType((*NotificationRequest)(nil), "proto.NotificationRequest") - proto.RegisterType((*NotificationReply)(nil), "proto.NotificationReply") - proto.RegisterType((*HealthCheckRequest)(nil), "proto.HealthCheckRequest") - proto.RegisterType((*HealthCheckResponse)(nil), "proto.HealthCheckResponse") +var File_gorush_proto protoreflect.FileDescriptor + +var file_gorush_proto_rawDesc = []byte{ + 0x0a, 0x0c, 0x67, 0x6f, 0x72, 0x75, 0x73, 0x68, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x05, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x22, 0xa3, 0x02, 0x0a, 0x05, 0x41, 0x6c, 0x65, 0x72, 0x74, 0x12, 0x14, 0x0a, + 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, + 0x74, 0x6c, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x12, 0x1a, 0x0a, 0x08, 0x73, 0x75, 0x62, 0x74, 0x69, + 0x74, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x73, 0x75, 0x62, 0x74, 0x69, + 0x74, 0x6c, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x06, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x22, 0x0a, 0x0c, 0x61, + 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4c, 0x6f, 0x63, 0x4b, 0x65, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0c, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4c, 0x6f, 0x63, 0x4b, 0x65, 0x79, 0x12, + 0x20, 0x0a, 0x0b, 0x6c, 0x61, 0x75, 0x6e, 0x63, 0x68, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x18, 0x06, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x6c, 0x61, 0x75, 0x6e, 0x63, 0x68, 0x49, 0x6d, 0x61, 0x67, + 0x65, 0x12, 0x16, 0x0a, 0x06, 0x6c, 0x6f, 0x63, 0x4b, 0x65, 0x79, 0x18, 0x07, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x06, 0x6c, 0x6f, 0x63, 0x4b, 0x65, 0x79, 0x12, 0x20, 0x0a, 0x0b, 0x74, 0x69, 0x74, + 0x6c, 0x65, 0x4c, 0x6f, 0x63, 0x4b, 0x65, 0x79, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, + 0x74, 0x69, 0x74, 0x6c, 0x65, 0x4c, 0x6f, 0x63, 0x4b, 0x65, 0x79, 0x12, 0x18, 0x0a, 0x07, 0x6c, + 0x6f, 0x63, 0x41, 0x72, 0x67, 0x73, 0x18, 0x09, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x6c, 0x6f, + 0x63, 0x41, 0x72, 0x67, 0x73, 0x12, 0x22, 0x0a, 0x0c, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x4c, 0x6f, + 0x63, 0x41, 0x72, 0x67, 0x73, 0x18, 0x0a, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0c, 0x74, 0x69, 0x74, + 0x6c, 0x65, 0x4c, 0x6f, 0x63, 0x41, 0x72, 0x67, 0x73, 0x22, 0xed, 0x03, 0x0a, 0x13, 0x4e, 0x6f, + 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x16, 0x0a, 0x06, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, + 0x09, 0x52, 0x06, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x6c, 0x61, + 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x70, 0x6c, 0x61, + 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, + 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, + 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x70, 0x69, 0x63, 0x18, 0x05, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x6f, 0x70, 0x69, 0x63, 0x12, 0x10, 0x0a, 0x03, 0x6b, + 0x65, 0x79, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, + 0x05, 0x62, 0x61, 0x64, 0x67, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x62, 0x61, + 0x64, 0x67, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x18, + 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x63, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x12, + 0x22, 0x0a, 0x05, 0x61, 0x6c, 0x65, 0x72, 0x74, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x41, 0x6c, 0x65, 0x72, 0x74, 0x52, 0x05, 0x61, 0x6c, + 0x65, 0x72, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x6f, 0x75, 0x6e, 0x64, 0x18, 0x0a, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x05, 0x73, 0x6f, 0x75, 0x6e, 0x64, 0x12, 0x2a, 0x0a, 0x10, 0x63, 0x6f, 0x6e, + 0x74, 0x65, 0x6e, 0x74, 0x41, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x18, 0x0b, 0x20, + 0x01, 0x28, 0x08, 0x52, 0x10, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x41, 0x76, 0x61, 0x69, + 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x74, 0x68, 0x72, 0x65, 0x61, 0x64, 0x49, + 0x44, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x74, 0x68, 0x72, 0x65, 0x61, 0x64, 0x49, + 0x44, 0x12, 0x26, 0x0a, 0x0e, 0x6d, 0x75, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x43, 0x6f, 0x6e, 0x74, + 0x65, 0x6e, 0x74, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0e, 0x6d, 0x75, 0x74, 0x61, 0x62, + 0x6c, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, 0x2b, 0x0a, 0x04, 0x64, 0x61, 0x74, + 0x61, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x75, 0x63, 0x74, + 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x18, + 0x0f, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x12, 0x2b, 0x0a, 0x08, + 0x50, 0x72, 0x69, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x18, 0x10, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0f, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x50, 0x72, 0x69, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x52, + 0x08, 0x50, 0x72, 0x69, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x22, 0x45, 0x0a, 0x11, 0x4e, 0x6f, 0x74, + 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x18, + 0x0a, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, + 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x63, 0x6f, 0x75, 0x6e, + 0x74, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, + 0x22, 0x2e, 0x0a, 0x12, 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x22, 0x93, 0x01, 0x0a, 0x13, 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x43, 0x68, 0x65, 0x63, 0x6b, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x40, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, + 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x28, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x2e, 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x6e, 0x67, 0x53, 0x74, 0x61, 0x74, + 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x3a, 0x0a, 0x0d, 0x53, 0x65, + 0x72, 0x76, 0x69, 0x6e, 0x67, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x0b, 0x0a, 0x07, 0x55, + 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x0b, 0x0a, 0x07, 0x53, 0x45, 0x52, 0x56, + 0x49, 0x4e, 0x47, 0x10, 0x01, 0x12, 0x0f, 0x0a, 0x0b, 0x4e, 0x4f, 0x54, 0x5f, 0x53, 0x45, 0x52, + 0x56, 0x49, 0x4e, 0x47, 0x10, 0x02, 0x2a, 0x20, 0x0a, 0x08, 0x50, 0x72, 0x69, 0x6f, 0x72, 0x69, + 0x74, 0x79, 0x12, 0x0a, 0x0a, 0x06, 0x4e, 0x6f, 0x72, 0x6d, 0x61, 0x6c, 0x10, 0x00, 0x12, 0x08, + 0x0a, 0x04, 0x48, 0x69, 0x67, 0x68, 0x10, 0x01, 0x32, 0x48, 0x0a, 0x06, 0x47, 0x6f, 0x72, 0x75, + 0x73, 0x68, 0x12, 0x3e, 0x0a, 0x04, 0x53, 0x65, 0x6e, 0x64, 0x12, 0x1a, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x2e, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x4e, + 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x70, 0x6c, 0x79, + 0x22, 0x00, 0x32, 0x48, 0x0a, 0x06, 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x12, 0x3e, 0x0a, 0x05, + 0x43, 0x68, 0x65, 0x63, 0x6b, 0x12, 0x19, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x48, 0x65, + 0x61, 0x6c, 0x74, 0x68, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x1a, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x43, + 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x62, 0x06, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x33, } -func init() { - proto.RegisterFile("gorush.proto", fileDescriptor_40935fa25e258221) +var ( + file_gorush_proto_rawDescOnce sync.Once + file_gorush_proto_rawDescData = file_gorush_proto_rawDesc +) + +func file_gorush_proto_rawDescGZIP() []byte { + file_gorush_proto_rawDescOnce.Do(func() { + file_gorush_proto_rawDescData = protoimpl.X.CompressGZIP(file_gorush_proto_rawDescData) + }) + return file_gorush_proto_rawDescData } -var fileDescriptor_40935fa25e258221 = []byte{ - // 614 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x54, 0xdd, 0x6e, 0xd3, 0x30, - 0x14, 0x5e, 0xd6, 0xa6, 0x6b, 0x4f, 0xbb, 0xad, 0x78, 0x08, 0x4c, 0xc5, 0x45, 0x95, 0x0b, 0x54, - 0x81, 0x94, 0x49, 0xe3, 0x8e, 0x8b, 0x89, 0x69, 0x4c, 0xdb, 0x34, 0x94, 0x49, 0x29, 0x3f, 0x97, - 0xc8, 0x71, 0xbc, 0x34, 0x9a, 0x1b, 0x87, 0xd8, 0x99, 0xd4, 0xe7, 0xe0, 0x11, 0x78, 0x11, 0x1e, - 0x0d, 0xf9, 0x38, 0x29, 0x2b, 0x94, 0xab, 0xfa, 0xfb, 0xce, 0x8f, 0x3f, 0x9f, 0xf3, 0x35, 0x30, - 0xca, 0x54, 0x55, 0xeb, 0x45, 0x58, 0x56, 0xca, 0x28, 0xe2, 0xe3, 0xcf, 0xe4, 0x65, 0xa6, 0x54, - 0x26, 0xc5, 0x31, 0xa2, 0xa4, 0xbe, 0x3b, 0xd6, 0xa6, 0xaa, 0xb9, 0x71, 0x49, 0xc1, 0xcf, 0x5d, - 0xf0, 0xcf, 0xa4, 0xa8, 0x0c, 0x79, 0x0a, 0xbe, 0xc9, 0x8d, 0x14, 0xd4, 0x9b, 0x7a, 0xb3, 0x41, - 0xec, 0x00, 0x21, 0xd0, 0x4d, 0x54, 0xba, 0xa2, 0xbb, 0x48, 0xe2, 0x99, 0x4c, 0xa0, 0xaf, 0xeb, - 0xc4, 0x25, 0x77, 0x90, 0x5f, 0x63, 0xf2, 0x0c, 0x7a, 0x8c, 0x9b, 0x5c, 0x15, 0xb4, 0x8b, 0x91, - 0x06, 0x91, 0x00, 0x46, 0xee, 0xf4, 0x51, 0xf1, 0x1b, 0xb1, 0xa2, 0x3e, 0x46, 0x37, 0x38, 0x32, - 0x85, 0xa1, 0x64, 0x75, 0xc1, 0x17, 0xd7, 0x4b, 0x96, 0x09, 0xda, 0xc3, 0x94, 0xc7, 0x94, 0xed, - 0x2e, 0x5d, 0xfd, 0x9e, 0xeb, 0x2e, 0xd7, 0x95, 0x78, 0x7d, 0xd3, 0xbc, 0xef, 0x2a, 0x1f, 0x51, - 0x84, 0xc2, 0x9e, 0x54, 0xfc, 0xac, 0xca, 0x34, 0x1d, 0x4c, 0x3b, 0xb3, 0x41, 0xdc, 0x42, 0xab, - 0xac, 0x4d, 0xc4, 0x30, 0x60, 0x78, 0x83, 0x0b, 0x7e, 0x75, 0xe0, 0x28, 0x52, 0x26, 0xbf, 0xcb, - 0x39, 0xb3, 0x82, 0x63, 0xf1, 0xbd, 0x16, 0xda, 0x58, 0x3d, 0x46, 0xdd, 0x8b, 0x42, 0x53, 0x0f, - 0xab, 0x1a, 0x64, 0x27, 0x54, 0x4a, 0x66, 0xee, 0x54, 0xb5, 0xc4, 0xc9, 0xf9, 0xf1, 0x1a, 0x5b, - 0x25, 0x4b, 0xa1, 0xb5, 0x7d, 0xa1, 0x1b, 0x5e, 0x0b, 0xff, 0x6c, 0xa0, 0xfb, 0x78, 0x03, 0x96, - 0x55, 0x65, 0xce, 0x9b, 0x91, 0x39, 0x40, 0xc6, 0xd0, 0xb9, 0x17, 0xab, 0x66, 0x46, 0xf6, 0x68, - 0xf3, 0x12, 0x96, 0x66, 0x02, 0x47, 0xe3, 0xc7, 0x0e, 0x58, 0x25, 0x9c, 0x19, 0x91, 0xa9, 0xaa, - 0x1d, 0xcb, 0x1a, 0x93, 0x00, 0x7c, 0x66, 0x57, 0x4f, 0x07, 0x53, 0x6f, 0x36, 0x3c, 0x19, 0x39, - 0x4b, 0x84, 0x68, 0x87, 0xd8, 0x85, 0x6c, 0x57, 0xad, 0xea, 0x22, 0xa5, 0xe0, 0x6e, 0x47, 0x40, - 0x5e, 0xc3, 0x98, 0xab, 0xc2, 0x88, 0xc2, 0x9c, 0x3d, 0xb0, 0x5c, 0xb2, 0x44, 0x0a, 0x3a, 0x9c, - 0x7a, 0xb3, 0x7e, 0xfc, 0x0f, 0x6f, 0x15, 0x98, 0x45, 0x25, 0x58, 0x7a, 0xfd, 0x81, 0x8e, 0x9c, - 0x82, 0x16, 0x93, 0x57, 0x70, 0xb0, 0xac, 0x8d, 0x4d, 0x3b, 0x77, 0x65, 0x74, 0x1f, 0xbb, 0xfc, - 0xc5, 0x92, 0x37, 0xd0, 0x4d, 0x99, 0x61, 0xf4, 0x00, 0x85, 0x3e, 0x0f, 0x9d, 0xa5, 0xc3, 0xd6, - 0xd2, 0xe1, 0x1c, 0x2d, 0x1d, 0x63, 0x92, 0x95, 0x9c, 0xa3, 0x81, 0x0e, 0x9d, 0x64, 0x04, 0xc1, - 0x05, 0x3c, 0xd9, 0xdc, 0x60, 0x29, 0xd1, 0x15, 0xba, 0xe6, 0x5c, 0x68, 0x8d, 0xae, 0xef, 0xc7, - 0x2d, 0xb4, 0x9b, 0xe5, 0xaa, 0x2e, 0x8c, 0x6e, 0xf6, 0xd7, 0xa0, 0x20, 0x04, 0x72, 0x25, 0x98, - 0x34, 0x8b, 0xf3, 0x85, 0xe0, 0xf7, 0xad, 0x0f, 0x6c, 0x1f, 0x51, 0x3d, 0xe4, 0xbc, 0xfd, 0xf7, - 0xb4, 0x30, 0xf8, 0xe1, 0xc1, 0xd1, 0x46, 0x81, 0x2e, 0x55, 0xa1, 0x05, 0x79, 0x0f, 0x3d, 0x6d, - 0x98, 0xa9, 0xdd, 0xc5, 0x07, 0x27, 0xb3, 0x66, 0xf8, 0x5b, 0x72, 0xc3, 0xb9, 0xed, 0x55, 0x64, - 0x73, 0xcc, 0x8f, 0x9b, 0xba, 0xe0, 0x1d, 0xec, 0x6f, 0x04, 0xc8, 0x10, 0xf6, 0x3e, 0x47, 0x37, - 0xd1, 0xed, 0xd7, 0x68, 0xbc, 0x63, 0xc1, 0xfc, 0x22, 0xfe, 0x72, 0x1d, 0x5d, 0x8e, 0x3d, 0x72, - 0x08, 0xc3, 0xe8, 0xf6, 0xd3, 0xb7, 0x96, 0xd8, 0x3d, 0xb9, 0x82, 0xde, 0x25, 0x7e, 0x2a, 0xc8, - 0x29, 0x74, 0xe7, 0xa2, 0x48, 0xc9, 0xa4, 0xb9, 0x7f, 0x8b, 0xcb, 0x27, 0x74, 0x6b, 0xac, 0x94, - 0xab, 0x60, 0xc7, 0x76, 0x72, 0x92, 0xc9, 0x29, 0xf8, 0x28, 0x9b, 0xbc, 0xd8, 0xf6, 0x14, 0xd7, - 0x69, 0xf2, 0xff, 0x57, 0x26, 0x3d, 0x0c, 0xbd, 0xfd, 0x1d, 0x00, 0x00, 0xff, 0xff, 0xa0, 0xcb, - 0xd2, 0xf3, 0xc5, 0x04, 0x00, 0x00, +var file_gorush_proto_enumTypes = make([]protoimpl.EnumInfo, 2) +var file_gorush_proto_msgTypes = make([]protoimpl.MessageInfo, 5) +var file_gorush_proto_goTypes = []interface{}{ + (Priority)(0), // 0: proto.Priority + (HealthCheckResponse_ServingStatus)(0), // 1: proto.HealthCheckResponse.ServingStatus + (*Alert)(nil), // 2: proto.Alert + (*NotificationRequest)(nil), // 3: proto.NotificationRequest + (*NotificationReply)(nil), // 4: proto.NotificationReply + (*HealthCheckRequest)(nil), // 5: proto.HealthCheckRequest + (*HealthCheckResponse)(nil), // 6: proto.HealthCheckResponse + (*_struct.Struct)(nil), // 7: google.protobuf.Struct +} +var file_gorush_proto_depIdxs = []int32{ + 2, // 0: proto.NotificationRequest.alert:type_name -> proto.Alert + 7, // 1: proto.NotificationRequest.data:type_name -> google.protobuf.Struct + 0, // 2: proto.NotificationRequest.Priority:type_name -> proto.Priority + 1, // 3: proto.HealthCheckResponse.status:type_name -> proto.HealthCheckResponse.ServingStatus + 3, // 4: proto.Gorush.Send:input_type -> proto.NotificationRequest + 5, // 5: proto.Health.Check:input_type -> proto.HealthCheckRequest + 4, // 6: proto.Gorush.Send:output_type -> proto.NotificationReply + 6, // 7: proto.Health.Check:output_type -> proto.HealthCheckResponse + 6, // [6:8] is the sub-list for method output_type + 4, // [4:6] is the sub-list for method input_type + 4, // [4:4] is the sub-list for extension type_name + 4, // [4:4] is the sub-list for extension extendee + 0, // [0:4] is the sub-list for field type_name +} + +func init() { file_gorush_proto_init() } +func file_gorush_proto_init() { + if File_gorush_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_gorush_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Alert); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_gorush_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*NotificationRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_gorush_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*NotificationReply); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_gorush_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*HealthCheckRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_gorush_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*HealthCheckResponse); 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_gorush_proto_rawDesc, + NumEnums: 2, + NumMessages: 5, + NumExtensions: 0, + NumServices: 2, + }, + GoTypes: file_gorush_proto_goTypes, + DependencyIndexes: file_gorush_proto_depIdxs, + EnumInfos: file_gorush_proto_enumTypes, + MessageInfos: file_gorush_proto_msgTypes, + }.Build() + File_gorush_proto = out.File + file_gorush_proto_rawDesc = nil + file_gorush_proto_goTypes = nil + file_gorush_proto_depIdxs = nil } // Reference imports to suppress errors if they are not otherwise used. @@ -537,7 +816,7 @@ type GorushServer interface { type UnimplementedGorushServer struct { } -func (*UnimplementedGorushServer) Send(ctx context.Context, req *NotificationRequest) (*NotificationReply, error) { +func (*UnimplementedGorushServer) Send(context.Context, *NotificationRequest) (*NotificationReply, error) { return nil, status.Errorf(codes.Unimplemented, "method Send not implemented") } @@ -609,7 +888,7 @@ type HealthServer interface { type UnimplementedHealthServer struct { } -func (*UnimplementedHealthServer) Check(ctx context.Context, req *HealthCheckRequest) (*HealthCheckResponse, error) { +func (*UnimplementedHealthServer) Check(context.Context, *HealthCheckRequest) (*HealthCheckResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Check not implemented") } diff --git a/rpc/proto/gorush.proto b/rpc/proto/gorush.proto index fdf21a7..25238c7 100644 --- a/rpc/proto/gorush.proto +++ b/rpc/proto/gorush.proto @@ -32,6 +32,11 @@ message NotificationRequest { bool mutableContent = 13; google.protobuf.Struct data = 14; string image = 15; + enum Priority { + Normal = 0; + High = 1; + } + Priority Priority = 16; } message NotificationReply { diff --git a/rpc/server.go b/rpc/server.go index 9213826..f2fe084 100644 --- a/rpc/server.go +++ b/rpc/server.go @@ -3,6 +3,7 @@ package rpc import ( "context" "net" + "strings" "sync" "github.com/appleboy/gorush/gorush" @@ -62,6 +63,7 @@ func (s *Server) Send(ctx context.Context, in *proto.NotificationRequest) (*prot ThreadID: in.ThreadID, MutableContent: in.MutableContent, Image: in.Image, + Priority: strings.ToLower(in.GetPriority().String()), } if badge > 0 {